text
stringlengths 30
1.67M
|
|---|
<s> package org . eclipse . jdt . internal . compiler ; import java . util . Arrays ; import org . eclipse . jdt . internal . compiler . lookup . SourceTypeBinding ; public class ClassFilePool { public static final int POOL_SIZE = <NUM_LIT> ; ClassFile [ ] classFiles ; private ClassFilePool ( ) { this . classFiles = new ClassFile [ POOL_SIZE ] ; } public static ClassFilePool newInstance ( ) { return new ClassFilePool ( ) ; } public synchronized ClassFile acquire ( SourceTypeBinding typeBinding ) { for ( int i = <NUM_LIT:0> ; i < POOL_SIZE ; i ++ ) { ClassFile classFile = this . classFiles [ i ] ; if ( classFile == null ) { ClassFile newClassFile = new ClassFile ( typeBinding ) ; this . classFiles [ i ] = newClassFile ; newClassFile . isShared = true ; return newClassFile ; } if ( ! classFile . isShared ) { classFile . reset ( typeBinding ) ; classFile . isShared = true ; return classFile ; } } return new ClassFile ( typeBinding ) ; } public synchronized void release ( ClassFile classFile ) { classFile . isShared = false ; } public void reset ( ) { Arrays . fill ( this . classFiles , null ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler ; import java . util . Locale ; import org . eclipse . jdt . core . compiler . CategorizedProblem ; public interface IProblemFactory { CategorizedProblem createProblem ( char [ ] originatingFileName , int problemId , String [ ] problemArguments , String [ ] messageArguments , int severity , int startPosition , int endPosition , int lineNumber , int columnNumber ) ; CategorizedProblem createProblem ( char [ ] originatingFileName , int problemId , String [ ] problemArguments , int elaborationId , String [ ] messageArguments , int severity , int startPosition , int endPosition , int lineNumber , int columnNumber ) ; Locale getLocale ( ) ; String getLocalizedMessage ( int problemId , String [ ] messageArguments ) ; String getLocalizedMessage ( int problemId , int elaborationId , String [ ] messageArguments ) ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler ; import java . util . Arrays ; import java . util . Comparator ; import java . util . HashMap ; import java . util . HashSet ; import java . util . Hashtable ; import java . util . Iterator ; import java . util . Map ; 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 . AbstractMethodDeclaration ; import org . eclipse . jdt . internal . compiler . env . ICompilationUnit ; import org . eclipse . jdt . internal . compiler . impl . ReferenceContext ; import org . eclipse . jdt . internal . compiler . lookup . SourceTypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . TypeConstants ; import org . eclipse . jdt . internal . compiler . parser . RecoveryScannerData ; import org . eclipse . jdt . internal . compiler . util . Util ; public class CompilationResult { public CategorizedProblem problems [ ] ; public CategorizedProblem tasks [ ] ; public int problemCount ; public int taskCount ; public ICompilationUnit compilationUnit ; private Map problemsMap ; private Set firstErrors ; private int maxProblemPerUnit ; public char [ ] [ ] [ ] qualifiedReferences ; public char [ ] [ ] simpleNameReferences ; public char [ ] [ ] rootReferences ; public boolean hasAnnotations = false ; public int lineSeparatorPositions [ ] ; public RecoveryScannerData recoveryScannerData ; public Map compiledTypes = new Hashtable ( <NUM_LIT:11> ) ; public int unitIndex , totalUnitsKnown ; public boolean hasBeenAccepted = false ; public char [ ] fileName ; public boolean hasInconsistentToplevelHierarchies = false ; public boolean hasSyntaxError = false ; public char [ ] [ ] packageName ; public boolean checkSecondaryTypes = false ; private int numberOfErrors ; private boolean hasMandatoryErrors ; private static final int [ ] EMPTY_LINE_ENDS = Util . EMPTY_INT_ARRAY ; private static final Comparator PROBLEM_COMPARATOR = new Comparator ( ) { public int compare ( Object o1 , Object o2 ) { return ( ( CategorizedProblem ) o1 ) . getSourceStart ( ) - ( ( CategorizedProblem ) o2 ) . getSourceStart ( ) ; } } ; public CompilationResult ( char [ ] fileName , int unitIndex , int totalUnitsKnown , int maxProblemPerUnit ) { this . fileName = fileName ; this . unitIndex = unitIndex ; this . totalUnitsKnown = totalUnitsKnown ; this . maxProblemPerUnit = maxProblemPerUnit ; } public CompilationResult ( ICompilationUnit compilationUnit , int unitIndex , int totalUnitsKnown , int maxProblemPerUnit ) { this . fileName = compilationUnit . getFileName ( ) ; this . compilationUnit = compilationUnit ; this . unitIndex = unitIndex ; this . totalUnitsKnown = totalUnitsKnown ; this . maxProblemPerUnit = maxProblemPerUnit ; } private int computePriority ( CategorizedProblem problem ) { final int P_STATIC = <NUM_LIT> ; final int P_OUTSIDE_METHOD = <NUM_LIT> ; final int P_FIRST_ERROR = <NUM_LIT> ; final int P_ERROR = <NUM_LIT> ; int priority = <NUM_LIT> - problem . getSourceLineNumber ( ) ; if ( priority < <NUM_LIT:0> ) priority = <NUM_LIT:0> ; if ( problem . isError ( ) ) { priority += P_ERROR ; } ReferenceContext context = this . problemsMap == null ? null : ( ReferenceContext ) this . problemsMap . get ( problem ) ; if ( context != null ) { if ( context instanceof AbstractMethodDeclaration ) { AbstractMethodDeclaration method = ( AbstractMethodDeclaration ) context ; if ( method . isStatic ( ) ) { priority += P_STATIC ; } } else { priority += P_OUTSIDE_METHOD ; } if ( this . firstErrors . contains ( problem ) ) { priority += P_FIRST_ERROR ; } } else { priority += P_OUTSIDE_METHOD ; } return priority ; } public CategorizedProblem [ ] getAllProblems ( ) { CategorizedProblem [ ] onlyProblems = getProblems ( ) ; int onlyProblemCount = onlyProblems != null ? onlyProblems . length : <NUM_LIT:0> ; CategorizedProblem [ ] onlyTasks = getTasks ( ) ; int onlyTaskCount = onlyTasks != null ? onlyTasks . length : <NUM_LIT:0> ; if ( onlyTaskCount == <NUM_LIT:0> ) { return onlyProblems ; } if ( onlyProblemCount == <NUM_LIT:0> ) { return onlyTasks ; } int totalNumberOfProblem = onlyProblemCount + onlyTaskCount ; CategorizedProblem [ ] allProblems = new CategorizedProblem [ totalNumberOfProblem ] ; int allProblemIndex = <NUM_LIT:0> ; int taskIndex = <NUM_LIT:0> ; int problemIndex = <NUM_LIT:0> ; while ( taskIndex + problemIndex < totalNumberOfProblem ) { CategorizedProblem nextTask = null ; CategorizedProblem nextProblem = null ; if ( taskIndex < onlyTaskCount ) { nextTask = onlyTasks [ taskIndex ] ; } if ( problemIndex < onlyProblemCount ) { nextProblem = onlyProblems [ problemIndex ] ; } CategorizedProblem currentProblem = null ; if ( nextProblem != null ) { if ( nextTask != null ) { if ( nextProblem . getSourceStart ( ) < nextTask . getSourceStart ( ) ) { currentProblem = nextProblem ; problemIndex ++ ; } else { currentProblem = nextTask ; taskIndex ++ ; } } else { currentProblem = nextProblem ; problemIndex ++ ; } } else { if ( nextTask != null ) { currentProblem = nextTask ; taskIndex ++ ; } } allProblems [ allProblemIndex ++ ] = currentProblem ; } return allProblems ; } public ClassFile [ ] getClassFiles ( ) { ClassFile [ ] classFiles = new ClassFile [ this . compiledTypes . size ( ) ] ; this . compiledTypes . values ( ) . toArray ( classFiles ) ; return classFiles ; } public ICompilationUnit getCompilationUnit ( ) { return this . compilationUnit ; } public CategorizedProblem [ ] getErrors ( ) { CategorizedProblem [ ] reportedProblems = getProblems ( ) ; int errorCount = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < this . problemCount ; i ++ ) { if ( reportedProblems [ i ] . isError ( ) ) errorCount ++ ; } if ( errorCount == this . problemCount ) return reportedProblems ; CategorizedProblem [ ] errors = new CategorizedProblem [ errorCount ] ; int index = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < this . problemCount ; i ++ ) { if ( reportedProblems [ i ] . isError ( ) ) errors [ index ++ ] = reportedProblems [ i ] ; } return errors ; } public char [ ] getFileName ( ) { return this . fileName ; } public int [ ] getLineSeparatorPositions ( ) { return this . lineSeparatorPositions == null ? CompilationResult . EMPTY_LINE_ENDS : this . lineSeparatorPositions ; } public CategorizedProblem [ ] getProblems ( ) { if ( this . problems != null ) { if ( this . problemCount != this . problems . length ) { System . arraycopy ( this . problems , <NUM_LIT:0> , ( this . problems = new CategorizedProblem [ this . problemCount ] ) , <NUM_LIT:0> , this . problemCount ) ; } if ( this . maxProblemPerUnit > <NUM_LIT:0> && this . problemCount > this . maxProblemPerUnit ) { quickPrioritize ( this . problems , <NUM_LIT:0> , this . problemCount - <NUM_LIT:1> ) ; this . problemCount = this . maxProblemPerUnit ; System . arraycopy ( this . problems , <NUM_LIT:0> , ( this . problems = new CategorizedProblem [ this . problemCount ] ) , <NUM_LIT:0> , this . problemCount ) ; } Arrays . sort ( this . problems , <NUM_LIT:0> , this . problems . length , CompilationResult . PROBLEM_COMPARATOR ) ; } return this . problems ; } public CategorizedProblem [ ] getCUProblems ( ) { if ( this . problems != null ) { CategorizedProblem [ ] filteredProblems = new CategorizedProblem [ this . problemCount ] ; int keep = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < this . problemCount ; i ++ ) { CategorizedProblem problem = this . problems [ i ] ; if ( problem . getID ( ) != IProblem . MissingNonNullByDefaultAnnotationOnPackage ) { filteredProblems [ keep ++ ] = problem ; } else if ( this . compilationUnit != null ) { if ( CharOperation . equals ( this . compilationUnit . getMainTypeName ( ) , TypeConstants . PACKAGE_INFO_NAME ) ) { filteredProblems [ keep ++ ] = problem ; } } } if ( keep < this . problemCount ) { System . arraycopy ( filteredProblems , <NUM_LIT:0> , filteredProblems = new CategorizedProblem [ keep ] , <NUM_LIT:0> , keep ) ; this . problemCount = keep ; } this . problems = filteredProblems ; if ( this . maxProblemPerUnit > <NUM_LIT:0> && this . problemCount > this . maxProblemPerUnit ) { quickPrioritize ( this . problems , <NUM_LIT:0> , this . problemCount - <NUM_LIT:1> ) ; this . problemCount = this . maxProblemPerUnit ; System . arraycopy ( this . problems , <NUM_LIT:0> , ( this . problems = new CategorizedProblem [ this . problemCount ] ) , <NUM_LIT:0> , this . problemCount ) ; } Arrays . sort ( this . problems , <NUM_LIT:0> , this . problems . length , CompilationResult . PROBLEM_COMPARATOR ) ; } return this . problems ; } public CategorizedProblem [ ] getTasks ( ) { if ( this . tasks != null ) { if ( this . taskCount != this . tasks . length ) { System . arraycopy ( this . tasks , <NUM_LIT:0> , ( this . tasks = new CategorizedProblem [ this . taskCount ] ) , <NUM_LIT:0> , this . taskCount ) ; } Arrays . sort ( this . tasks , <NUM_LIT:0> , this . tasks . length , CompilationResult . PROBLEM_COMPARATOR ) ; } return this . tasks ; } public boolean hasErrors ( ) { return this . numberOfErrors != <NUM_LIT:0> ; } public boolean hasMandatoryErrors ( ) { return this . hasMandatoryErrors ; } public boolean hasProblems ( ) { return this . problemCount != <NUM_LIT:0> ; } public boolean hasTasks ( ) { return this . taskCount != <NUM_LIT:0> ; } public boolean hasWarnings ( ) { if ( this . problems != null ) for ( int i = <NUM_LIT:0> ; i < this . problemCount ; i ++ ) { if ( this . problems [ i ] . isWarning ( ) ) return true ; } return false ; } private void quickPrioritize ( CategorizedProblem [ ] problemList , int left , int right ) { if ( left >= right ) return ; int original_left = left ; int original_right = right ; int mid = computePriority ( problemList [ left + ( right - left ) / <NUM_LIT:2> ] ) ; do { while ( computePriority ( problemList [ right ] ) < mid ) right -- ; while ( mid < computePriority ( problemList [ left ] ) ) left ++ ; if ( left <= right ) { CategorizedProblem tmp = problemList [ left ] ; problemList [ left ] = problemList [ right ] ; problemList [ right ] = tmp ; left ++ ; right -- ; } } while ( left <= right ) ; if ( original_left < right ) quickPrioritize ( problemList , original_left , right ) ; if ( left < original_right ) quickPrioritize ( problemList , left , original_right ) ; } public void recordPackageName ( char [ ] [ ] packName ) { this . packageName = packName ; } public void record ( CategorizedProblem newProblem , ReferenceContext referenceContext ) { record ( newProblem , referenceContext , true ) ; return ; } public void record ( CategorizedProblem newProblem , ReferenceContext referenceContext , boolean mandatoryError ) { if ( newProblem . getID ( ) == IProblem . Task ) { recordTask ( newProblem ) ; return ; } if ( this . problemCount == <NUM_LIT:0> ) { this . problems = new CategorizedProblem [ <NUM_LIT:5> ] ; } else if ( this . problemCount == this . problems . length ) { System . arraycopy ( this . problems , <NUM_LIT:0> , ( this . problems = new CategorizedProblem [ this . problemCount * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . problemCount ) ; } this . problems [ this . problemCount ++ ] = newProblem ; if ( referenceContext != null ) { if ( this . problemsMap == null ) this . problemsMap = new HashMap ( <NUM_LIT:5> ) ; if ( this . firstErrors == null ) this . firstErrors = new HashSet ( <NUM_LIT:5> ) ; if ( newProblem . isError ( ) && ! referenceContext . hasErrors ( ) ) this . firstErrors . add ( newProblem ) ; this . problemsMap . put ( newProblem , referenceContext ) ; } if ( newProblem . isError ( ) ) { this . numberOfErrors ++ ; if ( mandatoryError ) this . hasMandatoryErrors = true ; if ( ( newProblem . getID ( ) & IProblem . Syntax ) != <NUM_LIT:0> ) { this . hasSyntaxError = true ; } } } public void record ( char [ ] typeName , ClassFile classFile ) { SourceTypeBinding sourceType = classFile . referenceBinding ; if ( ! sourceType . isLocalType ( ) && sourceType . isHierarchyInconsistent ( ) ) { this . hasInconsistentToplevelHierarchies = true ; } this . compiledTypes . put ( typeName , classFile ) ; } private void recordTask ( CategorizedProblem newProblem ) { if ( this . taskCount == <NUM_LIT:0> ) { this . tasks = new CategorizedProblem [ <NUM_LIT:5> ] ; } else if ( this . taskCount == this . tasks . length ) { System . arraycopy ( this . tasks , <NUM_LIT:0> , ( this . tasks = new CategorizedProblem [ this . taskCount * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . taskCount ) ; } this . tasks [ this . taskCount ++ ] = newProblem ; } public void removeProblem ( CategorizedProblem problem ) { if ( this . problemsMap != null ) this . problemsMap . remove ( problem ) ; if ( this . firstErrors != null ) this . firstErrors . remove ( problem ) ; if ( problem . isError ( ) ) { this . numberOfErrors -- ; } this . problemCount -- ; } public CompilationResult tagAsAccepted ( ) { this . hasBeenAccepted = true ; this . problemsMap = null ; this . firstErrors = null ; return this ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; if ( this . fileName != null ) { buffer . append ( "<STR_LIT>" ) . append ( this . fileName ) . append ( '<STR_LIT:\n>' ) ; } if ( this . compiledTypes != null ) { buffer . append ( "<STR_LIT>" ) ; Iterator keys = this . compiledTypes . keySet ( ) . iterator ( ) ; while ( keys . hasNext ( ) ) { char [ ] typeName = ( char [ ] ) keys . next ( ) ; buffer . append ( "<STR_LIT>" ) . append ( typeName ) . append ( '<STR_LIT:\n>' ) ; } } else { buffer . append ( "<STR_LIT>" ) ; } if ( this . problems != null ) { buffer . append ( this . problemCount ) . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> ; i < this . problemCount ; i ++ ) { buffer . append ( "<STR_LIT>" ) . append ( this . problems [ i ] ) . append ( '<STR_LIT:\n>' ) ; } } else { buffer . append ( "<STR_LIT>" ) ; } return buffer . toString ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . util ; public final class HashtableOfLong { public long [ ] keyTable ; public Object [ ] valueTable ; public int elementSize ; int threshold ; public HashtableOfLong ( ) { this ( <NUM_LIT> ) ; } public HashtableOfLong ( int size ) { this . elementSize = <NUM_LIT:0> ; this . threshold = size ; int extraRoom = ( int ) ( size * <NUM_LIT> ) ; if ( this . threshold == extraRoom ) extraRoom ++ ; this . keyTable = new long [ extraRoom ] ; this . valueTable = new Object [ extraRoom ] ; } public boolean containsKey ( long key ) { int length = this . keyTable . length , index = ( ( int ) ( key > > > <NUM_LIT:32> ) ) % length ; long currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != <NUM_LIT:0> ) { if ( currentKey == key ) return true ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return false ; } public Object get ( long key ) { int length = this . keyTable . length , index = ( ( int ) ( key > > > <NUM_LIT:32> ) ) % length ; long currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != <NUM_LIT:0> ) { if ( currentKey == key ) return this . valueTable [ index ] ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return null ; } public Object put ( long key , Object value ) { int length = this . keyTable . length , index = ( ( int ) ( key > > > <NUM_LIT:32> ) ) % length ; long currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != <NUM_LIT:0> ) { if ( currentKey == key ) return this . valueTable [ index ] = value ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } this . keyTable [ index ] = key ; this . valueTable [ index ] = value ; if ( ++ this . elementSize > this . threshold ) rehash ( ) ; return value ; } private void rehash ( ) { HashtableOfLong newHashtable = new HashtableOfLong ( this . elementSize * <NUM_LIT:2> ) ; long currentKey ; for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) if ( ( currentKey = this . keyTable [ i ] ) != <NUM_LIT:0> ) newHashtable . put ( currentKey , this . valueTable [ i ] ) ; this . keyTable = newHashtable . keyTable ; this . valueTable = newHashtable . valueTable ; this . threshold = newHashtable . threshold ; } public int size ( ) { return this . elementSize ; } public String toString ( ) { String s = "<STR_LIT>" ; Object object ; for ( int i = <NUM_LIT:0> , length = this . valueTable . length ; i < length ; i ++ ) if ( ( object = this . valueTable [ i ] ) != null ) s += this . keyTable [ i ] + "<STR_LIT>" + object . toString ( ) + "<STR_LIT:n>" ; return s ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . util ; public final class SimpleLookupTable implements Cloneable { public Object [ ] keyTable ; public Object [ ] valueTable ; public int elementSize ; public int threshold ; public SimpleLookupTable ( ) { this ( <NUM_LIT> ) ; } public SimpleLookupTable ( int size ) { this . elementSize = <NUM_LIT:0> ; this . threshold = size ; int extraRoom = ( int ) ( size * <NUM_LIT> ) ; if ( this . threshold == extraRoom ) extraRoom ++ ; this . keyTable = new Object [ extraRoom ] ; this . valueTable = new Object [ extraRoom ] ; } public Object clone ( ) throws CloneNotSupportedException { SimpleLookupTable result = ( SimpleLookupTable ) super . clone ( ) ; result . elementSize = this . elementSize ; result . threshold = this . threshold ; int length = this . keyTable . length ; result . keyTable = new Object [ length ] ; System . arraycopy ( this . keyTable , <NUM_LIT:0> , result . keyTable , <NUM_LIT:0> , length ) ; length = this . valueTable . length ; result . valueTable = new Object [ length ] ; System . arraycopy ( this . valueTable , <NUM_LIT:0> , result . valueTable , <NUM_LIT:0> , length ) ; return result ; } public boolean containsKey ( Object key ) { int length = this . keyTable . length ; int index = ( key . hashCode ( ) & <NUM_LIT> ) % length ; Object currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != null ) { if ( currentKey . equals ( key ) ) return true ; if ( ++ index == length ) index = <NUM_LIT:0> ; } return false ; } public Object get ( Object key ) { int length = this . keyTable . length ; int index = ( key . hashCode ( ) & <NUM_LIT> ) % length ; Object currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != null ) { if ( currentKey . equals ( key ) ) return this . valueTable [ index ] ; if ( ++ index == length ) index = <NUM_LIT:0> ; } return null ; } public Object getKey ( Object key ) { int length = this . keyTable . length ; int index = ( key . hashCode ( ) & <NUM_LIT> ) % length ; Object currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != null ) { if ( currentKey . equals ( key ) ) return currentKey ; if ( ++ index == length ) index = <NUM_LIT:0> ; } return key ; } public Object keyForValue ( Object valueToMatch ) { if ( valueToMatch != null ) for ( int i = <NUM_LIT:0> , l = this . keyTable . length ; i < l ; i ++ ) if ( this . keyTable [ i ] != null && valueToMatch . equals ( this . valueTable [ i ] ) ) return this . keyTable [ i ] ; return null ; } public Object put ( Object key , Object value ) { int length = this . keyTable . length ; int index = ( key . hashCode ( ) & <NUM_LIT> ) % length ; Object currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != null ) { if ( currentKey . equals ( key ) ) return this . valueTable [ index ] = value ; if ( ++ index == length ) index = <NUM_LIT:0> ; } this . keyTable [ index ] = key ; this . valueTable [ index ] = value ; if ( ++ this . elementSize > this . threshold ) rehash ( ) ; return value ; } public Object removeKey ( Object key ) { int length = this . keyTable . length ; int index = ( key . hashCode ( ) & <NUM_LIT> ) % length ; Object currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != null ) { if ( currentKey . equals ( key ) ) { this . elementSize -- ; Object oldValue = this . valueTable [ index ] ; this . keyTable [ index ] = null ; this . valueTable [ index ] = null ; if ( this . keyTable [ index + <NUM_LIT:1> == length ? <NUM_LIT:0> : index + <NUM_LIT:1> ] != null ) rehash ( ) ; return oldValue ; } if ( ++ index == length ) index = <NUM_LIT:0> ; } return null ; } public void removeValue ( Object valueToRemove ) { boolean rehash = false ; for ( int i = <NUM_LIT:0> , l = this . valueTable . length ; i < l ; i ++ ) { Object value = this . valueTable [ i ] ; if ( value != null && value . equals ( valueToRemove ) ) { this . elementSize -- ; this . keyTable [ i ] = null ; this . valueTable [ i ] = null ; if ( ! rehash && this . keyTable [ i + <NUM_LIT:1> == l ? <NUM_LIT:0> : i + <NUM_LIT:1> ] != null ) rehash = true ; } } if ( rehash ) rehash ( ) ; } private void rehash ( ) { SimpleLookupTable newLookupTable = new SimpleLookupTable ( this . elementSize * <NUM_LIT:2> ) ; Object currentKey ; for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) if ( ( currentKey = this . keyTable [ i ] ) != null ) newLookupTable . put ( currentKey , this . valueTable [ i ] ) ; this . keyTable = newLookupTable . keyTable ; this . valueTable = newLookupTable . valueTable ; this . elementSize = newLookupTable . elementSize ; this . threshold = newLookupTable . threshold ; } public String toString ( ) { String s = "<STR_LIT>" ; Object object ; for ( int i = <NUM_LIT:0> , l = this . valueTable . length ; i < l ; i ++ ) if ( ( object = this . valueTable [ i ] ) != null ) s += this . keyTable [ i ] . toString ( ) + "<STR_LIT>" + object . toString ( ) + "<STR_LIT:n>" ; return s ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . util ; public final class HashtableOfObjectToInt implements Cloneable { public Object [ ] keyTable ; public int [ ] valueTable ; public int elementSize ; int threshold ; public HashtableOfObjectToInt ( ) { this ( <NUM_LIT> ) ; } public HashtableOfObjectToInt ( int size ) { this . elementSize = <NUM_LIT:0> ; this . threshold = size ; int extraRoom = ( int ) ( size * <NUM_LIT> ) ; if ( this . threshold == extraRoom ) extraRoom ++ ; this . keyTable = new Object [ extraRoom ] ; this . valueTable = new int [ extraRoom ] ; } public Object clone ( ) throws CloneNotSupportedException { HashtableOfObjectToInt result = ( HashtableOfObjectToInt ) super . clone ( ) ; result . elementSize = this . elementSize ; result . threshold = this . threshold ; int length = this . keyTable . length ; result . keyTable = new Object [ length ] ; System . arraycopy ( this . keyTable , <NUM_LIT:0> , result . keyTable , <NUM_LIT:0> , length ) ; length = this . valueTable . length ; result . valueTable = new int [ length ] ; System . arraycopy ( this . valueTable , <NUM_LIT:0> , result . valueTable , <NUM_LIT:0> , length ) ; return result ; } public boolean containsKey ( Object key ) { int length = this . keyTable . length , index = ( key . hashCode ( ) & <NUM_LIT> ) % length ; Object currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != null ) { if ( currentKey . equals ( key ) ) return true ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return false ; } public int get ( Object key ) { int length = this . keyTable . length , index = ( key . hashCode ( ) & <NUM_LIT> ) % length ; Object currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != null ) { if ( currentKey . equals ( key ) ) return this . valueTable [ index ] ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return - <NUM_LIT:1> ; } public void keysToArray ( Object [ ] array ) { int index = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> , length = this . keyTable . length ; i < length ; i ++ ) { if ( this . keyTable [ i ] != null ) array [ index ++ ] = this . keyTable [ i ] ; } } public int put ( Object key , int value ) { int length = this . keyTable . length , index = ( key . hashCode ( ) & <NUM_LIT> ) % length ; Object currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != null ) { if ( currentKey . equals ( key ) ) return this . valueTable [ index ] = value ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } this . keyTable [ index ] = key ; this . valueTable [ index ] = value ; if ( ++ this . elementSize > this . threshold ) rehash ( ) ; return value ; } public int removeKey ( Object key ) { int length = this . keyTable . length , index = ( key . hashCode ( ) & <NUM_LIT> ) % length ; Object currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != null ) { if ( currentKey . equals ( key ) ) { int value = this . valueTable [ index ] ; this . elementSize -- ; this . keyTable [ index ] = null ; rehash ( ) ; return value ; } if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return - <NUM_LIT:1> ; } private void rehash ( ) { HashtableOfObjectToInt newHashtable = new HashtableOfObjectToInt ( this . elementSize * <NUM_LIT:2> ) ; Object currentKey ; for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) if ( ( currentKey = this . keyTable [ i ] ) != null ) newHashtable . put ( currentKey , this . valueTable [ i ] ) ; this . keyTable = newHashtable . keyTable ; this . valueTable = newHashtable . valueTable ; this . threshold = newHashtable . threshold ; } public int size ( ) { return this . elementSize ; } public String toString ( ) { String s = "<STR_LIT>" ; Object key ; for ( int i = <NUM_LIT:0> , length = this . keyTable . length ; i < length ; i ++ ) if ( ( key = this . keyTable [ i ] ) != null ) s += key + "<STR_LIT>" + this . valueTable [ i ] + "<STR_LIT:n>" ; return s ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . util ; public interface SuffixConstants { public final static String EXTENSION_class = "<STR_LIT:class>" ; public final static String EXTENSION_CLASS = "<STR_LIT>" ; public final static String EXTENSION_java = "<STR_LIT>" ; public final static String EXTENSION_JAVA = "<STR_LIT>" ; public final static String SUFFIX_STRING_class = "<STR_LIT:.>" + EXTENSION_class ; public final static String SUFFIX_STRING_CLASS = "<STR_LIT:.>" + EXTENSION_CLASS ; public final static String SUFFIX_STRING_java = "<STR_LIT:.>" + EXTENSION_java ; public final static String SUFFIX_STRING_JAVA = "<STR_LIT:.>" + EXTENSION_JAVA ; public final static char [ ] SUFFIX_class = SUFFIX_STRING_class . toCharArray ( ) ; public final static char [ ] SUFFIX_CLASS = SUFFIX_STRING_CLASS . toCharArray ( ) ; public final static char [ ] SUFFIX_java = SUFFIX_STRING_java . toCharArray ( ) ; public final static char [ ] SUFFIX_JAVA = SUFFIX_STRING_JAVA . toCharArray ( ) ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . util ; import java . io . IOException ; import java . io . InputStream ; import java . util . ArrayList ; import java . util . List ; public class ManifestAnalyzer { private static final int START = <NUM_LIT:0> , IN_CLASSPATH_HEADER = <NUM_LIT:1> , PAST_CLASSPATH_HEADER = <NUM_LIT:2> , SKIPPING_WHITESPACE = <NUM_LIT:3> , READING_JAR = <NUM_LIT:4> , CONTINUING = <NUM_LIT:5> , SKIP_LINE = <NUM_LIT:6> ; private static final char [ ] CLASSPATH_HEADER_TOKEN = "<STR_LIT>" . toCharArray ( ) ; private int classpathSectionsCount ; private ArrayList calledFilesNames ; public boolean analyzeManifestContents ( InputStream inputStream ) throws IOException { char [ ] chars = Util . getInputStreamAsCharArray ( inputStream , - <NUM_LIT:1> , Util . UTF_8 ) ; int state = START , substate = <NUM_LIT:0> ; StringBuffer currentJarToken = new StringBuffer ( ) ; int currentChar ; this . classpathSectionsCount = <NUM_LIT:0> ; this . calledFilesNames = null ; for ( int i = <NUM_LIT:0> , max = chars . length ; i < max ; ) { currentChar = chars [ i ++ ] ; if ( currentChar == '<STR_LIT>' ) { if ( i < max ) { currentChar = chars [ i ++ ] ; } } switch ( state ) { case START : if ( currentChar == CLASSPATH_HEADER_TOKEN [ <NUM_LIT:0> ] ) { state = IN_CLASSPATH_HEADER ; substate = <NUM_LIT:1> ; } else { state = SKIP_LINE ; } break ; case IN_CLASSPATH_HEADER : if ( currentChar == '<STR_LIT:\n>' ) { state = START ; } else if ( currentChar != CLASSPATH_HEADER_TOKEN [ substate ++ ] ) { state = SKIP_LINE ; } else if ( substate == CLASSPATH_HEADER_TOKEN . length ) { state = PAST_CLASSPATH_HEADER ; } break ; case PAST_CLASSPATH_HEADER : if ( currentChar == '<CHAR_LIT:U+0020>' ) { state = SKIPPING_WHITESPACE ; this . classpathSectionsCount ++ ; } else { return false ; } break ; case SKIPPING_WHITESPACE : if ( currentChar == '<STR_LIT:\n>' ) { state = CONTINUING ; } else if ( currentChar != '<CHAR_LIT:U+0020>' ) { currentJarToken . append ( ( char ) currentChar ) ; state = READING_JAR ; } else { addCurrentTokenJarWhenNecessary ( currentJarToken ) ; } break ; case CONTINUING : if ( currentChar == '<STR_LIT:\n>' ) { addCurrentTokenJarWhenNecessary ( currentJarToken ) ; state = START ; } else if ( currentChar == '<CHAR_LIT:U+0020>' ) { state = SKIPPING_WHITESPACE ; } else if ( currentChar == CLASSPATH_HEADER_TOKEN [ <NUM_LIT:0> ] ) { addCurrentTokenJarWhenNecessary ( currentJarToken ) ; state = IN_CLASSPATH_HEADER ; substate = <NUM_LIT:1> ; } else if ( this . calledFilesNames == null ) { addCurrentTokenJarWhenNecessary ( currentJarToken ) ; state = START ; } else { addCurrentTokenJarWhenNecessary ( currentJarToken ) ; state = SKIP_LINE ; } break ; case SKIP_LINE : if ( currentChar == '<STR_LIT:\n>' ) { state = START ; } break ; case READING_JAR : if ( currentChar == '<STR_LIT:\n>' ) { state = CONTINUING ; break ; } else if ( currentChar == '<CHAR_LIT:U+0020>' ) { state = SKIPPING_WHITESPACE ; } else { currentJarToken . append ( ( char ) currentChar ) ; break ; } addCurrentTokenJarWhenNecessary ( currentJarToken ) ; break ; } } switch ( state ) { case START : return true ; case IN_CLASSPATH_HEADER : return true ; case PAST_CLASSPATH_HEADER : return false ; case SKIPPING_WHITESPACE : addCurrentTokenJarWhenNecessary ( currentJarToken ) ; return true ; case CONTINUING : addCurrentTokenJarWhenNecessary ( currentJarToken ) ; return true ; case SKIP_LINE : if ( this . classpathSectionsCount != <NUM_LIT:0> ) { if ( this . calledFilesNames == null ) { return false ; } } return true ; case READING_JAR : return false ; } return true ; } private boolean addCurrentTokenJarWhenNecessary ( StringBuffer currentJarToken ) { if ( currentJarToken != null && currentJarToken . length ( ) > <NUM_LIT:0> ) { if ( this . calledFilesNames == null ) { this . calledFilesNames = new ArrayList ( ) ; } this . calledFilesNames . add ( currentJarToken . toString ( ) ) ; currentJarToken . setLength ( <NUM_LIT:0> ) ; return true ; } return false ; } public int getClasspathSectionsCount ( ) { return this . classpathSectionsCount ; } public List getCalledFileNames ( ) { return this . calledFilesNames ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . util ; import org . eclipse . jdt . core . compiler . CharOperation ; public final class HashtableOfIntValues implements Cloneable { public static final int NO_VALUE = Integer . MIN_VALUE ; public char [ ] keyTable [ ] ; public int valueTable [ ] ; public int elementSize ; int threshold ; public HashtableOfIntValues ( ) { this ( <NUM_LIT> ) ; } public HashtableOfIntValues ( int size ) { this . elementSize = <NUM_LIT:0> ; this . threshold = size ; int extraRoom = ( int ) ( size * <NUM_LIT> ) ; if ( this . threshold == extraRoom ) extraRoom ++ ; this . keyTable = new char [ extraRoom ] [ ] ; this . valueTable = new int [ extraRoom ] ; } public Object clone ( ) throws CloneNotSupportedException { HashtableOfIntValues result = ( HashtableOfIntValues ) super . clone ( ) ; result . elementSize = this . elementSize ; result . threshold = this . threshold ; int length = this . keyTable . length ; result . keyTable = new char [ length ] [ ] ; System . arraycopy ( this . keyTable , <NUM_LIT:0> , result . keyTable , <NUM_LIT:0> , length ) ; length = this . valueTable . length ; result . valueTable = new int [ length ] ; System . arraycopy ( this . valueTable , <NUM_LIT:0> , result . valueTable , <NUM_LIT:0> , length ) ; return result ; } public boolean containsKey ( char [ ] key ) { int length = this . keyTable . length , index = CharOperation . hashCode ( key ) % length ; int keyLength = key . length ; char [ ] currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != null ) { if ( currentKey . length == keyLength && CharOperation . equals ( currentKey , key ) ) return true ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return false ; } public int get ( char [ ] key ) { int length = this . keyTable . length , index = CharOperation . hashCode ( key ) % length ; int keyLength = key . length ; char [ ] currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != null ) { if ( currentKey . length == keyLength && CharOperation . equals ( currentKey , key ) ) return this . valueTable [ index ] ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return NO_VALUE ; } public int put ( char [ ] key , int value ) { int length = this . keyTable . length , index = CharOperation . hashCode ( key ) % length ; int keyLength = key . length ; char [ ] currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != null ) { if ( currentKey . length == keyLength && CharOperation . equals ( currentKey , key ) ) return this . valueTable [ index ] = value ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } this . keyTable [ index ] = key ; this . valueTable [ index ] = value ; if ( ++ this . elementSize > this . threshold ) rehash ( ) ; return value ; } public int removeKey ( char [ ] key ) { int length = this . keyTable . length , index = CharOperation . hashCode ( key ) % length ; int keyLength = key . length ; char [ ] currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != null ) { if ( currentKey . length == keyLength && CharOperation . equals ( currentKey , key ) ) { int value = this . valueTable [ index ] ; this . elementSize -- ; this . keyTable [ index ] = null ; this . valueTable [ index ] = NO_VALUE ; rehash ( ) ; return value ; } if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return NO_VALUE ; } private void rehash ( ) { HashtableOfIntValues newHashtable = new HashtableOfIntValues ( this . elementSize * <NUM_LIT:2> ) ; char [ ] currentKey ; for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) if ( ( currentKey = this . keyTable [ i ] ) != null ) newHashtable . put ( currentKey , this . valueTable [ i ] ) ; this . keyTable = newHashtable . keyTable ; this . valueTable = newHashtable . valueTable ; this . threshold = newHashtable . threshold ; } public int size ( ) { return this . elementSize ; } public String toString ( ) { String s = "<STR_LIT>" ; char [ ] key ; for ( int i = <NUM_LIT:0> , length = this . valueTable . length ; i < length ; i ++ ) if ( ( key = this . keyTable [ i ] ) != null ) s += new String ( key ) + "<STR_LIT>" + this . valueTable [ i ] + "<STR_LIT:n>" ; return s ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . util ; public class FloatUtil { private static final int DOUBLE_FRACTION_WIDTH = <NUM_LIT> ; private static final int DOUBLE_PRECISION = <NUM_LIT> ; private static final int MAX_DOUBLE_EXPONENT = + <NUM_LIT> ; private static final int MIN_NORMALIZED_DOUBLE_EXPONENT = - <NUM_LIT> ; private static final int MIN_UNNORMALIZED_DOUBLE_EXPONENT = MIN_NORMALIZED_DOUBLE_EXPONENT - DOUBLE_PRECISION ; private static final int DOUBLE_EXPONENT_BIAS = + <NUM_LIT> ; private static final int DOUBLE_EXPONENT_SHIFT = <NUM_LIT> ; private static final int SINGLE_FRACTION_WIDTH = <NUM_LIT> ; private static final int SINGLE_PRECISION = <NUM_LIT:24> ; private static final int MAX_SINGLE_EXPONENT = + <NUM_LIT> ; private static final int MIN_NORMALIZED_SINGLE_EXPONENT = - <NUM_LIT> ; private static final int MIN_UNNORMALIZED_SINGLE_EXPONENT = MIN_NORMALIZED_SINGLE_EXPONENT - SINGLE_PRECISION ; private static final int SINGLE_EXPONENT_BIAS = + <NUM_LIT> ; private static final int SINGLE_EXPONENT_SHIFT = <NUM_LIT> ; public static float valueOfHexFloatLiteral ( char [ ] source ) { long bits = convertHexFloatingPointLiteralToBits ( source ) ; return Float . intBitsToFloat ( ( int ) bits ) ; } public static double valueOfHexDoubleLiteral ( char [ ] source ) { long bits = convertHexFloatingPointLiteralToBits ( source ) ; return Double . longBitsToDouble ( bits ) ; } private static long convertHexFloatingPointLiteralToBits ( char [ ] source ) { int length = source . length ; long mantissa = <NUM_LIT:0> ; int next = <NUM_LIT:0> ; char nextChar = source [ next ] ; nextChar = source [ next ] ; if ( nextChar == '<CHAR_LIT:0>' ) { next ++ ; } else { throw new NumberFormatException ( ) ; } nextChar = source [ next ] ; if ( nextChar == '<CHAR_LIT>' || nextChar == '<CHAR_LIT>' ) { next ++ ; } else { throw new NumberFormatException ( ) ; } int binaryPointPosition = - <NUM_LIT:1> ; loop : while ( true ) { nextChar = source [ next ] ; switch ( nextChar ) { case '<CHAR_LIT:0>' : next ++ ; continue loop ; case '<CHAR_LIT:.>' : binaryPointPosition = next ; next ++ ; continue loop ; default : break loop ; } } int mantissaBits = <NUM_LIT:0> ; int leadingDigitPosition = - <NUM_LIT:1> ; loop : while ( true ) { nextChar = source [ next ] ; int hexdigit ; switch ( nextChar ) { case '<CHAR_LIT:0>' : case '<CHAR_LIT:1>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT:9>' : hexdigit = nextChar - '<CHAR_LIT:0>' ; break ; case '<CHAR_LIT:a>' : case '<CHAR_LIT:b>' : case '<CHAR_LIT:c>' : case '<CHAR_LIT>' : case '<CHAR_LIT:e>' : case '<CHAR_LIT>' : hexdigit = ( nextChar - '<CHAR_LIT:a>' ) + <NUM_LIT:10> ; break ; case '<CHAR_LIT:A>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : hexdigit = ( nextChar - '<CHAR_LIT:A>' ) + <NUM_LIT:10> ; break ; case '<CHAR_LIT:.>' : binaryPointPosition = next ; next ++ ; continue loop ; default : if ( binaryPointPosition < <NUM_LIT:0> ) { binaryPointPosition = next ; } break loop ; } if ( mantissaBits == <NUM_LIT:0> ) { leadingDigitPosition = next ; mantissa = hexdigit ; mantissaBits = <NUM_LIT:4> ; } else if ( mantissaBits < <NUM_LIT> ) { mantissa <<= <NUM_LIT:4> ; mantissa |= hexdigit ; mantissaBits += <NUM_LIT:4> ; } else { } next ++ ; continue loop ; } nextChar = source [ next ] ; if ( nextChar == '<CHAR_LIT>' || nextChar == '<CHAR_LIT>' ) { next ++ ; } else { throw new NumberFormatException ( ) ; } int exponent = <NUM_LIT:0> ; int exponentSign = + <NUM_LIT:1> ; loop : while ( next < length ) { nextChar = source [ next ] ; switch ( nextChar ) { case '<CHAR_LIT>' : exponentSign = + <NUM_LIT:1> ; next ++ ; continue loop ; case '<CHAR_LIT:->' : exponentSign = - <NUM_LIT:1> ; next ++ ; continue loop ; case '<CHAR_LIT:0>' : case '<CHAR_LIT:1>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT:9>' : int digit = nextChar - '<CHAR_LIT:0>' ; exponent = ( exponent * <NUM_LIT:10> ) + digit ; next ++ ; continue loop ; default : break loop ; } } boolean doublePrecision = true ; if ( next < length ) { nextChar = source [ next ] ; switch ( nextChar ) { case '<CHAR_LIT>' : case '<CHAR_LIT>' : doublePrecision = false ; next ++ ; break ; case '<CHAR_LIT>' : case '<CHAR_LIT>' : doublePrecision = true ; next ++ ; break ; default : throw new NumberFormatException ( ) ; } } if ( mantissa == <NUM_LIT:0> ) { return <NUM_LIT> ; } int scaleFactorCompensation = <NUM_LIT:0> ; long top = ( mantissa > > > ( mantissaBits - <NUM_LIT:4> ) ) ; if ( ( top & <NUM_LIT> ) == <NUM_LIT:0> ) { mantissaBits -- ; scaleFactorCompensation ++ ; if ( ( top & <NUM_LIT> ) == <NUM_LIT:0> ) { mantissaBits -- ; scaleFactorCompensation ++ ; if ( ( top & <NUM_LIT> ) == <NUM_LIT:0> ) { mantissaBits -- ; scaleFactorCompensation ++ ; } } } long result = <NUM_LIT> ; if ( doublePrecision ) { long fraction ; if ( mantissaBits > DOUBLE_PRECISION ) { int extraBits = mantissaBits - DOUBLE_PRECISION ; fraction = mantissa > > > ( extraBits - <NUM_LIT:1> ) ; long lowBit = fraction & <NUM_LIT> ; fraction += lowBit ; fraction = fraction > > > <NUM_LIT:1> ; if ( ( fraction & ( <NUM_LIT:1L> << DOUBLE_PRECISION ) ) != <NUM_LIT:0> ) { fraction = fraction > > > <NUM_LIT:1> ; scaleFactorCompensation -= <NUM_LIT:1> ; } } else { fraction = mantissa << ( DOUBLE_PRECISION - mantissaBits ) ; } int scaleFactor = <NUM_LIT:0> ; if ( mantissaBits > <NUM_LIT:0> ) { if ( leadingDigitPosition < binaryPointPosition ) { scaleFactor = <NUM_LIT:4> * ( binaryPointPosition - leadingDigitPosition ) ; scaleFactor -= scaleFactorCompensation ; } else { scaleFactor = - <NUM_LIT:4> * ( leadingDigitPosition - binaryPointPosition - <NUM_LIT:1> ) ; scaleFactor -= scaleFactorCompensation ; } } int e = ( exponentSign * exponent ) + scaleFactor ; if ( e - <NUM_LIT:1> > MAX_DOUBLE_EXPONENT ) { result = Double . doubleToLongBits ( Double . POSITIVE_INFINITY ) ; } else if ( e - <NUM_LIT:1> >= MIN_NORMALIZED_DOUBLE_EXPONENT ) { long biasedExponent = e - <NUM_LIT:1> + DOUBLE_EXPONENT_BIAS ; result = fraction & ~ ( <NUM_LIT:1L> << DOUBLE_FRACTION_WIDTH ) ; result |= ( biasedExponent << DOUBLE_EXPONENT_SHIFT ) ; } else if ( e - <NUM_LIT:1> > MIN_UNNORMALIZED_DOUBLE_EXPONENT ) { long biasedExponent = <NUM_LIT:0> ; result = fraction > > > ( MIN_NORMALIZED_DOUBLE_EXPONENT - e + <NUM_LIT:1> ) ; result |= ( biasedExponent << DOUBLE_EXPONENT_SHIFT ) ; } else { result = Double . doubleToLongBits ( Double . NaN ) ; } return result ; } long fraction ; if ( mantissaBits > SINGLE_PRECISION ) { int extraBits = mantissaBits - SINGLE_PRECISION ; fraction = mantissa > > > ( extraBits - <NUM_LIT:1> ) ; long lowBit = fraction & <NUM_LIT> ; fraction += lowBit ; fraction = fraction > > > <NUM_LIT:1> ; if ( ( fraction & ( <NUM_LIT:1L> << SINGLE_PRECISION ) ) != <NUM_LIT:0> ) { fraction = fraction > > > <NUM_LIT:1> ; scaleFactorCompensation -= <NUM_LIT:1> ; } } else { fraction = mantissa << ( SINGLE_PRECISION - mantissaBits ) ; } int scaleFactor = <NUM_LIT:0> ; if ( mantissaBits > <NUM_LIT:0> ) { if ( leadingDigitPosition < binaryPointPosition ) { scaleFactor = <NUM_LIT:4> * ( binaryPointPosition - leadingDigitPosition ) ; scaleFactor -= scaleFactorCompensation ; } else { scaleFactor = - <NUM_LIT:4> * ( leadingDigitPosition - binaryPointPosition - <NUM_LIT:1> ) ; scaleFactor -= scaleFactorCompensation ; } } int e = ( exponentSign * exponent ) + scaleFactor ; if ( e - <NUM_LIT:1> > MAX_SINGLE_EXPONENT ) { result = Float . floatToIntBits ( Float . POSITIVE_INFINITY ) ; } else if ( e - <NUM_LIT:1> >= MIN_NORMALIZED_SINGLE_EXPONENT ) { long biasedExponent = e - <NUM_LIT:1> + SINGLE_EXPONENT_BIAS ; result = fraction & ~ ( <NUM_LIT:1L> << SINGLE_FRACTION_WIDTH ) ; result |= ( biasedExponent << SINGLE_EXPONENT_SHIFT ) ; } else if ( e - <NUM_LIT:1> > MIN_UNNORMALIZED_SINGLE_EXPONENT ) { long biasedExponent = <NUM_LIT:0> ; result = fraction > > > ( MIN_NORMALIZED_SINGLE_EXPONENT - e + <NUM_LIT:1> ) ; result |= ( biasedExponent << SINGLE_EXPONENT_SHIFT ) ; } else { result = Float . floatToIntBits ( Float . NaN ) ; } return result ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . util ; public final class ObjectVector { static int INITIAL_SIZE = <NUM_LIT:10> ; public int size ; int maxSize ; Object [ ] elements ; public ObjectVector ( ) { this ( INITIAL_SIZE ) ; } public ObjectVector ( int initialSize ) { this . maxSize = initialSize > <NUM_LIT:0> ? initialSize : INITIAL_SIZE ; this . size = <NUM_LIT:0> ; this . elements = new Object [ this . maxSize ] ; } public void add ( Object newElement ) { if ( this . size == this . maxSize ) System . arraycopy ( this . elements , <NUM_LIT:0> , ( this . elements = new Object [ this . maxSize *= <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . size ) ; this . elements [ this . size ++ ] = newElement ; } public void addAll ( Object [ ] newElements ) { if ( this . size + newElements . length >= this . maxSize ) { this . maxSize = this . size + newElements . length ; System . arraycopy ( this . elements , <NUM_LIT:0> , ( this . elements = new Object [ this . maxSize ] ) , <NUM_LIT:0> , this . size ) ; } System . arraycopy ( newElements , <NUM_LIT:0> , this . elements , this . size , newElements . length ) ; this . size += newElements . length ; } public void addAll ( ObjectVector newVector ) { if ( this . size + newVector . size >= this . maxSize ) { this . maxSize = this . size + newVector . size ; System . arraycopy ( this . elements , <NUM_LIT:0> , ( this . elements = new Object [ this . maxSize ] ) , <NUM_LIT:0> , this . size ) ; } System . arraycopy ( newVector . elements , <NUM_LIT:0> , this . elements , this . size , newVector . size ) ; this . size += newVector . size ; } public boolean containsIdentical ( Object element ) { for ( int i = this . size ; -- i >= <NUM_LIT:0> ; ) if ( element == this . elements [ i ] ) return true ; return false ; } public boolean contains ( Object element ) { for ( int i = this . size ; -- i >= <NUM_LIT:0> ; ) if ( element . equals ( this . elements [ i ] ) ) return true ; return false ; } public void copyInto ( Object [ ] targetArray ) { this . copyInto ( targetArray , <NUM_LIT:0> ) ; } public void copyInto ( Object [ ] targetArray , int index ) { System . arraycopy ( this . elements , <NUM_LIT:0> , targetArray , index , this . size ) ; } public Object elementAt ( int index ) { return this . elements [ index ] ; } public Object find ( Object element ) { for ( int i = this . size ; -- i >= <NUM_LIT:0> ; ) if ( element . equals ( this . elements [ i ] ) ) return this . elements [ i ] ; return null ; } public Object remove ( Object element ) { for ( int i = this . size ; -- i >= <NUM_LIT:0> ; ) if ( element . equals ( this . elements [ i ] ) ) { System . arraycopy ( this . elements , i + <NUM_LIT:1> , this . elements , i , -- this . size - i ) ; this . elements [ this . size ] = null ; return element ; } return null ; } public void removeAll ( ) { for ( int i = this . size ; -- i >= <NUM_LIT:0> ; ) this . elements [ i ] = null ; this . size = <NUM_LIT:0> ; } public int size ( ) { return this . size ; } public String toString ( ) { String s = "<STR_LIT>" ; for ( int i = <NUM_LIT:0> ; i < this . size ; i ++ ) s += this . elements [ i ] . toString ( ) + "<STR_LIT:n>" ; return s ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . util ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . lookup . PackageBinding ; public final class HashtableOfPackage { public char [ ] keyTable [ ] ; public PackageBinding valueTable [ ] ; public int elementSize ; int threshold ; public HashtableOfPackage ( ) { this ( <NUM_LIT:3> ) ; } public HashtableOfPackage ( int size ) { this . elementSize = <NUM_LIT:0> ; this . threshold = size ; int extraRoom = ( int ) ( size * <NUM_LIT> ) ; if ( this . threshold == extraRoom ) extraRoom ++ ; this . keyTable = new char [ extraRoom ] [ ] ; this . valueTable = new PackageBinding [ extraRoom ] ; } public boolean containsKey ( char [ ] key ) { int length = this . keyTable . length , index = CharOperation . hashCode ( key ) % length ; int keyLength = key . length ; char [ ] currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != null ) { if ( currentKey . length == keyLength && CharOperation . equals ( currentKey , key ) ) return true ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return false ; } public PackageBinding get ( char [ ] key ) { int length = this . keyTable . length , index = CharOperation . hashCode ( key ) % length ; int keyLength = key . length ; char [ ] currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != null ) { if ( currentKey . length == keyLength && CharOperation . equals ( currentKey , key ) ) return this . valueTable [ index ] ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return null ; } public PackageBinding put ( char [ ] key , PackageBinding value ) { int length = this . keyTable . length , index = CharOperation . hashCode ( key ) % length ; int keyLength = key . length ; char [ ] currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != null ) { if ( currentKey . length == keyLength && CharOperation . equals ( currentKey , key ) ) return this . valueTable [ index ] = value ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } this . keyTable [ index ] = key ; this . valueTable [ index ] = value ; if ( ++ this . elementSize > this . threshold ) rehash ( ) ; return value ; } private void rehash ( ) { HashtableOfPackage newHashtable = new HashtableOfPackage ( this . elementSize * <NUM_LIT:2> ) ; char [ ] currentKey ; for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) if ( ( currentKey = this . keyTable [ i ] ) != null ) newHashtable . put ( currentKey , this . valueTable [ i ] ) ; this . keyTable = newHashtable . keyTable ; this . valueTable = newHashtable . valueTable ; this . threshold = newHashtable . threshold ; } public int size ( ) { return this . elementSize ; } public String toString ( ) { String s = "<STR_LIT>" ; PackageBinding pkg ; for ( int i = <NUM_LIT:0> , length = this . valueTable . length ; i < length ; i ++ ) if ( ( pkg = this . valueTable [ i ] ) != null ) s += pkg . toString ( ) + "<STR_LIT:n>" ; return s ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . util ; public final class HashtableOfInt { public int [ ] keyTable ; public Object [ ] valueTable ; public int elementSize ; int threshold ; public HashtableOfInt ( ) { this ( <NUM_LIT> ) ; } public HashtableOfInt ( int size ) { this . elementSize = <NUM_LIT:0> ; this . threshold = size ; int extraRoom = ( int ) ( size * <NUM_LIT> ) ; if ( this . threshold == extraRoom ) extraRoom ++ ; this . keyTable = new int [ extraRoom ] ; this . valueTable = new Object [ extraRoom ] ; } public boolean containsKey ( int key ) { int length = this . keyTable . length , index = key % length ; int currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != <NUM_LIT:0> ) { if ( currentKey == key ) return true ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return false ; } public Object get ( int key ) { int length = this . keyTable . length , index = key % length ; int currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != <NUM_LIT:0> ) { if ( currentKey == key ) return this . valueTable [ index ] ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return null ; } public Object put ( int key , Object value ) { int length = this . keyTable . length , index = key % length ; int currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != <NUM_LIT:0> ) { if ( currentKey == key ) return this . valueTable [ index ] = value ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } this . keyTable [ index ] = key ; this . valueTable [ index ] = value ; if ( ++ this . elementSize > this . threshold ) rehash ( ) ; return value ; } private void rehash ( ) { HashtableOfInt newHashtable = new HashtableOfInt ( this . elementSize * <NUM_LIT:2> ) ; int currentKey ; for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) if ( ( currentKey = this . keyTable [ i ] ) != <NUM_LIT:0> ) newHashtable . put ( currentKey , this . valueTable [ i ] ) ; this . keyTable = newHashtable . keyTable ; this . valueTable = newHashtable . valueTable ; this . threshold = newHashtable . threshold ; } public int size ( ) { return this . elementSize ; } public String toString ( ) { String s = "<STR_LIT>" ; Object object ; for ( int i = <NUM_LIT:0> , length = this . valueTable . length ; i < length ; i ++ ) if ( ( object = this . valueTable [ i ] ) != null ) s += this . keyTable [ i ] + "<STR_LIT>" + object . toString ( ) + "<STR_LIT:n>" ; return s ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . util ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . lookup . ReferenceBinding ; public final class HashtableOfType { public char [ ] keyTable [ ] ; public ReferenceBinding valueTable [ ] ; public int elementSize ; int threshold ; public HashtableOfType ( ) { this ( <NUM_LIT:3> ) ; } public HashtableOfType ( int size ) { this . elementSize = <NUM_LIT:0> ; this . threshold = size ; int extraRoom = ( int ) ( size * <NUM_LIT> ) ; if ( this . threshold == extraRoom ) extraRoom ++ ; this . keyTable = new char [ extraRoom ] [ ] ; this . valueTable = new ReferenceBinding [ extraRoom ] ; } public boolean containsKey ( char [ ] key ) { int length = this . keyTable . length , index = CharOperation . hashCode ( key ) % length ; int keyLength = key . length ; char [ ] currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != null ) { if ( currentKey . length == keyLength && CharOperation . equals ( currentKey , key ) ) return true ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return false ; } public ReferenceBinding get ( char [ ] key ) { int length = this . keyTable . length , index = CharOperation . hashCode ( key ) % length ; int keyLength = key . length ; char [ ] currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != null ) { if ( currentKey . length == keyLength && CharOperation . equals ( currentKey , key ) ) return this . valueTable [ index ] ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return null ; } public ReferenceBinding put ( char [ ] key , ReferenceBinding value ) { int length = this . keyTable . length , index = CharOperation . hashCode ( key ) % length ; int keyLength = key . length ; char [ ] currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != null ) { if ( currentKey . length == keyLength && CharOperation . equals ( currentKey , key ) ) return this . valueTable [ index ] = value ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } this . keyTable [ index ] = key ; this . valueTable [ index ] = value ; if ( ++ this . elementSize > this . threshold ) rehash ( ) ; return value ; } private void rehash ( ) { HashtableOfType newHashtable = new HashtableOfType ( this . elementSize < <NUM_LIT:100> ? <NUM_LIT:100> : this . elementSize * <NUM_LIT:2> ) ; char [ ] currentKey ; for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) if ( ( currentKey = this . keyTable [ i ] ) != null ) newHashtable . put ( currentKey , this . valueTable [ i ] ) ; this . keyTable = newHashtable . keyTable ; this . valueTable = newHashtable . valueTable ; this . threshold = newHashtable . threshold ; } public int size ( ) { return this . elementSize ; } public String toString ( ) { String s = "<STR_LIT>" ; ReferenceBinding type ; for ( int i = <NUM_LIT:0> , length = this . valueTable . length ; i < length ; i ++ ) if ( ( type = this . valueTable [ i ] ) != null ) s += type . toString ( ) + "<STR_LIT:n>" ; return s ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . util ; import org . eclipse . jdt . core . compiler . CharOperation ; public final class CompoundNameVector { static int INITIAL_SIZE = <NUM_LIT:10> ; public int size ; int maxSize ; char [ ] [ ] [ ] elements ; public CompoundNameVector ( ) { this . maxSize = INITIAL_SIZE ; this . size = <NUM_LIT:0> ; this . elements = new char [ this . maxSize ] [ ] [ ] ; } public void add ( char [ ] [ ] newElement ) { if ( this . size == this . maxSize ) System . arraycopy ( this . elements , <NUM_LIT:0> , ( this . elements = new char [ this . maxSize *= <NUM_LIT:2> ] [ ] [ ] ) , <NUM_LIT:0> , this . size ) ; this . elements [ this . size ++ ] = newElement ; } public void addAll ( char [ ] [ ] [ ] newElements ) { if ( this . size + newElements . length >= this . maxSize ) { this . maxSize = this . size + newElements . length ; System . arraycopy ( this . elements , <NUM_LIT:0> , ( this . elements = new char [ this . maxSize ] [ ] [ ] ) , <NUM_LIT:0> , this . size ) ; } System . arraycopy ( newElements , <NUM_LIT:0> , this . elements , this . size , newElements . length ) ; this . size += newElements . length ; } public boolean contains ( char [ ] [ ] element ) { for ( int i = this . size ; -- i >= <NUM_LIT:0> ; ) if ( CharOperation . equals ( element , this . elements [ i ] ) ) return true ; return false ; } public char [ ] [ ] elementAt ( int index ) { return this . elements [ index ] ; } public char [ ] [ ] remove ( char [ ] [ ] element ) { for ( int i = this . size ; -- i >= <NUM_LIT:0> ; ) if ( element == this . elements [ i ] ) { System . arraycopy ( this . elements , i + <NUM_LIT:1> , this . elements , i , -- this . size - i ) ; this . elements [ this . size ] = null ; return element ; } return null ; } public void removeAll ( ) { for ( int i = this . size ; -- i >= <NUM_LIT:0> ; ) this . elements [ i ] = null ; this . size = <NUM_LIT:0> ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; for ( int i = <NUM_LIT:0> ; i < this . size ; i ++ ) { buffer . append ( CharOperation . toString ( this . elements [ i ] ) ) . append ( "<STR_LIT:n>" ) ; } return buffer . toString ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . util ; public final class HashSetOfInt implements Cloneable { public int [ ] set ; public int elementSize ; int threshold ; public HashSetOfInt ( ) { this ( <NUM_LIT> ) ; } public HashSetOfInt ( int size ) { this . elementSize = <NUM_LIT:0> ; this . threshold = size ; int extraRoom = ( int ) ( size * <NUM_LIT> ) ; if ( this . threshold == extraRoom ) extraRoom ++ ; this . set = new int [ extraRoom ] ; } public Object clone ( ) throws CloneNotSupportedException { HashSetOfInt result = ( HashSetOfInt ) super . clone ( ) ; result . elementSize = this . elementSize ; result . threshold = this . threshold ; int length = this . set . length ; result . set = new int [ length ] ; System . arraycopy ( this . set , <NUM_LIT:0> , result . set , <NUM_LIT:0> , length ) ; return result ; } public boolean contains ( int element ) { int length = this . set . length ; int index = element % length ; int currentElement ; while ( ( currentElement = this . set [ index ] ) != <NUM_LIT:0> ) { if ( currentElement == element ) return true ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return false ; } public int add ( int element ) { int length = this . set . length ; int index = element % length ; int currentElement ; while ( ( currentElement = this . set [ index ] ) != <NUM_LIT:0> ) { if ( currentElement == element ) return this . set [ index ] = element ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } this . set [ index ] = element ; if ( ++ this . elementSize > this . threshold ) rehash ( ) ; return element ; } public int remove ( int element ) { int length = this . set . length ; int index = element % length ; int currentElement ; while ( ( currentElement = this . set [ index ] ) != <NUM_LIT:0> ) { if ( currentElement == element ) { int existing = this . set [ index ] ; this . elementSize -- ; this . set [ index ] = <NUM_LIT:0> ; rehash ( ) ; return existing ; } if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return <NUM_LIT:0> ; } private void rehash ( ) { HashSetOfInt newHashSet = new HashSetOfInt ( this . elementSize * <NUM_LIT:2> ) ; int currentElement ; for ( int i = this . set . length ; -- i >= <NUM_LIT:0> ; ) if ( ( currentElement = this . set [ i ] ) != <NUM_LIT:0> ) newHashSet . add ( currentElement ) ; this . set = newHashSet . set ; this . threshold = newHashSet . threshold ; } public int size ( ) { return this . elementSize ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; int element ; for ( int i = <NUM_LIT:0> , length = this . set . length ; i < length ; i ++ ) if ( ( element = this . set [ i ] ) != <NUM_LIT:0> ) { buffer . append ( element ) ; if ( i != length - <NUM_LIT:1> ) buffer . append ( '<STR_LIT:\n>' ) ; } return buffer . toString ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . util ; import java . io . BufferedInputStream ; import java . io . BufferedOutputStream ; import java . io . BufferedReader ; import java . io . ByteArrayInputStream ; import java . io . File ; import java . io . FileInputStream ; import java . io . FileOutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . io . StringWriter ; import java . io . UnsupportedEncodingException ; import java . util . HashSet ; import java . util . List ; import java . util . StringTokenizer ; import java . util . zip . ZipEntry ; import java . util . zip . ZipFile ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ClassFile ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; import org . eclipse . jdt . internal . compiler . batch . FileSystem ; import org . eclipse . jdt . internal . compiler . batch . Main ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . lookup . ExtraCompilerModifiers ; import org . eclipse . jdt . internal . compiler . lookup . ParameterizedTypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . ReferenceBinding ; import org . eclipse . jdt . internal . compiler . lookup . TagBits ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . TypeVariableBinding ; import org . eclipse . jdt . internal . compiler . lookup . WildcardBinding ; public class Util implements SuffixConstants { public static final char C_BOOLEAN = '<CHAR_LIT:Z>' ; public static final char C_BYTE = '<CHAR_LIT>' ; public static final char C_CHAR = '<CHAR_LIT>' ; public static final char C_DOUBLE = '<CHAR_LIT>' ; public static final char C_FLOAT = '<CHAR_LIT>' ; public static final char C_INT = '<CHAR_LIT>' ; public static final char C_SEMICOLON = '<CHAR_LIT:;>' ; public static final char C_COLON = '<CHAR_LIT::>' ; public static final char C_LONG = '<CHAR_LIT>' ; public static final char C_SHORT = '<CHAR_LIT>' ; public static final char C_VOID = '<CHAR_LIT>' ; public static final char C_TYPE_VARIABLE = '<CHAR_LIT>' ; public static final char C_STAR = '<CHAR_LIT>' ; public static final char C_EXCEPTION_START = '<CHAR_LIT>' ; public static final char C_EXTENDS = '<CHAR_LIT>' ; public static final char C_SUPER = '<CHAR_LIT:->' ; public static final char C_DOT = '<CHAR_LIT:.>' ; public static final char C_DOLLAR = '<CHAR_LIT>' ; public static final char C_ARRAY = '<CHAR_LIT:[>' ; public static final char C_RESOLVED = '<CHAR_LIT>' ; public static final char C_UNRESOLVED = '<CHAR_LIT>' ; public static final char C_NAME_END = '<CHAR_LIT:;>' ; public static final char C_PARAM_START = '<CHAR_LIT:(>' ; public static final char C_PARAM_END = '<CHAR_LIT:)>' ; public static final char C_GENERIC_START = '<CHAR_LIT>' ; public static final char C_GENERIC_END = '<CHAR_LIT:>>' ; public static final char C_CAPTURE = '<CHAR_LIT>' ; public interface Displayable { String displayString ( Object o ) ; } private static final int DEFAULT_READING_SIZE = <NUM_LIT> ; private static final int DEFAULT_WRITING_SIZE = <NUM_LIT> ; public final static String UTF_8 = "<STR_LIT:UTF-8>" ; public static final String LINE_SEPARATOR = System . getProperty ( "<STR_LIT>" ) ; public static final String EMPTY_STRING = new String ( CharOperation . NO_CHAR ) ; public static final int [ ] EMPTY_INT_ARRAY = new int [ <NUM_LIT:0> ] ; public static String buildAllDirectoriesInto ( String outputPath , String relativeFileName ) throws IOException { char fileSeparatorChar = File . separatorChar ; String fileSeparator = File . separator ; File f ; outputPath = outputPath . replace ( '<CHAR_LIT:/>' , fileSeparatorChar ) ; relativeFileName = relativeFileName . replace ( '<CHAR_LIT:/>' , fileSeparatorChar ) ; String outputDirPath , fileName ; int separatorIndex = relativeFileName . lastIndexOf ( fileSeparatorChar ) ; if ( separatorIndex == - <NUM_LIT:1> ) { if ( outputPath . endsWith ( fileSeparator ) ) { outputDirPath = outputPath . substring ( <NUM_LIT:0> , outputPath . length ( ) - <NUM_LIT:1> ) ; fileName = outputPath + relativeFileName ; } else { outputDirPath = outputPath ; fileName = outputPath + fileSeparator + relativeFileName ; } } else { if ( outputPath . endsWith ( fileSeparator ) ) { outputDirPath = outputPath + relativeFileName . substring ( <NUM_LIT:0> , separatorIndex ) ; fileName = outputPath + relativeFileName ; } else { outputDirPath = outputPath + fileSeparator + relativeFileName . substring ( <NUM_LIT:0> , separatorIndex ) ; fileName = outputPath + fileSeparator + relativeFileName ; } } f = new File ( outputDirPath ) ; f . mkdirs ( ) ; if ( f . isDirectory ( ) ) { return fileName ; } else { if ( outputPath . endsWith ( fileSeparator ) ) { outputPath = outputPath . substring ( <NUM_LIT:0> , outputPath . length ( ) - <NUM_LIT:1> ) ; } f = new File ( outputPath ) ; boolean checkFileType = false ; if ( f . exists ( ) ) { checkFileType = true ; } else { if ( ! f . mkdirs ( ) ) { if ( f . exists ( ) ) { checkFileType = true ; } else { throw new IOException ( Messages . bind ( Messages . output_notValidAll , f . getAbsolutePath ( ) ) ) ; } } } if ( checkFileType ) { if ( ! f . isDirectory ( ) ) { throw new IOException ( Messages . bind ( Messages . output_isFile , f . getAbsolutePath ( ) ) ) ; } } StringBuffer outDir = new StringBuffer ( outputPath ) ; outDir . append ( fileSeparator ) ; StringTokenizer tokenizer = new StringTokenizer ( relativeFileName , fileSeparator ) ; String token = tokenizer . nextToken ( ) ; while ( tokenizer . hasMoreTokens ( ) ) { f = new File ( outDir . append ( token ) . append ( fileSeparator ) . toString ( ) ) ; checkFileType = false ; if ( f . exists ( ) ) { checkFileType = true ; } else { if ( ! f . mkdir ( ) ) { if ( f . exists ( ) ) { checkFileType = true ; } else { throw new IOException ( Messages . bind ( Messages . output_notValid , outDir . substring ( outputPath . length ( ) + <NUM_LIT:1> , outDir . length ( ) - <NUM_LIT:1> ) , outputPath ) ) ; } } } if ( checkFileType ) { if ( ! f . isDirectory ( ) ) { throw new IOException ( Messages . bind ( Messages . output_isFile , f . getAbsolutePath ( ) ) ) ; } } token = tokenizer . nextToken ( ) ; } return outDir . append ( token ) . toString ( ) ; } } public static char [ ] bytesToChar ( byte [ ] bytes , String encoding ) throws IOException { return getInputStreamAsCharArray ( new ByteArrayInputStream ( bytes ) , bytes . length , encoding ) ; } public static int computeOuterMostVisibility ( TypeDeclaration typeDeclaration , int visibility ) { while ( typeDeclaration != null ) { switch ( typeDeclaration . modifiers & ExtraCompilerModifiers . AccVisibilityMASK ) { case ClassFileConstants . AccPrivate : visibility = ClassFileConstants . AccPrivate ; break ; case ClassFileConstants . AccDefault : if ( visibility != ClassFileConstants . AccPrivate ) { visibility = ClassFileConstants . AccDefault ; } break ; case ClassFileConstants . AccProtected : if ( visibility == ClassFileConstants . AccPublic ) { visibility = ClassFileConstants . AccProtected ; } break ; } typeDeclaration = typeDeclaration . enclosingType ; } return visibility ; } public static byte [ ] getFileByteContent ( File file ) throws IOException { InputStream stream = null ; try { stream = new BufferedInputStream ( new FileInputStream ( file ) ) ; return getInputStreamAsByteArray ( stream , ( int ) file . length ( ) ) ; } finally { if ( stream != null ) { try { stream . close ( ) ; } catch ( IOException e ) { } } } } public static char [ ] getFileCharContent ( File file , String encoding ) throws IOException { InputStream stream = null ; try { stream = new FileInputStream ( file ) ; return getInputStreamAsCharArray ( stream , ( int ) file . length ( ) , encoding ) ; } finally { if ( stream != null ) { try { stream . close ( ) ; } catch ( IOException e ) { } } } } private static FileOutputStream getFileOutputStream ( boolean generatePackagesStructure , String outputPath , String relativeFileName ) throws IOException { if ( generatePackagesStructure ) { return new FileOutputStream ( new File ( buildAllDirectoriesInto ( outputPath , relativeFileName ) ) ) ; } else { String fileName = null ; char fileSeparatorChar = File . separatorChar ; String fileSeparator = File . separator ; outputPath = outputPath . replace ( '<CHAR_LIT:/>' , fileSeparatorChar ) ; int indexOfPackageSeparator = relativeFileName . lastIndexOf ( fileSeparatorChar ) ; if ( indexOfPackageSeparator == - <NUM_LIT:1> ) { if ( outputPath . endsWith ( fileSeparator ) ) { fileName = outputPath + relativeFileName ; } else { fileName = outputPath + fileSeparator + relativeFileName ; } } else { int length = relativeFileName . length ( ) ; if ( outputPath . endsWith ( fileSeparator ) ) { fileName = outputPath + relativeFileName . substring ( indexOfPackageSeparator + <NUM_LIT:1> , length ) ; } else { fileName = outputPath + fileSeparator + relativeFileName . substring ( indexOfPackageSeparator + <NUM_LIT:1> , length ) ; } } return new FileOutputStream ( new File ( fileName ) ) ; } } public static byte [ ] getInputStreamAsByteArray ( InputStream stream , int length ) throws IOException { byte [ ] contents ; if ( length == - <NUM_LIT:1> ) { contents = new byte [ <NUM_LIT:0> ] ; int contentsLength = <NUM_LIT:0> ; int amountRead = - <NUM_LIT:1> ; do { int amountRequested = Math . max ( stream . available ( ) , DEFAULT_READING_SIZE ) ; if ( contentsLength + amountRequested > contents . length ) { System . arraycopy ( contents , <NUM_LIT:0> , contents = new byte [ contentsLength + amountRequested ] , <NUM_LIT:0> , contentsLength ) ; } amountRead = stream . read ( contents , contentsLength , amountRequested ) ; if ( amountRead > <NUM_LIT:0> ) { contentsLength += amountRead ; } } while ( amountRead != - <NUM_LIT:1> ) ; if ( contentsLength < contents . length ) { System . arraycopy ( contents , <NUM_LIT:0> , contents = new byte [ contentsLength ] , <NUM_LIT:0> , contentsLength ) ; } } else { contents = new byte [ length ] ; int len = <NUM_LIT:0> ; int readSize = <NUM_LIT:0> ; while ( ( readSize != - <NUM_LIT:1> ) && ( len != length ) ) { len += readSize ; readSize = stream . read ( contents , len , length - len ) ; } } return contents ; } public static char [ ] getInputStreamAsCharArray ( InputStream stream , int length , String encoding ) throws IOException { BufferedReader reader = null ; try { reader = encoding == null ? new BufferedReader ( new InputStreamReader ( stream ) ) : new BufferedReader ( new InputStreamReader ( stream , encoding ) ) ; } catch ( UnsupportedEncodingException e ) { reader = new BufferedReader ( new InputStreamReader ( stream ) ) ; } char [ ] contents ; int totalRead = <NUM_LIT:0> ; if ( length == - <NUM_LIT:1> ) { contents = CharOperation . NO_CHAR ; } else { contents = new char [ length ] ; } while ( true ) { int amountRequested ; if ( totalRead < length ) { amountRequested = length - totalRead ; } else { int current = reader . read ( ) ; if ( current < <NUM_LIT:0> ) break ; amountRequested = Math . max ( stream . available ( ) , DEFAULT_READING_SIZE ) ; if ( totalRead + <NUM_LIT:1> + amountRequested > contents . length ) System . arraycopy ( contents , <NUM_LIT:0> , contents = new char [ totalRead + <NUM_LIT:1> + amountRequested ] , <NUM_LIT:0> , totalRead ) ; contents [ totalRead ++ ] = ( char ) current ; } int amountRead = reader . read ( contents , totalRead , amountRequested ) ; if ( amountRead < <NUM_LIT:0> ) break ; totalRead += amountRead ; } int start = <NUM_LIT:0> ; if ( totalRead > <NUM_LIT:0> && UTF_8 . equals ( encoding ) ) { if ( contents [ <NUM_LIT:0> ] == <NUM_LIT> ) { totalRead -- ; start = <NUM_LIT:1> ; } } if ( totalRead < contents . length ) System . arraycopy ( contents , start , contents = new char [ totalRead ] , <NUM_LIT:0> , totalRead ) ; return contents ; } public static String getExceptionSummary ( Throwable exception ) { StringWriter stringWriter = new StringWriter ( ) ; exception . printStackTrace ( new PrintWriter ( stringWriter ) ) ; StringBuffer buffer = stringWriter . getBuffer ( ) ; StringBuffer exceptionBuffer = new StringBuffer ( <NUM_LIT> ) ; exceptionBuffer . append ( exception . toString ( ) ) ; lookupLine2 : for ( int i = <NUM_LIT:0> , lineSep = <NUM_LIT:0> , max = buffer . length ( ) , line2Start = <NUM_LIT:0> ; i < max ; i ++ ) { switch ( buffer . charAt ( i ) ) { case '<STR_LIT:\n>' : case '<STR_LIT>' : if ( line2Start > <NUM_LIT:0> ) { exceptionBuffer . append ( '<CHAR_LIT:U+0020>' ) . append ( buffer . substring ( line2Start , i ) ) ; break lookupLine2 ; } lineSep ++ ; break ; case '<CHAR_LIT:U+0020>' : case '<STR_LIT:\t>' : break ; default : if ( lineSep > <NUM_LIT:0> ) { line2Start = i ; lineSep = <NUM_LIT:0> ; } break ; } } return exceptionBuffer . toString ( ) ; } public static int getLineNumber ( int position , int [ ] lineEnds , int g , int d ) { if ( lineEnds == null ) return <NUM_LIT:1> ; if ( d == - <NUM_LIT:1> ) return <NUM_LIT:1> ; int m = g , start ; while ( g <= d ) { m = g + ( d - g ) / <NUM_LIT:2> ; if ( position < ( start = lineEnds [ m ] ) ) { d = m - <NUM_LIT:1> ; } else if ( position > start ) { g = m + <NUM_LIT:1> ; } else { return m + <NUM_LIT:1> ; } } if ( position < lineEnds [ m ] ) { return m + <NUM_LIT:1> ; } return m + <NUM_LIT:2> ; } public static byte [ ] getZipEntryByteContent ( ZipEntry ze , ZipFile zip ) throws IOException { InputStream stream = null ; try { InputStream inputStream = zip . getInputStream ( ze ) ; if ( inputStream == null ) throw new IOException ( "<STR_LIT>" + ze . getName ( ) ) ; stream = new BufferedInputStream ( inputStream ) ; return getInputStreamAsByteArray ( stream , ( int ) ze . getSize ( ) ) ; } finally { if ( stream != null ) { try { stream . close ( ) ; } catch ( IOException e ) { } } } } public static int hashCode ( Object [ ] array ) { int prime = <NUM_LIT:31> ; if ( array == null ) { return <NUM_LIT:0> ; } int result = <NUM_LIT:1> ; for ( int index = <NUM_LIT:0> ; index < array . length ; index ++ ) { result = prime * result + ( array [ index ] == null ? <NUM_LIT:0> : array [ index ] . hashCode ( ) ) ; } return result ; } public final static boolean isPotentialZipArchive ( String name ) { int lastDot = name . lastIndexOf ( '<CHAR_LIT:.>' ) ; if ( lastDot == - <NUM_LIT:1> ) return false ; if ( name . lastIndexOf ( File . separatorChar ) > lastDot ) return false ; int length = name . length ( ) ; int extensionLength = length - lastDot - <NUM_LIT:1> ; if ( extensionLength == EXTENSION_java . length ( ) ) { for ( int i = extensionLength - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) { if ( Character . toLowerCase ( name . charAt ( length - extensionLength + i ) ) != EXTENSION_java . charAt ( i ) ) { break ; } if ( i == <NUM_LIT:0> ) { return false ; } } } if ( extensionLength == EXTENSION_class . length ( ) ) { for ( int i = extensionLength - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) { if ( Character . toLowerCase ( name . charAt ( length - extensionLength + i ) ) != EXTENSION_class . charAt ( i ) ) { return true ; } } return false ; } return true ; } public final static boolean isClassFileName ( char [ ] name ) { int nameLength = name == null ? <NUM_LIT:0> : name . length ; int suffixLength = SUFFIX_CLASS . length ; if ( nameLength < suffixLength ) return false ; for ( int i = <NUM_LIT:0> , offset = nameLength - suffixLength ; i < suffixLength ; i ++ ) { char c = name [ offset + i ] ; if ( c != SUFFIX_class [ i ] && c != SUFFIX_CLASS [ i ] ) return false ; } return true ; } public final static boolean isClassFileName ( String name ) { int nameLength = name == null ? <NUM_LIT:0> : name . length ( ) ; int suffixLength = SUFFIX_CLASS . length ; if ( nameLength < suffixLength ) return false ; for ( int i = <NUM_LIT:0> ; i < suffixLength ; i ++ ) { char c = name . charAt ( nameLength - i - <NUM_LIT:1> ) ; int suffixIndex = suffixLength - i - <NUM_LIT:1> ; if ( c != SUFFIX_class [ suffixIndex ] && c != SUFFIX_CLASS [ suffixIndex ] ) return false ; } return true ; } public final static boolean isExcluded ( char [ ] path , char [ ] [ ] inclusionPatterns , char [ ] [ ] exclusionPatterns , boolean isFolderPath ) { if ( inclusionPatterns == null && exclusionPatterns == null ) return false ; inclusionCheck : if ( inclusionPatterns != null ) { for ( int i = <NUM_LIT:0> , length = inclusionPatterns . length ; i < length ; i ++ ) { char [ ] pattern = inclusionPatterns [ i ] ; char [ ] folderPattern = pattern ; if ( isFolderPath ) { int lastSlash = CharOperation . lastIndexOf ( '<CHAR_LIT:/>' , pattern ) ; if ( lastSlash != - <NUM_LIT:1> && lastSlash != pattern . length - <NUM_LIT:1> ) { int star = CharOperation . indexOf ( '<CHAR_LIT>' , pattern , lastSlash ) ; if ( ( star == - <NUM_LIT:1> || star >= pattern . length - <NUM_LIT:1> || pattern [ star + <NUM_LIT:1> ] != '<CHAR_LIT>' ) ) { folderPattern = CharOperation . subarray ( pattern , <NUM_LIT:0> , lastSlash ) ; } } } if ( CharOperation . pathMatch ( folderPattern , path , true , '<CHAR_LIT:/>' ) ) { break inclusionCheck ; } } return true ; } if ( isFolderPath ) { path = CharOperation . concat ( path , new char [ ] { '<CHAR_LIT>' } , '<CHAR_LIT:/>' ) ; } if ( exclusionPatterns != null ) { for ( int i = <NUM_LIT:0> , length = exclusionPatterns . length ; i < length ; i ++ ) { if ( CharOperation . pathMatch ( exclusionPatterns [ i ] , path , true , '<CHAR_LIT:/>' ) ) { return true ; } } } return false ; } public final static boolean isJavaFileName ( char [ ] name ) { int nameLength = name == null ? <NUM_LIT:0> : name . length ; int suffixLength = SUFFIX_JAVA . length ; if ( nameLength < suffixLength ) return false ; for ( int i = <NUM_LIT:0> , offset = nameLength - suffixLength ; i < suffixLength ; i ++ ) { char c = name [ offset + i ] ; if ( c != SUFFIX_java [ i ] && c != SUFFIX_JAVA [ i ] ) return false ; } return true ; } public final static boolean isJavaFileName ( String name ) { int nameLength = name == null ? <NUM_LIT:0> : name . length ( ) ; int suffixLength = SUFFIX_JAVA . length ; if ( nameLength < suffixLength ) return false ; for ( int i = <NUM_LIT:0> ; i < suffixLength ; i ++ ) { char c = name . charAt ( nameLength - i - <NUM_LIT:1> ) ; int suffixIndex = suffixLength - i - <NUM_LIT:1> ; if ( c != SUFFIX_java [ suffixIndex ] && c != SUFFIX_JAVA [ suffixIndex ] ) return false ; } return true ; } public static void reverseQuickSort ( char [ ] [ ] list , int left , int right ) { int original_left = left ; int original_right = right ; char [ ] mid = list [ left + ( ( right - left ) / <NUM_LIT:2> ) ] ; do { while ( CharOperation . compareTo ( list [ left ] , mid ) > <NUM_LIT:0> ) { left ++ ; } while ( CharOperation . compareTo ( mid , list [ right ] ) > <NUM_LIT:0> ) { right -- ; } if ( left <= right ) { char [ ] tmp = list [ left ] ; list [ left ] = list [ right ] ; list [ right ] = tmp ; left ++ ; right -- ; } } while ( left <= right ) ; if ( original_left < right ) { reverseQuickSort ( list , original_left , right ) ; } if ( left < original_right ) { reverseQuickSort ( list , left , original_right ) ; } } public static void reverseQuickSort ( char [ ] [ ] list , int left , int right , int [ ] result ) { int original_left = left ; int original_right = right ; char [ ] mid = list [ left + ( ( right - left ) / <NUM_LIT:2> ) ] ; do { while ( CharOperation . compareTo ( list [ left ] , mid ) > <NUM_LIT:0> ) { left ++ ; } while ( CharOperation . compareTo ( mid , list [ right ] ) > <NUM_LIT:0> ) { right -- ; } if ( left <= right ) { char [ ] tmp = list [ left ] ; list [ left ] = list [ right ] ; list [ right ] = tmp ; int temp = result [ left ] ; result [ left ] = result [ right ] ; result [ right ] = temp ; left ++ ; right -- ; } } while ( left <= right ) ; if ( original_left < right ) { reverseQuickSort ( list , original_left , right , result ) ; } if ( left < original_right ) { reverseQuickSort ( list , left , original_right , result ) ; } } public static final int searchColumnNumber ( int [ ] startLineIndexes , int lineNumber , int position ) { switch ( lineNumber ) { case <NUM_LIT:1> : return position + <NUM_LIT:1> ; case <NUM_LIT:2> : return position - startLineIndexes [ <NUM_LIT:0> ] ; default : int line = lineNumber - <NUM_LIT:2> ; int length = startLineIndexes . length ; if ( line >= length ) { return position - startLineIndexes [ length - <NUM_LIT:1> ] ; } return position - startLineIndexes [ line ] ; } } public static Boolean toBoolean ( boolean bool ) { if ( bool ) { return Boolean . TRUE ; } else { return Boolean . FALSE ; } } public static String toString ( Object [ ] objects ) { return toString ( objects , new Displayable ( ) { public String displayString ( Object o ) { if ( o == null ) return "<STR_LIT:null>" ; return o . toString ( ) ; } } ) ; } public static String toString ( Object [ ] objects , Displayable renderer ) { if ( objects == null ) return "<STR_LIT>" ; StringBuffer buffer = new StringBuffer ( <NUM_LIT:10> ) ; for ( int i = <NUM_LIT:0> ; i < objects . length ; i ++ ) { if ( i > <NUM_LIT:0> ) buffer . append ( "<STR_LIT:U+002CU+0020>" ) ; buffer . append ( renderer . displayString ( objects [ i ] ) ) ; } return buffer . toString ( ) ; } public static void writeToDisk ( boolean generatePackagesStructure , String outputPath , String relativeFileName , ClassFile classFile ) throws IOException { FileOutputStream file = getFileOutputStream ( generatePackagesStructure , outputPath , relativeFileName ) ; BufferedOutputStream output = new BufferedOutputStream ( file , DEFAULT_WRITING_SIZE ) ; try { output . write ( classFile . header , <NUM_LIT:0> , classFile . headerOffset ) ; output . write ( classFile . contents , <NUM_LIT:0> , classFile . contentsOffset ) ; output . flush ( ) ; } catch ( IOException e ) { throw e ; } finally { output . close ( ) ; } } public static void recordNestedType ( ClassFile classFile , TypeBinding typeBinding ) { if ( classFile . visitedTypes == null ) { classFile . visitedTypes = new HashSet ( <NUM_LIT:3> ) ; } else if ( classFile . visitedTypes . contains ( typeBinding ) ) { return ; } classFile . visitedTypes . add ( typeBinding ) ; if ( typeBinding . isParameterizedType ( ) && ( ( typeBinding . tagBits & TagBits . ContainsNestedTypeReferences ) != <NUM_LIT:0> ) ) { ParameterizedTypeBinding parameterizedTypeBinding = ( ParameterizedTypeBinding ) typeBinding ; ReferenceBinding genericType = parameterizedTypeBinding . genericType ( ) ; if ( ( genericType . tagBits & TagBits . ContainsNestedTypeReferences ) != <NUM_LIT:0> ) { recordNestedType ( classFile , genericType ) ; } TypeBinding [ ] arguments = parameterizedTypeBinding . arguments ; if ( arguments != null ) { for ( int j = <NUM_LIT:0> , max2 = arguments . length ; j < max2 ; j ++ ) { TypeBinding argument = arguments [ j ] ; if ( argument . isWildcard ( ) ) { WildcardBinding wildcardBinding = ( WildcardBinding ) argument ; TypeBinding bound = wildcardBinding . bound ; if ( bound != null && ( ( bound . tagBits & TagBits . ContainsNestedTypeReferences ) != <NUM_LIT:0> ) ) { recordNestedType ( classFile , bound ) ; } ReferenceBinding superclass = wildcardBinding . superclass ( ) ; if ( superclass != null && ( ( superclass . tagBits & TagBits . ContainsNestedTypeReferences ) != <NUM_LIT:0> ) ) { recordNestedType ( classFile , superclass ) ; } ReferenceBinding [ ] superInterfaces = wildcardBinding . superInterfaces ( ) ; if ( superInterfaces != null ) { for ( int k = <NUM_LIT:0> , max3 = superInterfaces . length ; k < max3 ; k ++ ) { ReferenceBinding superInterface = superInterfaces [ k ] ; if ( ( superInterface . tagBits & TagBits . ContainsNestedTypeReferences ) != <NUM_LIT:0> ) { recordNestedType ( classFile , superInterface ) ; } } } } else if ( ( argument . tagBits & TagBits . ContainsNestedTypeReferences ) != <NUM_LIT:0> ) { recordNestedType ( classFile , argument ) ; } } } } else if ( typeBinding . isTypeVariable ( ) && ( ( typeBinding . tagBits & TagBits . ContainsNestedTypeReferences ) != <NUM_LIT:0> ) ) { TypeVariableBinding typeVariableBinding = ( TypeVariableBinding ) typeBinding ; TypeBinding upperBound = typeVariableBinding . upperBound ( ) ; if ( upperBound != null && ( ( upperBound . tagBits & TagBits . ContainsNestedTypeReferences ) != <NUM_LIT:0> ) ) { recordNestedType ( classFile , upperBound ) ; } TypeBinding [ ] upperBounds = typeVariableBinding . otherUpperBounds ( ) ; if ( upperBounds != null ) { for ( int k = <NUM_LIT:0> , max3 = upperBounds . length ; k < max3 ; k ++ ) { TypeBinding otherUpperBound = upperBounds [ k ] ; if ( ( otherUpperBound . tagBits & TagBits . ContainsNestedTypeReferences ) != <NUM_LIT:0> ) { recordNestedType ( classFile , otherUpperBound ) ; } } } } else if ( typeBinding . isNestedType ( ) ) { classFile . recordInnerClasses ( typeBinding ) ; } } public static File getJavaHome ( ) { String javaHome = System . getProperty ( "<STR_LIT>" ) ; if ( javaHome != null ) { File javaHomeFile = new File ( javaHome ) ; if ( javaHomeFile . exists ( ) ) { return javaHomeFile ; } } return null ; } public static void collectRunningVMBootclasspath ( List bootclasspaths ) { String javaversion = System . getProperty ( "<STR_LIT>" ) ; if ( javaversion != null && javaversion . equalsIgnoreCase ( "<STR_LIT>" ) ) { throw new IllegalStateException ( ) ; } String bootclasspathProperty = System . getProperty ( "<STR_LIT>" ) ; if ( ( bootclasspathProperty == null ) || ( bootclasspathProperty . length ( ) == <NUM_LIT:0> ) ) { bootclasspathProperty = System . getProperty ( "<STR_LIT>" ) ; if ( ( bootclasspathProperty == null ) || ( bootclasspathProperty . length ( ) == <NUM_LIT:0> ) ) { bootclasspathProperty = System . getProperty ( "<STR_LIT>" ) ; } } if ( ( bootclasspathProperty != null ) && ( bootclasspathProperty . length ( ) != <NUM_LIT:0> ) ) { StringTokenizer tokenizer = new StringTokenizer ( bootclasspathProperty , File . pathSeparator ) ; String token ; while ( tokenizer . hasMoreTokens ( ) ) { token = tokenizer . nextToken ( ) ; FileSystem . Classpath currentClasspath = FileSystem . getClasspath ( token , null , null ) ; if ( currentClasspath != null ) { bootclasspaths . add ( currentClasspath ) ; } } } else { final File javaHome = getJavaHome ( ) ; if ( javaHome != null ) { File [ ] directoriesToCheck = null ; if ( System . getProperty ( "<STR_LIT>" ) . startsWith ( "<STR_LIT>" ) ) { directoriesToCheck = new File [ ] { new File ( javaHome , "<STR_LIT>" ) , } ; } else { directoriesToCheck = new File [ ] { new File ( javaHome , "<STR_LIT>" ) } ; } File [ ] [ ] systemLibrariesJars = Main . getLibrariesFiles ( directoriesToCheck ) ; if ( systemLibrariesJars != null ) { for ( int i = <NUM_LIT:0> , max = systemLibrariesJars . length ; i < max ; i ++ ) { File [ ] current = systemLibrariesJars [ i ] ; if ( current != null ) { for ( int j = <NUM_LIT:0> , max2 = current . length ; j < max2 ; j ++ ) { FileSystem . Classpath classpath = FileSystem . getClasspath ( current [ j ] . getAbsolutePath ( ) , null , false , null , null ) ; if ( classpath != null ) { bootclasspaths . add ( classpath ) ; } } } } } } } } public static int getParameterCount ( char [ ] methodSignature ) { try { int count = <NUM_LIT:0> ; int i = CharOperation . indexOf ( C_PARAM_START , methodSignature ) ; if ( i < <NUM_LIT:0> ) { throw new IllegalArgumentException ( ) ; } else { i ++ ; } for ( ; ; ) { if ( methodSignature [ i ] == C_PARAM_END ) { return count ; } int e = Util . scanTypeSignature ( methodSignature , i ) ; if ( e < <NUM_LIT:0> ) { throw new IllegalArgumentException ( ) ; } else { i = e + <NUM_LIT:1> ; } count ++ ; } } catch ( ArrayIndexOutOfBoundsException e ) { throw new IllegalArgumentException ( ) ; } } public static int scanTypeSignature ( char [ ] string , int start ) { if ( start >= string . length ) { throw new IllegalArgumentException ( ) ; } char c = string [ start ] ; switch ( c ) { case C_ARRAY : return scanArrayTypeSignature ( string , start ) ; case C_RESOLVED : case C_UNRESOLVED : return scanClassTypeSignature ( string , start ) ; case C_TYPE_VARIABLE : return scanTypeVariableSignature ( string , start ) ; case C_BOOLEAN : case C_BYTE : case C_CHAR : case C_DOUBLE : case C_FLOAT : case C_INT : case C_LONG : case C_SHORT : case C_VOID : return scanBaseTypeSignature ( string , start ) ; case C_CAPTURE : return scanCaptureTypeSignature ( string , start ) ; case C_EXTENDS : case C_SUPER : case C_STAR : return scanTypeBoundSignature ( string , start ) ; default : throw new IllegalArgumentException ( ) ; } } public static int scanBaseTypeSignature ( char [ ] string , int start ) { if ( start >= string . length ) { throw new IllegalArgumentException ( ) ; } char c = string [ start ] ; if ( "<STR_LIT>" . indexOf ( c ) >= <NUM_LIT:0> ) { return start ; } else { throw new IllegalArgumentException ( ) ; } } public static int scanArrayTypeSignature ( char [ ] string , int start ) { int length = string . length ; if ( start >= length - <NUM_LIT:1> ) { throw new IllegalArgumentException ( ) ; } char c = string [ start ] ; if ( c != C_ARRAY ) { throw new IllegalArgumentException ( ) ; } c = string [ ++ start ] ; while ( c == C_ARRAY ) { if ( start >= length - <NUM_LIT:1> ) { throw new IllegalArgumentException ( ) ; } c = string [ ++ start ] ; } return scanTypeSignature ( string , start ) ; } public static int scanCaptureTypeSignature ( char [ ] string , int start ) { if ( start >= string . length - <NUM_LIT:1> ) { throw new IllegalArgumentException ( ) ; } char c = string [ start ] ; if ( c != C_CAPTURE ) { throw new IllegalArgumentException ( ) ; } return scanTypeBoundSignature ( string , start + <NUM_LIT:1> ) ; } public static int scanTypeVariableSignature ( char [ ] string , int start ) { if ( start >= string . length - <NUM_LIT:2> ) { throw new IllegalArgumentException ( ) ; } char c = string [ start ] ; if ( c != C_TYPE_VARIABLE ) { throw new IllegalArgumentException ( ) ; } int id = scanIdentifier ( string , start + <NUM_LIT:1> ) ; c = string [ id + <NUM_LIT:1> ] ; if ( c == C_SEMICOLON ) { return id + <NUM_LIT:1> ; } else { throw new IllegalArgumentException ( ) ; } } public static int scanIdentifier ( char [ ] string , int start ) { if ( start >= string . length ) { throw new IllegalArgumentException ( ) ; } int p = start ; while ( true ) { char c = string [ p ] ; if ( c == '<CHAR_LIT>' || c == '<CHAR_LIT:>>' || c == '<CHAR_LIT::>' || c == '<CHAR_LIT:;>' || c == '<CHAR_LIT:.>' || c == '<CHAR_LIT:/>' ) { return p - <NUM_LIT:1> ; } p ++ ; if ( p == string . length ) { return p - <NUM_LIT:1> ; } } } public static int scanClassTypeSignature ( char [ ] string , int start ) { if ( start >= string . length - <NUM_LIT:2> ) { throw new IllegalArgumentException ( ) ; } char c = string [ start ] ; if ( c != C_RESOLVED && c != C_UNRESOLVED ) { return - <NUM_LIT:1> ; } int p = start + <NUM_LIT:1> ; while ( true ) { if ( p >= string . length ) { throw new IllegalArgumentException ( ) ; } c = string [ p ] ; if ( c == C_SEMICOLON ) { return p ; } else if ( c == C_GENERIC_START ) { int e = scanTypeArgumentSignatures ( string , p ) ; p = e ; } else if ( c == C_DOT || c == '<CHAR_LIT:/>' ) { int id = scanIdentifier ( string , p + <NUM_LIT:1> ) ; p = id ; } p ++ ; } } public static int scanTypeBoundSignature ( char [ ] string , int start ) { if ( start >= string . length ) { throw new IllegalArgumentException ( ) ; } char c = string [ start ] ; switch ( c ) { case C_STAR : return start ; case C_SUPER : case C_EXTENDS : if ( start >= string . length - <NUM_LIT:2> ) { throw new IllegalArgumentException ( ) ; } break ; default : throw new IllegalArgumentException ( ) ; } c = string [ ++ start ] ; switch ( c ) { case C_CAPTURE : return scanCaptureTypeSignature ( string , start ) ; case C_SUPER : case C_EXTENDS : return scanTypeBoundSignature ( string , start ) ; case C_RESOLVED : case C_UNRESOLVED : return scanClassTypeSignature ( string , start ) ; case C_TYPE_VARIABLE : return scanTypeVariableSignature ( string , start ) ; case C_ARRAY : return scanArrayTypeSignature ( string , start ) ; case C_STAR : return start ; default : throw new IllegalArgumentException ( ) ; } } public static int scanTypeArgumentSignatures ( char [ ] string , int start ) { if ( start >= string . length - <NUM_LIT:1> ) { throw new IllegalArgumentException ( ) ; } char c = string [ start ] ; if ( c != C_GENERIC_START ) { throw new IllegalArgumentException ( ) ; } int p = start + <NUM_LIT:1> ; while ( true ) { if ( p >= string . length ) { throw new IllegalArgumentException ( ) ; } c = string [ p ] ; if ( c == C_GENERIC_END ) { return p ; } int e = scanTypeArgumentSignature ( string , p ) ; p = e + <NUM_LIT:1> ; } } public static int scanTypeArgumentSignature ( char [ ] string , int start ) { if ( start >= string . length ) { throw new IllegalArgumentException ( ) ; } char c = string [ start ] ; switch ( c ) { case C_STAR : return start ; case C_EXTENDS : case C_SUPER : return scanTypeBoundSignature ( string , start ) ; default : return scanTypeSignature ( string , start ) ; } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . util ; import org . eclipse . jdt . core . compiler . CharOperation ; public final class SimpleNameVector { static int INITIAL_SIZE = <NUM_LIT:10> ; public int size ; int maxSize ; char [ ] [ ] elements ; public SimpleNameVector ( ) { this . maxSize = INITIAL_SIZE ; this . size = <NUM_LIT:0> ; this . elements = new char [ this . maxSize ] [ ] ; } public void add ( char [ ] newElement ) { if ( this . size == this . maxSize ) System . arraycopy ( this . elements , <NUM_LIT:0> , ( this . elements = new char [ this . maxSize *= <NUM_LIT:2> ] [ ] ) , <NUM_LIT:0> , this . size ) ; this . elements [ this . size ++ ] = newElement ; } public void addAll ( char [ ] [ ] newElements ) { if ( this . size + newElements . length >= this . maxSize ) { this . maxSize = this . size + newElements . length ; System . arraycopy ( this . elements , <NUM_LIT:0> , ( this . elements = new char [ this . maxSize ] [ ] ) , <NUM_LIT:0> , this . size ) ; } System . arraycopy ( newElements , <NUM_LIT:0> , this . elements , this . size , newElements . length ) ; this . size += newElements . length ; } public void copyInto ( Object [ ] targetArray ) { System . arraycopy ( this . elements , <NUM_LIT:0> , targetArray , <NUM_LIT:0> , this . size ) ; } public boolean contains ( char [ ] element ) { for ( int i = this . size ; -- i >= <NUM_LIT:0> ; ) if ( CharOperation . equals ( element , this . elements [ i ] ) ) return true ; return false ; } public char [ ] elementAt ( int index ) { return this . elements [ index ] ; } public char [ ] remove ( char [ ] element ) { for ( int i = this . size ; -- i >= <NUM_LIT:0> ; ) if ( element == this . elements [ i ] ) { System . arraycopy ( this . elements , i + <NUM_LIT:1> , this . elements , i , -- this . size - i ) ; this . elements [ this . size ] = null ; return element ; } return null ; } public void removeAll ( ) { for ( int i = this . size ; -- i >= <NUM_LIT:0> ; ) this . elements [ i ] = null ; this . size = <NUM_LIT:0> ; } public int size ( ) { return this . size ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; for ( int i = <NUM_LIT:0> ; i < this . size ; i ++ ) { buffer . append ( this . elements [ i ] ) . append ( "<STR_LIT:n>" ) ; } return buffer . toString ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . util ; import java . io . OutputStream ; import java . io . PrintWriter ; import java . io . Writer ; import java . util . Arrays ; import java . util . Comparator ; import java . util . HashMap ; import java . util . Map ; public class GenericXMLWriter extends PrintWriter { private static final String XML_VERSION = "<STR_LIT>" ; private static void appendEscapedChar ( StringBuffer buffer , char c ) { String replacement = getReplacement ( c ) ; if ( replacement != null ) { buffer . append ( '<CHAR_LIT>' ) ; buffer . append ( replacement ) ; buffer . append ( '<CHAR_LIT:;>' ) ; } else { buffer . append ( c ) ; } } private static String getEscaped ( String s ) { StringBuffer result = new StringBuffer ( s . length ( ) + <NUM_LIT:10> ) ; for ( int i = <NUM_LIT:0> ; i < s . length ( ) ; ++ i ) appendEscapedChar ( result , s . charAt ( i ) ) ; return result . toString ( ) ; } private static String getReplacement ( char c ) { switch ( c ) { case '<CHAR_LIT>' : return "<STR_LIT>" ; case '<CHAR_LIT:>>' : return "<STR_LIT>" ; case '<CHAR_LIT:">' : return "<STR_LIT>" ; case '<STR_LIT>' : return "<STR_LIT>" ; case '<CHAR_LIT>' : return "<STR_LIT>" ; } return null ; } private String lineSeparator ; private int tab ; public GenericXMLWriter ( OutputStream stream , String lineSeparator , boolean printXmlVersion ) { this ( new PrintWriter ( stream ) , lineSeparator , printXmlVersion ) ; } public GenericXMLWriter ( Writer writer , String lineSeparator , boolean printXmlVersion ) { super ( writer ) ; this . tab = <NUM_LIT:0> ; this . lineSeparator = lineSeparator ; if ( printXmlVersion ) { print ( XML_VERSION ) ; print ( this . lineSeparator ) ; } } public void endTag ( String name , boolean insertTab , boolean insertNewLine ) { this . tab -- ; printTag ( '<CHAR_LIT:/>' + name , null , insertTab , insertNewLine , false ) ; } public void printString ( String string , boolean insertTab , boolean insertNewLine ) { if ( insertTab ) { printTabulation ( ) ; } print ( string ) ; if ( insertNewLine ) { print ( this . lineSeparator ) ; } } private void printTabulation ( ) { for ( int i = <NUM_LIT:0> ; i < this . tab ; i ++ ) this . print ( '<STR_LIT:\t>' ) ; } public void printTag ( String name , HashMap parameters , boolean insertTab , boolean insertNewLine , boolean closeTag ) { if ( insertTab ) { printTabulation ( ) ; } this . print ( '<CHAR_LIT>' ) ; this . print ( name ) ; if ( parameters != null ) { int length = parameters . size ( ) ; Map . Entry [ ] entries = new Map . Entry [ length ] ; parameters . entrySet ( ) . toArray ( entries ) ; Arrays . sort ( entries , new Comparator ( ) { public int compare ( Object o1 , Object o2 ) { Map . Entry entry1 = ( Map . Entry ) o1 ; Map . Entry entry2 = ( Map . Entry ) o2 ; return ( ( String ) entry1 . getKey ( ) ) . compareTo ( ( String ) entry2 . getKey ( ) ) ; } } ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { this . print ( '<CHAR_LIT:U+0020>' ) ; this . print ( entries [ i ] . getKey ( ) ) ; this . print ( "<STR_LIT>" ) ; this . print ( getEscaped ( String . valueOf ( entries [ i ] . getValue ( ) ) ) ) ; this . print ( '<STR_LIT:\">' ) ; } } if ( closeTag ) { this . print ( "<STR_LIT>" ) ; } else { this . print ( "<STR_LIT:>>" ) ; } if ( insertNewLine ) { print ( this . lineSeparator ) ; } if ( parameters != null && ! closeTag ) this . tab ++ ; } public void startTag ( String name , boolean insertTab ) { printTag ( name , null , insertTab , true , false ) ; this . tab ++ ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . util ; import org . eclipse . jdt . core . compiler . CharOperation ; public final class HashtableOfObject implements Cloneable { public char [ ] keyTable [ ] ; public Object valueTable [ ] ; public int elementSize ; int threshold ; public HashtableOfObject ( ) { this ( <NUM_LIT> ) ; } public HashtableOfObject ( int size ) { this . elementSize = <NUM_LIT:0> ; this . threshold = size ; int extraRoom = ( int ) ( size * <NUM_LIT> ) ; if ( this . threshold == extraRoom ) extraRoom ++ ; this . keyTable = new char [ extraRoom ] [ ] ; this . valueTable = new Object [ extraRoom ] ; } public void clear ( ) { for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) { this . keyTable [ i ] = null ; this . valueTable [ i ] = null ; } this . elementSize = <NUM_LIT:0> ; } public Object clone ( ) throws CloneNotSupportedException { HashtableOfObject result = ( HashtableOfObject ) super . clone ( ) ; result . elementSize = this . elementSize ; result . threshold = this . threshold ; int length = this . keyTable . length ; result . keyTable = new char [ length ] [ ] ; System . arraycopy ( this . keyTable , <NUM_LIT:0> , result . keyTable , <NUM_LIT:0> , length ) ; length = this . valueTable . length ; result . valueTable = new Object [ length ] ; System . arraycopy ( this . valueTable , <NUM_LIT:0> , result . valueTable , <NUM_LIT:0> , length ) ; return result ; } public boolean containsKey ( char [ ] key ) { int length = this . keyTable . length , index = CharOperation . hashCode ( key ) % length ; int keyLength = key . length ; char [ ] currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != null ) { if ( currentKey . length == keyLength && CharOperation . equals ( currentKey , key ) ) return true ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return false ; } public Object get ( char [ ] key ) { int length = this . keyTable . length , index = CharOperation . hashCode ( key ) % length ; int keyLength = key . length ; char [ ] currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != null ) { if ( currentKey . length == keyLength && CharOperation . equals ( currentKey , key ) ) return this . valueTable [ index ] ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return null ; } public Object put ( char [ ] key , Object value ) { int length = this . keyTable . length , index = CharOperation . hashCode ( key ) % length ; int keyLength = key . length ; char [ ] currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != null ) { if ( currentKey . length == keyLength && CharOperation . equals ( currentKey , key ) ) return this . valueTable [ index ] = value ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } this . keyTable [ index ] = key ; this . valueTable [ index ] = value ; if ( ++ this . elementSize > this . threshold ) rehash ( ) ; return value ; } public void putUnsafely ( char [ ] key , Object value ) { int length = this . keyTable . length , index = CharOperation . hashCode ( key ) % length ; while ( this . keyTable [ index ] != null ) { if ( ++ index == length ) { index = <NUM_LIT:0> ; } } this . keyTable [ index ] = key ; this . valueTable [ index ] = value ; if ( ++ this . elementSize > this . threshold ) { rehash ( ) ; } } public Object removeKey ( char [ ] key ) { int length = this . keyTable . length , index = CharOperation . hashCode ( key ) % length ; int keyLength = key . length ; char [ ] currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != null ) { if ( currentKey . length == keyLength && CharOperation . equals ( currentKey , key ) ) { Object value = this . valueTable [ index ] ; this . elementSize -- ; this . keyTable [ index ] = null ; this . valueTable [ index ] = null ; rehash ( ) ; return value ; } if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return null ; } private void rehash ( ) { HashtableOfObject newHashtable = new HashtableOfObject ( this . elementSize * <NUM_LIT:2> ) ; char [ ] currentKey ; for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) if ( ( currentKey = this . keyTable [ i ] ) != null ) newHashtable . putUnsafely ( currentKey , this . valueTable [ i ] ) ; this . keyTable = newHashtable . keyTable ; this . valueTable = newHashtable . valueTable ; this . threshold = newHashtable . threshold ; } public int size ( ) { return this . elementSize ; } public String toString ( ) { String s = "<STR_LIT>" ; Object object ; for ( int i = <NUM_LIT:0> , length = this . valueTable . length ; i < length ; i ++ ) if ( ( object = this . valueTable [ i ] ) != null ) s += new String ( this . keyTable [ i ] ) + "<STR_LIT>" + object . toString ( ) + "<STR_LIT:n>" ; return s ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . util ; public final class SimpleSet implements Cloneable { public Object [ ] values ; public int elementSize ; public int threshold ; public SimpleSet ( ) { this ( <NUM_LIT> ) ; } public SimpleSet ( int size ) { if ( size < <NUM_LIT:3> ) size = <NUM_LIT:3> ; this . elementSize = <NUM_LIT:0> ; this . threshold = size + <NUM_LIT:1> ; this . values = new Object [ <NUM_LIT:2> * size + <NUM_LIT:1> ] ; } public Object add ( Object object ) { int length = this . values . length ; int index = ( object . hashCode ( ) & <NUM_LIT> ) % length ; Object current ; while ( ( current = this . values [ index ] ) != null ) { if ( current . equals ( object ) ) return this . values [ index ] = object ; if ( ++ index == length ) index = <NUM_LIT:0> ; } this . values [ index ] = object ; if ( ++ this . elementSize > this . threshold ) rehash ( ) ; return object ; } public Object addIfNotIncluded ( Object object ) { int length = this . values . length ; int index = ( object . hashCode ( ) & <NUM_LIT> ) % length ; Object current ; while ( ( current = this . values [ index ] ) != null ) { if ( current . equals ( object ) ) return null ; if ( ++ index == length ) index = <NUM_LIT:0> ; } this . values [ index ] = object ; if ( ++ this . elementSize > this . threshold ) rehash ( ) ; return object ; } public void asArray ( Object [ ] copy ) { if ( this . elementSize != copy . length ) throw new IllegalArgumentException ( ) ; int index = this . elementSize ; for ( int i = <NUM_LIT:0> , l = this . values . length ; i < l && index > <NUM_LIT:0> ; i ++ ) if ( this . values [ i ] != null ) copy [ -- index ] = this . values [ i ] ; } public void clear ( ) { for ( int i = this . values . length ; -- i >= <NUM_LIT:0> ; ) this . values [ i ] = null ; this . elementSize = <NUM_LIT:0> ; } public Object clone ( ) throws CloneNotSupportedException { SimpleSet result = ( SimpleSet ) super . clone ( ) ; result . elementSize = this . elementSize ; result . threshold = this . threshold ; int length = this . values . length ; result . values = new Object [ length ] ; System . arraycopy ( this . values , <NUM_LIT:0> , result . values , <NUM_LIT:0> , length ) ; return result ; } public boolean includes ( Object object ) { int length = this . values . length ; int index = ( object . hashCode ( ) & <NUM_LIT> ) % length ; Object current ; while ( ( current = this . values [ index ] ) != null ) { if ( current . equals ( object ) ) return true ; if ( ++ index == length ) index = <NUM_LIT:0> ; } return false ; } public Object remove ( Object object ) { int length = this . values . length ; int index = ( object . hashCode ( ) & <NUM_LIT> ) % length ; Object current ; while ( ( current = this . values [ index ] ) != null ) { if ( current . equals ( object ) ) { this . elementSize -- ; Object oldValue = this . values [ index ] ; this . values [ index ] = null ; if ( this . values [ index + <NUM_LIT:1> == length ? <NUM_LIT:0> : index + <NUM_LIT:1> ] != null ) rehash ( ) ; return oldValue ; } if ( ++ index == length ) index = <NUM_LIT:0> ; } return null ; } private void rehash ( ) { SimpleSet newSet = new SimpleSet ( this . elementSize * <NUM_LIT:2> ) ; Object current ; for ( int i = this . values . length ; -- i >= <NUM_LIT:0> ; ) if ( ( current = this . values [ i ] ) != null ) newSet . add ( current ) ; this . values = newSet . values ; this . elementSize = newSet . elementSize ; this . threshold = newSet . threshold ; } public String toString ( ) { String s = "<STR_LIT>" ; Object object ; for ( int i = <NUM_LIT:0> , l = this . values . length ; i < l ; i ++ ) if ( ( object = this . values [ i ] ) != null ) s += object . toString ( ) + "<STR_LIT:n>" ; return s ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . util ; import java . io . IOException ; import java . io . InputStream ; import java . lang . reflect . Field ; import java . lang . reflect . Modifier ; import java . text . MessageFormat ; import java . util . ArrayList ; import java . util . HashMap ; import java . util . Locale ; import java . util . Map ; import java . util . Properties ; public final class Messages { private static class MessagesProperties extends Properties { private static final int MOD_EXPECTED = Modifier . PUBLIC | Modifier . STATIC ; private static final int MOD_MASK = MOD_EXPECTED | Modifier . FINAL ; private static final long serialVersionUID = <NUM_LIT:1L> ; private final Map fields ; public MessagesProperties ( Field [ ] fieldArray , String bundleName ) { super ( ) ; final int len = fieldArray . length ; this . fields = new HashMap ( len * <NUM_LIT:2> ) ; for ( int i = <NUM_LIT:0> ; i < len ; i ++ ) { this . fields . put ( fieldArray [ i ] . getName ( ) , fieldArray [ i ] ) ; } } public synchronized Object put ( Object key , Object value ) { try { Field field = ( Field ) this . fields . get ( key ) ; if ( field == null ) { return null ; } if ( ( field . getModifiers ( ) & MOD_MASK ) != MOD_EXPECTED ) return null ; try { field . set ( null , value ) ; } catch ( Exception e ) { } } catch ( SecurityException e ) { } return null ; } } private static String [ ] nlSuffixes ; private static final String EXTENSION = "<STR_LIT>" ; private static final String BUNDLE_NAME = "<STR_LIT>" ; private Messages ( ) { } public static String compilation_unresolvedProblem ; public static String compilation_unresolvedProblems ; public static String compilation_request ; public static String compilation_loadBinary ; public static String compilation_process ; public static String compilation_write ; public static String compilation_done ; public static String compilation_units ; public static String compilation_unit ; public static String compilation_internalError ; public static String compilation_beginningToCompile ; public static String compilation_processing ; public static String output_isFile ; public static String output_notValidAll ; public static String output_notValid ; public static String problem_noSourceInformation ; public static String problem_atLine ; public static String abort_invalidAttribute ; public static String abort_invalidExceptionAttribute ; public static String abort_invalidOpcode ; public static String abort_missingCode ; public static String abort_againstSourceModel ; public static String accept_cannot ; public static String parser_incorrectPath ; public static String parser_moveFiles ; public static String parser_syntaxRecovery ; public static String parser_regularParse ; public static String parser_missingFile ; public static String parser_corruptedFile ; public static String parser_endOfFile ; public static String parser_endOfConstructor ; public static String parser_endOfMethod ; public static String parser_endOfInitializer ; public static String ast_missingCode ; public static String constant_cannotCastedInto ; public static String constant_cannotConvertedTo ; static { 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 String [ ] buildVariants ( String root ) { if ( nlSuffixes == null ) { String nl = Locale . getDefault ( ) . toString ( ) ; ArrayList result = new ArrayList ( <NUM_LIT:4> ) ; int lastSeparator ; while ( true ) { result . add ( '<CHAR_LIT:_>' + nl + EXTENSION ) ; lastSeparator = nl . lastIndexOf ( '<CHAR_LIT:_>' ) ; if ( lastSeparator == - <NUM_LIT:1> ) break ; nl = nl . substring ( <NUM_LIT:0> , lastSeparator ) ; } result . add ( EXTENSION ) ; nlSuffixes = ( String [ ] ) result . toArray ( new String [ result . size ( ) ] ) ; } root = root . replace ( '<CHAR_LIT:.>' , '<CHAR_LIT:/>' ) ; String [ ] variants = new String [ nlSuffixes . length ] ; for ( int i = <NUM_LIT:0> ; i < variants . length ; i ++ ) variants [ i ] = root + nlSuffixes [ i ] ; return variants ; } public static void initializeMessages ( String bundleName , Class clazz ) { final Field [ ] fields = clazz . getDeclaredFields ( ) ; load ( bundleName , clazz . getClassLoader ( ) , fields ) ; final int MOD_EXPECTED = Modifier . PUBLIC | Modifier . STATIC ; final int MOD_MASK = MOD_EXPECTED | Modifier . FINAL ; final int numFields = fields . length ; for ( int i = <NUM_LIT:0> ; i < numFields ; i ++ ) { Field field = fields [ i ] ; if ( ( field . getModifiers ( ) & MOD_MASK ) != MOD_EXPECTED ) continue ; try { if ( field . get ( clazz ) == null ) { String value = "<STR_LIT>" + field . getName ( ) + "<STR_LIT>" + bundleName ; field . set ( null , value ) ; } } catch ( IllegalArgumentException e ) { } catch ( IllegalAccessException e ) { } } } public static void load ( final String bundleName , final ClassLoader loader , final Field [ ] fields ) { final String [ ] variants = buildVariants ( bundleName ) ; for ( int i = variants . length ; -- i >= <NUM_LIT:0> ; ) { InputStream input = ( loader == null ) ? ClassLoader . getSystemResourceAsStream ( variants [ i ] ) : loader . getResourceAsStream ( variants [ i ] ) ; if ( input == null ) continue ; try { final MessagesProperties properties = new MessagesProperties ( fields , bundleName ) ; properties . load ( input ) ; } catch ( IOException e ) { } finally { try { input . close ( ) ; } catch ( IOException e ) { } } } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . util ; public final class HashtableOfObjectToIntArray implements Cloneable { public Object [ ] keyTable ; public int [ ] [ ] valueTable ; public int elementSize ; int threshold ; public HashtableOfObjectToIntArray ( ) { this ( <NUM_LIT> ) ; } public HashtableOfObjectToIntArray ( int size ) { this . elementSize = <NUM_LIT:0> ; this . threshold = size ; int extraRoom = ( int ) ( size * <NUM_LIT> ) ; if ( this . threshold == extraRoom ) extraRoom ++ ; this . keyTable = new Object [ extraRoom ] ; this . valueTable = new int [ extraRoom ] [ ] ; } public Object clone ( ) throws CloneNotSupportedException { HashtableOfObjectToIntArray result = ( HashtableOfObjectToIntArray ) super . clone ( ) ; result . elementSize = this . elementSize ; result . threshold = this . threshold ; int length = this . keyTable . length ; result . keyTable = new Object [ length ] ; System . arraycopy ( this . keyTable , <NUM_LIT:0> , result . keyTable , <NUM_LIT:0> , length ) ; length = this . valueTable . length ; result . valueTable = new int [ length ] [ ] ; System . arraycopy ( this . valueTable , <NUM_LIT:0> , result . valueTable , <NUM_LIT:0> , length ) ; return result ; } public boolean containsKey ( Object key ) { int length = this . keyTable . length , index = ( key . hashCode ( ) & <NUM_LIT> ) % length ; Object currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != null ) { if ( currentKey . equals ( key ) ) return true ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return false ; } public int [ ] get ( Object key ) { int length = this . keyTable . length , index = ( key . hashCode ( ) & <NUM_LIT> ) % length ; Object currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != null ) { if ( currentKey . equals ( key ) ) return this . valueTable [ index ] ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return null ; } public void keysToArray ( Object [ ] array ) { int index = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> , length = this . keyTable . length ; i < length ; i ++ ) { if ( this . keyTable [ i ] != null ) array [ index ++ ] = this . keyTable [ i ] ; } } public int [ ] put ( Object key , int [ ] value ) { int length = this . keyTable . length , index = ( key . hashCode ( ) & <NUM_LIT> ) % length ; Object currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != null ) { if ( currentKey . equals ( key ) ) return this . valueTable [ index ] = value ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } this . keyTable [ index ] = key ; this . valueTable [ index ] = value ; if ( ++ this . elementSize > this . threshold ) rehash ( ) ; return value ; } public int [ ] removeKey ( Object key ) { int length = this . keyTable . length , index = ( key . hashCode ( ) & <NUM_LIT> ) % length ; Object currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != null ) { if ( currentKey . equals ( key ) ) { int [ ] value = this . valueTable [ index ] ; this . elementSize -- ; this . keyTable [ index ] = null ; rehash ( ) ; return value ; } if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return null ; } private void rehash ( ) { HashtableOfObjectToIntArray newHashtable = new HashtableOfObjectToIntArray ( this . elementSize * <NUM_LIT:2> ) ; Object currentKey ; for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) if ( ( currentKey = this . keyTable [ i ] ) != null ) newHashtable . put ( currentKey , this . valueTable [ i ] ) ; this . keyTable = newHashtable . keyTable ; this . valueTable = newHashtable . valueTable ; this . threshold = newHashtable . threshold ; } public int size ( ) { return this . elementSize ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; Object key ; for ( int i = <NUM_LIT:0> , length = this . keyTable . length ; i < length ; i ++ ) { if ( ( key = this . keyTable [ i ] ) != null ) { buffer . append ( key ) . append ( "<STR_LIT>" ) ; int [ ] ints = this . valueTable [ i ] ; buffer . append ( '<CHAR_LIT:[>' ) ; if ( ints != null ) { for ( int j = <NUM_LIT:0> , max = ints . length ; j < max ; j ++ ) { if ( j > <NUM_LIT:0> ) { buffer . append ( '<CHAR_LIT:U+002C>' ) ; } buffer . append ( ints [ j ] ) ; } } buffer . append ( "<STR_LIT>" ) ; } } return String . valueOf ( buffer ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . util ; import org . eclipse . jdt . core . compiler . CharOperation ; public final class SimpleSetOfCharArray implements Cloneable { public char [ ] [ ] values ; public int elementSize ; public int threshold ; public SimpleSetOfCharArray ( ) { this ( <NUM_LIT> ) ; } public SimpleSetOfCharArray ( int size ) { if ( size < <NUM_LIT:3> ) size = <NUM_LIT:3> ; this . elementSize = <NUM_LIT:0> ; this . threshold = size + <NUM_LIT:1> ; this . values = new char [ <NUM_LIT:2> * size + <NUM_LIT:1> ] [ ] ; } public Object add ( char [ ] object ) { int length = this . values . length ; int index = ( CharOperation . hashCode ( object ) & <NUM_LIT> ) % length ; char [ ] current ; while ( ( current = this . values [ index ] ) != null ) { if ( CharOperation . equals ( current , object ) ) return this . values [ index ] = object ; if ( ++ index == length ) index = <NUM_LIT:0> ; } this . values [ index ] = object ; if ( ++ this . elementSize > this . threshold ) rehash ( ) ; return object ; } public void asArray ( Object [ ] copy ) { if ( this . elementSize != copy . length ) throw new IllegalArgumentException ( ) ; int index = this . elementSize ; for ( int i = <NUM_LIT:0> , l = this . values . length ; i < l && index > <NUM_LIT:0> ; i ++ ) if ( this . values [ i ] != null ) copy [ -- index ] = this . values [ i ] ; } public void clear ( ) { for ( int i = this . values . length ; -- i >= <NUM_LIT:0> ; ) this . values [ i ] = null ; this . elementSize = <NUM_LIT:0> ; } public Object clone ( ) throws CloneNotSupportedException { SimpleSetOfCharArray result = ( SimpleSetOfCharArray ) super . clone ( ) ; result . elementSize = this . elementSize ; result . threshold = this . threshold ; int length = this . values . length ; result . values = new char [ length ] [ ] ; System . arraycopy ( this . values , <NUM_LIT:0> , result . values , <NUM_LIT:0> , length ) ; return result ; } public char [ ] get ( char [ ] object ) { int length = this . values . length ; int index = ( CharOperation . hashCode ( object ) & <NUM_LIT> ) % length ; char [ ] current ; while ( ( current = this . values [ index ] ) != null ) { if ( CharOperation . equals ( current , object ) ) return current ; if ( ++ index == length ) index = <NUM_LIT:0> ; } this . values [ index ] = object ; if ( ++ this . elementSize > this . threshold ) rehash ( ) ; return object ; } public boolean includes ( char [ ] object ) { int length = this . values . length ; int index = ( CharOperation . hashCode ( object ) & <NUM_LIT> ) % length ; char [ ] current ; while ( ( current = this . values [ index ] ) != null ) { if ( CharOperation . equals ( current , object ) ) return true ; if ( ++ index == length ) index = <NUM_LIT:0> ; } return false ; } public char [ ] remove ( char [ ] object ) { int length = this . values . length ; int index = ( CharOperation . hashCode ( object ) & <NUM_LIT> ) % length ; char [ ] current ; while ( ( current = this . values [ index ] ) != null ) { if ( CharOperation . equals ( current , object ) ) { this . elementSize -- ; char [ ] oldValue = this . values [ index ] ; this . values [ index ] = null ; if ( this . values [ index + <NUM_LIT:1> == length ? <NUM_LIT:0> : index + <NUM_LIT:1> ] != null ) rehash ( ) ; return oldValue ; } if ( ++ index == length ) index = <NUM_LIT:0> ; } return null ; } private void rehash ( ) { SimpleSetOfCharArray newSet = new SimpleSetOfCharArray ( this . elementSize * <NUM_LIT:2> ) ; char [ ] current ; for ( int i = this . values . length ; -- i >= <NUM_LIT:0> ; ) if ( ( current = this . values [ i ] ) != null ) newSet . add ( current ) ; this . values = newSet . values ; this . elementSize = newSet . elementSize ; this . threshold = newSet . threshold ; } public String toString ( ) { String s = "<STR_LIT>" ; char [ ] object ; for ( int i = <NUM_LIT:0> , l = this . values . length ; i < l ; i ++ ) if ( ( object = this . values [ i ] ) != null ) s += new String ( object ) + "<STR_LIT:n>" ; return s ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler ; import org . eclipse . jdt . internal . compiler . ast . CompilationUnitDeclaration ; import org . eclipse . jdt . internal . compiler . util . Messages ; public class ProcessTaskManager implements Runnable { Compiler compiler ; private int unitIndex ; private Thread processingThread ; CompilationUnitDeclaration unitToProcess ; private Throwable caughtException ; volatile int currentIndex , availableIndex , size , sleepCount ; CompilationUnitDeclaration [ ] units ; public static final int PROCESSED_QUEUE_SIZE = <NUM_LIT:12> ; public ProcessTaskManager ( Compiler compiler ) { this . compiler = compiler ; this . unitIndex = <NUM_LIT:0> ; this . currentIndex = <NUM_LIT:0> ; this . availableIndex = <NUM_LIT:0> ; this . size = PROCESSED_QUEUE_SIZE ; this . sleepCount = <NUM_LIT:0> ; this . units = new CompilationUnitDeclaration [ this . size ] ; synchronized ( this ) { this . processingThread = new Thread ( this , "<STR_LIT>" ) ; this . processingThread . setDaemon ( true ) ; this . processingThread . start ( ) ; } } private synchronized void addNextUnit ( CompilationUnitDeclaration newElement ) { while ( this . units [ this . availableIndex ] != null ) { this . sleepCount = <NUM_LIT:1> ; try { wait ( <NUM_LIT> ) ; } catch ( InterruptedException ignore ) { } this . sleepCount = <NUM_LIT:0> ; } this . units [ this . availableIndex ++ ] = newElement ; if ( this . availableIndex >= this . size ) this . availableIndex = <NUM_LIT:0> ; if ( this . sleepCount <= - <NUM_LIT:1> ) notify ( ) ; } public CompilationUnitDeclaration removeNextUnit ( ) throws Error { CompilationUnitDeclaration next = null ; boolean yield = false ; synchronized ( this ) { next = this . units [ this . currentIndex ] ; if ( next == null || this . caughtException != null ) { do { if ( this . processingThread == null ) { if ( this . caughtException != null ) { if ( this . caughtException instanceof Error ) throw ( Error ) this . caughtException ; throw ( RuntimeException ) this . caughtException ; } return null ; } this . sleepCount = - <NUM_LIT:1> ; try { wait ( <NUM_LIT:100> ) ; } catch ( InterruptedException ignore ) { } this . sleepCount = <NUM_LIT:0> ; next = this . units [ this . currentIndex ] ; } while ( next == null ) ; } this . units [ this . currentIndex ++ ] = null ; if ( this . currentIndex >= this . size ) this . currentIndex = <NUM_LIT:0> ; if ( this . sleepCount >= <NUM_LIT:1> && ++ this . sleepCount > <NUM_LIT:4> ) { notify ( ) ; yield = this . sleepCount > <NUM_LIT:8> ; } } if ( yield ) Thread . yield ( ) ; return next ; } public void run ( ) { while ( this . processingThread != null ) { this . unitToProcess = null ; int index = - <NUM_LIT:1> ; try { synchronized ( this ) { if ( this . processingThread == null ) return ; this . unitToProcess = this . compiler . getUnitToProcess ( this . unitIndex ) ; if ( this . unitToProcess == null ) { this . processingThread = null ; return ; } index = this . unitIndex ++ ; } try { this . compiler . reportProgress ( Messages . bind ( Messages . compilation_processing , new String ( this . unitToProcess . getFileName ( ) ) ) ) ; if ( this . compiler . options . verbose ) this . compiler . out . println ( Messages . bind ( Messages . compilation_process , new String [ ] { String . valueOf ( index + <NUM_LIT:1> ) , String . valueOf ( this . compiler . totalUnits ) , new String ( this . unitToProcess . getFileName ( ) ) } ) ) ; this . compiler . process ( this . unitToProcess , index ) ; } finally { if ( this . unitToProcess != null ) this . unitToProcess . cleanUp ( ) ; } addNextUnit ( this . unitToProcess ) ; } catch ( Error e ) { synchronized ( this ) { this . processingThread = null ; this . caughtException = e ; } return ; } catch ( RuntimeException e ) { synchronized ( this ) { this . processingThread = null ; this . caughtException = e ; } return ; } } } public void shutdown ( ) { try { Thread t = null ; synchronized ( this ) { if ( this . processingThread != null ) { t = this . processingThread ; this . processingThread = null ; notifyAll ( ) ; } } if ( t != null ) t . join ( <NUM_LIT> ) ; } catch ( InterruptedException ignored ) { } } } </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 . parser ; import java . util . HashSet ; import java . util . Set ; import org . eclipse . jdt . core . compiler . * ; import org . eclipse . jdt . internal . compiler . ast . AbstractMethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . Annotation ; import org . eclipse . jdt . internal . compiler . ast . Argument ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . Block ; import org . eclipse . jdt . internal . compiler . ast . ConstructorDeclaration ; import org . eclipse . jdt . internal . compiler . ast . ExplicitConstructorCall ; import org . eclipse . jdt . internal . compiler . ast . FieldDeclaration ; import org . eclipse . jdt . internal . compiler . ast . LocalDeclaration ; import org . eclipse . jdt . internal . compiler . ast . MemberValuePair ; import org . eclipse . jdt . internal . compiler . ast . MethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . Statement ; import org . eclipse . jdt . internal . compiler . ast . SuperReference ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; import org . eclipse . jdt . internal . compiler . ast . TypeParameter ; import org . eclipse . jdt . internal . compiler . ast . TypeReference ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; import org . eclipse . jdt . internal . compiler . util . Util ; public class RecoveredMethod extends RecoveredElement implements TerminalTokens { public AbstractMethodDeclaration methodDeclaration ; public RecoveredAnnotation [ ] annotations ; public int annotationCount ; public int modifiers ; public int modifiersStart ; public RecoveredType [ ] localTypes ; public int localTypeCount ; public RecoveredBlock methodBody ; public boolean discardBody = true ; int pendingModifiers ; int pendingModifersSourceStart = - <NUM_LIT:1> ; RecoveredAnnotation [ ] pendingAnnotations ; int pendingAnnotationCount ; public RecoveredMethod ( AbstractMethodDeclaration methodDeclaration , RecoveredElement parent , int bracketBalance , Parser parser ) { super ( parent , bracketBalance , parser ) ; this . methodDeclaration = methodDeclaration ; this . foundOpeningBrace = ! bodyStartsAtHeaderEnd ( ) ; if ( this . foundOpeningBrace ) { this . bracketBalance ++ ; } } public RecoveredElement add ( Block nestedBlockDeclaration , int bracketBalanceValue ) { if ( this . methodDeclaration . declarationSourceEnd > <NUM_LIT:0> && nestedBlockDeclaration . sourceStart > this . methodDeclaration . declarationSourceEnd ) { resetPendingModifiers ( ) ; if ( this . parent == null ) { return this ; } else { return this . parent . add ( nestedBlockDeclaration , bracketBalanceValue ) ; } } if ( ! this . foundOpeningBrace ) { this . foundOpeningBrace = true ; this . bracketBalance ++ ; } this . methodBody = new RecoveredBlock ( nestedBlockDeclaration , this , bracketBalanceValue ) ; if ( nestedBlockDeclaration . sourceEnd == <NUM_LIT:0> ) return this . methodBody ; return this ; } public RecoveredElement add ( FieldDeclaration fieldDeclaration , int bracketBalanceValue ) { resetPendingModifiers ( ) ; char [ ] [ ] fieldTypeName ; if ( ( fieldDeclaration . modifiers & ~ ClassFileConstants . AccFinal ) != <NUM_LIT:0> || ( fieldDeclaration . type == null ) || ( ( fieldTypeName = fieldDeclaration . type . getTypeName ( ) ) . length == <NUM_LIT:1> && CharOperation . equals ( fieldTypeName [ <NUM_LIT:0> ] , TypeBinding . VOID . sourceName ( ) ) ) ) { if ( this . parent == null ) { return this ; } else { this . updateSourceEndIfNecessary ( previousAvailableLineEnd ( fieldDeclaration . declarationSourceStart - <NUM_LIT:1> ) ) ; return this . parent . add ( fieldDeclaration , bracketBalanceValue ) ; } } if ( this . methodDeclaration . declarationSourceEnd > <NUM_LIT:0> && fieldDeclaration . declarationSourceStart > this . methodDeclaration . declarationSourceEnd ) { if ( this . parent == null ) { return this ; } else { return this . parent . add ( fieldDeclaration , bracketBalanceValue ) ; } } if ( ! this . foundOpeningBrace ) { this . foundOpeningBrace = true ; this . bracketBalance ++ ; } return this ; } public RecoveredElement add ( LocalDeclaration localDeclaration , int bracketBalanceValue ) { resetPendingModifiers ( ) ; if ( this . methodDeclaration . declarationSourceEnd != <NUM_LIT:0> && localDeclaration . declarationSourceStart > this . methodDeclaration . declarationSourceEnd ) { if ( this . parent == null ) { return this ; } else { return this . parent . add ( localDeclaration , bracketBalanceValue ) ; } } if ( this . methodBody == null ) { Block block = new Block ( <NUM_LIT:0> ) ; block . sourceStart = this . methodDeclaration . bodyStart ; RecoveredElement currentBlock = this . add ( block , <NUM_LIT:1> ) ; if ( this . bracketBalance > <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> ; i < this . bracketBalance - <NUM_LIT:1> ; i ++ ) { currentBlock = currentBlock . add ( new Block ( <NUM_LIT:0> ) , <NUM_LIT:1> ) ; } this . bracketBalance = <NUM_LIT:1> ; } return currentBlock . add ( localDeclaration , bracketBalanceValue ) ; } return this . methodBody . add ( localDeclaration , bracketBalanceValue , true ) ; } public RecoveredElement add ( Statement statement , int bracketBalanceValue ) { resetPendingModifiers ( ) ; if ( this . methodDeclaration . declarationSourceEnd != <NUM_LIT:0> && statement . sourceStart > this . methodDeclaration . declarationSourceEnd ) { if ( this . parent == null ) { return this ; } else { return this . parent . add ( statement , bracketBalanceValue ) ; } } if ( this . methodBody == null ) { Block block = new Block ( <NUM_LIT:0> ) ; block . sourceStart = this . methodDeclaration . bodyStart ; RecoveredElement currentBlock = this . add ( block , <NUM_LIT:1> ) ; if ( this . bracketBalance > <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> ; i < this . bracketBalance - <NUM_LIT:1> ; i ++ ) { currentBlock = currentBlock . add ( new Block ( <NUM_LIT:0> ) , <NUM_LIT:1> ) ; } this . bracketBalance = <NUM_LIT:1> ; } return currentBlock . add ( statement , bracketBalanceValue ) ; } return this . methodBody . add ( statement , bracketBalanceValue , true ) ; } public RecoveredElement add ( TypeDeclaration typeDeclaration , int bracketBalanceValue ) { if ( this . methodDeclaration . declarationSourceEnd != <NUM_LIT:0> && typeDeclaration . declarationSourceStart > this . methodDeclaration . declarationSourceEnd ) { if ( this . parent == null ) { return this ; } return this . parent . add ( typeDeclaration , bracketBalanceValue ) ; } if ( ( typeDeclaration . bits & ASTNode . IsLocalType ) != <NUM_LIT:0> || parser ( ) . methodRecoveryActivated || parser ( ) . statementRecoveryActivated ) { if ( this . methodBody == null ) { Block block = new Block ( <NUM_LIT:0> ) ; block . sourceStart = this . methodDeclaration . bodyStart ; this . add ( block , <NUM_LIT:1> ) ; } this . methodBody . attachPendingModifiers ( this . pendingAnnotations , this . pendingAnnotationCount , this . pendingModifiers , this . pendingModifersSourceStart ) ; resetPendingModifiers ( ) ; return this . methodBody . add ( typeDeclaration , bracketBalanceValue , true ) ; } switch ( TypeDeclaration . kind ( typeDeclaration . modifiers ) ) { case TypeDeclaration . INTERFACE_DECL : case TypeDeclaration . ANNOTATION_TYPE_DECL : resetPendingModifiers ( ) ; this . updateSourceEndIfNecessary ( previousAvailableLineEnd ( typeDeclaration . declarationSourceStart - <NUM_LIT:1> ) ) ; if ( this . parent == null ) { return this ; } return this . parent . add ( typeDeclaration , bracketBalanceValue ) ; } if ( this . localTypes == null ) { this . localTypes = new RecoveredType [ <NUM_LIT:5> ] ; this . localTypeCount = <NUM_LIT:0> ; } else { if ( this . localTypeCount == this . localTypes . length ) { System . arraycopy ( this . localTypes , <NUM_LIT:0> , ( this . localTypes = new RecoveredType [ <NUM_LIT:2> * this . localTypeCount ] ) , <NUM_LIT:0> , this . localTypeCount ) ; } } RecoveredType element = new RecoveredType ( typeDeclaration , this , bracketBalanceValue ) ; this . localTypes [ this . localTypeCount ++ ] = element ; if ( this . pendingAnnotationCount > <NUM_LIT:0> ) { element . attach ( this . pendingAnnotations , this . pendingAnnotationCount , this . pendingModifiers , this . pendingModifersSourceStart ) ; } resetPendingModifiers ( ) ; if ( ! this . foundOpeningBrace ) { this . foundOpeningBrace = true ; this . bracketBalance ++ ; } return element ; } public boolean bodyStartsAtHeaderEnd ( ) { return this . methodDeclaration . bodyStart == this . methodDeclaration . sourceEnd + <NUM_LIT:1> ; } public ASTNode parseTree ( ) { return this . methodDeclaration ; } public void resetPendingModifiers ( ) { this . pendingAnnotations = null ; this . pendingAnnotationCount = <NUM_LIT:0> ; this . pendingModifiers = <NUM_LIT:0> ; this . pendingModifersSourceStart = - <NUM_LIT:1> ; } public int sourceEnd ( ) { return this . methodDeclaration . declarationSourceEnd ; } public String toString ( int tab ) { StringBuffer result = new StringBuffer ( tabString ( tab ) ) ; result . append ( "<STR_LIT>" ) ; this . methodDeclaration . print ( tab + <NUM_LIT:1> , result ) ; if ( this . annotations != null ) { for ( int i = <NUM_LIT:0> ; i < this . annotationCount ; i ++ ) { result . append ( "<STR_LIT:n>" ) ; result . append ( this . annotations [ i ] . toString ( tab + <NUM_LIT:1> ) ) ; } } if ( this . localTypes != null ) { for ( int i = <NUM_LIT:0> ; i < this . localTypeCount ; i ++ ) { result . append ( "<STR_LIT:n>" ) ; result . append ( this . localTypes [ i ] . toString ( tab + <NUM_LIT:1> ) ) ; } } if ( this . methodBody != null ) { result . append ( "<STR_LIT:n>" ) ; result . append ( this . methodBody . toString ( tab + <NUM_LIT:1> ) ) ; } return result . toString ( ) ; } public void updateBodyStart ( int bodyStart ) { this . foundOpeningBrace = true ; this . methodDeclaration . bodyStart = bodyStart ; } public AbstractMethodDeclaration updatedMethodDeclaration ( int depth , Set knownTypes ) { if ( this . modifiers != <NUM_LIT:0> ) { this . methodDeclaration . modifiers |= this . modifiers ; if ( this . modifiersStart < this . methodDeclaration . declarationSourceStart ) { this . methodDeclaration . declarationSourceStart = this . modifiersStart ; } } if ( this . annotationCount > <NUM_LIT:0> ) { int existingCount = this . methodDeclaration . annotations == null ? <NUM_LIT:0> : this . methodDeclaration . annotations . length ; Annotation [ ] annotationReferences = new Annotation [ existingCount + this . annotationCount ] ; if ( existingCount > <NUM_LIT:0> ) { System . arraycopy ( this . methodDeclaration . annotations , <NUM_LIT:0> , annotationReferences , this . annotationCount , existingCount ) ; } for ( int i = <NUM_LIT:0> ; i < this . annotationCount ; i ++ ) { annotationReferences [ i ] = this . annotations [ i ] . updatedAnnotationReference ( ) ; } this . methodDeclaration . annotations = annotationReferences ; int start = this . annotations [ <NUM_LIT:0> ] . annotation . sourceStart ; if ( start < this . methodDeclaration . declarationSourceStart ) { this . methodDeclaration . declarationSourceStart = start ; } } if ( this . methodBody != null ) { Block block = this . methodBody . updatedBlock ( depth , knownTypes ) ; if ( block != null ) { this . methodDeclaration . statements = block . statements ; if ( this . methodDeclaration . declarationSourceEnd == <NUM_LIT:0> ) { this . methodDeclaration . declarationSourceEnd = block . sourceEnd ; this . methodDeclaration . bodyEnd = block . sourceEnd ; } if ( this . methodDeclaration . isConstructor ( ) ) { ConstructorDeclaration constructor = ( ConstructorDeclaration ) this . methodDeclaration ; if ( this . methodDeclaration . statements != null && this . methodDeclaration . statements [ <NUM_LIT:0> ] instanceof ExplicitConstructorCall ) { constructor . constructorCall = ( ExplicitConstructorCall ) this . methodDeclaration . statements [ <NUM_LIT:0> ] ; int length = this . methodDeclaration . statements . length ; System . arraycopy ( this . methodDeclaration . statements , <NUM_LIT:1> , ( this . methodDeclaration . statements = new Statement [ length - <NUM_LIT:1> ] ) , <NUM_LIT:0> , length - <NUM_LIT:1> ) ; } if ( constructor . constructorCall == null ) { constructor . constructorCall = SuperReference . implicitSuperConstructorCall ( ) ; } } } } else { if ( this . methodDeclaration . declarationSourceEnd == <NUM_LIT:0> ) { if ( this . methodDeclaration . sourceEnd + <NUM_LIT:1> == this . methodDeclaration . bodyStart ) { this . methodDeclaration . declarationSourceEnd = this . methodDeclaration . sourceEnd ; this . methodDeclaration . bodyStart = this . methodDeclaration . sourceEnd ; this . methodDeclaration . bodyEnd = this . methodDeclaration . sourceEnd ; } else { this . methodDeclaration . declarationSourceEnd = this . methodDeclaration . bodyStart ; this . methodDeclaration . bodyEnd = this . methodDeclaration . bodyStart ; } } } if ( this . localTypeCount > <NUM_LIT:0> ) this . methodDeclaration . bits |= ASTNode . HasLocalType ; return this . methodDeclaration ; } public void updateFromParserState ( ) { if ( bodyStartsAtHeaderEnd ( ) && this . parent != null ) { Parser parser = parser ( ) ; if ( parser . listLength > <NUM_LIT:0> && parser . astLengthPtr > <NUM_LIT:0> ) { if ( this . methodDeclaration . sourceEnd == parser . rParenPos ) { int length = parser . astLengthStack [ parser . astLengthPtr ] ; int astPtr = parser . astPtr - length ; boolean canConsume = astPtr >= <NUM_LIT:0> ; if ( canConsume ) { if ( ( ! ( parser . astStack [ astPtr ] instanceof AbstractMethodDeclaration ) ) ) { canConsume = false ; } for ( int i = <NUM_LIT:1> , max = length + <NUM_LIT:1> ; i < max ; i ++ ) { if ( ! ( parser . astStack [ astPtr + i ] instanceof TypeReference ) ) { canConsume = false ; } } } if ( canConsume ) { parser . consumeMethodHeaderThrowsClause ( ) ; } else { parser . listLength = <NUM_LIT:0> ; } } else { if ( parser . currentToken == TokenNameLPAREN || parser . currentToken == TokenNameSEMICOLON ) { parser . astLengthStack [ parser . astLengthPtr ] -- ; parser . astPtr -- ; parser . listLength -- ; parser . currentToken = <NUM_LIT:0> ; } int argLength = parser . astLengthStack [ parser . astLengthPtr ] ; int argStart = parser . astPtr - argLength + <NUM_LIT:1> ; boolean needUpdateRParenPos = parser . rParenPos < parser . lParenPos ; MemberValuePair [ ] memberValuePairs = null ; while ( argLength > <NUM_LIT:0> && parser . astStack [ parser . astPtr ] instanceof MemberValuePair ) { System . arraycopy ( parser . astStack , argStart , memberValuePairs = new MemberValuePair [ argLength ] , <NUM_LIT:0> , argLength ) ; parser . astLengthPtr -- ; parser . astPtr -= argLength ; argLength = parser . astLengthStack [ parser . astLengthPtr ] ; argStart = parser . astPtr - argLength + <NUM_LIT:1> ; needUpdateRParenPos = true ; } int count ; for ( count = <NUM_LIT:0> ; count < argLength ; count ++ ) { ASTNode aNode = parser . astStack [ argStart + count ] ; if ( aNode instanceof Argument ) { Argument argument = ( Argument ) aNode ; char [ ] [ ] argTypeName = argument . type . getTypeName ( ) ; if ( ( argument . modifiers & ~ ClassFileConstants . AccFinal ) != <NUM_LIT:0> || ( argTypeName . length == <NUM_LIT:1> && CharOperation . equals ( argTypeName [ <NUM_LIT:0> ] , TypeBinding . VOID . sourceName ( ) ) ) ) { parser . astLengthStack [ parser . astLengthPtr ] = count ; parser . astPtr = argStart + count - <NUM_LIT:1> ; parser . listLength = count ; parser . currentToken = <NUM_LIT:0> ; break ; } if ( needUpdateRParenPos ) parser . rParenPos = argument . sourceEnd + <NUM_LIT:1> ; } else { parser . astLengthStack [ parser . astLengthPtr ] = count ; parser . astPtr = argStart + count - <NUM_LIT:1> ; parser . listLength = count ; parser . currentToken = <NUM_LIT:0> ; break ; } } if ( parser . listLength > <NUM_LIT:0> && parser . astLengthPtr > <NUM_LIT:0> ) { int length = parser . astLengthStack [ parser . astLengthPtr ] ; int astPtr = parser . astPtr - length ; boolean canConsume = astPtr >= <NUM_LIT:0> ; if ( canConsume ) { if ( ( ! ( parser . astStack [ astPtr ] instanceof AbstractMethodDeclaration ) ) ) { canConsume = false ; } for ( int i = <NUM_LIT:1> , max = length + <NUM_LIT:1> ; i < max ; i ++ ) { if ( ! ( parser . astStack [ astPtr + i ] instanceof Argument ) ) { canConsume = false ; } } } if ( canConsume ) { parser . consumeMethodHeaderRightParen ( ) ; if ( parser . currentElement == this ) { this . methodDeclaration . sourceEnd = this . methodDeclaration . arguments [ this . methodDeclaration . arguments . length - <NUM_LIT:1> ] . sourceEnd ; this . methodDeclaration . bodyStart = this . methodDeclaration . sourceEnd + <NUM_LIT:1> ; parser . lastCheckPoint = this . methodDeclaration . bodyStart ; } } } if ( memberValuePairs != null ) { System . arraycopy ( memberValuePairs , <NUM_LIT:0> , parser . astStack , parser . astPtr + <NUM_LIT:1> , memberValuePairs . length ) ; parser . astPtr += memberValuePairs . length ; parser . astLengthStack [ ++ parser . astLengthPtr ] = memberValuePairs . length ; } } } } } public RecoveredElement updateOnClosingBrace ( int braceStart , int braceEnd ) { if ( this . methodDeclaration . isAnnotationMethod ( ) ) { this . updateSourceEndIfNecessary ( braceStart , braceEnd ) ; if ( ! this . foundOpeningBrace && this . parent != null ) { return this . parent . updateOnClosingBrace ( braceStart , braceEnd ) ; } return this ; } if ( this . parent != null && this . parent instanceof RecoveredType ) { int mods = ( ( RecoveredType ) this . parent ) . typeDeclaration . modifiers ; if ( TypeDeclaration . kind ( mods ) == TypeDeclaration . INTERFACE_DECL ) { if ( ! this . foundOpeningBrace ) { this . updateSourceEndIfNecessary ( braceStart - <NUM_LIT:1> , braceStart - <NUM_LIT:1> ) ; return this . parent . updateOnClosingBrace ( braceStart , braceEnd ) ; } } } return super . updateOnClosingBrace ( braceStart , braceEnd ) ; } public RecoveredElement updateOnOpeningBrace ( int braceStart , int braceEnd ) { if ( this . bracketBalance == <NUM_LIT:0> ) { switch ( parser ( ) . lastIgnoredToken ) { case - <NUM_LIT:1> : case TokenNamethrows : break ; default : this . foundOpeningBrace = true ; this . bracketBalance = <NUM_LIT:1> ; } } return super . updateOnOpeningBrace ( braceStart , braceEnd ) ; } public void updateParseTree ( ) { updatedMethodDeclaration ( <NUM_LIT:0> , new HashSet ( ) ) ; } public void updateSourceEndIfNecessary ( int braceStart , int braceEnd ) { if ( this . methodDeclaration . declarationSourceEnd == <NUM_LIT:0> ) { if ( parser ( ) . rBraceSuccessorStart >= braceEnd ) { this . methodDeclaration . declarationSourceEnd = parser ( ) . rBraceEnd ; this . methodDeclaration . bodyEnd = parser ( ) . rBraceStart ; } else { this . methodDeclaration . declarationSourceEnd = braceEnd ; this . methodDeclaration . bodyEnd = braceStart - <NUM_LIT:1> ; } } } public RecoveredElement addAnnotationName ( int identifierPtr , int identifierLengthPtr , int annotationStart , int bracketBalanceValue ) { if ( this . pendingAnnotations == null ) { this . pendingAnnotations = new RecoveredAnnotation [ <NUM_LIT:5> ] ; this . pendingAnnotationCount = <NUM_LIT:0> ; } else { if ( this . pendingAnnotationCount == this . pendingAnnotations . length ) { System . arraycopy ( this . pendingAnnotations , <NUM_LIT:0> , ( this . pendingAnnotations = new RecoveredAnnotation [ <NUM_LIT:2> * this . pendingAnnotationCount ] ) , <NUM_LIT:0> , this . pendingAnnotationCount ) ; } } RecoveredAnnotation element = new RecoveredAnnotation ( identifierPtr , identifierLengthPtr , annotationStart , this , bracketBalanceValue ) ; this . pendingAnnotations [ this . pendingAnnotationCount ++ ] = element ; return element ; } public void addModifier ( int flag , int modifiersSourceStart ) { this . pendingModifiers |= flag ; if ( this . pendingModifersSourceStart < <NUM_LIT:0> ) { this . pendingModifersSourceStart = modifiersSourceStart ; } } void attach ( TypeParameter [ ] parameters , int startPos ) { if ( this . methodDeclaration . modifiers != ClassFileConstants . AccDefault ) return ; int lastParameterEnd = parameters [ parameters . length - <NUM_LIT:1> ] . sourceEnd ; Parser parser = parser ( ) ; Scanner scanner = parser . scanner ; if ( Util . getLineNumber ( this . methodDeclaration . declarationSourceStart , scanner . lineEnds , <NUM_LIT:0> , scanner . linePtr ) != Util . getLineNumber ( lastParameterEnd , scanner . lineEnds , <NUM_LIT:0> , scanner . linePtr ) ) return ; if ( parser . modifiersSourceStart > lastParameterEnd && parser . modifiersSourceStart < this . methodDeclaration . declarationSourceStart ) return ; if ( this . methodDeclaration instanceof MethodDeclaration ) { ( ( MethodDeclaration ) this . methodDeclaration ) . typeParameters = parameters ; this . methodDeclaration . declarationSourceStart = startPos ; } else if ( this . methodDeclaration instanceof ConstructorDeclaration ) { ( ( ConstructorDeclaration ) this . methodDeclaration ) . typeParameters = parameters ; this . methodDeclaration . declarationSourceStart = startPos ; } } public void attach ( RecoveredAnnotation [ ] annots , int annotCount , int mods , int modsSourceStart ) { if ( annotCount > <NUM_LIT:0> ) { Annotation [ ] existingAnnotations = this . methodDeclaration . annotations ; if ( existingAnnotations != null ) { this . annotations = new RecoveredAnnotation [ annotCount ] ; this . annotationCount = <NUM_LIT:0> ; next : for ( int i = <NUM_LIT:0> ; i < annotCount ; i ++ ) { for ( int j = <NUM_LIT:0> ; j < existingAnnotations . length ; j ++ ) { if ( annots [ i ] . annotation == existingAnnotations [ j ] ) continue next ; } this . annotations [ this . annotationCount ++ ] = annots [ i ] ; } } else { this . annotations = annots ; this . annotationCount = annotCount ; } } if ( mods != <NUM_LIT:0> ) { this . modifiers = mods ; this . modifiersStart = modsSourceStart ; } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . parser ; import java . util . HashSet ; import java . util . Set ; import org . eclipse . jdt . core . compiler . * ; import org . eclipse . jdt . internal . compiler . ast . AbstractMethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . Argument ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . Block ; import org . eclipse . jdt . internal . compiler . ast . FieldDeclaration ; import org . eclipse . jdt . internal . compiler . ast . LocalDeclaration ; import org . eclipse . jdt . internal . compiler . ast . Statement ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; public class RecoveredBlock extends RecoveredStatement implements TerminalTokens { public Block blockDeclaration ; public RecoveredStatement [ ] statements ; public int statementCount ; public boolean preserveContent = false ; public RecoveredLocalVariable pendingArgument ; int pendingModifiers ; int pendingModifersSourceStart = - <NUM_LIT:1> ; RecoveredAnnotation [ ] pendingAnnotations ; int pendingAnnotationCount ; public RecoveredBlock ( Block block , RecoveredElement parent , int bracketBalance ) { super ( block , parent , bracketBalance ) ; this . blockDeclaration = block ; this . foundOpeningBrace = true ; this . preserveContent = parser ( ) . methodRecoveryActivated || parser ( ) . statementRecoveryActivated ; } public RecoveredElement add ( AbstractMethodDeclaration methodDeclaration , int bracketBalanceValue ) { if ( this . parent != null && this . parent instanceof RecoveredMethod ) { RecoveredMethod enclosingRecoveredMethod = ( RecoveredMethod ) this . parent ; if ( enclosingRecoveredMethod . methodBody == this && enclosingRecoveredMethod . parent == null ) { resetPendingModifiers ( ) ; return this ; } } return super . add ( methodDeclaration , bracketBalanceValue ) ; } public RecoveredElement add ( Block nestedBlockDeclaration , int bracketBalanceValue ) { resetPendingModifiers ( ) ; if ( this . blockDeclaration . sourceEnd != <NUM_LIT:0> && nestedBlockDeclaration . sourceStart > this . blockDeclaration . sourceEnd ) { return this . parent . add ( nestedBlockDeclaration , bracketBalanceValue ) ; } RecoveredBlock element = new RecoveredBlock ( nestedBlockDeclaration , this , bracketBalanceValue ) ; if ( this . pendingArgument != null ) { element . attach ( this . pendingArgument ) ; this . pendingArgument = null ; } if ( parser ( ) . statementRecoveryActivated ) { addBlockStatement ( element ) ; } attach ( element ) ; if ( nestedBlockDeclaration . sourceEnd == <NUM_LIT:0> ) return element ; return this ; } public RecoveredElement add ( LocalDeclaration localDeclaration , int bracketBalanceValue ) { return this . add ( localDeclaration , bracketBalanceValue , false ) ; } public RecoveredElement add ( LocalDeclaration localDeclaration , int bracketBalanceValue , boolean delegatedByParent ) { if ( this . blockDeclaration . sourceEnd != <NUM_LIT:0> && localDeclaration . declarationSourceStart > this . blockDeclaration . sourceEnd ) { resetPendingModifiers ( ) ; if ( delegatedByParent ) return this ; return this . parent . add ( localDeclaration , bracketBalanceValue ) ; } RecoveredLocalVariable element = new RecoveredLocalVariable ( localDeclaration , this , bracketBalanceValue ) ; if ( this . pendingAnnotationCount > <NUM_LIT:0> ) { element . attach ( this . pendingAnnotations , this . pendingAnnotationCount , this . pendingModifiers , this . pendingModifersSourceStart ) ; } resetPendingModifiers ( ) ; if ( localDeclaration instanceof Argument ) { this . pendingArgument = element ; return this ; } attach ( element ) ; if ( localDeclaration . declarationSourceEnd == <NUM_LIT:0> ) return element ; return this ; } public RecoveredElement add ( Statement stmt , int bracketBalanceValue ) { return this . add ( stmt , bracketBalanceValue , false ) ; } public RecoveredElement add ( Statement stmt , int bracketBalanceValue , boolean delegatedByParent ) { resetPendingModifiers ( ) ; if ( this . blockDeclaration . sourceEnd != <NUM_LIT:0> && stmt . sourceStart > this . blockDeclaration . sourceEnd ) { if ( delegatedByParent ) return this ; return this . parent . add ( stmt , bracketBalanceValue ) ; } RecoveredStatement element = new RecoveredStatement ( stmt , this , bracketBalanceValue ) ; attach ( element ) ; if ( stmt . sourceEnd == <NUM_LIT:0> ) return element ; return this ; } public RecoveredElement add ( TypeDeclaration typeDeclaration , int bracketBalanceValue ) { return this . add ( typeDeclaration , bracketBalanceValue , false ) ; } public RecoveredElement add ( TypeDeclaration typeDeclaration , int bracketBalanceValue , boolean delegatedByParent ) { if ( this . blockDeclaration . sourceEnd != <NUM_LIT:0> && typeDeclaration . declarationSourceStart > this . blockDeclaration . sourceEnd ) { resetPendingModifiers ( ) ; if ( delegatedByParent ) return this ; return this . parent . add ( typeDeclaration , bracketBalanceValue ) ; } RecoveredType element = new RecoveredType ( typeDeclaration , this , bracketBalanceValue ) ; if ( this . pendingAnnotationCount > <NUM_LIT:0> ) { element . attach ( this . pendingAnnotations , this . pendingAnnotationCount , this . pendingModifiers , this . pendingModifersSourceStart ) ; } resetPendingModifiers ( ) ; attach ( element ) ; if ( typeDeclaration . declarationSourceEnd == <NUM_LIT:0> ) return element ; return this ; } public RecoveredElement addAnnotationName ( int identifierPtr , int identifierLengthPtr , int annotationStart , int bracketBalanceValue ) { if ( this . pendingAnnotations == null ) { this . pendingAnnotations = new RecoveredAnnotation [ <NUM_LIT:5> ] ; this . pendingAnnotationCount = <NUM_LIT:0> ; } else { if ( this . pendingAnnotationCount == this . pendingAnnotations . length ) { System . arraycopy ( this . pendingAnnotations , <NUM_LIT:0> , ( this . pendingAnnotations = new RecoveredAnnotation [ <NUM_LIT:2> * this . pendingAnnotationCount ] ) , <NUM_LIT:0> , this . pendingAnnotationCount ) ; } } RecoveredAnnotation element = new RecoveredAnnotation ( identifierPtr , identifierLengthPtr , annotationStart , this , bracketBalanceValue ) ; this . pendingAnnotations [ this . pendingAnnotationCount ++ ] = element ; return element ; } public void addModifier ( int flag , int modifiersSourceStart ) { this . pendingModifiers |= flag ; if ( this . pendingModifersSourceStart < <NUM_LIT:0> ) { this . pendingModifersSourceStart = modifiersSourceStart ; } } void attach ( RecoveredStatement recoveredStatement ) { if ( this . statements == null ) { this . statements = new RecoveredStatement [ <NUM_LIT:5> ] ; this . statementCount = <NUM_LIT:0> ; } else { if ( this . statementCount == this . statements . length ) { System . arraycopy ( this . statements , <NUM_LIT:0> , ( this . statements = new RecoveredStatement [ <NUM_LIT:2> * this . statementCount ] ) , <NUM_LIT:0> , this . statementCount ) ; } } this . statements [ this . statementCount ++ ] = recoveredStatement ; } void attachPendingModifiers ( RecoveredAnnotation [ ] pendingAnnots , int pendingAnnotCount , int pendingMods , int pendingModsSourceStart ) { this . pendingAnnotations = pendingAnnots ; this . pendingAnnotationCount = pendingAnnotCount ; this . pendingModifiers = pendingMods ; this . pendingModifersSourceStart = pendingModsSourceStart ; } public ASTNode parseTree ( ) { return this . blockDeclaration ; } public void resetPendingModifiers ( ) { this . pendingAnnotations = null ; this . pendingAnnotationCount = <NUM_LIT:0> ; this . pendingModifiers = <NUM_LIT:0> ; this . pendingModifersSourceStart = - <NUM_LIT:1> ; } public String toString ( int tab ) { StringBuffer result = new StringBuffer ( tabString ( tab ) ) ; result . append ( "<STR_LIT>" ) ; this . blockDeclaration . print ( tab + <NUM_LIT:1> , result ) ; if ( this . statements != null ) { for ( int i = <NUM_LIT:0> ; i < this . statementCount ; i ++ ) { result . append ( "<STR_LIT:n>" ) ; result . append ( this . statements [ i ] . toString ( tab + <NUM_LIT:1> ) ) ; } } return result . toString ( ) ; } public Block updatedBlock ( int depth , Set knownTypes ) { if ( ! this . preserveContent || this . statementCount == <NUM_LIT:0> ) return null ; Statement [ ] updatedStatements = new Statement [ this . statementCount ] ; int updatedCount = <NUM_LIT:0> ; RecoveredStatement lastStatement = this . statements [ this . statementCount - <NUM_LIT:1> ] ; RecoveredMethod enclosingMethod = enclosingMethod ( ) ; RecoveredInitializer enclosingIntializer = enclosingInitializer ( ) ; int bodyEndValue = <NUM_LIT:0> ; if ( enclosingMethod != null ) { bodyEndValue = enclosingMethod . methodDeclaration . bodyEnd ; if ( enclosingIntializer != null && enclosingMethod . methodDeclaration . sourceStart < enclosingIntializer . fieldDeclaration . sourceStart ) { bodyEndValue = enclosingIntializer . fieldDeclaration . declarationSourceEnd ; } } else if ( enclosingIntializer != null ) { bodyEndValue = enclosingIntializer . fieldDeclaration . declarationSourceEnd ; } else { bodyEndValue = this . blockDeclaration . sourceEnd - <NUM_LIT:1> ; } if ( lastStatement instanceof RecoveredLocalVariable ) { RecoveredLocalVariable lastLocalVariable = ( RecoveredLocalVariable ) lastStatement ; if ( lastLocalVariable . localDeclaration . declarationSourceEnd == <NUM_LIT:0> ) { lastLocalVariable . localDeclaration . declarationSourceEnd = bodyEndValue ; lastLocalVariable . localDeclaration . declarationEnd = bodyEndValue ; } } else if ( lastStatement instanceof RecoveredBlock ) { RecoveredBlock lastBlock = ( RecoveredBlock ) lastStatement ; if ( lastBlock . blockDeclaration . sourceEnd == <NUM_LIT:0> ) { lastBlock . blockDeclaration . sourceEnd = bodyEndValue ; } } else if ( ! ( lastStatement instanceof RecoveredType ) ) { if ( lastStatement . statement . sourceEnd == <NUM_LIT:0> ) { lastStatement . statement . sourceEnd = bodyEndValue ; } } int lastEnd = this . blockDeclaration . sourceStart ; for ( int i = <NUM_LIT:0> ; i < this . statementCount ; i ++ ) { Statement updatedStatement = this . statements [ i ] . updatedStatement ( depth , knownTypes ) ; if ( updatedStatement != null ) { updatedStatements [ updatedCount ++ ] = updatedStatement ; if ( updatedStatement instanceof LocalDeclaration ) { LocalDeclaration localDeclaration = ( LocalDeclaration ) updatedStatement ; if ( localDeclaration . declarationSourceEnd > lastEnd ) { lastEnd = localDeclaration . declarationSourceEnd ; } } else if ( updatedStatement instanceof TypeDeclaration ) { TypeDeclaration typeDeclaration = ( TypeDeclaration ) updatedStatement ; if ( typeDeclaration . declarationSourceEnd > lastEnd ) { lastEnd = typeDeclaration . declarationSourceEnd ; } } else { if ( updatedStatement . sourceEnd > lastEnd ) { lastEnd = updatedStatement . sourceEnd ; } } } } if ( updatedCount == <NUM_LIT:0> ) return null ; if ( updatedCount != this . statementCount ) { this . blockDeclaration . statements = new Statement [ updatedCount ] ; System . arraycopy ( updatedStatements , <NUM_LIT:0> , this . blockDeclaration . statements , <NUM_LIT:0> , updatedCount ) ; } else { this . blockDeclaration . statements = updatedStatements ; } if ( this . blockDeclaration . sourceEnd == <NUM_LIT:0> ) { if ( lastEnd < bodyEndValue ) { this . blockDeclaration . sourceEnd = bodyEndValue ; } else { this . blockDeclaration . sourceEnd = lastEnd ; } } return this . blockDeclaration ; } public Statement updatedStatement ( int depth , Set knownTypes ) { return updatedBlock ( depth , knownTypes ) ; } public RecoveredElement updateOnClosingBrace ( int braceStart , int braceEnd ) { if ( ( -- this . bracketBalance <= <NUM_LIT:0> ) && ( this . parent != null ) ) { this . updateSourceEndIfNecessary ( braceStart , braceEnd ) ; RecoveredMethod method = enclosingMethod ( ) ; if ( method != null && method . methodBody == this ) { return this . parent . updateOnClosingBrace ( braceStart , braceEnd ) ; } RecoveredInitializer initializer = enclosingInitializer ( ) ; if ( initializer != null && initializer . initializerBody == this ) { return this . parent . updateOnClosingBrace ( braceStart , braceEnd ) ; } return this . parent ; } return this ; } public RecoveredElement updateOnOpeningBrace ( int braceStart , int braceEnd ) { Block block = new Block ( <NUM_LIT:0> ) ; block . sourceStart = parser ( ) . scanner . startPosition ; return this . add ( block , <NUM_LIT:1> ) ; } public void updateParseTree ( ) { updatedBlock ( <NUM_LIT:0> , new HashSet ( ) ) ; } public Statement updateStatement ( int depth , Set knownTypes ) { if ( this . blockDeclaration . sourceEnd != <NUM_LIT:0> || this . statementCount == <NUM_LIT:0> ) return null ; Statement [ ] updatedStatements = new Statement [ this . statementCount ] ; int updatedCount = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < this . statementCount ; i ++ ) { Statement updatedStatement = this . statements [ i ] . updatedStatement ( depth , knownTypes ) ; if ( updatedStatement != null ) { updatedStatements [ updatedCount ++ ] = updatedStatement ; } } if ( updatedCount == <NUM_LIT:0> ) return null ; if ( updatedCount != this . statementCount ) { this . blockDeclaration . statements = new Statement [ updatedCount ] ; System . arraycopy ( updatedStatements , <NUM_LIT:0> , this . blockDeclaration . statements , <NUM_LIT:0> , updatedCount ) ; } else { this . blockDeclaration . statements = updatedStatements ; } return this . blockDeclaration ; } public RecoveredElement add ( FieldDeclaration fieldDeclaration , int bracketBalanceValue ) { resetPendingModifiers ( ) ; char [ ] [ ] fieldTypeName ; if ( ( fieldDeclaration . modifiers & ~ ClassFileConstants . AccFinal ) != <NUM_LIT:0> || ( fieldDeclaration . type == null ) || ( ( fieldTypeName = fieldDeclaration . type . getTypeName ( ) ) . length == <NUM_LIT:1> && CharOperation . equals ( fieldTypeName [ <NUM_LIT:0> ] , TypeBinding . VOID . sourceName ( ) ) ) ) { this . updateSourceEndIfNecessary ( previousAvailableLineEnd ( fieldDeclaration . declarationSourceStart - <NUM_LIT:1> ) ) ; return this . parent . add ( fieldDeclaration , bracketBalanceValue ) ; } if ( this . blockDeclaration . sourceEnd != <NUM_LIT:0> && fieldDeclaration . declarationSourceStart > this . blockDeclaration . sourceEnd ) { return this . parent . add ( fieldDeclaration , bracketBalanceValue ) ; } return this ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . parser . diagnose ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . AbstractMethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . FieldDeclaration ; import org . eclipse . jdt . internal . compiler . ast . Initializer ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; import org . eclipse . jdt . internal . compiler . lookup . ExtraCompilerModifiers ; public class RangeUtil { public static final int NO_FLAG = <NUM_LIT:0> ; public static final int LBRACE_MISSING = <NUM_LIT:1> ; public static final int IGNORE = <NUM_LIT:2> ; static class RangeResult { private static final int INITIAL_SIZE = <NUM_LIT:10> ; int pos ; int [ ] intervalStarts ; int [ ] intervalEnds ; int [ ] intervalFlags ; RangeResult ( ) { this . pos = <NUM_LIT:0> ; this . intervalStarts = new int [ INITIAL_SIZE ] ; this . intervalEnds = new int [ INITIAL_SIZE ] ; this . intervalFlags = new int [ INITIAL_SIZE ] ; } void addInterval ( int start , int end ) { addInterval ( start , end , NO_FLAG ) ; } void addInterval ( int start , int end , int flags ) { if ( this . pos >= this . intervalStarts . length ) { System . arraycopy ( this . intervalStarts , <NUM_LIT:0> , this . intervalStarts = new int [ this . pos * <NUM_LIT:2> ] , <NUM_LIT:0> , this . pos ) ; System . arraycopy ( this . intervalEnds , <NUM_LIT:0> , this . intervalEnds = new int [ this . pos * <NUM_LIT:2> ] , <NUM_LIT:0> , this . pos ) ; System . arraycopy ( this . intervalFlags , <NUM_LIT:0> , this . intervalFlags = new int [ this . pos * <NUM_LIT:2> ] , <NUM_LIT:0> , this . pos ) ; } this . intervalStarts [ this . pos ] = start ; this . intervalEnds [ this . pos ] = end ; this . intervalFlags [ this . pos ] = flags ; this . pos ++ ; } int [ ] [ ] getRanges ( ) { int [ ] resultStarts = new int [ this . pos ] ; int [ ] resultEnds = new int [ this . pos ] ; int [ ] resultFlags = new int [ this . pos ] ; System . arraycopy ( this . intervalStarts , <NUM_LIT:0> , resultStarts , <NUM_LIT:0> , this . pos ) ; System . arraycopy ( this . intervalEnds , <NUM_LIT:0> , resultEnds , <NUM_LIT:0> , this . pos ) ; System . arraycopy ( this . intervalFlags , <NUM_LIT:0> , resultFlags , <NUM_LIT:0> , this . pos ) ; if ( resultStarts . length > <NUM_LIT:1> ) { quickSort ( resultStarts , resultEnds , resultFlags , <NUM_LIT:0> , resultStarts . length - <NUM_LIT:1> ) ; } return new int [ ] [ ] { resultStarts , resultEnds , resultFlags } ; } private void quickSort ( int [ ] list , int [ ] list2 , int [ ] list3 , int left , int right ) { int original_left = left ; int original_right = right ; int mid = list [ left + ( right - left ) / <NUM_LIT:2> ] ; do { while ( compare ( list [ left ] , mid ) < <NUM_LIT:0> ) { left ++ ; } while ( compare ( mid , list [ right ] ) < <NUM_LIT:0> ) { right -- ; } if ( left <= right ) { int tmp = list [ left ] ; list [ left ] = list [ right ] ; list [ right ] = tmp ; tmp = list2 [ left ] ; list2 [ left ] = list2 [ right ] ; list2 [ right ] = tmp ; tmp = list3 [ left ] ; list3 [ left ] = list3 [ right ] ; list3 [ right ] = tmp ; left ++ ; right -- ; } } while ( left <= right ) ; if ( original_left < right ) { quickSort ( list , list2 , list3 , original_left , right ) ; } if ( left < original_right ) { quickSort ( list , list2 , list3 , left , original_right ) ; } } private int compare ( int i1 , int i2 ) { return i1 - i2 ; } } public static boolean containsErrorInSignature ( AbstractMethodDeclaration method ) { return method . sourceEnd + <NUM_LIT:1> == method . bodyStart || method . bodyEnd == method . declarationSourceEnd ; } public static int [ ] [ ] computeDietRange ( TypeDeclaration [ ] types ) { if ( types == null || types . length == <NUM_LIT:0> ) { return new int [ <NUM_LIT:3> ] [ <NUM_LIT:0> ] ; } else { RangeResult result = new RangeResult ( ) ; computeDietRange0 ( types , result ) ; return result . getRanges ( ) ; } } private static void computeDietRange0 ( TypeDeclaration [ ] types , RangeResult result ) { for ( int j = <NUM_LIT:0> ; j < types . length ; j ++ ) { TypeDeclaration [ ] memberTypeDeclarations = types [ j ] . memberTypes ; if ( memberTypeDeclarations != null && memberTypeDeclarations . length > <NUM_LIT:0> ) { computeDietRange0 ( types [ j ] . memberTypes , result ) ; } AbstractMethodDeclaration [ ] methods = types [ j ] . methods ; if ( methods != null ) { int length = methods . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { AbstractMethodDeclaration method = methods [ i ] ; if ( containsIgnoredBody ( method ) ) { if ( containsErrorInSignature ( method ) ) { method . bits |= ASTNode . ErrorInSignature ; result . addInterval ( method . declarationSourceStart , method . declarationSourceEnd , IGNORE ) ; } else { int flags = method . sourceEnd + <NUM_LIT:1> == method . bodyStart ? LBRACE_MISSING : NO_FLAG ; result . addInterval ( method . bodyStart , method . bodyEnd , flags ) ; } } } } FieldDeclaration [ ] fields = types [ j ] . fields ; if ( fields != null ) { int length = fields . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( fields [ i ] instanceof Initializer ) { Initializer initializer = ( Initializer ) fields [ i ] ; if ( initializer . declarationSourceEnd == initializer . bodyEnd && initializer . declarationSourceStart != initializer . declarationSourceEnd ) { initializer . bits |= ASTNode . ErrorInSignature ; result . addInterval ( initializer . declarationSourceStart , initializer . declarationSourceEnd , IGNORE ) ; } else { result . addInterval ( initializer . bodyStart , initializer . bodyEnd ) ; } } } } } } public static boolean containsIgnoredBody ( AbstractMethodDeclaration method ) { return ! method . isDefaultConstructor ( ) && ! method . isClinit ( ) && ( method . modifiers & ExtraCompilerModifiers . AccSemicolonBody ) == <NUM_LIT:0> ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . parser . diagnose ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . core . compiler . InvalidInputException ; import org . eclipse . jdt . internal . compiler . parser . Scanner ; import org . eclipse . jdt . internal . compiler . parser . TerminalTokens ; import org . eclipse . jdt . internal . compiler . util . Util ; public class LexStream implements TerminalTokens { public static final int IS_AFTER_JUMP = <NUM_LIT:1> ; public static final int LBRACE_MISSING = <NUM_LIT:2> ; public static class Token { int kind ; char [ ] name ; int start ; int end ; int line ; int flags ; public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( this . name ) . append ( '<CHAR_LIT:[>' ) . append ( this . kind ) . append ( '<CHAR_LIT:]>' ) ; buffer . append ( '<CHAR_LIT>' ) . append ( this . start ) . append ( '<CHAR_LIT:U+002C>' ) . append ( this . end ) . append ( '<CHAR_LIT:}>' ) . append ( this . line ) ; return buffer . toString ( ) ; } } private int tokenCacheIndex ; private int tokenCacheEOFIndex ; private Token [ ] tokenCache ; private int currentIndex = - <NUM_LIT:1> ; private Scanner scanner ; private int [ ] intervalStartToSkip ; private int [ ] intervalEndToSkip ; private int [ ] intervalFlagsToSkip ; private int previousInterval = - <NUM_LIT:1> ; private int currentInterval = - <NUM_LIT:1> ; public LexStream ( int size , Scanner scanner , int [ ] intervalStartToSkip , int [ ] intervalEndToSkip , int [ ] intervalFlagsToSkip , int firstToken , int init , int eof ) { this . tokenCache = new Token [ size ] ; this . tokenCacheIndex = <NUM_LIT:0> ; this . tokenCacheEOFIndex = Integer . MAX_VALUE ; this . tokenCache [ <NUM_LIT:0> ] = new Token ( ) ; this . tokenCache [ <NUM_LIT:0> ] . kind = firstToken ; this . tokenCache [ <NUM_LIT:0> ] . name = CharOperation . NO_CHAR ; this . tokenCache [ <NUM_LIT:0> ] . start = init ; this . tokenCache [ <NUM_LIT:0> ] . end = init ; this . tokenCache [ <NUM_LIT:0> ] . line = <NUM_LIT:0> ; this . intervalStartToSkip = intervalStartToSkip ; this . intervalEndToSkip = intervalEndToSkip ; this . intervalFlagsToSkip = intervalFlagsToSkip ; scanner . resetTo ( init , eof ) ; this . scanner = scanner ; } private void readTokenFromScanner ( ) { int length = this . tokenCache . length ; boolean tokenNotFound = true ; while ( tokenNotFound ) { try { int tokenKind = this . scanner . getNextToken ( ) ; if ( tokenKind != TokenNameEOF ) { int start = this . scanner . getCurrentTokenStartPosition ( ) ; int end = this . scanner . getCurrentTokenEndPosition ( ) ; int nextInterval = this . currentInterval + <NUM_LIT:1> ; if ( this . intervalStartToSkip . length == <NUM_LIT:0> || nextInterval >= this . intervalStartToSkip . length || start < this . intervalStartToSkip [ nextInterval ] ) { Token token = new Token ( ) ; token . kind = tokenKind ; token . name = this . scanner . getCurrentTokenSource ( ) ; token . start = start ; token . end = end ; token . line = Util . getLineNumber ( end , this . scanner . lineEnds , <NUM_LIT:0> , this . scanner . linePtr ) ; if ( this . currentInterval != this . previousInterval && ( this . intervalFlagsToSkip [ this . currentInterval ] & RangeUtil . IGNORE ) == <NUM_LIT:0> ) { token . flags = IS_AFTER_JUMP ; if ( ( this . intervalFlagsToSkip [ this . currentInterval ] & RangeUtil . LBRACE_MISSING ) != <NUM_LIT:0> ) { token . flags |= LBRACE_MISSING ; } } this . previousInterval = this . currentInterval ; this . tokenCache [ ++ this . tokenCacheIndex % length ] = token ; tokenNotFound = false ; } else { this . scanner . resetTo ( this . intervalEndToSkip [ ++ this . currentInterval ] + <NUM_LIT:1> , this . scanner . eofPosition - <NUM_LIT:1> ) ; } } else { int start = this . scanner . getCurrentTokenStartPosition ( ) ; int end = this . scanner . getCurrentTokenEndPosition ( ) ; Token token = new Token ( ) ; token . kind = tokenKind ; token . name = CharOperation . NO_CHAR ; token . start = start ; token . end = end ; token . line = Util . getLineNumber ( end , this . scanner . lineEnds , <NUM_LIT:0> , this . scanner . linePtr ) ; this . tokenCache [ ++ this . tokenCacheIndex % length ] = token ; this . tokenCacheEOFIndex = this . tokenCacheIndex ; tokenNotFound = false ; } } catch ( InvalidInputException e ) { } } } public Token token ( int index ) { if ( index < <NUM_LIT:0> ) { Token eofToken = new Token ( ) ; eofToken . kind = TokenNameEOF ; eofToken . name = CharOperation . NO_CHAR ; return eofToken ; } if ( this . tokenCacheEOFIndex >= <NUM_LIT:0> && index > this . tokenCacheEOFIndex ) { return token ( this . tokenCacheEOFIndex ) ; } int length = this . tokenCache . length ; if ( index > this . tokenCacheIndex ) { int tokensToRead = index - this . tokenCacheIndex ; while ( tokensToRead -- != <NUM_LIT:0> ) { readTokenFromScanner ( ) ; } } else if ( this . tokenCacheIndex - length >= index ) { return null ; } return this . tokenCache [ index % length ] ; } public int getToken ( ) { return this . currentIndex = next ( this . currentIndex ) ; } public int previous ( int tokenIndex ) { return tokenIndex > <NUM_LIT:0> ? tokenIndex - <NUM_LIT:1> : <NUM_LIT:0> ; } public int next ( int tokenIndex ) { return tokenIndex < this . tokenCacheEOFIndex ? tokenIndex + <NUM_LIT:1> : this . tokenCacheEOFIndex ; } public boolean afterEol ( int i ) { return i < <NUM_LIT:1> ? true : line ( i - <NUM_LIT:1> ) < line ( i ) ; } public void reset ( ) { this . currentIndex = - <NUM_LIT:1> ; } public void reset ( int i ) { this . currentIndex = previous ( i ) ; } public int badtoken ( ) { return <NUM_LIT:0> ; } public int kind ( int tokenIndex ) { return token ( tokenIndex ) . kind ; } public char [ ] name ( int tokenIndex ) { return token ( tokenIndex ) . name ; } public int line ( int tokenIndex ) { return token ( tokenIndex ) . line ; } public int start ( int tokenIndex ) { return token ( tokenIndex ) . start ; } public int end ( int tokenIndex ) { return token ( tokenIndex ) . end ; } public int flags ( int tokenIndex ) { return token ( tokenIndex ) . flags ; } public boolean isInsideStream ( int index ) { if ( this . tokenCacheEOFIndex >= <NUM_LIT:0> && index > this . tokenCacheEOFIndex ) { return false ; } else if ( index > this . tokenCacheIndex ) { return true ; } else if ( this . tokenCacheIndex - this . tokenCache . length >= index ) { return false ; } else { return true ; } } public String toString ( ) { StringBuffer res = new StringBuffer ( ) ; String source = new String ( this . scanner . source ) ; if ( this . currentIndex < <NUM_LIT:0> ) { int previousEnd = - <NUM_LIT:1> ; for ( int i = <NUM_LIT:0> ; i < this . intervalStartToSkip . length ; i ++ ) { int intervalStart = this . intervalStartToSkip [ i ] ; int intervalEnd = this . intervalEndToSkip [ i ] ; res . append ( source . substring ( previousEnd + <NUM_LIT:1> , intervalStart ) ) ; res . append ( '<CHAR_LIT>' ) ; res . append ( '<CHAR_LIT>' ) ; res . append ( source . substring ( intervalStart , intervalEnd + <NUM_LIT:1> ) ) ; res . append ( '<CHAR_LIT>' ) ; res . append ( '<CHAR_LIT:>>' ) ; previousEnd = intervalEnd ; } res . append ( source . substring ( previousEnd + <NUM_LIT:1> ) ) ; } else { Token token = token ( this . currentIndex ) ; int curtokKind = token . kind ; int curtokStart = token . start ; int curtokEnd = token . end ; int previousEnd = - <NUM_LIT:1> ; for ( int i = <NUM_LIT:0> ; i < this . intervalStartToSkip . length ; i ++ ) { int intervalStart = this . intervalStartToSkip [ i ] ; int intervalEnd = this . intervalEndToSkip [ i ] ; if ( curtokStart >= previousEnd && curtokEnd <= intervalStart ) { res . append ( source . substring ( previousEnd + <NUM_LIT:1> , curtokStart ) ) ; res . append ( '<CHAR_LIT>' ) ; res . append ( '<CHAR_LIT>' ) ; res . append ( source . substring ( curtokStart , curtokEnd + <NUM_LIT:1> ) ) ; res . append ( '<CHAR_LIT>' ) ; res . append ( '<CHAR_LIT:>>' ) ; res . append ( source . substring ( curtokEnd + <NUM_LIT:1> , intervalStart ) ) ; } else { res . append ( source . substring ( previousEnd + <NUM_LIT:1> , intervalStart ) ) ; } res . append ( '<CHAR_LIT>' ) ; res . append ( '<CHAR_LIT>' ) ; res . append ( source . substring ( intervalStart , intervalEnd + <NUM_LIT:1> ) ) ; res . append ( '<CHAR_LIT>' ) ; res . append ( '<CHAR_LIT:>>' ) ; previousEnd = intervalEnd ; } if ( curtokStart >= previousEnd ) { res . append ( source . substring ( previousEnd + <NUM_LIT:1> , curtokStart ) ) ; res . append ( '<CHAR_LIT>' ) ; res . append ( '<CHAR_LIT>' ) ; if ( curtokKind == TokenNameEOF ) { res . append ( "<STR_LIT>" ) ; } else { res . append ( source . substring ( curtokStart , curtokEnd + <NUM_LIT:1> ) ) ; res . append ( '<CHAR_LIT>' ) ; res . append ( '<CHAR_LIT:>>' ) ; res . append ( source . substring ( curtokEnd + <NUM_LIT:1> ) ) ; } } else { res . append ( source . substring ( previousEnd + <NUM_LIT:1> ) ) ; } } return res . toString ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . parser . diagnose ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . parser . Parser ; import org . eclipse . jdt . internal . compiler . parser . ParserBasicInformation ; import org . eclipse . jdt . internal . compiler . parser . RecoveryScanner ; import org . eclipse . jdt . internal . compiler . parser . ScannerHelper ; import org . eclipse . jdt . internal . compiler . parser . TerminalTokens ; import org . eclipse . jdt . internal . compiler . problem . ProblemReporter ; import org . eclipse . jdt . internal . compiler . util . Util ; public class DiagnoseParser implements ParserBasicInformation , TerminalTokens { private static final boolean DEBUG = false ; private boolean DEBUG_PARSECHECK = false ; private static final int STACK_INCREMENT = <NUM_LIT> ; private static final int BEFORE_CODE = <NUM_LIT:2> ; private static final int INSERTION_CODE = <NUM_LIT:3> ; private static final int INVALID_CODE = <NUM_LIT:4> ; private static final int SUBSTITUTION_CODE = <NUM_LIT:5> ; private static final int DELETION_CODE = <NUM_LIT:6> ; private static final int MERGE_CODE = <NUM_LIT:7> ; private static final int MISPLACED_CODE = <NUM_LIT:8> ; private static final int SCOPE_CODE = <NUM_LIT:9> ; private static final int SECONDARY_CODE = <NUM_LIT:10> ; private static final int EOF_CODE = <NUM_LIT:11> ; private static final int BUFF_UBOUND = <NUM_LIT:31> ; private static final int BUFF_SIZE = <NUM_LIT:32> ; private static final int MAX_DISTANCE = <NUM_LIT:30> ; private static final int MIN_DISTANCE = <NUM_LIT:3> ; private CompilerOptions options ; private LexStream lexStream ; private int errorToken ; private int errorTokenStart ; private int currentToken = <NUM_LIT:0> ; private int stackLength ; private int stateStackTop ; private int [ ] stack ; private int [ ] locationStack ; private int [ ] locationStartStack ; private int tempStackTop ; private int [ ] tempStack ; private int prevStackTop ; private int [ ] prevStack ; private int nextStackTop ; private int [ ] nextStack ; private int scopeStackTop ; private int [ ] scopeIndex ; private int [ ] scopePosition ; int [ ] list = new int [ NUM_SYMBOLS + <NUM_LIT:1> ] ; int [ ] buffer = new int [ BUFF_SIZE ] ; private static final int NIL = - <NUM_LIT:1> ; int [ ] stateSeen ; int statePoolTop ; StateInfo [ ] statePool ; private Parser parser ; private RecoveryScanner recoveryScanner ; private boolean reportProblem ; private static class RepairCandidate { public int symbol ; public int location ; public RepairCandidate ( ) { this . symbol = <NUM_LIT:0> ; this . location = <NUM_LIT:0> ; } } private static class PrimaryRepairInfo { public int distance ; public int misspellIndex ; public int code ; public int bufferPosition ; public int symbol ; public PrimaryRepairInfo ( ) { this . distance = <NUM_LIT:0> ; this . misspellIndex = <NUM_LIT:0> ; this . code = <NUM_LIT:0> ; this . bufferPosition = <NUM_LIT:0> ; this . symbol = <NUM_LIT:0> ; } public PrimaryRepairInfo copy ( ) { PrimaryRepairInfo c = new PrimaryRepairInfo ( ) ; c . distance = this . distance ; c . misspellIndex = this . misspellIndex ; c . code = this . code ; c . bufferPosition = this . bufferPosition ; c . symbol = this . symbol ; return c ; } } static class SecondaryRepairInfo { public int code ; public int distance ; public int bufferPosition ; public int stackPosition ; public int numDeletions ; public int symbol ; boolean recoveryOnNextStack ; } private static class StateInfo { int state ; int next ; public StateInfo ( int state , int next ) { this . state = state ; this . next = next ; } } public DiagnoseParser ( Parser parser , int firstToken , int start , int end , CompilerOptions options ) { this ( parser , firstToken , start , end , Util . EMPTY_INT_ARRAY , Util . EMPTY_INT_ARRAY , Util . EMPTY_INT_ARRAY , options ) ; } public DiagnoseParser ( Parser parser , int firstToken , int start , int end , int [ ] intervalStartToSkip , int [ ] intervalEndToSkip , int [ ] intervalFlagsToSkip , CompilerOptions options ) { this . parser = parser ; this . options = options ; this . lexStream = new LexStream ( BUFF_SIZE , parser . scanner , intervalStartToSkip , intervalEndToSkip , intervalFlagsToSkip , firstToken , start , end ) ; this . recoveryScanner = parser . recoveryScanner ; } private ProblemReporter problemReporter ( ) { return this . parser . problemReporter ( ) ; } private void reallocateStacks ( ) { int old_stack_length = this . stackLength ; this . stackLength += STACK_INCREMENT ; if ( old_stack_length == <NUM_LIT:0> ) { this . stack = new int [ this . stackLength ] ; this . locationStack = new int [ this . stackLength ] ; this . locationStartStack = new int [ this . stackLength ] ; this . tempStack = new int [ this . stackLength ] ; this . prevStack = new int [ this . stackLength ] ; this . nextStack = new int [ this . stackLength ] ; this . scopeIndex = new int [ this . stackLength ] ; this . scopePosition = new int [ this . stackLength ] ; } else { System . arraycopy ( this . stack , <NUM_LIT:0> , this . stack = new int [ this . stackLength ] , <NUM_LIT:0> , old_stack_length ) ; System . arraycopy ( this . locationStack , <NUM_LIT:0> , this . locationStack = new int [ this . stackLength ] , <NUM_LIT:0> , old_stack_length ) ; System . arraycopy ( this . locationStartStack , <NUM_LIT:0> , this . locationStartStack = new int [ this . stackLength ] , <NUM_LIT:0> , old_stack_length ) ; System . arraycopy ( this . tempStack , <NUM_LIT:0> , this . tempStack = new int [ this . stackLength ] , <NUM_LIT:0> , old_stack_length ) ; System . arraycopy ( this . prevStack , <NUM_LIT:0> , this . prevStack = new int [ this . stackLength ] , <NUM_LIT:0> , old_stack_length ) ; System . arraycopy ( this . nextStack , <NUM_LIT:0> , this . nextStack = new int [ this . stackLength ] , <NUM_LIT:0> , old_stack_length ) ; System . arraycopy ( this . scopeIndex , <NUM_LIT:0> , this . scopeIndex = new int [ this . stackLength ] , <NUM_LIT:0> , old_stack_length ) ; System . arraycopy ( this . scopePosition , <NUM_LIT:0> , this . scopePosition = new int [ this . stackLength ] , <NUM_LIT:0> , old_stack_length ) ; } return ; } public void diagnoseParse ( boolean record ) { this . reportProblem = true ; boolean oldRecord = false ; if ( this . recoveryScanner != null ) { oldRecord = this . recoveryScanner . record ; this . recoveryScanner . record = record ; } try { this . lexStream . reset ( ) ; this . currentToken = this . lexStream . getToken ( ) ; int prev_pos ; int pos ; int next_pos ; int act = START_STATE ; reallocateStacks ( ) ; this . stateStackTop = <NUM_LIT:0> ; this . stack [ this . stateStackTop ] = act ; int tok = this . lexStream . kind ( this . currentToken ) ; this . locationStack [ this . stateStackTop ] = this . currentToken ; this . locationStartStack [ this . stateStackTop ] = this . lexStream . start ( this . currentToken ) ; boolean forceRecoveryAfterLBracketMissing = false ; do { prev_pos = - <NUM_LIT:1> ; this . prevStackTop = - <NUM_LIT:1> ; next_pos = - <NUM_LIT:1> ; this . nextStackTop = - <NUM_LIT:1> ; pos = this . stateStackTop ; this . tempStackTop = this . stateStackTop - <NUM_LIT:1> ; for ( int i = <NUM_LIT:0> ; i <= this . stateStackTop ; i ++ ) this . tempStack [ i ] = this . stack [ i ] ; act = Parser . tAction ( act , tok ) ; while ( act <= NUM_RULES ) { do { this . tempStackTop -= ( Parser . rhs [ act ] - <NUM_LIT:1> ) ; act = Parser . ntAction ( this . tempStack [ this . tempStackTop ] , Parser . lhs [ act ] ) ; } while ( act <= NUM_RULES ) ; if ( this . tempStackTop + <NUM_LIT:1> >= this . stackLength ) reallocateStacks ( ) ; pos = pos < this . tempStackTop ? pos : this . tempStackTop ; this . tempStack [ this . tempStackTop + <NUM_LIT:1> ] = act ; act = Parser . tAction ( act , tok ) ; } while ( act > ERROR_ACTION || act < ACCEPT_ACTION ) { this . nextStackTop = this . tempStackTop + <NUM_LIT:1> ; for ( int i = next_pos + <NUM_LIT:1> ; i <= this . nextStackTop ; i ++ ) this . nextStack [ i ] = this . tempStack [ i ] ; for ( int i = pos + <NUM_LIT:1> ; i <= this . nextStackTop ; i ++ ) { this . locationStack [ i ] = this . locationStack [ this . stateStackTop ] ; this . locationStartStack [ i ] = this . locationStartStack [ this . stateStackTop ] ; } if ( act > ERROR_ACTION ) { act -= ERROR_ACTION ; do { this . nextStackTop -= ( Parser . rhs [ act ] - <NUM_LIT:1> ) ; act = Parser . ntAction ( this . nextStack [ this . nextStackTop ] , Parser . lhs [ act ] ) ; } while ( act <= NUM_RULES ) ; pos = pos < this . nextStackTop ? pos : this . nextStackTop ; } if ( this . nextStackTop + <NUM_LIT:1> >= this . stackLength ) reallocateStacks ( ) ; this . tempStackTop = this . nextStackTop ; this . nextStack [ ++ this . nextStackTop ] = act ; next_pos = this . nextStackTop ; this . currentToken = this . lexStream . getToken ( ) ; tok = this . lexStream . kind ( this . currentToken ) ; act = Parser . tAction ( act , tok ) ; while ( act <= NUM_RULES ) { do { int lhs_symbol = Parser . lhs [ act ] ; if ( DEBUG ) { System . out . println ( Parser . name [ Parser . non_terminal_index [ lhs_symbol ] ] ) ; } this . tempStackTop -= ( Parser . rhs [ act ] - <NUM_LIT:1> ) ; act = ( this . tempStackTop > next_pos ? this . tempStack [ this . tempStackTop ] : this . nextStack [ this . tempStackTop ] ) ; act = Parser . ntAction ( act , lhs_symbol ) ; } while ( act <= NUM_RULES ) ; if ( this . tempStackTop + <NUM_LIT:1> >= this . stackLength ) reallocateStacks ( ) ; next_pos = next_pos < this . tempStackTop ? next_pos : this . tempStackTop ; this . tempStack [ this . tempStackTop + <NUM_LIT:1> ] = act ; act = Parser . tAction ( act , tok ) ; } if ( act != ERROR_ACTION ) { this . prevStackTop = this . stateStackTop ; for ( int i = prev_pos + <NUM_LIT:1> ; i <= this . prevStackTop ; i ++ ) this . prevStack [ i ] = this . stack [ i ] ; prev_pos = pos ; this . stateStackTop = this . nextStackTop ; for ( int i = pos + <NUM_LIT:1> ; i <= this . stateStackTop ; i ++ ) this . stack [ i ] = this . nextStack [ i ] ; this . locationStack [ this . stateStackTop ] = this . currentToken ; this . locationStartStack [ this . stateStackTop ] = this . lexStream . start ( this . currentToken ) ; pos = next_pos ; } } if ( act == ERROR_ACTION ) { RepairCandidate candidate = errorRecovery ( this . currentToken , forceRecoveryAfterLBracketMissing ) ; forceRecoveryAfterLBracketMissing = false ; if ( this . parser . reportOnlyOneSyntaxError ) { return ; } if ( this . parser . problemReporter ( ) . options . maxProblemsPerUnit < this . parser . compilationUnit . compilationResult . problemCount ) { if ( this . recoveryScanner == null || ! this . recoveryScanner . record ) return ; this . reportProblem = false ; } act = this . stack [ this . stateStackTop ] ; if ( candidate . symbol == <NUM_LIT:0> ) { break ; } else if ( candidate . symbol > NT_OFFSET ) { int lhs_symbol = candidate . symbol - NT_OFFSET ; if ( DEBUG ) { System . out . println ( Parser . name [ Parser . non_terminal_index [ lhs_symbol ] ] ) ; } act = Parser . ntAction ( act , lhs_symbol ) ; while ( act <= NUM_RULES ) { this . stateStackTop -= ( Parser . rhs [ act ] - <NUM_LIT:1> ) ; act = Parser . ntAction ( this . stack [ this . stateStackTop ] , Parser . lhs [ act ] ) ; } this . stack [ ++ this . stateStackTop ] = act ; this . currentToken = this . lexStream . getToken ( ) ; tok = this . lexStream . kind ( this . currentToken ) ; this . locationStack [ this . stateStackTop ] = this . currentToken ; this . locationStartStack [ this . stateStackTop ] = this . lexStream . start ( this . currentToken ) ; } else { tok = candidate . symbol ; this . locationStack [ this . stateStackTop ] = candidate . location ; this . locationStartStack [ this . stateStackTop ] = this . lexStream . start ( candidate . location ) ; } } } while ( act != ACCEPT_ACTION ) ; } finally { if ( this . recoveryScanner != null ) { this . recoveryScanner . record = oldRecord ; } } return ; } private static char [ ] displayEscapeCharacters ( char [ ] tokenSource , int start , int end ) { StringBuffer tokenSourceBuffer = new StringBuffer ( ) ; for ( int i = <NUM_LIT:0> ; i < start ; i ++ ) { tokenSourceBuffer . append ( tokenSource [ i ] ) ; } for ( int i = start ; i < end ; i ++ ) { char c = tokenSource [ i ] ; switch ( c ) { case '<STR_LIT>' : tokenSourceBuffer . append ( "<STR_LIT>" ) ; break ; case '<STR_LIT:\n>' : tokenSourceBuffer . append ( "<STR_LIT>" ) ; break ; case '<STR_LIT>' : tokenSourceBuffer . append ( "<STR_LIT>" ) ; break ; case '<STR_LIT:\t>' : tokenSourceBuffer . append ( "<STR_LIT:t>" ) ; break ; case '<STR_LIT>' : tokenSourceBuffer . append ( "<STR_LIT>" ) ; break ; case '<STR_LIT:\">' : tokenSourceBuffer . append ( "<STR_LIT>" ) ; break ; case '<STR_LIT>' : tokenSourceBuffer . append ( "<STR_LIT>" ) ; break ; case '<STR_LIT:\\>' : tokenSourceBuffer . append ( "<STR_LIT>" ) ; break ; default : tokenSourceBuffer . append ( c ) ; } } for ( int i = end ; i < tokenSource . length ; i ++ ) { tokenSourceBuffer . append ( tokenSource [ i ] ) ; } return tokenSourceBuffer . toString ( ) . toCharArray ( ) ; } private RepairCandidate errorRecovery ( int error_token , boolean forcedError ) { this . errorToken = error_token ; this . errorTokenStart = this . lexStream . start ( error_token ) ; int prevtok = this . lexStream . previous ( error_token ) ; int prevtokKind = this . lexStream . kind ( prevtok ) ; if ( forcedError ) { int name_index = Parser . terminal_index [ TokenNameLBRACE ] ; reportError ( INSERTION_CODE , name_index , prevtok , prevtok ) ; RepairCandidate candidate = new RepairCandidate ( ) ; candidate . symbol = TokenNameLBRACE ; candidate . location = error_token ; this . lexStream . reset ( error_token ) ; this . stateStackTop = this . nextStackTop ; for ( int j = <NUM_LIT:0> ; j <= this . stateStackTop ; j ++ ) { this . stack [ j ] = this . nextStack [ j ] ; } this . locationStack [ this . stateStackTop ] = error_token ; this . locationStartStack [ this . stateStackTop ] = this . lexStream . start ( error_token ) ; return candidate ; } RepairCandidate candidate = primaryPhase ( error_token ) ; if ( candidate . symbol != <NUM_LIT:0> ) { return candidate ; } candidate = secondaryPhase ( error_token ) ; if ( candidate . symbol != <NUM_LIT:0> ) { return candidate ; } if ( this . lexStream . kind ( error_token ) == EOFT_SYMBOL ) { reportError ( EOF_CODE , Parser . terminal_index [ EOFT_SYMBOL ] , prevtok , prevtok ) ; candidate . symbol = <NUM_LIT:0> ; candidate . location = error_token ; return candidate ; } while ( this . lexStream . kind ( this . buffer [ BUFF_UBOUND ] ) != EOFT_SYMBOL ) { candidate = secondaryPhase ( this . buffer [ MAX_DISTANCE - MIN_DISTANCE + <NUM_LIT:2> ] ) ; if ( candidate . symbol != <NUM_LIT:0> ) { return candidate ; } } int i ; for ( i = BUFF_UBOUND ; this . lexStream . kind ( this . buffer [ i ] ) == EOFT_SYMBOL ; i -- ) { } reportError ( DELETION_CODE , Parser . terminal_index [ prevtokKind ] , error_token , this . buffer [ i ] ) ; candidate . symbol = <NUM_LIT:0> ; candidate . location = this . buffer [ i ] ; return candidate ; } private RepairCandidate primaryPhase ( int error_token ) { PrimaryRepairInfo repair = new PrimaryRepairInfo ( ) ; RepairCandidate candidate = new RepairCandidate ( ) ; int i = ( this . nextStackTop >= <NUM_LIT:0> ? <NUM_LIT:3> : <NUM_LIT:2> ) ; this . buffer [ i ] = error_token ; for ( int j = i ; j > <NUM_LIT:0> ; j -- ) this . buffer [ j - <NUM_LIT:1> ] = this . lexStream . previous ( this . buffer [ j ] ) ; for ( int k = i + <NUM_LIT:1> ; k < BUFF_SIZE ; k ++ ) this . buffer [ k ] = this . lexStream . next ( this . buffer [ k - <NUM_LIT:1> ] ) ; if ( this . nextStackTop >= <NUM_LIT:0> ) { repair . bufferPosition = <NUM_LIT:3> ; repair = checkPrimaryDistance ( this . nextStack , this . nextStackTop , repair ) ; } PrimaryRepairInfo new_repair = repair . copy ( ) ; new_repair . bufferPosition = <NUM_LIT:2> ; new_repair = checkPrimaryDistance ( this . stack , this . stateStackTop , new_repair ) ; if ( new_repair . distance > repair . distance || new_repair . misspellIndex > repair . misspellIndex ) { repair = new_repair ; } if ( this . prevStackTop >= <NUM_LIT:0> ) { new_repair = repair . copy ( ) ; new_repair . bufferPosition = <NUM_LIT:1> ; new_repair = checkPrimaryDistance ( this . prevStack , this . prevStackTop , new_repair ) ; if ( new_repair . distance > repair . distance || new_repair . misspellIndex > repair . misspellIndex ) { repair = new_repair ; } } if ( this . nextStackTop >= <NUM_LIT:0> ) { if ( secondaryCheck ( this . nextStack , this . nextStackTop , <NUM_LIT:3> , repair . distance ) ) { return candidate ; } } else if ( secondaryCheck ( this . stack , this . stateStackTop , <NUM_LIT:2> , repair . distance ) ) { return candidate ; } repair . distance = repair . distance - repair . bufferPosition + <NUM_LIT:1> ; if ( repair . code == INVALID_CODE || repair . code == DELETION_CODE || repair . code == SUBSTITUTION_CODE || repair . code == MERGE_CODE ) { repair . distance -- ; } if ( repair . distance < MIN_DISTANCE ) { return candidate ; } if ( repair . code == INSERTION_CODE ) { if ( this . buffer [ repair . bufferPosition - <NUM_LIT:1> ] == <NUM_LIT:0> ) { repair . code = BEFORE_CODE ; } } if ( repair . bufferPosition == <NUM_LIT:1> ) { this . stateStackTop = this . prevStackTop ; for ( int j = <NUM_LIT:0> ; j <= this . stateStackTop ; j ++ ) { this . stack [ j ] = this . prevStack [ j ] ; } } else if ( this . nextStackTop >= <NUM_LIT:0> && repair . bufferPosition >= <NUM_LIT:3> ) { this . stateStackTop = this . nextStackTop ; for ( int j = <NUM_LIT:0> ; j <= this . stateStackTop ; j ++ ) { this . stack [ j ] = this . nextStack [ j ] ; } this . locationStack [ this . stateStackTop ] = this . buffer [ <NUM_LIT:3> ] ; this . locationStartStack [ this . stateStackTop ] = this . lexStream . start ( this . buffer [ <NUM_LIT:3> ] ) ; } return primaryDiagnosis ( repair ) ; } private int mergeCandidate ( int state , int buffer_position ) { char [ ] name1 = this . lexStream . name ( this . buffer [ buffer_position ] ) ; char [ ] name2 = this . lexStream . name ( this . buffer [ buffer_position + <NUM_LIT:1> ] ) ; int len = name1 . length + name2 . length ; char [ ] str = CharOperation . concat ( name1 , name2 ) ; for ( int k = Parser . asi ( state ) ; Parser . asr [ k ] != <NUM_LIT:0> ; k ++ ) { int l = Parser . terminal_index [ Parser . asr [ k ] ] ; if ( len == Parser . name [ l ] . length ( ) ) { char [ ] name = Parser . name [ l ] . toCharArray ( ) ; if ( CharOperation . equals ( str , name , false ) ) { return Parser . asr [ k ] ; } } } return <NUM_LIT:0> ; } private PrimaryRepairInfo checkPrimaryDistance ( int stck [ ] , int stack_top , PrimaryRepairInfo repair ) { int i , j , k , next_state , max_pos , act , root , symbol , tok ; PrimaryRepairInfo scope_repair = scopeTrial ( stck , stack_top , repair . copy ( ) ) ; if ( scope_repair . distance > repair . distance ) repair = scope_repair ; if ( this . buffer [ repair . bufferPosition ] != <NUM_LIT:0> && this . buffer [ repair . bufferPosition + <NUM_LIT:1> ] != <NUM_LIT:0> ) { symbol = mergeCandidate ( stck [ stack_top ] , repair . bufferPosition ) ; if ( symbol != <NUM_LIT:0> ) { j = parseCheck ( stck , stack_top , symbol , repair . bufferPosition + <NUM_LIT:2> ) ; if ( ( j > repair . distance ) || ( j == repair . distance && repair . misspellIndex < <NUM_LIT:10> ) ) { repair . misspellIndex = <NUM_LIT:10> ; repair . symbol = symbol ; repair . distance = j ; repair . code = MERGE_CODE ; } } } j = parseCheck ( stck , stack_top , this . lexStream . kind ( this . buffer [ repair . bufferPosition + <NUM_LIT:1> ] ) , repair . bufferPosition + <NUM_LIT:2> ) ; if ( this . lexStream . kind ( this . buffer [ repair . bufferPosition ] ) == EOLT_SYMBOL && this . lexStream . afterEol ( this . buffer [ repair . bufferPosition + <NUM_LIT:1> ] ) ) { k = <NUM_LIT:10> ; } else { k = <NUM_LIT:0> ; } if ( j > repair . distance || ( j == repair . distance && k > repair . misspellIndex ) ) { repair . misspellIndex = k ; repair . code = DELETION_CODE ; repair . distance = j ; } next_state = stck [ stack_top ] ; max_pos = stack_top ; this . tempStackTop = stack_top - <NUM_LIT:1> ; tok = this . lexStream . kind ( this . buffer [ repair . bufferPosition ] ) ; this . lexStream . reset ( this . buffer [ repair . bufferPosition + <NUM_LIT:1> ] ) ; act = Parser . tAction ( next_state , tok ) ; while ( act <= NUM_RULES ) { do { this . tempStackTop -= ( Parser . rhs [ act ] - <NUM_LIT:1> ) ; symbol = Parser . lhs [ act ] ; act = ( this . tempStackTop > max_pos ? this . tempStack [ this . tempStackTop ] : stck [ this . tempStackTop ] ) ; act = Parser . ntAction ( act , symbol ) ; } while ( act <= NUM_RULES ) ; max_pos = max_pos < this . tempStackTop ? max_pos : this . tempStackTop ; this . tempStack [ this . tempStackTop + <NUM_LIT:1> ] = act ; next_state = act ; act = Parser . tAction ( next_state , tok ) ; } root = <NUM_LIT:0> ; for ( i = Parser . asi ( next_state ) ; Parser . asr [ i ] != <NUM_LIT:0> ; i ++ ) { symbol = Parser . asr [ i ] ; if ( symbol != EOFT_SYMBOL && symbol != ERROR_SYMBOL ) { if ( root == <NUM_LIT:0> ) { this . list [ symbol ] = symbol ; } else { this . list [ symbol ] = this . list [ root ] ; this . list [ root ] = symbol ; } root = symbol ; } } if ( stck [ stack_top ] != next_state ) { for ( i = Parser . asi ( stck [ stack_top ] ) ; Parser . asr [ i ] != <NUM_LIT:0> ; i ++ ) { symbol = Parser . asr [ i ] ; if ( symbol != EOFT_SYMBOL && symbol != ERROR_SYMBOL && this . list [ symbol ] == <NUM_LIT:0> ) { if ( root == <NUM_LIT:0> ) { this . list [ symbol ] = symbol ; } else { this . list [ symbol ] = this . list [ root ] ; this . list [ root ] = symbol ; } root = symbol ; } } } i = this . list [ root ] ; this . list [ root ] = <NUM_LIT:0> ; root = i ; symbol = root ; while ( symbol != <NUM_LIT:0> ) { if ( symbol == EOLT_SYMBOL && this . lexStream . afterEol ( this . buffer [ repair . bufferPosition ] ) ) { k = <NUM_LIT:10> ; } else { k = <NUM_LIT:0> ; } j = parseCheck ( stck , stack_top , symbol , repair . bufferPosition ) ; if ( j > repair . distance ) { repair . misspellIndex = k ; repair . distance = j ; repair . symbol = symbol ; repair . code = INSERTION_CODE ; } else if ( j == repair . distance && k > repair . misspellIndex ) { repair . misspellIndex = k ; repair . distance = j ; repair . symbol = symbol ; repair . code = INSERTION_CODE ; } symbol = this . list [ symbol ] ; } symbol = root ; if ( this . buffer [ repair . bufferPosition ] != <NUM_LIT:0> ) { while ( symbol != <NUM_LIT:0> ) { if ( symbol == EOLT_SYMBOL && this . lexStream . afterEol ( this . buffer [ repair . bufferPosition + <NUM_LIT:1> ] ) ) { k = <NUM_LIT:10> ; } else { k = misspell ( symbol , this . buffer [ repair . bufferPosition ] ) ; } j = parseCheck ( stck , stack_top , symbol , repair . bufferPosition + <NUM_LIT:1> ) ; if ( j > repair . distance ) { repair . misspellIndex = k ; repair . distance = j ; repair . symbol = symbol ; repair . code = SUBSTITUTION_CODE ; } else if ( j == repair . distance && k > repair . misspellIndex ) { repair . misspellIndex = k ; repair . symbol = symbol ; repair . code = SUBSTITUTION_CODE ; } i = symbol ; symbol = this . list [ symbol ] ; this . list [ i ] = <NUM_LIT:0> ; } } for ( i = Parser . nasi ( stck [ stack_top ] ) ; Parser . nasr [ i ] != <NUM_LIT:0> ; i ++ ) { symbol = Parser . nasr [ i ] + NT_OFFSET ; j = parseCheck ( stck , stack_top , symbol , repair . bufferPosition + <NUM_LIT:1> ) ; if ( j > repair . distance ) { repair . misspellIndex = <NUM_LIT:0> ; repair . distance = j ; repair . symbol = symbol ; repair . code = INVALID_CODE ; } j = parseCheck ( stck , stack_top , symbol , repair . bufferPosition ) ; if ( ( j > repair . distance ) || ( j == repair . distance && repair . code == INVALID_CODE ) ) { repair . misspellIndex = <NUM_LIT:0> ; repair . distance = j ; repair . symbol = symbol ; repair . code = INSERTION_CODE ; } } return repair ; } private RepairCandidate primaryDiagnosis ( PrimaryRepairInfo repair ) { int name_index ; int prevtok = this . buffer [ repair . bufferPosition - <NUM_LIT:1> ] ; int curtok = this . buffer [ repair . bufferPosition ] ; switch ( repair . code ) { case INSERTION_CODE : case BEFORE_CODE : { if ( repair . symbol > NT_OFFSET ) name_index = getNtermIndex ( this . stack [ this . stateStackTop ] , repair . symbol , repair . bufferPosition ) ; else name_index = getTermIndex ( this . stack , this . stateStackTop , repair . symbol , repair . bufferPosition ) ; int t = ( repair . code == INSERTION_CODE ? prevtok : curtok ) ; reportError ( repair . code , name_index , t , t ) ; break ; } case INVALID_CODE : { name_index = getNtermIndex ( this . stack [ this . stateStackTop ] , repair . symbol , repair . bufferPosition + <NUM_LIT:1> ) ; reportError ( repair . code , name_index , curtok , curtok ) ; break ; } case SUBSTITUTION_CODE : { if ( repair . misspellIndex >= <NUM_LIT:6> ) name_index = Parser . terminal_index [ repair . symbol ] ; else { name_index = getTermIndex ( this . stack , this . stateStackTop , repair . symbol , repair . bufferPosition + <NUM_LIT:1> ) ; if ( name_index != Parser . terminal_index [ repair . symbol ] ) repair . code = INVALID_CODE ; } reportError ( repair . code , name_index , curtok , curtok ) ; break ; } case MERGE_CODE : { reportError ( repair . code , Parser . terminal_index [ repair . symbol ] , curtok , this . lexStream . next ( curtok ) ) ; break ; } case SCOPE_CODE : { for ( int i = <NUM_LIT:0> ; i < this . scopeStackTop ; i ++ ) { reportError ( repair . code , - this . scopeIndex [ i ] , this . locationStack [ this . scopePosition [ i ] ] , prevtok , Parser . non_terminal_index [ Parser . scope_lhs [ this . scopeIndex [ i ] ] ] ) ; } repair . symbol = Parser . scope_lhs [ this . scopeIndex [ this . scopeStackTop ] ] + NT_OFFSET ; this . stateStackTop = this . scopePosition [ this . scopeStackTop ] ; reportError ( repair . code , - this . scopeIndex [ this . scopeStackTop ] , this . locationStack [ this . scopePosition [ this . scopeStackTop ] ] , prevtok , getNtermIndex ( this . stack [ this . stateStackTop ] , repair . symbol , repair . bufferPosition ) ) ; break ; } default : { reportError ( repair . code , Parser . terminal_index [ ERROR_SYMBOL ] , curtok , curtok ) ; } } RepairCandidate candidate = new RepairCandidate ( ) ; switch ( repair . code ) { case INSERTION_CODE : case BEFORE_CODE : case SCOPE_CODE : { candidate . symbol = repair . symbol ; candidate . location = this . buffer [ repair . bufferPosition ] ; this . lexStream . reset ( this . buffer [ repair . bufferPosition ] ) ; break ; } case INVALID_CODE : case SUBSTITUTION_CODE : { candidate . symbol = repair . symbol ; candidate . location = this . buffer [ repair . bufferPosition ] ; this . lexStream . reset ( this . buffer [ repair . bufferPosition + <NUM_LIT:1> ] ) ; break ; } case MERGE_CODE : { candidate . symbol = repair . symbol ; candidate . location = this . buffer [ repair . bufferPosition ] ; this . lexStream . reset ( this . buffer [ repair . bufferPosition + <NUM_LIT:2> ] ) ; break ; } default : { candidate . location = this . buffer [ repair . bufferPosition + <NUM_LIT:1> ] ; candidate . symbol = this . lexStream . kind ( this . buffer [ repair . bufferPosition + <NUM_LIT:1> ] ) ; this . lexStream . reset ( this . buffer [ repair . bufferPosition + <NUM_LIT:2> ] ) ; break ; } } return candidate ; } private int getTermIndex ( int stck [ ] , int stack_top , int tok , int buffer_position ) { int act = stck [ stack_top ] , max_pos = stack_top , highest_symbol = tok ; this . tempStackTop = stack_top - <NUM_LIT:1> ; this . lexStream . reset ( this . buffer [ buffer_position ] ) ; act = Parser . tAction ( act , tok ) ; while ( act <= NUM_RULES ) { do { this . tempStackTop -= ( Parser . rhs [ act ] - <NUM_LIT:1> ) ; int lhs_symbol = Parser . lhs [ act ] ; act = ( this . tempStackTop > max_pos ? this . tempStack [ this . tempStackTop ] : stck [ this . tempStackTop ] ) ; act = Parser . ntAction ( act , lhs_symbol ) ; } while ( act <= NUM_RULES ) ; max_pos = max_pos < this . tempStackTop ? max_pos : this . tempStackTop ; this . tempStack [ this . tempStackTop + <NUM_LIT:1> ] = act ; act = Parser . tAction ( act , tok ) ; } this . tempStackTop ++ ; int threshold = this . tempStackTop ; tok = this . lexStream . kind ( this . buffer [ buffer_position ] ) ; this . lexStream . reset ( this . buffer [ buffer_position + <NUM_LIT:1> ] ) ; if ( act > ERROR_ACTION ) { act -= ERROR_ACTION ; } else { this . tempStack [ this . tempStackTop + <NUM_LIT:1> ] = act ; act = Parser . tAction ( act , tok ) ; } while ( act <= NUM_RULES ) { do { this . tempStackTop -= ( Parser . rhs [ act ] - <NUM_LIT:1> ) ; if ( this . tempStackTop < threshold ) { return ( highest_symbol > NT_OFFSET ? Parser . non_terminal_index [ highest_symbol - NT_OFFSET ] : Parser . terminal_index [ highest_symbol ] ) ; } int lhs_symbol = Parser . lhs [ act ] ; if ( this . tempStackTop == threshold ) highest_symbol = lhs_symbol + NT_OFFSET ; act = ( this . tempStackTop > max_pos ? this . tempStack [ this . tempStackTop ] : stck [ this . tempStackTop ] ) ; act = Parser . ntAction ( act , lhs_symbol ) ; } while ( act <= NUM_RULES ) ; this . tempStack [ this . tempStackTop + <NUM_LIT:1> ] = act ; act = Parser . tAction ( act , tok ) ; } return ( highest_symbol > NT_OFFSET ? Parser . non_terminal_index [ highest_symbol - NT_OFFSET ] : Parser . terminal_index [ highest_symbol ] ) ; } private int getNtermIndex ( int start , int sym , int buffer_position ) { int highest_symbol = sym - NT_OFFSET , tok = this . lexStream . kind ( this . buffer [ buffer_position ] ) ; this . lexStream . reset ( this . buffer [ buffer_position + <NUM_LIT:1> ] ) ; this . tempStackTop = <NUM_LIT:0> ; this . tempStack [ this . tempStackTop ] = start ; int act = Parser . ntAction ( start , highest_symbol ) ; if ( act > NUM_RULES ) { this . tempStack [ this . tempStackTop + <NUM_LIT:1> ] = act ; act = Parser . tAction ( act , tok ) ; } while ( act <= NUM_RULES ) { do { this . tempStackTop -= ( Parser . rhs [ act ] - <NUM_LIT:1> ) ; if ( this . tempStackTop < <NUM_LIT:0> ) return Parser . non_terminal_index [ highest_symbol ] ; if ( this . tempStackTop == <NUM_LIT:0> ) highest_symbol = Parser . lhs [ act ] ; act = Parser . ntAction ( this . tempStack [ this . tempStackTop ] , Parser . lhs [ act ] ) ; } while ( act <= NUM_RULES ) ; this . tempStack [ this . tempStackTop + <NUM_LIT:1> ] = act ; act = Parser . tAction ( act , tok ) ; } return Parser . non_terminal_index [ highest_symbol ] ; } private int misspell ( int sym , int tok ) { char [ ] name = Parser . name [ Parser . terminal_index [ sym ] ] . toCharArray ( ) ; int n = name . length ; char [ ] s1 = new char [ n + <NUM_LIT:1> ] ; for ( int k = <NUM_LIT:0> ; k < n ; k ++ ) { char c = name [ k ] ; s1 [ k ] = ScannerHelper . toLowerCase ( c ) ; } s1 [ n ] = '<STR_LIT>' ; char [ ] tokenName = this . lexStream . name ( tok ) ; int len = tokenName . length ; int m = len < MAX_NAME_LENGTH ? len : MAX_NAME_LENGTH ; char [ ] s2 = new char [ m + <NUM_LIT:1> ] ; for ( int k = <NUM_LIT:0> ; k < m ; k ++ ) { char c = tokenName [ k ] ; s2 [ k ] = ScannerHelper . toLowerCase ( c ) ; } s2 [ m ] = '<STR_LIT>' ; if ( n == <NUM_LIT:1> && m == <NUM_LIT:1> ) { if ( ( s1 [ <NUM_LIT:0> ] == '<CHAR_LIT:;>' && s2 [ <NUM_LIT:0> ] == '<CHAR_LIT:U+002C>' ) || ( s1 [ <NUM_LIT:0> ] == '<CHAR_LIT:U+002C>' && s2 [ <NUM_LIT:0> ] == '<CHAR_LIT:;>' ) || ( s1 [ <NUM_LIT:0> ] == '<CHAR_LIT:;>' && s2 [ <NUM_LIT:0> ] == '<CHAR_LIT::>' ) || ( s1 [ <NUM_LIT:0> ] == '<CHAR_LIT::>' && s2 [ <NUM_LIT:0> ] == '<CHAR_LIT:;>' ) || ( s1 [ <NUM_LIT:0> ] == '<CHAR_LIT:.>' && s2 [ <NUM_LIT:0> ] == '<CHAR_LIT:U+002C>' ) || ( s1 [ <NUM_LIT:0> ] == '<CHAR_LIT:U+002C>' && s2 [ <NUM_LIT:0> ] == '<CHAR_LIT:.>' ) || ( s1 [ <NUM_LIT:0> ] == '<STR_LIT>' && s2 [ <NUM_LIT:0> ] == '<STR_LIT:\">' ) || ( s1 [ <NUM_LIT:0> ] == '<STR_LIT:\">' && s2 [ <NUM_LIT:0> ] == '<STR_LIT>' ) ) { return <NUM_LIT:3> ; } } int count = <NUM_LIT:0> ; int prefix_length = <NUM_LIT:0> ; int num_errors = <NUM_LIT:0> ; int i = <NUM_LIT:0> ; int j = <NUM_LIT:0> ; while ( ( i < n ) && ( j < m ) ) { if ( s1 [ i ] == s2 [ j ] ) { count ++ ; i ++ ; j ++ ; if ( num_errors == <NUM_LIT:0> ) { prefix_length ++ ; } } else if ( s1 [ i + <NUM_LIT:1> ] == s2 [ j ] && s1 [ i ] == s2 [ j + <NUM_LIT:1> ] ) { count += <NUM_LIT:2> ; i += <NUM_LIT:2> ; j += <NUM_LIT:2> ; num_errors ++ ; } else if ( s1 [ i + <NUM_LIT:1> ] == s2 [ j + <NUM_LIT:1> ] ) { i ++ ; j ++ ; num_errors ++ ; } else { if ( ( n - i ) > ( m - j ) ) { i ++ ; } else if ( ( m - j ) > ( n - i ) ) { j ++ ; } else { i ++ ; j ++ ; } num_errors ++ ; } } if ( i < n || j < m ) num_errors ++ ; if ( num_errors > ( ( n < m ? n : m ) / <NUM_LIT:6> + <NUM_LIT:1> ) ) count = prefix_length ; return ( count * <NUM_LIT:10> / ( ( n < len ? len : n ) + num_errors ) ) ; } private PrimaryRepairInfo scopeTrial ( int stck [ ] , int stack_top , PrimaryRepairInfo repair ) { this . stateSeen = new int [ this . stackLength ] ; for ( int i = <NUM_LIT:0> ; i < this . stackLength ; i ++ ) this . stateSeen [ i ] = NIL ; this . statePoolTop = <NUM_LIT:0> ; this . statePool = new StateInfo [ this . stackLength ] ; scopeTrialCheck ( stck , stack_top , repair , <NUM_LIT:0> ) ; this . stateSeen = null ; this . statePoolTop = <NUM_LIT:0> ; repair . code = SCOPE_CODE ; repair . misspellIndex = <NUM_LIT:10> ; return repair ; } private void scopeTrialCheck ( int stck [ ] , int stack_top , PrimaryRepairInfo repair , int indx ) { if ( indx > <NUM_LIT:20> ) return ; int act = stck [ stack_top ] ; for ( int i = this . stateSeen [ stack_top ] ; i != NIL ; i = this . statePool [ i ] . next ) { if ( this . statePool [ i ] . state == act ) return ; } int old_state_pool_top = this . statePoolTop ++ ; if ( this . statePoolTop >= this . statePool . length ) { System . arraycopy ( this . statePool , <NUM_LIT:0> , this . statePool = new StateInfo [ this . statePoolTop * <NUM_LIT:2> ] , <NUM_LIT:0> , this . statePoolTop ) ; } this . statePool [ old_state_pool_top ] = new StateInfo ( act , this . stateSeen [ stack_top ] ) ; this . stateSeen [ stack_top ] = old_state_pool_top ; next : for ( int i = <NUM_LIT:0> ; i < SCOPE_SIZE ; i ++ ) { act = stck [ stack_top ] ; this . tempStackTop = stack_top - <NUM_LIT:1> ; int max_pos = stack_top ; int tok = Parser . scope_la [ i ] ; this . lexStream . reset ( this . buffer [ repair . bufferPosition ] ) ; act = Parser . tAction ( act , tok ) ; while ( act <= NUM_RULES ) { do { this . tempStackTop -= ( Parser . rhs [ act ] - <NUM_LIT:1> ) ; int lhs_symbol = Parser . lhs [ act ] ; act = ( this . tempStackTop > max_pos ? this . tempStack [ this . tempStackTop ] : stck [ this . tempStackTop ] ) ; act = Parser . ntAction ( act , lhs_symbol ) ; } while ( act <= NUM_RULES ) ; if ( this . tempStackTop + <NUM_LIT:1> >= this . stackLength ) return ; max_pos = max_pos < this . tempStackTop ? max_pos : this . tempStackTop ; this . tempStack [ this . tempStackTop + <NUM_LIT:1> ] = act ; act = Parser . tAction ( act , tok ) ; } if ( act != ERROR_ACTION ) { int j , k ; k = Parser . scope_prefix [ i ] ; for ( j = this . tempStackTop + <NUM_LIT:1> ; j >= ( max_pos + <NUM_LIT:1> ) && Parser . in_symbol ( this . tempStack [ j ] ) == Parser . scope_rhs [ k ] ; j -- ) { k ++ ; } if ( j == max_pos ) { for ( j = max_pos ; j >= <NUM_LIT:1> && Parser . in_symbol ( stck [ j ] ) == Parser . scope_rhs [ k ] ; j -- ) { k ++ ; } } int marked_pos = ( max_pos < stack_top ? max_pos + <NUM_LIT:1> : stack_top ) ; if ( Parser . scope_rhs [ k ] == <NUM_LIT:0> && j < marked_pos ) { int stack_position = j ; for ( j = Parser . scope_state_set [ i ] ; stck [ stack_position ] != Parser . scope_state [ j ] && Parser . scope_state [ j ] != <NUM_LIT:0> ; j ++ ) { } if ( Parser . scope_state [ j ] != <NUM_LIT:0> ) { int previous_distance = repair . distance ; int distance = parseCheck ( stck , stack_position , Parser . scope_lhs [ i ] + NT_OFFSET , repair . bufferPosition ) ; if ( ( distance - repair . bufferPosition + <NUM_LIT:1> ) < MIN_DISTANCE ) { int top = stack_position ; act = Parser . ntAction ( stck [ top ] , Parser . scope_lhs [ i ] ) ; while ( act <= NUM_RULES ) { if ( Parser . rules_compliance [ act ] > this . options . sourceLevel ) { continue next ; } top -= ( Parser . rhs [ act ] - <NUM_LIT:1> ) ; act = Parser . ntAction ( stck [ top ] , Parser . lhs [ act ] ) ; } top ++ ; j = act ; act = stck [ top ] ; stck [ top ] = j ; scopeTrialCheck ( stck , top , repair , indx + <NUM_LIT:1> ) ; stck [ top ] = act ; } else if ( distance > repair . distance ) { this . scopeStackTop = indx ; repair . distance = distance ; } if ( this . lexStream . kind ( this . buffer [ repair . bufferPosition ] ) == EOFT_SYMBOL && repair . distance == previous_distance ) { this . scopeStackTop = indx ; repair . distance = MAX_DISTANCE ; } if ( repair . distance > previous_distance ) { this . scopeIndex [ indx ] = i ; this . scopePosition [ indx ] = stack_position ; return ; } } } } } } private boolean secondaryCheck ( int stck [ ] , int stack_top , int buffer_position , int distance ) { int top , j ; for ( top = stack_top - <NUM_LIT:1> ; top >= <NUM_LIT:0> ; top -- ) { j = parseCheck ( stck , top , this . lexStream . kind ( this . buffer [ buffer_position ] ) , buffer_position + <NUM_LIT:1> ) ; if ( ( ( j - buffer_position + <NUM_LIT:1> ) > MIN_DISTANCE ) && ( j > distance ) ) return true ; } PrimaryRepairInfo repair = new PrimaryRepairInfo ( ) ; repair . bufferPosition = buffer_position + <NUM_LIT:1> ; repair . distance = distance ; repair = scopeTrial ( stck , stack_top , repair ) ; if ( ( repair . distance - buffer_position ) > MIN_DISTANCE && repair . distance > distance ) return true ; return false ; } private RepairCandidate secondaryPhase ( int error_token ) { SecondaryRepairInfo repair = new SecondaryRepairInfo ( ) ; SecondaryRepairInfo misplaced = new SecondaryRepairInfo ( ) ; RepairCandidate candidate = new RepairCandidate ( ) ; int i , j , k , top ; int next_last_index = <NUM_LIT:0> ; int last_index ; candidate . symbol = <NUM_LIT:0> ; repair . code = <NUM_LIT:0> ; repair . distance = <NUM_LIT:0> ; repair . recoveryOnNextStack = false ; misplaced . distance = <NUM_LIT:0> ; misplaced . recoveryOnNextStack = false ; if ( this . nextStackTop >= <NUM_LIT:0> ) { int save_location ; this . buffer [ <NUM_LIT:2> ] = error_token ; this . buffer [ <NUM_LIT:1> ] = this . lexStream . previous ( this . buffer [ <NUM_LIT:2> ] ) ; this . buffer [ <NUM_LIT:0> ] = this . lexStream . previous ( this . buffer [ <NUM_LIT:1> ] ) ; for ( k = <NUM_LIT:3> ; k < BUFF_UBOUND ; k ++ ) this . buffer [ k ] = this . lexStream . next ( this . buffer [ k - <NUM_LIT:1> ] ) ; this . buffer [ BUFF_UBOUND ] = this . lexStream . badtoken ( ) ; for ( next_last_index = MAX_DISTANCE - <NUM_LIT:1> ; next_last_index >= <NUM_LIT:1> && this . lexStream . kind ( this . buffer [ next_last_index ] ) == EOFT_SYMBOL ; next_last_index -- ) { } next_last_index = next_last_index + <NUM_LIT:1> ; save_location = this . locationStack [ this . nextStackTop ] ; int save_location_start = this . locationStartStack [ this . nextStackTop ] ; this . locationStack [ this . nextStackTop ] = this . buffer [ <NUM_LIT:2> ] ; this . locationStartStack [ this . nextStackTop ] = this . lexStream . start ( this . buffer [ <NUM_LIT:2> ] ) ; misplaced . numDeletions = this . nextStackTop ; misplaced = misplacementRecovery ( this . nextStack , this . nextStackTop , next_last_index , misplaced , true ) ; if ( misplaced . recoveryOnNextStack ) misplaced . distance ++ ; repair . numDeletions = this . nextStackTop + BUFF_UBOUND ; repair = secondaryRecovery ( this . nextStack , this . nextStackTop , next_last_index , repair , true ) ; if ( repair . recoveryOnNextStack ) repair . distance ++ ; this . locationStack [ this . nextStackTop ] = save_location ; this . locationStartStack [ this . nextStackTop ] = save_location_start ; } else { misplaced . numDeletions = this . stateStackTop ; repair . numDeletions = this . stateStackTop + BUFF_UBOUND ; } this . buffer [ <NUM_LIT:3> ] = error_token ; this . buffer [ <NUM_LIT:2> ] = this . lexStream . previous ( this . buffer [ <NUM_LIT:3> ] ) ; this . buffer [ <NUM_LIT:1> ] = this . lexStream . previous ( this . buffer [ <NUM_LIT:2> ] ) ; this . buffer [ <NUM_LIT:0> ] = this . lexStream . previous ( this . buffer [ <NUM_LIT:1> ] ) ; for ( k = <NUM_LIT:4> ; k < BUFF_SIZE ; k ++ ) this . buffer [ k ] = this . lexStream . next ( this . buffer [ k - <NUM_LIT:1> ] ) ; for ( last_index = MAX_DISTANCE - <NUM_LIT:1> ; last_index >= <NUM_LIT:1> && this . lexStream . kind ( this . buffer [ last_index ] ) == EOFT_SYMBOL ; last_index -- ) { } last_index ++ ; misplaced = misplacementRecovery ( this . stack , this . stateStackTop , last_index , misplaced , false ) ; repair = secondaryRecovery ( this . stack , this . stateStackTop , last_index , repair , false ) ; if ( misplaced . distance > MIN_DISTANCE ) { if ( misplaced . numDeletions <= repair . numDeletions || ( misplaced . distance - misplaced . numDeletions ) >= ( repair . distance - repair . numDeletions ) ) { repair . code = MISPLACED_CODE ; repair . stackPosition = misplaced . stackPosition ; repair . bufferPosition = <NUM_LIT:2> ; repair . numDeletions = misplaced . numDeletions ; repair . distance = misplaced . distance ; repair . recoveryOnNextStack = misplaced . recoveryOnNextStack ; } } if ( repair . recoveryOnNextStack ) { this . stateStackTop = this . nextStackTop ; for ( i = <NUM_LIT:0> ; i <= this . stateStackTop ; i ++ ) this . stack [ i ] = this . nextStack [ i ] ; this . buffer [ <NUM_LIT:2> ] = error_token ; this . buffer [ <NUM_LIT:1> ] = this . lexStream . previous ( this . buffer [ <NUM_LIT:2> ] ) ; this . buffer [ <NUM_LIT:0> ] = this . lexStream . previous ( this . buffer [ <NUM_LIT:1> ] ) ; for ( k = <NUM_LIT:3> ; k < BUFF_UBOUND ; k ++ ) this . buffer [ k ] = this . lexStream . next ( this . buffer [ k - <NUM_LIT:1> ] ) ; this . buffer [ BUFF_UBOUND ] = this . lexStream . badtoken ( ) ; this . locationStack [ this . nextStackTop ] = this . buffer [ <NUM_LIT:2> ] ; this . locationStartStack [ this . nextStackTop ] = this . lexStream . start ( this . buffer [ <NUM_LIT:2> ] ) ; last_index = next_last_index ; } if ( repair . code == SECONDARY_CODE || repair . code == DELETION_CODE ) { PrimaryRepairInfo scope_repair = new PrimaryRepairInfo ( ) ; scope_repair . distance = <NUM_LIT:0> ; for ( scope_repair . bufferPosition = <NUM_LIT:2> ; scope_repair . bufferPosition <= repair . bufferPosition && repair . code != SCOPE_CODE ; scope_repair . bufferPosition ++ ) { scope_repair = scopeTrial ( this . stack , this . stateStackTop , scope_repair ) ; j = ( scope_repair . distance == MAX_DISTANCE ? last_index : scope_repair . distance ) ; k = scope_repair . bufferPosition - <NUM_LIT:1> ; if ( ( j - k ) > MIN_DISTANCE && ( j - k ) > ( repair . distance - repair . numDeletions ) ) { repair . code = SCOPE_CODE ; i = this . scopeIndex [ this . scopeStackTop ] ; repair . symbol = Parser . scope_lhs [ i ] + NT_OFFSET ; repair . stackPosition = this . stateStackTop ; repair . bufferPosition = scope_repair . bufferPosition ; } } } if ( repair . code == <NUM_LIT:0> && this . lexStream . kind ( this . buffer [ last_index ] ) == EOFT_SYMBOL ) { PrimaryRepairInfo scope_repair = new PrimaryRepairInfo ( ) ; scope_repair . bufferPosition = last_index ; scope_repair . distance = <NUM_LIT:0> ; for ( top = this . stateStackTop ; top >= <NUM_LIT:0> && repair . code == <NUM_LIT:0> ; top -- ) { scope_repair = scopeTrial ( this . stack , top , scope_repair ) ; if ( scope_repair . distance > <NUM_LIT:0> ) { repair . code = SCOPE_CODE ; i = this . scopeIndex [ this . scopeStackTop ] ; repair . symbol = Parser . scope_lhs [ i ] + NT_OFFSET ; repair . stackPosition = top ; repair . bufferPosition = scope_repair . bufferPosition ; } } } if ( repair . code == <NUM_LIT:0> ) return candidate ; secondaryDiagnosis ( repair ) ; switch ( repair . code ) { case MISPLACED_CODE : candidate . location = this . buffer [ <NUM_LIT:2> ] ; candidate . symbol = this . lexStream . kind ( this . buffer [ <NUM_LIT:2> ] ) ; this . lexStream . reset ( this . lexStream . next ( this . buffer [ <NUM_LIT:2> ] ) ) ; break ; case DELETION_CODE : candidate . location = this . buffer [ repair . bufferPosition ] ; candidate . symbol = this . lexStream . kind ( this . buffer [ repair . bufferPosition ] ) ; this . lexStream . reset ( this . lexStream . next ( this . buffer [ repair . bufferPosition ] ) ) ; break ; default : candidate . symbol = repair . symbol ; candidate . location = this . buffer [ repair . bufferPosition ] ; this . lexStream . reset ( this . buffer [ repair . bufferPosition ] ) ; break ; } return candidate ; } private SecondaryRepairInfo misplacementRecovery ( int stck [ ] , int stack_top , int last_index , SecondaryRepairInfo repair , boolean stack_flag ) { int previous_loc = this . buffer [ <NUM_LIT:2> ] ; int stack_deletions = <NUM_LIT:0> ; for ( int top = stack_top - <NUM_LIT:1> ; top >= <NUM_LIT:0> ; top -- ) { if ( this . locationStack [ top ] < previous_loc ) { stack_deletions ++ ; } previous_loc = this . locationStack [ top ] ; int j = parseCheck ( stck , top , this . lexStream . kind ( this . buffer [ <NUM_LIT:2> ] ) , <NUM_LIT:3> ) ; if ( j == MAX_DISTANCE ) { j = last_index ; } if ( ( j > MIN_DISTANCE ) && ( j - stack_deletions ) > ( repair . distance - repair . numDeletions ) ) { repair . stackPosition = top ; repair . distance = j ; repair . numDeletions = stack_deletions ; repair . recoveryOnNextStack = stack_flag ; } } return repair ; } private SecondaryRepairInfo secondaryRecovery ( int stck [ ] , int stack_top , int last_index , SecondaryRepairInfo repair , boolean stack_flag ) { int previous_loc ; int stack_deletions = <NUM_LIT:0> ; previous_loc = this . buffer [ <NUM_LIT:2> ] ; for ( int top = stack_top ; top >= <NUM_LIT:0> && repair . numDeletions >= stack_deletions ; top -- ) { if ( this . locationStack [ top ] < previous_loc ) { stack_deletions ++ ; } previous_loc = this . locationStack [ top ] ; for ( int i = <NUM_LIT:2> ; i <= ( last_index - MIN_DISTANCE + <NUM_LIT:1> ) && ( repair . numDeletions >= ( stack_deletions + i - <NUM_LIT:1> ) ) ; i ++ ) { int j = parseCheck ( stck , top , this . lexStream . kind ( this . buffer [ i ] ) , i + <NUM_LIT:1> ) ; if ( j == MAX_DISTANCE ) { j = last_index ; } if ( ( j - i + <NUM_LIT:1> ) > MIN_DISTANCE ) { int k = stack_deletions + i - <NUM_LIT:1> ; if ( ( k < repair . numDeletions ) || ( j - k ) > ( repair . distance - repair . numDeletions ) || ( ( repair . code == SECONDARY_CODE ) && ( j - k ) == ( repair . distance - repair . numDeletions ) ) ) { repair . code = DELETION_CODE ; repair . distance = j ; repair . stackPosition = top ; repair . bufferPosition = i ; repair . numDeletions = k ; repair . recoveryOnNextStack = stack_flag ; } } for ( int l = Parser . nasi ( stck [ top ] ) ; l >= <NUM_LIT:0> && Parser . nasr [ l ] != <NUM_LIT:0> ; l ++ ) { int symbol = Parser . nasr [ l ] + NT_OFFSET ; j = parseCheck ( stck , top , symbol , i ) ; if ( j == MAX_DISTANCE ) { j = last_index ; } if ( ( j - i + <NUM_LIT:1> ) > MIN_DISTANCE ) { int k = stack_deletions + i - <NUM_LIT:1> ; if ( k < repair . numDeletions || ( j - k ) > ( repair . distance - repair . numDeletions ) ) { repair . code = SECONDARY_CODE ; repair . symbol = symbol ; repair . distance = j ; repair . stackPosition = top ; repair . bufferPosition = i ; repair . numDeletions = k ; repair . recoveryOnNextStack = stack_flag ; } } } } } return repair ; } private void secondaryDiagnosis ( SecondaryRepairInfo repair ) { switch ( repair . code ) { case SCOPE_CODE : { if ( repair . stackPosition < this . stateStackTop ) { reportError ( DELETION_CODE , Parser . terminal_index [ ERROR_SYMBOL ] , this . locationStack [ repair . stackPosition ] , this . buffer [ <NUM_LIT:1> ] ) ; } for ( int i = <NUM_LIT:0> ; i < this . scopeStackTop ; i ++ ) { reportError ( SCOPE_CODE , - this . scopeIndex [ i ] , this . locationStack [ this . scopePosition [ i ] ] , this . buffer [ <NUM_LIT:1> ] , Parser . non_terminal_index [ Parser . scope_lhs [ this . scopeIndex [ i ] ] ] ) ; } repair . symbol = Parser . scope_lhs [ this . scopeIndex [ this . scopeStackTop ] ] + NT_OFFSET ; this . stateStackTop = this . scopePosition [ this . scopeStackTop ] ; reportError ( SCOPE_CODE , - this . scopeIndex [ this . scopeStackTop ] , this . locationStack [ this . scopePosition [ this . scopeStackTop ] ] , this . buffer [ <NUM_LIT:1> ] , getNtermIndex ( this . stack [ this . stateStackTop ] , repair . symbol , repair . bufferPosition ) ) ; break ; } default : { reportError ( repair . code , ( repair . code == SECONDARY_CODE ? getNtermIndex ( this . stack [ repair . stackPosition ] , repair . symbol , repair . bufferPosition ) : Parser . terminal_index [ ERROR_SYMBOL ] ) , this . locationStack [ repair . stackPosition ] , this . buffer [ repair . bufferPosition - <NUM_LIT:1> ] ) ; this . stateStackTop = repair . stackPosition ; } } } private int parseCheck ( int stck [ ] , int stack_top , int first_token , int buffer_position ) { int max_pos ; int indx ; int ct ; int act ; act = stck [ stack_top ] ; if ( first_token > NT_OFFSET ) { this . tempStackTop = stack_top ; if ( this . DEBUG_PARSECHECK ) { System . out . println ( this . tempStackTop ) ; } max_pos = stack_top ; indx = buffer_position ; ct = this . lexStream . kind ( this . buffer [ indx ] ) ; this . lexStream . reset ( this . lexStream . next ( this . buffer [ indx ] ) ) ; int lhs_symbol = first_token - NT_OFFSET ; act = Parser . ntAction ( act , lhs_symbol ) ; if ( act <= NUM_RULES ) { do { this . tempStackTop -= ( Parser . rhs [ act ] - <NUM_LIT:1> ) ; if ( this . DEBUG_PARSECHECK ) { System . out . print ( this . tempStackTop ) ; System . out . print ( "<STR_LIT:U+0020(>" ) ; System . out . print ( - ( Parser . rhs [ act ] - <NUM_LIT:1> ) ) ; System . out . print ( "<STR_LIT>" ) ; System . out . print ( max_pos ) ; System . out . print ( "<STR_LIT>" ) ; System . out . print ( act ) ; System . out . print ( "<STR_LIT:t>" ) ; System . out . print ( Parser . name [ Parser . non_terminal_index [ Parser . lhs [ act ] ] ] ) ; System . out . println ( ) ; } if ( Parser . rules_compliance [ act ] > this . options . sourceLevel ) { return <NUM_LIT:0> ; } lhs_symbol = Parser . lhs [ act ] ; act = ( this . tempStackTop > max_pos ? this . tempStack [ this . tempStackTop ] : stck [ this . tempStackTop ] ) ; act = Parser . ntAction ( act , lhs_symbol ) ; } while ( act <= NUM_RULES ) ; max_pos = max_pos < this . tempStackTop ? max_pos : this . tempStackTop ; } } else { this . tempStackTop = stack_top - <NUM_LIT:1> ; if ( this . DEBUG_PARSECHECK ) { System . out . println ( this . tempStackTop ) ; } max_pos = this . tempStackTop ; indx = buffer_position - <NUM_LIT:1> ; ct = first_token ; this . lexStream . reset ( this . buffer [ buffer_position ] ) ; } process_terminal : for ( ; ; ) { if ( this . DEBUG_PARSECHECK ) { System . out . print ( this . tempStackTop + <NUM_LIT:1> ) ; System . out . print ( "<STR_LIT>" ) ; System . out . print ( max_pos ) ; System . out . print ( "<STR_LIT>" ) ; System . out . print ( ct ) ; System . out . print ( "<STR_LIT:t>" ) ; System . out . print ( Parser . name [ Parser . terminal_index [ ct ] ] ) ; System . out . println ( ) ; } if ( ++ this . tempStackTop >= this . stackLength ) return indx ; this . tempStack [ this . tempStackTop ] = act ; act = Parser . tAction ( act , ct ) ; if ( act <= NUM_RULES ) { this . tempStackTop -- ; if ( this . DEBUG_PARSECHECK ) { System . out . print ( this . tempStackTop ) ; System . out . print ( "<STR_LIT>" ) ; System . out . print ( max_pos ) ; System . out . print ( "<STR_LIT>" ) ; System . out . println ( ) ; } } else if ( act < ACCEPT_ACTION || act > ERROR_ACTION ) { if ( indx == MAX_DISTANCE ) return indx ; indx ++ ; ct = this . lexStream . kind ( this . buffer [ indx ] ) ; this . lexStream . reset ( this . lexStream . next ( this . buffer [ indx ] ) ) ; if ( act > ERROR_ACTION ) { act -= ERROR_ACTION ; if ( this . DEBUG_PARSECHECK ) { System . out . print ( this . tempStackTop ) ; System . out . print ( "<STR_LIT>" ) ; System . out . println ( ) ; } } else { if ( this . DEBUG_PARSECHECK ) { System . out . println ( "<STR_LIT>" ) ; } continue process_terminal ; } } else if ( act == ACCEPT_ACTION ) { return MAX_DISTANCE ; } else { return indx ; } do { this . tempStackTop -= ( Parser . rhs [ act ] - <NUM_LIT:1> ) ; if ( this . DEBUG_PARSECHECK ) { System . out . print ( this . tempStackTop ) ; System . out . print ( "<STR_LIT:U+0020(>" ) ; System . out . print ( - ( Parser . rhs [ act ] - <NUM_LIT:1> ) ) ; System . out . print ( "<STR_LIT>" ) ; System . out . print ( max_pos ) ; System . out . print ( "<STR_LIT>" ) ; System . out . print ( act ) ; System . out . print ( "<STR_LIT:t>" ) ; System . out . print ( Parser . name [ Parser . non_terminal_index [ Parser . lhs [ act ] ] ] ) ; System . out . println ( ) ; } if ( act <= NUM_RULES ) { if ( Parser . rules_compliance [ act ] > this . options . sourceLevel ) { return <NUM_LIT:0> ; } } int lhs_symbol = Parser . lhs [ act ] ; act = ( this . tempStackTop > max_pos ? this . tempStack [ this . tempStackTop ] : stck [ this . tempStackTop ] ) ; act = Parser . ntAction ( act , lhs_symbol ) ; } while ( act <= NUM_RULES ) ; max_pos = max_pos < this . tempStackTop ? max_pos : this . tempStackTop ; } } private void reportError ( int msgCode , int nameIndex , int leftToken , int rightToken ) { reportError ( msgCode , nameIndex , leftToken , rightToken , <NUM_LIT:0> ) ; } private void reportError ( int msgCode , int nameIndex , int leftToken , int rightToken , int scopeNameIndex ) { int lToken = ( leftToken > rightToken ? rightToken : leftToken ) ; if ( lToken < rightToken ) { reportSecondaryError ( msgCode , nameIndex , lToken , rightToken , scopeNameIndex ) ; } else { reportPrimaryError ( msgCode , nameIndex , rightToken , scopeNameIndex ) ; } } private void reportPrimaryError ( int msgCode , int nameIndex , int token , int scopeNameIndex ) { String name ; if ( nameIndex >= <NUM_LIT:0> ) { name = Parser . readableName [ nameIndex ] ; } else { name = Util . EMPTY_STRING ; } int errorStart = this . lexStream . start ( token ) ; int errorEnd = this . lexStream . end ( token ) ; int currentKind = this . lexStream . kind ( token ) ; String errorTokenName = Parser . name [ Parser . terminal_index [ this . lexStream . kind ( token ) ] ] ; char [ ] errorTokenSource = this . lexStream . name ( token ) ; if ( currentKind == TerminalTokens . TokenNameStringLiteral ) { errorTokenSource = displayEscapeCharacters ( errorTokenSource , <NUM_LIT:1> , errorTokenSource . length - <NUM_LIT:1> ) ; } int addedToken = - <NUM_LIT:1> ; if ( this . recoveryScanner != null ) { if ( nameIndex >= <NUM_LIT:0> ) { addedToken = Parser . reverse_index [ nameIndex ] ; } } switch ( msgCode ) { case BEFORE_CODE : if ( this . recoveryScanner != null ) { if ( addedToken > - <NUM_LIT:1> ) { this . recoveryScanner . insertToken ( addedToken , - <NUM_LIT:1> , errorStart ) ; } else { int [ ] template = getNTermTemplate ( - addedToken ) ; if ( template != null ) { this . recoveryScanner . insertTokens ( template , - <NUM_LIT:1> , errorStart ) ; } } } if ( this . reportProblem ) problemReporter ( ) . parseErrorInsertBeforeToken ( errorStart , errorEnd , currentKind , errorTokenSource , errorTokenName , name ) ; break ; case INSERTION_CODE : if ( this . recoveryScanner != null ) { if ( addedToken > - <NUM_LIT:1> ) { this . recoveryScanner . insertToken ( addedToken , - <NUM_LIT:1> , errorEnd ) ; } else { int [ ] template = getNTermTemplate ( - addedToken ) ; if ( template != null ) { this . recoveryScanner . insertTokens ( template , - <NUM_LIT:1> , errorEnd ) ; } } } if ( this . reportProblem ) problemReporter ( ) . parseErrorInsertAfterToken ( errorStart , errorEnd , currentKind , errorTokenSource , errorTokenName , name ) ; break ; case DELETION_CODE : if ( this . recoveryScanner != null ) { this . recoveryScanner . removeTokens ( errorStart , errorEnd ) ; } if ( this . reportProblem ) problemReporter ( ) . parseErrorDeleteToken ( errorStart , errorEnd , currentKind , errorTokenSource , errorTokenName ) ; break ; case INVALID_CODE : if ( name . length ( ) == <NUM_LIT:0> ) { if ( this . recoveryScanner != null ) { this . recoveryScanner . removeTokens ( errorStart , errorEnd ) ; } if ( this . reportProblem ) problemReporter ( ) . parseErrorReplaceToken ( errorStart , errorEnd , currentKind , errorTokenSource , errorTokenName , name ) ; } else { if ( this . recoveryScanner != null ) { if ( addedToken > - <NUM_LIT:1> ) { this . recoveryScanner . replaceTokens ( addedToken , errorStart , errorEnd ) ; } else { int [ ] template = getNTermTemplate ( - addedToken ) ; if ( template != null ) { this . recoveryScanner . replaceTokens ( template , errorStart , errorEnd ) ; } } } if ( this . reportProblem ) problemReporter ( ) . parseErrorInvalidToken ( errorStart , errorEnd , currentKind , errorTokenSource , errorTokenName , name ) ; } break ; case SUBSTITUTION_CODE : if ( this . recoveryScanner != null ) { if ( addedToken > - <NUM_LIT:1> ) { this . recoveryScanner . replaceTokens ( addedToken , errorStart , errorEnd ) ; } else { int [ ] template = getNTermTemplate ( - addedToken ) ; if ( template != null ) { this . recoveryScanner . replaceTokens ( template , errorStart , errorEnd ) ; } } } if ( this . reportProblem ) problemReporter ( ) . parseErrorReplaceToken ( errorStart , errorEnd , currentKind , errorTokenSource , errorTokenName , name ) ; break ; case SCOPE_CODE : StringBuffer buf = new StringBuffer ( ) ; int [ ] addedTokens = null ; int addedTokenCount = <NUM_LIT:0> ; if ( this . recoveryScanner != null ) { addedTokens = new int [ Parser . scope_rhs . length - Parser . scope_suffix [ - nameIndex ] ] ; } for ( int i = Parser . scope_suffix [ - nameIndex ] ; Parser . scope_rhs [ i ] != <NUM_LIT:0> ; i ++ ) { buf . append ( Parser . readableName [ Parser . scope_rhs [ i ] ] ) ; if ( Parser . scope_rhs [ i + <NUM_LIT:1> ] != <NUM_LIT:0> ) buf . append ( '<CHAR_LIT:U+0020>' ) ; if ( addedTokens != null ) { int tmpAddedToken = Parser . reverse_index [ Parser . scope_rhs [ i ] ] ; if ( tmpAddedToken > - <NUM_LIT:1> ) { int length = addedTokens . length ; if ( addedTokenCount == length ) { System . arraycopy ( addedTokens , <NUM_LIT:0> , addedTokens = new int [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; } addedTokens [ addedTokenCount ++ ] = tmpAddedToken ; } else { int [ ] template = getNTermTemplate ( - tmpAddedToken ) ; if ( template != null ) { for ( int j = <NUM_LIT:0> ; j < template . length ; j ++ ) { int length = addedTokens . length ; if ( addedTokenCount == length ) { System . arraycopy ( addedTokens , <NUM_LIT:0> , addedTokens = new int [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; } addedTokens [ addedTokenCount ++ ] = template [ j ] ; } } else { addedTokenCount = <NUM_LIT:0> ; addedTokens = null ; } } } } if ( addedTokenCount > <NUM_LIT:0> ) { System . arraycopy ( addedTokens , <NUM_LIT:0> , addedTokens = new int [ addedTokenCount ] , <NUM_LIT:0> , addedTokenCount ) ; int completedToken = - <NUM_LIT:1> ; if ( scopeNameIndex != <NUM_LIT:0> ) { completedToken = - Parser . reverse_index [ scopeNameIndex ] ; } this . recoveryScanner . insertTokens ( addedTokens , completedToken , errorEnd ) ; } if ( scopeNameIndex != <NUM_LIT:0> ) { if ( this . reportProblem ) problemReporter ( ) . parseErrorInsertToComplete ( errorStart , errorEnd , buf . toString ( ) , Parser . readableName [ scopeNameIndex ] ) ; } else { if ( this . reportProblem ) problemReporter ( ) . parseErrorInsertToCompleteScope ( errorStart , errorEnd , buf . toString ( ) ) ; } break ; case EOF_CODE : if ( this . reportProblem ) problemReporter ( ) . parseErrorUnexpectedEnd ( errorStart , errorEnd ) ; break ; case MERGE_CODE : if ( this . recoveryScanner != null ) { if ( addedToken > - <NUM_LIT:1> ) { this . recoveryScanner . replaceTokens ( addedToken , errorStart , errorEnd ) ; } else { int [ ] template = getNTermTemplate ( - addedToken ) ; if ( template != null ) { this . recoveryScanner . replaceTokens ( template , errorStart , errorEnd ) ; } } } if ( this . reportProblem ) problemReporter ( ) . parseErrorMergeTokens ( errorStart , errorEnd , name ) ; break ; case MISPLACED_CODE : if ( this . recoveryScanner != null ) { this . recoveryScanner . removeTokens ( errorStart , errorEnd ) ; } if ( this . reportProblem ) problemReporter ( ) . parseErrorMisplacedConstruct ( errorStart , errorEnd ) ; break ; default : if ( name . length ( ) == <NUM_LIT:0> ) { if ( this . recoveryScanner != null ) { this . recoveryScanner . removeTokens ( errorStart , errorEnd ) ; } if ( this . reportProblem ) problemReporter ( ) . parseErrorNoSuggestion ( errorStart , errorEnd , currentKind , errorTokenSource , errorTokenName ) ; } else { if ( this . recoveryScanner != null ) { if ( addedToken > - <NUM_LIT:1> ) { this . recoveryScanner . replaceTokens ( addedToken , errorStart , errorEnd ) ; } else { int [ ] template = getNTermTemplate ( - addedToken ) ; if ( template != null ) { this . recoveryScanner . replaceTokens ( template , errorStart , errorEnd ) ; } } } if ( this . reportProblem ) problemReporter ( ) . parseErrorReplaceToken ( errorStart , errorEnd , currentKind , errorTokenSource , errorTokenName , name ) ; } break ; } } private void reportSecondaryError ( int msgCode , int nameIndex , int leftToken , int rightToken , int scopeNameIndex ) { String name ; if ( nameIndex >= <NUM_LIT:0> ) { name = Parser . readableName [ nameIndex ] ; } else { name = Util . EMPTY_STRING ; } int errorStart = - <NUM_LIT:1> ; if ( this . lexStream . isInsideStream ( leftToken ) ) { if ( leftToken == <NUM_LIT:0> ) { errorStart = this . lexStream . start ( leftToken + <NUM_LIT:1> ) ; } else { errorStart = this . lexStream . start ( leftToken ) ; } } else { if ( leftToken == this . errorToken ) { errorStart = this . errorTokenStart ; } else { for ( int i = <NUM_LIT:0> ; i <= this . stateStackTop ; i ++ ) { if ( this . locationStack [ i ] == leftToken ) { errorStart = this . locationStartStack [ i ] ; } } } if ( errorStart == - <NUM_LIT:1> ) { errorStart = this . lexStream . start ( rightToken ) ; } } int errorEnd = this . lexStream . end ( rightToken ) ; int addedToken = - <NUM_LIT:1> ; if ( this . recoveryScanner != null ) { if ( nameIndex >= <NUM_LIT:0> ) { addedToken = Parser . reverse_index [ nameIndex ] ; } } switch ( msgCode ) { case MISPLACED_CODE : if ( this . recoveryScanner != null ) { this . recoveryScanner . removeTokens ( errorStart , errorEnd ) ; } if ( this . reportProblem ) problemReporter ( ) . parseErrorMisplacedConstruct ( errorStart , errorEnd ) ; break ; case SCOPE_CODE : errorStart = this . lexStream . start ( rightToken ) ; StringBuffer buf = new StringBuffer ( ) ; int [ ] addedTokens = null ; int addedTokenCount = <NUM_LIT:0> ; if ( this . recoveryScanner != null ) { addedTokens = new int [ Parser . scope_rhs . length - Parser . scope_suffix [ - nameIndex ] ] ; } for ( int i = Parser . scope_suffix [ - nameIndex ] ; Parser . scope_rhs [ i ] != <NUM_LIT:0> ; i ++ ) { buf . append ( Parser . readableName [ Parser . scope_rhs [ i ] ] ) ; if ( Parser . scope_rhs [ i + <NUM_LIT:1> ] != <NUM_LIT:0> ) buf . append ( '<CHAR_LIT:U+0020>' ) ; if ( addedTokens != null ) { int tmpAddedToken = Parser . reverse_index [ Parser . scope_rhs [ i ] ] ; if ( tmpAddedToken > - <NUM_LIT:1> ) { int length = addedTokens . length ; if ( addedTokenCount == length ) { System . arraycopy ( addedTokens , <NUM_LIT:0> , addedTokens = new int [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; } addedTokens [ addedTokenCount ++ ] = tmpAddedToken ; } else { int [ ] template = getNTermTemplate ( - tmpAddedToken ) ; if ( template != null ) { for ( int j = <NUM_LIT:0> ; j < template . length ; j ++ ) { int length = addedTokens . length ; if ( addedTokenCount == length ) { System . arraycopy ( addedTokens , <NUM_LIT:0> , addedTokens = new int [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; } addedTokens [ addedTokenCount ++ ] = template [ j ] ; } } else { addedTokenCount = <NUM_LIT:0> ; addedTokens = null ; } } } } if ( addedTokenCount > <NUM_LIT:0> ) { System . arraycopy ( addedTokens , <NUM_LIT:0> , addedTokens = new int [ addedTokenCount ] , <NUM_LIT:0> , addedTokenCount ) ; int completedToken = - <NUM_LIT:1> ; if ( scopeNameIndex != <NUM_LIT:0> ) { completedToken = - Parser . reverse_index [ scopeNameIndex ] ; } this . recoveryScanner . insertTokens ( addedTokens , completedToken , errorEnd ) ; } if ( scopeNameIndex != <NUM_LIT:0> ) { if ( this . reportProblem ) problemReporter ( ) . parseErrorInsertToComplete ( errorStart , errorEnd , buf . toString ( ) , Parser . readableName [ scopeNameIndex ] ) ; } else { if ( this . reportProblem ) problemReporter ( ) . parseErrorInsertToCompletePhrase ( errorStart , errorEnd , buf . toString ( ) ) ; } break ; case MERGE_CODE : if ( this . recoveryScanner != null ) { if ( addedToken > - <NUM_LIT:1> ) { this . recoveryScanner . replaceTokens ( addedToken , errorStart , errorEnd ) ; } else { int [ ] template = getNTermTemplate ( - addedToken ) ; if ( template != null ) { this . recoveryScanner . replaceTokens ( template , errorStart , errorEnd ) ; } } } if ( this . reportProblem ) problemReporter ( ) . parseErrorMergeTokens ( errorStart , errorEnd , name ) ; break ; case DELETION_CODE : if ( this . recoveryScanner != null ) { this . recoveryScanner . removeTokens ( errorStart , errorEnd ) ; } if ( this . reportProblem ) problemReporter ( ) . parseErrorDeleteTokens ( errorStart , errorEnd ) ; break ; default : if ( name . length ( ) == <NUM_LIT:0> ) { if ( this . recoveryScanner != null ) { this . recoveryScanner . removeTokens ( errorStart , errorEnd ) ; } if ( this . reportProblem ) problemReporter ( ) . parseErrorNoSuggestionForTokens ( errorStart , errorEnd ) ; } else { if ( this . recoveryScanner != null ) { if ( addedToken > - <NUM_LIT:1> ) { this . recoveryScanner . replaceTokens ( addedToken , errorStart , errorEnd ) ; } else { int [ ] template = getNTermTemplate ( - addedToken ) ; if ( template != null ) { this . recoveryScanner . replaceTokens ( template , errorStart , errorEnd ) ; } } } if ( this . reportProblem ) problemReporter ( ) . parseErrorReplaceTokens ( errorStart , errorEnd , name ) ; } } return ; } private int [ ] getNTermTemplate ( int sym ) { int templateIndex = Parser . recovery_templates_index [ sym ] ; if ( templateIndex > <NUM_LIT:0> ) { int [ ] result = new int [ Parser . recovery_templates . length ] ; int count = <NUM_LIT:0> ; for ( int j = templateIndex ; Parser . recovery_templates [ j ] != <NUM_LIT:0> ; j ++ ) { result [ count ++ ] = Parser . recovery_templates [ j ] ; } System . arraycopy ( result , <NUM_LIT:0> , result = new int [ count ] , <NUM_LIT:0> , count ) ; return result ; } else { return null ; } } public String toString ( ) { StringBuffer res = new StringBuffer ( ) ; res . append ( this . lexStream . toString ( ) ) ; return res . toString ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . parser ; public class NLSTag { public int start ; public int end ; public int lineNumber ; public int index ; public NLSTag ( int start , int end , int lineNumber , int index ) { this . start = start ; this . end = end ; this . lineNumber = lineNumber ; this . index = index ; } public String toString ( ) { return "<STR_LIT>" + this . start + "<STR_LIT:U+002C>" + this . end + "<STR_LIT:U+002C>" + this . lineNumber + "<STR_LIT:)>" ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . parser ; import java . util . HashSet ; import java . util . Set ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . Statement ; public class RecoveredStatement extends RecoveredElement { public Statement statement ; public RecoveredStatement ( Statement statement , RecoveredElement parent , int bracketBalance ) { super ( parent , bracketBalance ) ; this . statement = statement ; } public ASTNode parseTree ( ) { return this . statement ; } public int sourceEnd ( ) { return this . statement . sourceEnd ; } public String toString ( int tab ) { return tabString ( tab ) + "<STR_LIT>" + this . statement . print ( tab + <NUM_LIT:1> , new StringBuffer ( <NUM_LIT:10> ) ) ; } public Statement updatedStatement ( int depth , Set knownTypes ) { return this . statement ; } public void updateParseTree ( ) { updatedStatement ( <NUM_LIT:0> , new HashSet ( ) ) ; } public void updateSourceEndIfNecessary ( int bodyStart , int bodyEnd ) { if ( this . statement . sourceEnd == <NUM_LIT:0> ) this . statement . sourceEnd = bodyEnd ; } public RecoveredElement updateOnClosingBrace ( int braceStart , int braceEnd ) { if ( ( -- this . bracketBalance <= <NUM_LIT:0> ) && ( this . parent != null ) ) { this . updateSourceEndIfNecessary ( braceStart , braceEnd ) ; return this . parent . updateOnClosingBrace ( braceStart , braceEnd ) ; } return this ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . parser ; import java . util . HashSet ; import java . util . Set ; import org . eclipse . jdt . internal . compiler . ast . AbstractMethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . Block ; import org . eclipse . jdt . internal . compiler . ast . CompilationUnitDeclaration ; import org . eclipse . jdt . internal . compiler . ast . FieldDeclaration ; import org . eclipse . jdt . internal . compiler . ast . ImportReference ; import org . eclipse . jdt . internal . compiler . ast . Initializer ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; public class RecoveredUnit extends RecoveredElement { public CompilationUnitDeclaration unitDeclaration ; public RecoveredImport [ ] imports ; public int importCount ; public RecoveredType [ ] types ; public int typeCount ; int pendingModifiers ; int pendingModifersSourceStart = - <NUM_LIT:1> ; RecoveredAnnotation [ ] pendingAnnotations ; int pendingAnnotationCount ; public RecoveredUnit ( CompilationUnitDeclaration unitDeclaration , int bracketBalance , Parser parser ) { super ( null , bracketBalance , parser ) ; this . unitDeclaration = unitDeclaration ; } public RecoveredElement addAnnotationName ( int identifierPtr , int identifierLengthPtr , int annotationStart , int bracketBalanceValue ) { if ( this . pendingAnnotations == null ) { this . pendingAnnotations = new RecoveredAnnotation [ <NUM_LIT:5> ] ; this . pendingAnnotationCount = <NUM_LIT:0> ; } else { if ( this . pendingAnnotationCount == this . pendingAnnotations . length ) { System . arraycopy ( this . pendingAnnotations , <NUM_LIT:0> , ( this . pendingAnnotations = new RecoveredAnnotation [ <NUM_LIT:2> * this . pendingAnnotationCount ] ) , <NUM_LIT:0> , this . pendingAnnotationCount ) ; } } RecoveredAnnotation element = new RecoveredAnnotation ( identifierPtr , identifierLengthPtr , annotationStart , this , bracketBalanceValue ) ; this . pendingAnnotations [ this . pendingAnnotationCount ++ ] = element ; return element ; } public void addModifier ( int flag , int modifiersSourceStart ) { this . pendingModifiers |= flag ; if ( this . pendingModifersSourceStart < <NUM_LIT:0> ) { this . pendingModifersSourceStart = modifiersSourceStart ; } } public RecoveredElement add ( AbstractMethodDeclaration methodDeclaration , int bracketBalanceValue ) { if ( this . typeCount > <NUM_LIT:0> ) { RecoveredType type = this . types [ this . typeCount - <NUM_LIT:1> ] ; int start = type . bodyEnd ; int end = type . typeDeclaration . bodyEnd ; type . bodyEnd = <NUM_LIT:0> ; type . typeDeclaration . declarationSourceEnd = <NUM_LIT:0> ; type . typeDeclaration . bodyEnd = <NUM_LIT:0> ; int kind = TypeDeclaration . kind ( type . typeDeclaration . modifiers ) ; if ( start > <NUM_LIT:0> && start < end && kind != TypeDeclaration . INTERFACE_DECL && kind != TypeDeclaration . ANNOTATION_TYPE_DECL ) { Initializer initializer = new Initializer ( new Block ( <NUM_LIT:0> ) , <NUM_LIT:0> ) ; initializer . bodyStart = end ; initializer . bodyEnd = end ; initializer . declarationSourceStart = end ; initializer . declarationSourceEnd = end ; initializer . sourceStart = end ; initializer . sourceEnd = end ; type . add ( initializer , bracketBalanceValue ) ; } resetPendingModifiers ( ) ; return type . add ( methodDeclaration , bracketBalanceValue ) ; } return this ; } public RecoveredElement add ( FieldDeclaration fieldDeclaration , int bracketBalanceValue ) { if ( this . typeCount > <NUM_LIT:0> ) { RecoveredType type = this . types [ this . typeCount - <NUM_LIT:1> ] ; type . bodyEnd = <NUM_LIT:0> ; type . typeDeclaration . declarationSourceEnd = <NUM_LIT:0> ; type . typeDeclaration . bodyEnd = <NUM_LIT:0> ; resetPendingModifiers ( ) ; return type . add ( fieldDeclaration , bracketBalanceValue ) ; } return this ; } public RecoveredElement add ( ImportReference importReference , int bracketBalanceValue ) { resetPendingModifiers ( ) ; if ( this . imports == null ) { this . imports = new RecoveredImport [ <NUM_LIT:5> ] ; this . importCount = <NUM_LIT:0> ; } else { if ( this . importCount == this . imports . length ) { System . arraycopy ( this . imports , <NUM_LIT:0> , ( this . imports = new RecoveredImport [ <NUM_LIT:2> * this . importCount ] ) , <NUM_LIT:0> , this . importCount ) ; } } RecoveredImport element = new RecoveredImport ( importReference , this , bracketBalanceValue ) ; this . imports [ this . importCount ++ ] = element ; if ( importReference . declarationSourceEnd == <NUM_LIT:0> ) return element ; return this ; } public RecoveredElement add ( TypeDeclaration typeDeclaration , int bracketBalanceValue ) { if ( ( typeDeclaration . bits & ASTNode . IsAnonymousType ) != <NUM_LIT:0> ) { if ( this . typeCount > <NUM_LIT:0> ) { RecoveredType lastType = this . types [ this . typeCount - <NUM_LIT:1> ] ; lastType . bodyEnd = <NUM_LIT:0> ; lastType . typeDeclaration . bodyEnd = <NUM_LIT:0> ; lastType . typeDeclaration . declarationSourceEnd = <NUM_LIT:0> ; lastType . bracketBalance ++ ; resetPendingModifiers ( ) ; return lastType . add ( typeDeclaration , bracketBalanceValue ) ; } } if ( this . types == null ) { this . types = new RecoveredType [ <NUM_LIT:5> ] ; this . typeCount = <NUM_LIT:0> ; } else { if ( this . typeCount == this . types . length ) { System . arraycopy ( this . types , <NUM_LIT:0> , ( this . types = new RecoveredType [ <NUM_LIT:2> * this . typeCount ] ) , <NUM_LIT:0> , this . typeCount ) ; } } RecoveredType element = new RecoveredType ( typeDeclaration , this , bracketBalanceValue ) ; this . types [ this . typeCount ++ ] = element ; if ( this . pendingAnnotationCount > <NUM_LIT:0> ) { element . attach ( this . pendingAnnotations , this . pendingAnnotationCount , this . pendingModifiers , this . pendingModifersSourceStart ) ; } resetPendingModifiers ( ) ; if ( typeDeclaration . declarationSourceEnd == <NUM_LIT:0> ) return element ; return this ; } public ASTNode parseTree ( ) { return this . unitDeclaration ; } public void resetPendingModifiers ( ) { this . pendingAnnotations = null ; this . pendingAnnotationCount = <NUM_LIT:0> ; this . pendingModifiers = <NUM_LIT:0> ; this . pendingModifersSourceStart = - <NUM_LIT:1> ; } public int sourceEnd ( ) { return this . unitDeclaration . sourceEnd ; } public String toString ( int tab ) { StringBuffer result = new StringBuffer ( tabString ( tab ) ) ; result . append ( "<STR_LIT>" ) ; this . unitDeclaration . print ( tab + <NUM_LIT:1> , result ) ; result . append ( tabString ( tab + <NUM_LIT:1> ) ) ; result . append ( "<STR_LIT:]>" ) ; if ( this . imports != null ) { for ( int i = <NUM_LIT:0> ; i < this . importCount ; i ++ ) { result . append ( "<STR_LIT:n>" ) ; result . append ( this . imports [ i ] . toString ( tab + <NUM_LIT:1> ) ) ; } } if ( this . types != null ) { for ( int i = <NUM_LIT:0> ; i < this . typeCount ; i ++ ) { result . append ( "<STR_LIT:n>" ) ; result . append ( this . types [ i ] . toString ( tab + <NUM_LIT:1> ) ) ; } } return result . toString ( ) ; } public CompilationUnitDeclaration updatedCompilationUnitDeclaration ( ) { if ( this . importCount > <NUM_LIT:0> ) { ImportReference [ ] importRefences = new ImportReference [ this . importCount ] ; for ( int i = <NUM_LIT:0> ; i < this . importCount ; i ++ ) { importRefences [ i ] = this . imports [ i ] . updatedImportReference ( ) ; } this . unitDeclaration . imports = importRefences ; } if ( this . typeCount > <NUM_LIT:0> ) { int existingCount = this . unitDeclaration . types == null ? <NUM_LIT:0> : this . unitDeclaration . types . length ; TypeDeclaration [ ] typeDeclarations = new TypeDeclaration [ existingCount + this . typeCount ] ; if ( existingCount > <NUM_LIT:0> ) { System . arraycopy ( this . unitDeclaration . types , <NUM_LIT:0> , typeDeclarations , <NUM_LIT:0> , existingCount ) ; } if ( this . types [ this . typeCount - <NUM_LIT:1> ] . typeDeclaration . declarationSourceEnd == <NUM_LIT:0> ) { this . types [ this . typeCount - <NUM_LIT:1> ] . typeDeclaration . declarationSourceEnd = this . unitDeclaration . sourceEnd ; this . types [ this . typeCount - <NUM_LIT:1> ] . typeDeclaration . bodyEnd = this . unitDeclaration . sourceEnd ; } Set knownTypes = new HashSet ( ) ; int actualCount = existingCount ; for ( int i = <NUM_LIT:0> ; i < this . typeCount ; i ++ ) { TypeDeclaration typeDecl = this . types [ i ] . updatedTypeDeclaration ( <NUM_LIT:0> , knownTypes ) ; if ( typeDecl != null && ( typeDecl . bits & ASTNode . IsLocalType ) == <NUM_LIT:0> ) { typeDeclarations [ actualCount ++ ] = typeDecl ; } } if ( actualCount != this . typeCount ) { System . arraycopy ( typeDeclarations , <NUM_LIT:0> , typeDeclarations = new TypeDeclaration [ existingCount + actualCount ] , <NUM_LIT:0> , existingCount + actualCount ) ; } this . unitDeclaration . types = typeDeclarations ; } return this . unitDeclaration ; } public void updateParseTree ( ) { updatedCompilationUnitDeclaration ( ) ; } public void updateSourceEndIfNecessary ( int bodyStart , int bodyEnd ) { if ( this . unitDeclaration . sourceEnd == <NUM_LIT:0> ) this . unitDeclaration . sourceEnd = bodyEnd ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . parser ; import java . io . BufferedInputStream ; import java . io . DataInputStream ; import java . io . FileNotFoundException ; import java . io . IOException ; import org . eclipse . jdt . core . compiler . InvalidInputException ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; public class ScannerHelper { public final static long [ ] Bits = { ASTNode . Bit1 , ASTNode . Bit2 , ASTNode . Bit3 , ASTNode . Bit4 , ASTNode . Bit5 , ASTNode . Bit6 , ASTNode . Bit7 , ASTNode . Bit8 , ASTNode . Bit9 , ASTNode . Bit10 , ASTNode . Bit11 , ASTNode . Bit12 , ASTNode . Bit13 , ASTNode . Bit14 , ASTNode . Bit15 , ASTNode . Bit16 , ASTNode . Bit17 , ASTNode . Bit18 , ASTNode . Bit19 , ASTNode . Bit20 , ASTNode . Bit21 , ASTNode . Bit22 , ASTNode . Bit23 , ASTNode . Bit24 , ASTNode . Bit25 , ASTNode . Bit26 , ASTNode . Bit27 , ASTNode . Bit28 , ASTNode . Bit29 , ASTNode . Bit30 , ASTNode . Bit31 , ASTNode . Bit32 , ASTNode . Bit33L , ASTNode . Bit34L , ASTNode . Bit35L , ASTNode . Bit36L , ASTNode . Bit37L , ASTNode . Bit38L , ASTNode . Bit39L , ASTNode . Bit40L , ASTNode . Bit41L , ASTNode . Bit42L , ASTNode . Bit43L , ASTNode . Bit44L , ASTNode . Bit45L , ASTNode . Bit46L , ASTNode . Bit47L , ASTNode . Bit48L , ASTNode . Bit49L , ASTNode . Bit50L , ASTNode . Bit51L , ASTNode . Bit52L , ASTNode . Bit53L , ASTNode . Bit54L , ASTNode . Bit55L , ASTNode . Bit56L , ASTNode . Bit57L , ASTNode . Bit58L , ASTNode . Bit59L , ASTNode . Bit60L , ASTNode . Bit61L , ASTNode . Bit62L , ASTNode . Bit63L , ASTNode . Bit64L , } ; private static final int START_INDEX = <NUM_LIT:0> ; private static final int PART_INDEX = <NUM_LIT:1> ; private static long [ ] [ ] [ ] Tables ; private static long [ ] [ ] [ ] Tables7 ; public final static int MAX_OBVIOUS = <NUM_LIT> ; public final static int [ ] OBVIOUS_IDENT_CHAR_NATURES = new int [ MAX_OBVIOUS ] ; public final static int C_JLS_SPACE = ASTNode . Bit9 ; public final static int C_SPECIAL = ASTNode . Bit8 ; public final static int C_IDENT_START = ASTNode . Bit7 ; public final static int C_UPPER_LETTER = ASTNode . Bit6 ; public final static int C_LOWER_LETTER = ASTNode . Bit5 ; public final static int C_IDENT_PART = ASTNode . Bit4 ; public final static int C_DIGIT = ASTNode . Bit3 ; public final static int C_SEPARATOR = ASTNode . Bit2 ; public final static int C_SPACE = ASTNode . Bit1 ; static { OBVIOUS_IDENT_CHAR_NATURES [ <NUM_LIT:0> ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ <NUM_LIT:1> ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ <NUM_LIT:2> ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ <NUM_LIT:3> ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ <NUM_LIT:4> ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ <NUM_LIT:5> ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ <NUM_LIT:6> ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ <NUM_LIT:7> ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ <NUM_LIT:8> ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ <NUM_LIT> ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ <NUM_LIT:15> ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ <NUM_LIT:16> ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ <NUM_LIT> ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ <NUM_LIT> ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ <NUM_LIT> ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ <NUM_LIT:20> ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ <NUM_LIT> ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ <NUM_LIT> ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ <NUM_LIT> ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ <NUM_LIT:24> ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ <NUM_LIT> ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ <NUM_LIT> ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ <NUM_LIT> ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ <NUM_LIT> ] = C_IDENT_PART ; for ( int i = '<CHAR_LIT:0>' ; i <= '<CHAR_LIT:9>' ; i ++ ) OBVIOUS_IDENT_CHAR_NATURES [ i ] = C_DIGIT | C_IDENT_PART ; for ( int i = '<CHAR_LIT:a>' ; i <= '<CHAR_LIT>' ; i ++ ) OBVIOUS_IDENT_CHAR_NATURES [ i ] = C_LOWER_LETTER | C_IDENT_PART | C_IDENT_START ; for ( int i = '<CHAR_LIT:A>' ; i <= '<CHAR_LIT:Z>' ; i ++ ) OBVIOUS_IDENT_CHAR_NATURES [ i ] = C_UPPER_LETTER | C_IDENT_PART | C_IDENT_START ; OBVIOUS_IDENT_CHAR_NATURES [ '<CHAR_LIT:_>' ] = C_SPECIAL | C_IDENT_PART | C_IDENT_START ; OBVIOUS_IDENT_CHAR_NATURES [ '<CHAR_LIT>' ] = C_SPECIAL | C_IDENT_PART | C_IDENT_START ; OBVIOUS_IDENT_CHAR_NATURES [ <NUM_LIT:9> ] = C_SPACE | C_JLS_SPACE ; OBVIOUS_IDENT_CHAR_NATURES [ <NUM_LIT:10> ] = C_SPACE | C_JLS_SPACE ; OBVIOUS_IDENT_CHAR_NATURES [ <NUM_LIT:11> ] = C_SPACE ; OBVIOUS_IDENT_CHAR_NATURES [ <NUM_LIT:12> ] = C_SPACE | C_JLS_SPACE ; OBVIOUS_IDENT_CHAR_NATURES [ <NUM_LIT> ] = C_SPACE | C_JLS_SPACE ; OBVIOUS_IDENT_CHAR_NATURES [ <NUM_LIT> ] = C_SPACE ; OBVIOUS_IDENT_CHAR_NATURES [ <NUM_LIT> ] = C_SPACE ; OBVIOUS_IDENT_CHAR_NATURES [ <NUM_LIT:30> ] = C_SPACE ; OBVIOUS_IDENT_CHAR_NATURES [ <NUM_LIT:31> ] = C_SPACE ; OBVIOUS_IDENT_CHAR_NATURES [ <NUM_LIT:32> ] = C_SPACE | C_JLS_SPACE ; OBVIOUS_IDENT_CHAR_NATURES [ '<CHAR_LIT:.>' ] = C_SEPARATOR ; OBVIOUS_IDENT_CHAR_NATURES [ '<CHAR_LIT::>' ] = C_SEPARATOR ; OBVIOUS_IDENT_CHAR_NATURES [ '<CHAR_LIT:;>' ] = C_SEPARATOR ; OBVIOUS_IDENT_CHAR_NATURES [ '<CHAR_LIT:U+002C>' ] = C_SEPARATOR ; OBVIOUS_IDENT_CHAR_NATURES [ '<CHAR_LIT:[>' ] = C_SEPARATOR ; OBVIOUS_IDENT_CHAR_NATURES [ '<CHAR_LIT:]>' ] = C_SEPARATOR ; OBVIOUS_IDENT_CHAR_NATURES [ '<CHAR_LIT:(>' ] = C_SEPARATOR ; OBVIOUS_IDENT_CHAR_NATURES [ '<CHAR_LIT:)>' ] = C_SEPARATOR ; OBVIOUS_IDENT_CHAR_NATURES [ '<CHAR_LIT>' ] = C_SEPARATOR ; OBVIOUS_IDENT_CHAR_NATURES [ '<CHAR_LIT:}>' ] = C_SEPARATOR ; OBVIOUS_IDENT_CHAR_NATURES [ '<CHAR_LIT>' ] = C_SEPARATOR ; OBVIOUS_IDENT_CHAR_NATURES [ '<CHAR_LIT:->' ] = C_SEPARATOR ; OBVIOUS_IDENT_CHAR_NATURES [ '<CHAR_LIT>' ] = C_SEPARATOR ; OBVIOUS_IDENT_CHAR_NATURES [ '<CHAR_LIT:/>' ] = C_SEPARATOR ; OBVIOUS_IDENT_CHAR_NATURES [ '<CHAR_LIT:=>' ] = C_SEPARATOR ; OBVIOUS_IDENT_CHAR_NATURES [ '<CHAR_LIT>' ] = C_SEPARATOR ; OBVIOUS_IDENT_CHAR_NATURES [ '<CHAR_LIT>' ] = C_SEPARATOR ; OBVIOUS_IDENT_CHAR_NATURES [ '<CHAR_LIT>' ] = C_SEPARATOR ; OBVIOUS_IDENT_CHAR_NATURES [ '<CHAR_LIT>' ] = C_SEPARATOR ; OBVIOUS_IDENT_CHAR_NATURES [ '<CHAR_LIT:>>' ] = C_SEPARATOR ; OBVIOUS_IDENT_CHAR_NATURES [ '<CHAR_LIT>' ] = C_SEPARATOR ; OBVIOUS_IDENT_CHAR_NATURES [ '<CHAR_LIT>' ] = C_SEPARATOR ; OBVIOUS_IDENT_CHAR_NATURES [ '<CHAR_LIT>' ] = C_SEPARATOR ; OBVIOUS_IDENT_CHAR_NATURES [ '<CHAR_LIT>' ] = C_SEPARATOR ; OBVIOUS_IDENT_CHAR_NATURES [ '<CHAR_LIT:">' ] = C_SEPARATOR ; OBVIOUS_IDENT_CHAR_NATURES [ '<STR_LIT>' ] = C_SEPARATOR ; } static void initializeTable ( ) { Tables = new long [ <NUM_LIT:2> ] [ ] [ ] ; Tables [ START_INDEX ] = new long [ <NUM_LIT:3> ] [ ] ; Tables [ PART_INDEX ] = new long [ <NUM_LIT:4> ] [ ] ; try { DataInputStream inputStream = new DataInputStream ( new BufferedInputStream ( ScannerHelper . class . getResourceAsStream ( "<STR_LIT>" ) ) ) ; long [ ] readValues = new long [ <NUM_LIT> ] ; for ( int i = <NUM_LIT:0> ; i < <NUM_LIT> ; i ++ ) { readValues [ i ] = inputStream . readLong ( ) ; } inputStream . close ( ) ; Tables [ START_INDEX ] [ <NUM_LIT:0> ] = readValues ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } try { DataInputStream inputStream = new DataInputStream ( new BufferedInputStream ( ScannerHelper . class . getResourceAsStream ( "<STR_LIT>" ) ) ) ; long [ ] readValues = new long [ <NUM_LIT> ] ; for ( int i = <NUM_LIT:0> ; i < <NUM_LIT> ; i ++ ) { readValues [ i ] = inputStream . readLong ( ) ; } inputStream . close ( ) ; Tables [ START_INDEX ] [ <NUM_LIT:1> ] = readValues ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } try { DataInputStream inputStream = new DataInputStream ( new BufferedInputStream ( ScannerHelper . class . getResourceAsStream ( "<STR_LIT>" ) ) ) ; long [ ] readValues = new long [ <NUM_LIT> ] ; for ( int i = <NUM_LIT:0> ; i < <NUM_LIT> ; i ++ ) { readValues [ i ] = inputStream . readLong ( ) ; } inputStream . close ( ) ; Tables [ START_INDEX ] [ <NUM_LIT:2> ] = readValues ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } try { DataInputStream inputStream = new DataInputStream ( new BufferedInputStream ( ScannerHelper . class . getResourceAsStream ( "<STR_LIT>" ) ) ) ; long [ ] readValues = new long [ <NUM_LIT> ] ; for ( int i = <NUM_LIT:0> ; i < <NUM_LIT> ; i ++ ) { readValues [ i ] = inputStream . readLong ( ) ; } inputStream . close ( ) ; Tables [ PART_INDEX ] [ <NUM_LIT:0> ] = readValues ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } try { DataInputStream inputStream = new DataInputStream ( new BufferedInputStream ( ScannerHelper . class . getResourceAsStream ( "<STR_LIT>" ) ) ) ; long [ ] readValues = new long [ <NUM_LIT> ] ; for ( int i = <NUM_LIT:0> ; i < <NUM_LIT> ; i ++ ) { readValues [ i ] = inputStream . readLong ( ) ; } inputStream . close ( ) ; Tables [ PART_INDEX ] [ <NUM_LIT:1> ] = readValues ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } try { DataInputStream inputStream = new DataInputStream ( new BufferedInputStream ( ScannerHelper . class . getResourceAsStream ( "<STR_LIT>" ) ) ) ; long [ ] readValues = new long [ <NUM_LIT> ] ; for ( int i = <NUM_LIT:0> ; i < <NUM_LIT> ; i ++ ) { readValues [ i ] = inputStream . readLong ( ) ; } inputStream . close ( ) ; Tables [ PART_INDEX ] [ <NUM_LIT:2> ] = readValues ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } try { DataInputStream inputStream = new DataInputStream ( new BufferedInputStream ( ScannerHelper . class . getResourceAsStream ( "<STR_LIT>" ) ) ) ; long [ ] readValues = new long [ <NUM_LIT> ] ; for ( int i = <NUM_LIT:0> ; i < <NUM_LIT> ; i ++ ) { readValues [ i ] = inputStream . readLong ( ) ; } inputStream . close ( ) ; Tables [ PART_INDEX ] [ <NUM_LIT:3> ] = readValues ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } static void initializeTable17 ( ) { Tables7 = new long [ <NUM_LIT:2> ] [ ] [ ] ; Tables7 [ START_INDEX ] = new long [ <NUM_LIT:3> ] [ ] ; Tables7 [ PART_INDEX ] = new long [ <NUM_LIT:4> ] [ ] ; try { DataInputStream inputStream = new DataInputStream ( new BufferedInputStream ( ScannerHelper . class . getResourceAsStream ( "<STR_LIT>" ) ) ) ; long [ ] readValues = new long [ <NUM_LIT> ] ; for ( int i = <NUM_LIT:0> ; i < <NUM_LIT> ; i ++ ) { readValues [ i ] = inputStream . readLong ( ) ; } inputStream . close ( ) ; Tables7 [ START_INDEX ] [ <NUM_LIT:0> ] = readValues ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } try { DataInputStream inputStream = new DataInputStream ( new BufferedInputStream ( ScannerHelper . class . getResourceAsStream ( "<STR_LIT>" ) ) ) ; long [ ] readValues = new long [ <NUM_LIT> ] ; for ( int i = <NUM_LIT:0> ; i < <NUM_LIT> ; i ++ ) { readValues [ i ] = inputStream . readLong ( ) ; } inputStream . close ( ) ; Tables7 [ START_INDEX ] [ <NUM_LIT:1> ] = readValues ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } try { DataInputStream inputStream = new DataInputStream ( new BufferedInputStream ( ScannerHelper . class . getResourceAsStream ( "<STR_LIT>" ) ) ) ; long [ ] readValues = new long [ <NUM_LIT> ] ; for ( int i = <NUM_LIT:0> ; i < <NUM_LIT> ; i ++ ) { readValues [ i ] = inputStream . readLong ( ) ; } inputStream . close ( ) ; Tables7 [ START_INDEX ] [ <NUM_LIT:2> ] = readValues ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } try { DataInputStream inputStream = new DataInputStream ( new BufferedInputStream ( ScannerHelper . class . getResourceAsStream ( "<STR_LIT>" ) ) ) ; long [ ] readValues = new long [ <NUM_LIT> ] ; for ( int i = <NUM_LIT:0> ; i < <NUM_LIT> ; i ++ ) { readValues [ i ] = inputStream . readLong ( ) ; } inputStream . close ( ) ; Tables7 [ PART_INDEX ] [ <NUM_LIT:0> ] = readValues ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } try { DataInputStream inputStream = new DataInputStream ( new BufferedInputStream ( ScannerHelper . class . getResourceAsStream ( "<STR_LIT>" ) ) ) ; long [ ] readValues = new long [ <NUM_LIT> ] ; for ( int i = <NUM_LIT:0> ; i < <NUM_LIT> ; i ++ ) { readValues [ i ] = inputStream . readLong ( ) ; } inputStream . close ( ) ; Tables7 [ PART_INDEX ] [ <NUM_LIT:1> ] = readValues ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } try { DataInputStream inputStream = new DataInputStream ( new BufferedInputStream ( ScannerHelper . class . getResourceAsStream ( "<STR_LIT>" ) ) ) ; long [ ] readValues = new long [ <NUM_LIT> ] ; for ( int i = <NUM_LIT:0> ; i < <NUM_LIT> ; i ++ ) { readValues [ i ] = inputStream . readLong ( ) ; } inputStream . close ( ) ; Tables7 [ PART_INDEX ] [ <NUM_LIT:2> ] = readValues ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } try { DataInputStream inputStream = new DataInputStream ( new BufferedInputStream ( ScannerHelper . class . getResourceAsStream ( "<STR_LIT>" ) ) ) ; long [ ] readValues = new long [ <NUM_LIT> ] ; for ( int i = <NUM_LIT:0> ; i < <NUM_LIT> ; i ++ ) { readValues [ i ] = inputStream . readLong ( ) ; } inputStream . close ( ) ; Tables7 [ PART_INDEX ] [ <NUM_LIT:3> ] = readValues ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } private final static boolean isBitSet ( long [ ] values , int i ) { try { return ( values [ i / <NUM_LIT> ] & Bits [ i % <NUM_LIT> ] ) != <NUM_LIT:0> ; } catch ( NullPointerException e ) { return false ; } } public static boolean isJavaIdentifierPart ( char c ) { if ( c < MAX_OBVIOUS ) { return ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] & ScannerHelper . C_IDENT_PART ) != <NUM_LIT:0> ; } return Character . isJavaIdentifierPart ( c ) ; } public static boolean isJavaIdentifierPart ( long complianceLevel , char c ) { if ( c < MAX_OBVIOUS ) { return ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] & ScannerHelper . C_IDENT_PART ) != <NUM_LIT:0> ; } return isJavaIdentifierPart ( complianceLevel , ( int ) c ) ; } public static boolean isJavaIdentifierPart ( long complianceLevel , int codePoint ) { if ( complianceLevel <= ClassFileConstants . JDK1_6 ) { if ( Tables == null ) { initializeTable ( ) ; } switch ( ( codePoint & <NUM_LIT> ) > > <NUM_LIT:16> ) { case <NUM_LIT:0> : return isBitSet ( Tables [ PART_INDEX ] [ <NUM_LIT:0> ] , codePoint & <NUM_LIT> ) ; case <NUM_LIT:1> : return isBitSet ( Tables [ PART_INDEX ] [ <NUM_LIT:1> ] , codePoint & <NUM_LIT> ) ; case <NUM_LIT:2> : return isBitSet ( Tables [ PART_INDEX ] [ <NUM_LIT:2> ] , codePoint & <NUM_LIT> ) ; case <NUM_LIT> : return isBitSet ( Tables [ PART_INDEX ] [ <NUM_LIT:3> ] , codePoint & <NUM_LIT> ) ; } } else { if ( Tables7 == null ) { initializeTable17 ( ) ; } switch ( ( codePoint & <NUM_LIT> ) > > <NUM_LIT:16> ) { case <NUM_LIT:0> : return isBitSet ( Tables7 [ PART_INDEX ] [ <NUM_LIT:0> ] , codePoint & <NUM_LIT> ) ; case <NUM_LIT:1> : return isBitSet ( Tables7 [ PART_INDEX ] [ <NUM_LIT:1> ] , codePoint & <NUM_LIT> ) ; case <NUM_LIT:2> : return isBitSet ( Tables7 [ PART_INDEX ] [ <NUM_LIT:2> ] , codePoint & <NUM_LIT> ) ; case <NUM_LIT> : return isBitSet ( Tables7 [ PART_INDEX ] [ <NUM_LIT:3> ] , codePoint & <NUM_LIT> ) ; } } return false ; } public static boolean isJavaIdentifierPart ( long complianceLevel , char high , char low ) { return isJavaIdentifierPart ( complianceLevel , toCodePoint ( high , low ) ) ; } public static boolean isJavaIdentifierStart ( char c ) { if ( c < MAX_OBVIOUS ) { return ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] & ScannerHelper . C_IDENT_START ) != <NUM_LIT:0> ; } return Character . isJavaIdentifierStart ( c ) ; } public static boolean isJavaIdentifierStart ( long complianceLevel , char c ) { if ( c < MAX_OBVIOUS ) { return ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] & ScannerHelper . C_IDENT_START ) != <NUM_LIT:0> ; } return ScannerHelper . isJavaIdentifierStart ( complianceLevel , ( int ) c ) ; } public static boolean isJavaIdentifierStart ( long complianceLevel , char high , char low ) { return isJavaIdentifierStart ( complianceLevel , toCodePoint ( high , low ) ) ; } public static boolean isJavaIdentifierStart ( long complianceLevel , int codePoint ) { if ( complianceLevel <= ClassFileConstants . JDK1_6 ) { if ( Tables == null ) { initializeTable ( ) ; } switch ( ( codePoint & <NUM_LIT> ) > > <NUM_LIT:16> ) { case <NUM_LIT:0> : return isBitSet ( Tables [ START_INDEX ] [ <NUM_LIT:0> ] , codePoint & <NUM_LIT> ) ; case <NUM_LIT:1> : return isBitSet ( Tables [ START_INDEX ] [ <NUM_LIT:1> ] , codePoint & <NUM_LIT> ) ; case <NUM_LIT:2> : return isBitSet ( Tables [ START_INDEX ] [ <NUM_LIT:2> ] , codePoint & <NUM_LIT> ) ; } } else { if ( Tables7 == null ) { initializeTable17 ( ) ; } switch ( ( codePoint & <NUM_LIT> ) > > <NUM_LIT:16> ) { case <NUM_LIT:0> : return isBitSet ( Tables7 [ START_INDEX ] [ <NUM_LIT:0> ] , codePoint & <NUM_LIT> ) ; case <NUM_LIT:1> : return isBitSet ( Tables7 [ START_INDEX ] [ <NUM_LIT:1> ] , codePoint & <NUM_LIT> ) ; case <NUM_LIT:2> : return isBitSet ( Tables7 [ START_INDEX ] [ <NUM_LIT:2> ] , codePoint & <NUM_LIT> ) ; } } return false ; } private static int toCodePoint ( char high , char low ) { return ( high - Scanner . HIGH_SURROGATE_MIN_VALUE ) * <NUM_LIT> + ( low - Scanner . LOW_SURROGATE_MIN_VALUE ) + <NUM_LIT> ; } public static boolean isDigit ( char c ) throws InvalidInputException { if ( c < ScannerHelper . MAX_OBVIOUS ) { return ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] & ScannerHelper . C_DIGIT ) != <NUM_LIT:0> ; } if ( Character . isDigit ( c ) ) { throw new InvalidInputException ( Scanner . INVALID_DIGIT ) ; } return false ; } public static int digit ( char c , int radix ) { if ( c < ScannerHelper . MAX_OBVIOUS ) { switch ( radix ) { case <NUM_LIT:8> : if ( c >= <NUM_LIT> && c <= <NUM_LIT> ) { return c - <NUM_LIT> ; } return - <NUM_LIT:1> ; case <NUM_LIT:10> : if ( c >= <NUM_LIT> && c <= <NUM_LIT> ) { return c - <NUM_LIT> ; } return - <NUM_LIT:1> ; case <NUM_LIT:16> : if ( c >= <NUM_LIT> && c <= <NUM_LIT> ) { return c - <NUM_LIT> ; } if ( c >= <NUM_LIT> && c <= <NUM_LIT> ) { return c - <NUM_LIT> + <NUM_LIT:10> ; } if ( c >= <NUM_LIT> && c <= <NUM_LIT> ) { return c - <NUM_LIT> + <NUM_LIT:10> ; } return - <NUM_LIT:1> ; } } return Character . digit ( c , radix ) ; } public static int getNumericValue ( char c ) { if ( c < ScannerHelper . MAX_OBVIOUS ) { switch ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] ) { case C_DIGIT : return c - '<CHAR_LIT:0>' ; case C_LOWER_LETTER : return <NUM_LIT:10> + c - '<CHAR_LIT:a>' ; case C_UPPER_LETTER : return <NUM_LIT:10> + c - '<CHAR_LIT:A>' ; } } return Character . getNumericValue ( c ) ; } public static int getHexadecimalValue ( char c ) { switch ( c ) { case '<CHAR_LIT:0>' : return <NUM_LIT:0> ; case '<CHAR_LIT:1>' : return <NUM_LIT:1> ; case '<CHAR_LIT>' : return <NUM_LIT:2> ; case '<CHAR_LIT>' : return <NUM_LIT:3> ; case '<CHAR_LIT>' : return <NUM_LIT:4> ; case '<CHAR_LIT>' : return <NUM_LIT:5> ; case '<CHAR_LIT>' : return <NUM_LIT:6> ; case '<CHAR_LIT>' : return <NUM_LIT:7> ; case '<CHAR_LIT>' : return <NUM_LIT:8> ; case '<CHAR_LIT:9>' : return <NUM_LIT:9> ; case '<CHAR_LIT:A>' : case '<CHAR_LIT:a>' : return <NUM_LIT:10> ; case '<CHAR_LIT>' : case '<CHAR_LIT:b>' : return <NUM_LIT:11> ; case '<CHAR_LIT>' : case '<CHAR_LIT:c>' : return <NUM_LIT:12> ; case '<CHAR_LIT>' : case '<CHAR_LIT>' : return <NUM_LIT> ; case '<CHAR_LIT>' : case '<CHAR_LIT:e>' : return <NUM_LIT> ; case '<CHAR_LIT>' : case '<CHAR_LIT>' : return <NUM_LIT:15> ; default : return - <NUM_LIT:1> ; } } public static char toUpperCase ( char c ) { if ( c < MAX_OBVIOUS ) { if ( ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] & ScannerHelper . C_UPPER_LETTER ) != <NUM_LIT:0> ) { return c ; } else if ( ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] & ScannerHelper . C_LOWER_LETTER ) != <NUM_LIT:0> ) { return ( char ) ( c - <NUM_LIT:32> ) ; } } return Character . toUpperCase ( c ) ; } public static char toLowerCase ( char c ) { if ( c < MAX_OBVIOUS ) { if ( ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] & ScannerHelper . C_LOWER_LETTER ) != <NUM_LIT:0> ) { return c ; } else if ( ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] & ScannerHelper . C_UPPER_LETTER ) != <NUM_LIT:0> ) { return ( char ) ( <NUM_LIT:32> + c ) ; } } return Character . toLowerCase ( c ) ; } public static boolean isLowerCase ( char c ) { if ( c < MAX_OBVIOUS ) { return ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] & ScannerHelper . C_LOWER_LETTER ) != <NUM_LIT:0> ; } return Character . isLowerCase ( c ) ; } public static boolean isUpperCase ( char c ) { if ( c < MAX_OBVIOUS ) { return ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] & ScannerHelper . C_UPPER_LETTER ) != <NUM_LIT:0> ; } return Character . isUpperCase ( c ) ; } public static boolean isWhitespace ( char c ) { if ( c < MAX_OBVIOUS ) { return ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] & ScannerHelper . C_SPACE ) != <NUM_LIT:0> ; } return Character . isWhitespace ( c ) ; } public static boolean isLetter ( char c ) { if ( c < MAX_OBVIOUS ) { return ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] & ( ScannerHelper . C_UPPER_LETTER | ScannerHelper . C_LOWER_LETTER ) ) != <NUM_LIT:0> ; } return Character . isLetter ( c ) ; } public static boolean isLetterOrDigit ( char c ) { if ( c < MAX_OBVIOUS ) { return ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] & ( ScannerHelper . C_UPPER_LETTER | ScannerHelper . C_LOWER_LETTER | ScannerHelper . C_DIGIT ) ) != <NUM_LIT:0> ; } return Character . isLetterOrDigit ( c ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . parser ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . core . compiler . InvalidInputException ; import org . eclipse . jdt . internal . compiler . CompilationResult ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . util . Util ; public class Scanner implements TerminalTokens { public long sourceLevel ; public long complianceLevel ; public boolean useAssertAsAnIndentifier = false ; public boolean containsAssertKeyword = false ; public boolean useEnumAsAnIndentifier = false ; public boolean recordLineSeparator = false ; public char currentCharacter ; public int startPosition ; public int currentPosition ; public int initialPosition , eofPosition ; public boolean skipComments = false ; public boolean tokenizeComments = false ; public boolean tokenizeWhiteSpace = false ; public char source [ ] ; public char [ ] withoutUnicodeBuffer ; public int withoutUnicodePtr ; public boolean unicodeAsBackSlash = false ; public boolean scanningFloatLiteral = false ; public final static int COMMENT_ARRAYS_SIZE = <NUM_LIT:30> ; public int [ ] commentStops = new int [ COMMENT_ARRAYS_SIZE ] ; public int [ ] commentStarts = new int [ COMMENT_ARRAYS_SIZE ] ; public int [ ] commentTagStarts = new int [ COMMENT_ARRAYS_SIZE ] ; public int commentPtr = - <NUM_LIT:1> ; protected int lastCommentLinePosition = - <NUM_LIT:1> ; public char [ ] [ ] foundTaskTags = null ; public char [ ] [ ] foundTaskMessages ; public char [ ] [ ] foundTaskPriorities = null ; public int [ ] [ ] foundTaskPositions ; public int foundTaskCount = <NUM_LIT:0> ; public char [ ] [ ] taskTags = null ; public char [ ] [ ] taskPriorities = null ; public boolean isTaskCaseSensitive = true ; public boolean diet = false ; public int [ ] lineEnds = new int [ <NUM_LIT> ] ; public int linePtr = - <NUM_LIT:1> ; public boolean wasAcr = false ; public static final String END_OF_SOURCE = "<STR_LIT>" ; public static final String INVALID_HEXA = "<STR_LIT>" ; public static final String INVALID_OCTAL = "<STR_LIT>" ; public static final String INVALID_CHARACTER_CONSTANT = "<STR_LIT>" ; public static final String INVALID_ESCAPE = "<STR_LIT>" ; public static final String INVALID_INPUT = "<STR_LIT>" ; public static final String INVALID_UNICODE_ESCAPE = "<STR_LIT>" ; public static final String INVALID_FLOAT = "<STR_LIT>" ; public static final String INVALID_LOW_SURROGATE = "<STR_LIT>" ; public static final String INVALID_HIGH_SURROGATE = "<STR_LIT>" ; public static final String NULL_SOURCE_STRING = "<STR_LIT>" ; public static final String UNTERMINATED_STRING = "<STR_LIT>" ; public static final String UNTERMINATED_COMMENT = "<STR_LIT>" ; public static final String INVALID_CHAR_IN_STRING = "<STR_LIT>" ; public static final String INVALID_DIGIT = "<STR_LIT>" ; private static final int [ ] EMPTY_LINE_ENDS = Util . EMPTY_INT_ARRAY ; public static final String INVALID_BINARY = "<STR_LIT>" ; public static final String BINARY_LITERAL_NOT_BELOW_17 = "<STR_LIT>" ; public static final String ILLEGAL_HEXA_LITERAL = "<STR_LIT>" ; public static final String INVALID_UNDERSCORE = "<STR_LIT>" ; public static final String UNDERSCORES_IN_LITERALS_NOT_BELOW_17 = "<STR_LIT>" ; static final char [ ] charArray_a = new char [ ] { '<CHAR_LIT:a>' } , charArray_b = new char [ ] { '<CHAR_LIT:b>' } , charArray_c = new char [ ] { '<CHAR_LIT:c>' } , charArray_d = new char [ ] { '<CHAR_LIT>' } , charArray_e = new char [ ] { '<CHAR_LIT:e>' } , charArray_f = new char [ ] { '<CHAR_LIT>' } , charArray_g = new char [ ] { '<CHAR_LIT>' } , charArray_h = new char [ ] { '<CHAR_LIT>' } , charArray_i = new char [ ] { '<CHAR_LIT>' } , charArray_j = new char [ ] { '<CHAR_LIT>' } , charArray_k = new char [ ] { '<CHAR_LIT>' } , charArray_l = new char [ ] { '<CHAR_LIT>' } , charArray_m = new char [ ] { '<CHAR_LIT>' } , charArray_n = new char [ ] { '<CHAR_LIT>' } , charArray_o = new char [ ] { '<CHAR_LIT>' } , charArray_p = new char [ ] { '<CHAR_LIT>' } , charArray_q = new char [ ] { '<CHAR_LIT>' } , charArray_r = new char [ ] { '<CHAR_LIT>' } , charArray_s = new char [ ] { '<CHAR_LIT>' } , charArray_t = new char [ ] { '<CHAR_LIT>' } , charArray_u = new char [ ] { '<CHAR_LIT>' } , charArray_v = new char [ ] { '<CHAR_LIT>' } , charArray_w = new char [ ] { '<CHAR_LIT>' } , charArray_x = new char [ ] { '<CHAR_LIT>' } , charArray_y = new char [ ] { '<CHAR_LIT>' } , charArray_z = new char [ ] { '<CHAR_LIT>' } ; static final char [ ] initCharArray = new char [ ] { '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' } ; static final int TableSize = <NUM_LIT:30> , InternalTableSize = <NUM_LIT:6> ; public static final int OptimizedLength = <NUM_LIT:7> ; public final char [ ] [ ] [ ] [ ] charArray_length = new char [ OptimizedLength ] [ TableSize ] [ InternalTableSize ] [ ] ; public static final char [ ] TAG_PREFIX = "<STR_LIT>" . toCharArray ( ) ; public static final int TAG_PREFIX_LENGTH = TAG_PREFIX . length ; public static final char TAG_POSTFIX = '<CHAR_LIT>' ; public static final int TAG_POSTFIX_LENGTH = <NUM_LIT:1> ; private NLSTag [ ] nlsTags = null ; protected int nlsTagsPtr ; public boolean checkNonExternalizedStringLiterals ; protected int lastPosition ; public boolean returnOnlyGreater = false ; { for ( int i = <NUM_LIT:0> ; i < <NUM_LIT:6> ; i ++ ) { for ( int j = <NUM_LIT:0> ; j < TableSize ; j ++ ) { for ( int k = <NUM_LIT:0> ; k < InternalTableSize ; k ++ ) { this . charArray_length [ i ] [ j ] [ k ] = initCharArray ; } } } } int newEntry2 = <NUM_LIT:0> , newEntry3 = <NUM_LIT:0> , newEntry4 = <NUM_LIT:0> , newEntry5 = <NUM_LIT:0> , newEntry6 = <NUM_LIT:0> ; public boolean insideRecovery = false ; public static final int RoundBracket = <NUM_LIT:0> ; public static final int SquareBracket = <NUM_LIT:1> ; public static final int CurlyBracket = <NUM_LIT:2> ; public static final int BracketKinds = <NUM_LIT:3> ; public static final int LOW_SURROGATE_MIN_VALUE = <NUM_LIT> ; public static final int HIGH_SURROGATE_MIN_VALUE = <NUM_LIT> ; public static final int HIGH_SURROGATE_MAX_VALUE = <NUM_LIT> ; public static final int LOW_SURROGATE_MAX_VALUE = <NUM_LIT> ; public Scanner ( ) { this ( false , false , false , ClassFileConstants . JDK1_3 , null , null , true ) ; } public Scanner ( boolean tokenizeComments , boolean tokenizeWhiteSpace , boolean checkNonExternalizedStringLiterals , long sourceLevel , long complianceLevel , char [ ] [ ] taskTags , char [ ] [ ] taskPriorities , boolean isTaskCaseSensitive ) { this . eofPosition = Integer . MAX_VALUE ; this . tokenizeComments = tokenizeComments ; this . tokenizeWhiteSpace = tokenizeWhiteSpace ; this . sourceLevel = sourceLevel ; this . complianceLevel = complianceLevel ; this . checkNonExternalizedStringLiterals = checkNonExternalizedStringLiterals ; if ( taskTags != null ) { int taskTagsLength = taskTags . length ; int length = taskTagsLength ; if ( taskPriorities != null ) { int taskPrioritiesLength = taskPriorities . length ; if ( taskPrioritiesLength != taskTagsLength ) { if ( taskPrioritiesLength > taskTagsLength ) { System . arraycopy ( taskPriorities , <NUM_LIT:0> , ( taskPriorities = new char [ taskTagsLength ] [ ] ) , <NUM_LIT:0> , taskTagsLength ) ; } else { System . arraycopy ( taskTags , <NUM_LIT:0> , ( taskTags = new char [ taskPrioritiesLength ] [ ] ) , <NUM_LIT:0> , taskPrioritiesLength ) ; length = taskPrioritiesLength ; } } int [ ] initialIndexes = new int [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { initialIndexes [ i ] = i ; } Util . reverseQuickSort ( taskTags , <NUM_LIT:0> , length - <NUM_LIT:1> , initialIndexes ) ; char [ ] [ ] temp = new char [ length ] [ ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { temp [ i ] = taskPriorities [ initialIndexes [ i ] ] ; } this . taskPriorities = temp ; } else { Util . reverseQuickSort ( taskTags , <NUM_LIT:0> , length - <NUM_LIT:1> ) ; } this . taskTags = taskTags ; this . isTaskCaseSensitive = isTaskCaseSensitive ; } } public Scanner ( boolean tokenizeComments , boolean tokenizeWhiteSpace , boolean checkNonExternalizedStringLiterals , long sourceLevel , char [ ] [ ] taskTags , char [ ] [ ] taskPriorities , boolean isTaskCaseSensitive ) { this ( tokenizeComments , tokenizeWhiteSpace , checkNonExternalizedStringLiterals , sourceLevel , sourceLevel , taskTags , taskPriorities , isTaskCaseSensitive ) ; } public final boolean atEnd ( ) { return this . eofPosition <= this . currentPosition ; } public void checkTaskTag ( int commentStart , int commentEnd ) throws InvalidInputException { char [ ] src = this . source ; if ( this . foundTaskCount > <NUM_LIT:0> && this . foundTaskPositions [ this . foundTaskCount - <NUM_LIT:1> ] [ <NUM_LIT:0> ] >= commentStart ) { return ; } int foundTaskIndex = this . foundTaskCount ; char previous = src [ commentStart + <NUM_LIT:1> ] ; for ( int i = commentStart + <NUM_LIT:2> ; i < commentEnd && i < this . eofPosition ; i ++ ) { char [ ] tag = null ; char [ ] priority = null ; if ( previous != '<CHAR_LIT>' ) { nextTag : for ( int itag = <NUM_LIT:0> ; itag < this . taskTags . length ; itag ++ ) { tag = this . taskTags [ itag ] ; int tagLength = tag . length ; if ( tagLength == <NUM_LIT:0> ) continue nextTag ; if ( ScannerHelper . isJavaIdentifierStart ( this . complianceLevel , tag [ <NUM_LIT:0> ] ) ) { if ( ScannerHelper . isJavaIdentifierPart ( this . complianceLevel , previous ) ) { continue nextTag ; } } for ( int t = <NUM_LIT:0> ; t < tagLength ; t ++ ) { char sc , tc ; int x = i + t ; if ( x >= this . eofPosition || x >= commentEnd ) continue nextTag ; if ( ( sc = src [ i + t ] ) != ( tc = tag [ t ] ) ) { if ( this . isTaskCaseSensitive || ( ScannerHelper . toLowerCase ( sc ) != ScannerHelper . toLowerCase ( tc ) ) ) { continue nextTag ; } } } if ( i + tagLength < commentEnd && ScannerHelper . isJavaIdentifierPart ( this . complianceLevel , src [ i + tagLength - <NUM_LIT:1> ] ) ) { if ( ScannerHelper . isJavaIdentifierPart ( this . complianceLevel , src [ i + tagLength ] ) ) continue nextTag ; } if ( this . foundTaskTags == null ) { this . foundTaskTags = new char [ <NUM_LIT:5> ] [ ] ; this . foundTaskMessages = new char [ <NUM_LIT:5> ] [ ] ; this . foundTaskPriorities = new char [ <NUM_LIT:5> ] [ ] ; this . foundTaskPositions = new int [ <NUM_LIT:5> ] [ ] ; } else if ( this . foundTaskCount == this . foundTaskTags . length ) { System . arraycopy ( this . foundTaskTags , <NUM_LIT:0> , this . foundTaskTags = new char [ this . foundTaskCount * <NUM_LIT:2> ] [ ] , <NUM_LIT:0> , this . foundTaskCount ) ; System . arraycopy ( this . foundTaskMessages , <NUM_LIT:0> , this . foundTaskMessages = new char [ this . foundTaskCount * <NUM_LIT:2> ] [ ] , <NUM_LIT:0> , this . foundTaskCount ) ; System . arraycopy ( this . foundTaskPriorities , <NUM_LIT:0> , this . foundTaskPriorities = new char [ this . foundTaskCount * <NUM_LIT:2> ] [ ] , <NUM_LIT:0> , this . foundTaskCount ) ; System . arraycopy ( this . foundTaskPositions , <NUM_LIT:0> , this . foundTaskPositions = new int [ this . foundTaskCount * <NUM_LIT:2> ] [ ] , <NUM_LIT:0> , this . foundTaskCount ) ; } priority = this . taskPriorities != null && itag < this . taskPriorities . length ? this . taskPriorities [ itag ] : null ; this . foundTaskTags [ this . foundTaskCount ] = tag ; this . foundTaskPriorities [ this . foundTaskCount ] = priority ; this . foundTaskPositions [ this . foundTaskCount ] = new int [ ] { i , i + tagLength - <NUM_LIT:1> } ; this . foundTaskMessages [ this . foundTaskCount ] = CharOperation . NO_CHAR ; this . foundTaskCount ++ ; i += tagLength - <NUM_LIT:1> ; break nextTag ; } } previous = src [ i ] ; } boolean containsEmptyTask = false ; for ( int i = foundTaskIndex ; i < this . foundTaskCount ; i ++ ) { int msgStart = this . foundTaskPositions [ i ] [ <NUM_LIT:0> ] + this . foundTaskTags [ i ] . length ; int max_value = i + <NUM_LIT:1> < this . foundTaskCount ? this . foundTaskPositions [ i + <NUM_LIT:1> ] [ <NUM_LIT:0> ] - <NUM_LIT:1> : commentEnd - <NUM_LIT:1> ; if ( max_value < msgStart ) { max_value = msgStart ; } int end = - <NUM_LIT:1> ; char c ; for ( int j = msgStart ; j < max_value ; j ++ ) { if ( ( c = src [ j ] ) == '<STR_LIT:\n>' || c == '<STR_LIT>' ) { end = j - <NUM_LIT:1> ; break ; } } if ( end == - <NUM_LIT:1> ) { for ( int j = max_value ; j > msgStart ; j -- ) { if ( ( c = src [ j ] ) == '<CHAR_LIT>' ) { end = j - <NUM_LIT:1> ; break ; } } if ( end == - <NUM_LIT:1> ) end = max_value ; } if ( msgStart == end ) { containsEmptyTask = true ; continue ; } while ( CharOperation . isWhitespace ( src [ end ] ) && msgStart <= end ) end -- ; this . foundTaskPositions [ i ] [ <NUM_LIT:1> ] = end ; final int messageLength = end - msgStart + <NUM_LIT:1> ; char [ ] message = new char [ messageLength ] ; System . arraycopy ( src , msgStart , message , <NUM_LIT:0> , messageLength ) ; this . foundTaskMessages [ i ] = message ; } if ( containsEmptyTask ) { for ( int i = foundTaskIndex , max = this . foundTaskCount ; i < max ; i ++ ) { if ( this . foundTaskMessages [ i ] . length == <NUM_LIT:0> ) { loop : for ( int j = i + <NUM_LIT:1> ; j < max ; j ++ ) { if ( this . foundTaskMessages [ j ] . length != <NUM_LIT:0> ) { this . foundTaskMessages [ i ] = this . foundTaskMessages [ j ] ; this . foundTaskPositions [ i ] [ <NUM_LIT:1> ] = this . foundTaskPositions [ j ] [ <NUM_LIT:1> ] ; break loop ; } } } } } } public char [ ] getCurrentIdentifierSource ( ) { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { char [ ] result = new char [ this . withoutUnicodePtr ] ; System . arraycopy ( this . withoutUnicodeBuffer , <NUM_LIT:1> , result , <NUM_LIT:0> , this . withoutUnicodePtr ) ; return result ; } int length = this . currentPosition - this . startPosition ; if ( length == this . eofPosition ) return this . source ; switch ( length ) { case <NUM_LIT:1> : return optimizedCurrentTokenSource1 ( ) ; case <NUM_LIT:2> : return optimizedCurrentTokenSource2 ( ) ; case <NUM_LIT:3> : return optimizedCurrentTokenSource3 ( ) ; case <NUM_LIT:4> : return optimizedCurrentTokenSource4 ( ) ; case <NUM_LIT:5> : return optimizedCurrentTokenSource5 ( ) ; case <NUM_LIT:6> : return optimizedCurrentTokenSource6 ( ) ; } char [ ] result = new char [ length ] ; System . arraycopy ( this . source , this . startPosition , result , <NUM_LIT:0> , length ) ; return result ; } public int getCurrentTokenEndPosition ( ) { return this . currentPosition - <NUM_LIT:1> ; } public char [ ] getCurrentTokenSource ( ) { char [ ] result ; if ( this . withoutUnicodePtr != <NUM_LIT:0> ) System . arraycopy ( this . withoutUnicodeBuffer , <NUM_LIT:1> , result = new char [ this . withoutUnicodePtr ] , <NUM_LIT:0> , this . withoutUnicodePtr ) ; else { int length ; System . arraycopy ( this . source , this . startPosition , result = new char [ length = this . currentPosition - this . startPosition ] , <NUM_LIT:0> , length ) ; } return result ; } public final String getCurrentTokenString ( ) { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { return new String ( this . withoutUnicodeBuffer , <NUM_LIT:1> , this . withoutUnicodePtr ) ; } return new String ( this . source , this . startPosition , this . currentPosition - this . startPosition ) ; } public char [ ] getCurrentTokenSourceString ( ) { char [ ] result ; if ( this . withoutUnicodePtr != <NUM_LIT:0> ) System . arraycopy ( this . withoutUnicodeBuffer , <NUM_LIT:2> , result = new char [ this . withoutUnicodePtr - <NUM_LIT:2> ] , <NUM_LIT:0> , this . withoutUnicodePtr - <NUM_LIT:2> ) ; else { int length ; System . arraycopy ( this . source , this . startPosition + <NUM_LIT:1> , result = new char [ length = this . currentPosition - this . startPosition - <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; } return result ; } public final String getCurrentStringLiteral ( ) { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) return new String ( this . withoutUnicodeBuffer , <NUM_LIT:2> , this . withoutUnicodePtr - <NUM_LIT:2> ) ; else { return new String ( this . source , this . startPosition + <NUM_LIT:1> , this . currentPosition - this . startPosition - <NUM_LIT:2> ) ; } } public final char [ ] getRawTokenSource ( ) { int length = this . currentPosition - this . startPosition ; char [ ] tokenSource = new char [ length ] ; System . arraycopy ( this . source , this . startPosition , tokenSource , <NUM_LIT:0> , length ) ; return tokenSource ; } public final char [ ] getRawTokenSourceEnd ( ) { int length = this . eofPosition - this . currentPosition - <NUM_LIT:1> ; char [ ] sourceEnd = new char [ length ] ; System . arraycopy ( this . source , this . currentPosition , sourceEnd , <NUM_LIT:0> , length ) ; return sourceEnd ; } public int getCurrentTokenStartPosition ( ) { return this . startPosition ; } public final int getLineEnd ( int lineNumber ) { if ( this . lineEnds == null || this . linePtr == - <NUM_LIT:1> ) return - <NUM_LIT:1> ; if ( lineNumber > this . lineEnds . length + <NUM_LIT:1> ) return - <NUM_LIT:1> ; if ( lineNumber <= <NUM_LIT:0> ) return - <NUM_LIT:1> ; if ( lineNumber == this . lineEnds . length + <NUM_LIT:1> ) return this . eofPosition ; return this . lineEnds [ lineNumber - <NUM_LIT:1> ] ; } public final int [ ] getLineEnds ( ) { if ( this . linePtr == - <NUM_LIT:1> ) { return EMPTY_LINE_ENDS ; } int [ ] copy ; System . arraycopy ( this . lineEnds , <NUM_LIT:0> , copy = new int [ this . linePtr + <NUM_LIT:1> ] , <NUM_LIT:0> , this . linePtr + <NUM_LIT:1> ) ; return copy ; } public final int getLineStart ( int lineNumber ) { if ( this . lineEnds == null || this . linePtr == - <NUM_LIT:1> ) return - <NUM_LIT:1> ; if ( lineNumber > this . lineEnds . length + <NUM_LIT:1> ) return - <NUM_LIT:1> ; if ( lineNumber <= <NUM_LIT:0> ) return - <NUM_LIT:1> ; if ( lineNumber == <NUM_LIT:1> ) return this . initialPosition ; return this . lineEnds [ lineNumber - <NUM_LIT:2> ] + <NUM_LIT:1> ; } public final int getNextChar ( ) { try { if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; } else { this . unicodeAsBackSlash = false ; if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } return this . currentCharacter ; } catch ( IndexOutOfBoundsException e ) { return - <NUM_LIT:1> ; } catch ( InvalidInputException e ) { return - <NUM_LIT:1> ; } } public final int getNextCharWithBoundChecks ( ) { if ( this . currentPosition >= this . eofPosition ) { return - <NUM_LIT:1> ; } this . currentCharacter = this . source [ this . currentPosition ++ ] ; if ( this . currentPosition >= this . eofPosition ) { this . unicodeAsBackSlash = false ; if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } return this . currentCharacter ; } if ( this . currentCharacter == '<STR_LIT:\\>' && this . source [ this . currentPosition ] == '<CHAR_LIT>' ) { try { getNextUnicodeChar ( ) ; } catch ( InvalidInputException e ) { return - <NUM_LIT:1> ; } } else { this . unicodeAsBackSlash = false ; if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } return this . currentCharacter ; } public final boolean getNextChar ( char testedChar ) { if ( this . currentPosition >= this . eofPosition ) { this . unicodeAsBackSlash = false ; return false ; } int temp = this . currentPosition ; try { if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; if ( this . currentCharacter != testedChar ) { this . currentPosition = temp ; this . withoutUnicodePtr -- ; return false ; } return true ; } else { if ( this . currentCharacter != testedChar ) { this . currentPosition = temp ; return false ; } this . unicodeAsBackSlash = false ; if ( this . withoutUnicodePtr != <NUM_LIT:0> ) unicodeStore ( ) ; return true ; } } catch ( IndexOutOfBoundsException e ) { this . unicodeAsBackSlash = false ; this . currentPosition = temp ; return false ; } catch ( InvalidInputException e ) { this . unicodeAsBackSlash = false ; this . currentPosition = temp ; return false ; } } public final int getNextChar ( char testedChar1 , char testedChar2 ) { if ( this . currentPosition >= this . eofPosition ) return - <NUM_LIT:1> ; int temp = this . currentPosition ; try { int result ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; if ( this . currentCharacter == testedChar1 ) { result = <NUM_LIT:0> ; } else if ( this . currentCharacter == testedChar2 ) { result = <NUM_LIT:1> ; } else { this . currentPosition = temp ; this . withoutUnicodePtr -- ; result = - <NUM_LIT:1> ; } return result ; } else { if ( this . currentCharacter == testedChar1 ) { result = <NUM_LIT:0> ; } else if ( this . currentCharacter == testedChar2 ) { result = <NUM_LIT:1> ; } else { this . currentPosition = temp ; return - <NUM_LIT:1> ; } if ( this . withoutUnicodePtr != <NUM_LIT:0> ) unicodeStore ( ) ; return result ; } } catch ( IndexOutOfBoundsException e ) { this . currentPosition = temp ; return - <NUM_LIT:1> ; } catch ( InvalidInputException e ) { this . currentPosition = temp ; return - <NUM_LIT:1> ; } } private final void consumeDigits ( int radix ) throws InvalidInputException { consumeDigits ( radix , false ) ; } private final void consumeDigits ( int radix , boolean expectingDigitFirst ) throws InvalidInputException { final int USING_UNDERSCORE = <NUM_LIT:1> ; final int INVALID_POSITION = <NUM_LIT:2> ; switch ( consumeDigits0 ( radix , USING_UNDERSCORE , INVALID_POSITION , expectingDigitFirst ) ) { case USING_UNDERSCORE : if ( this . sourceLevel < ClassFileConstants . JDK1_7 ) { throw new InvalidInputException ( UNDERSCORES_IN_LITERALS_NOT_BELOW_17 ) ; } break ; case INVALID_POSITION : if ( this . sourceLevel < ClassFileConstants . JDK1_7 ) { throw new InvalidInputException ( UNDERSCORES_IN_LITERALS_NOT_BELOW_17 ) ; } throw new InvalidInputException ( INVALID_UNDERSCORE ) ; } } private final int consumeDigits0 ( int radix , int usingUnderscore , int invalidPosition , boolean expectingDigitFirst ) throws InvalidInputException { int kind = <NUM_LIT:0> ; if ( getNextChar ( '<CHAR_LIT:_>' ) ) { if ( expectingDigitFirst ) { return invalidPosition ; } kind = usingUnderscore ; while ( getNextChar ( '<CHAR_LIT:_>' ) ) { } } if ( getNextCharAsDigit ( radix ) ) { while ( getNextCharAsDigit ( radix ) ) { } int kind2 = consumeDigits0 ( radix , usingUnderscore , invalidPosition , false ) ; if ( kind2 == <NUM_LIT:0> ) { return kind ; } return kind2 ; } if ( kind == usingUnderscore ) return invalidPosition ; return kind ; } public final boolean getNextCharAsDigit ( ) throws InvalidInputException { if ( this . currentPosition >= this . eofPosition ) return false ; int temp = this . currentPosition ; try { if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; if ( ! ScannerHelper . isDigit ( this . currentCharacter ) ) { this . currentPosition = temp ; this . withoutUnicodePtr -- ; return false ; } return true ; } else { if ( ! ScannerHelper . isDigit ( this . currentCharacter ) ) { this . currentPosition = temp ; return false ; } if ( this . withoutUnicodePtr != <NUM_LIT:0> ) unicodeStore ( ) ; return true ; } } catch ( IndexOutOfBoundsException e ) { this . currentPosition = temp ; return false ; } catch ( InvalidInputException e ) { this . currentPosition = temp ; return false ; } } public final boolean getNextCharAsDigit ( int radix ) { if ( this . currentPosition >= this . eofPosition ) return false ; int temp = this . currentPosition ; try { if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; if ( ScannerHelper . digit ( this . currentCharacter , radix ) == - <NUM_LIT:1> ) { this . currentPosition = temp ; this . withoutUnicodePtr -- ; return false ; } return true ; } else { if ( ScannerHelper . digit ( this . currentCharacter , radix ) == - <NUM_LIT:1> ) { this . currentPosition = temp ; return false ; } if ( this . withoutUnicodePtr != <NUM_LIT:0> ) unicodeStore ( ) ; return true ; } } catch ( IndexOutOfBoundsException e ) { this . currentPosition = temp ; return false ; } catch ( InvalidInputException e ) { this . currentPosition = temp ; return false ; } } public boolean getNextCharAsJavaIdentifierPartWithBoundCheck ( ) { int pos = this . currentPosition ; if ( pos >= this . eofPosition ) return false ; int temp2 = this . withoutUnicodePtr ; try { boolean unicode = false ; this . currentCharacter = this . source [ this . currentPosition ++ ] ; if ( this . currentPosition < this . eofPosition ) { if ( this . currentCharacter == '<STR_LIT:\\>' && this . source [ this . currentPosition ] == '<CHAR_LIT>' ) { getNextUnicodeChar ( ) ; unicode = true ; } } char c = this . currentCharacter ; boolean isJavaIdentifierPart = false ; if ( c >= HIGH_SURROGATE_MIN_VALUE && c <= HIGH_SURROGATE_MAX_VALUE ) { if ( this . complianceLevel < ClassFileConstants . JDK1_5 ) { this . currentPosition = pos ; this . withoutUnicodePtr = temp2 ; return false ; } char low = ( char ) getNextCharWithBoundChecks ( ) ; if ( low < LOW_SURROGATE_MIN_VALUE || low > LOW_SURROGATE_MAX_VALUE ) { this . currentPosition = pos ; this . withoutUnicodePtr = temp2 ; return false ; } isJavaIdentifierPart = ScannerHelper . isJavaIdentifierPart ( this . complianceLevel , c , low ) ; } else if ( c >= LOW_SURROGATE_MIN_VALUE && c <= LOW_SURROGATE_MAX_VALUE ) { this . currentPosition = pos ; this . withoutUnicodePtr = temp2 ; return false ; } else { isJavaIdentifierPart = ScannerHelper . isJavaIdentifierPart ( this . complianceLevel , c ) ; } if ( unicode ) { if ( ! isJavaIdentifierPart ) { this . currentPosition = pos ; this . withoutUnicodePtr = temp2 ; return false ; } return true ; } else { if ( ! isJavaIdentifierPart ) { this . currentPosition = pos ; return false ; } if ( this . withoutUnicodePtr != <NUM_LIT:0> ) unicodeStore ( ) ; return true ; } } catch ( InvalidInputException e ) { this . currentPosition = pos ; this . withoutUnicodePtr = temp2 ; return false ; } } public boolean getNextCharAsJavaIdentifierPart ( ) { int pos ; if ( ( pos = this . currentPosition ) >= this . eofPosition ) return false ; int temp2 = this . withoutUnicodePtr ; try { boolean unicode = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; unicode = true ; } char c = this . currentCharacter ; boolean isJavaIdentifierPart = false ; if ( c >= HIGH_SURROGATE_MIN_VALUE && c <= HIGH_SURROGATE_MAX_VALUE ) { if ( this . complianceLevel < ClassFileConstants . JDK1_5 ) { this . currentPosition = pos ; this . withoutUnicodePtr = temp2 ; return false ; } char low = ( char ) getNextChar ( ) ; if ( low < LOW_SURROGATE_MIN_VALUE || low > LOW_SURROGATE_MAX_VALUE ) { this . currentPosition = pos ; this . withoutUnicodePtr = temp2 ; return false ; } isJavaIdentifierPart = ScannerHelper . isJavaIdentifierPart ( this . complianceLevel , c , low ) ; } else if ( c >= LOW_SURROGATE_MIN_VALUE && c <= LOW_SURROGATE_MAX_VALUE ) { this . currentPosition = pos ; this . withoutUnicodePtr = temp2 ; return false ; } else { isJavaIdentifierPart = ScannerHelper . isJavaIdentifierPart ( this . complianceLevel , c ) ; } if ( unicode ) { if ( ! isJavaIdentifierPart ) { this . currentPosition = pos ; this . withoutUnicodePtr = temp2 ; return false ; } return true ; } else { if ( ! isJavaIdentifierPart ) { this . currentPosition = pos ; return false ; } if ( this . withoutUnicodePtr != <NUM_LIT:0> ) unicodeStore ( ) ; return true ; } } catch ( IndexOutOfBoundsException e ) { this . currentPosition = pos ; this . withoutUnicodePtr = temp2 ; return false ; } catch ( InvalidInputException e ) { this . currentPosition = pos ; this . withoutUnicodePtr = temp2 ; return false ; } } public int scanIdentifier ( ) throws InvalidInputException { int whiteStart = <NUM_LIT:0> ; while ( true ) { this . withoutUnicodePtr = <NUM_LIT:0> ; whiteStart = this . currentPosition ; boolean isWhiteSpace , hasWhiteSpaces = false ; int offset ; int unicodePtr ; boolean checkIfUnicode = false ; do { unicodePtr = this . withoutUnicodePtr ; offset = this . currentPosition ; this . startPosition = this . currentPosition ; if ( this . currentPosition < this . eofPosition ) { this . currentCharacter = this . source [ this . currentPosition ++ ] ; checkIfUnicode = this . currentPosition < this . eofPosition && this . currentCharacter == '<STR_LIT:\\>' && this . source [ this . currentPosition ] == '<CHAR_LIT>' ; } else if ( this . tokenizeWhiteSpace && ( whiteStart != this . currentPosition - <NUM_LIT:1> ) ) { this . currentPosition -- ; this . startPosition = whiteStart ; return TokenNameWHITESPACE ; } else { return TokenNameEOF ; } if ( checkIfUnicode ) { isWhiteSpace = jumpOverUnicodeWhiteSpace ( ) ; offset = this . currentPosition - offset ; } else { offset = this . currentPosition - offset ; switch ( this . currentCharacter ) { case <NUM_LIT:10> : case <NUM_LIT:12> : case <NUM_LIT> : case <NUM_LIT:32> : case <NUM_LIT:9> : isWhiteSpace = true ; break ; default : isWhiteSpace = false ; } } if ( isWhiteSpace ) { hasWhiteSpaces = true ; } } while ( isWhiteSpace ) ; if ( hasWhiteSpaces ) { if ( this . tokenizeWhiteSpace ) { this . currentPosition -= offset ; this . startPosition = whiteStart ; if ( checkIfUnicode ) { this . withoutUnicodePtr = unicodePtr ; } return TokenNameWHITESPACE ; } else if ( checkIfUnicode ) { this . withoutUnicodePtr = <NUM_LIT:0> ; unicodeStore ( ) ; } else { this . withoutUnicodePtr = <NUM_LIT:0> ; } } char c = this . currentCharacter ; if ( c < ScannerHelper . MAX_OBVIOUS ) { if ( ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] & ScannerHelper . C_IDENT_START ) != <NUM_LIT:0> ) { return scanIdentifierOrKeywordWithBoundCheck ( ) ; } return TokenNameERROR ; } boolean isJavaIdStart ; if ( c >= HIGH_SURROGATE_MIN_VALUE && c <= HIGH_SURROGATE_MAX_VALUE ) { if ( this . complianceLevel < ClassFileConstants . JDK1_5 ) { throw new InvalidInputException ( INVALID_UNICODE_ESCAPE ) ; } char low = ( char ) getNextCharWithBoundChecks ( ) ; if ( low < LOW_SURROGATE_MIN_VALUE || low > LOW_SURROGATE_MAX_VALUE ) { throw new InvalidInputException ( INVALID_LOW_SURROGATE ) ; } isJavaIdStart = ScannerHelper . isJavaIdentifierStart ( this . complianceLevel , c , low ) ; } else if ( c >= LOW_SURROGATE_MIN_VALUE && c <= LOW_SURROGATE_MAX_VALUE ) { if ( this . complianceLevel < ClassFileConstants . JDK1_5 ) { throw new InvalidInputException ( INVALID_UNICODE_ESCAPE ) ; } throw new InvalidInputException ( INVALID_HIGH_SURROGATE ) ; } else { isJavaIdStart = ScannerHelper . isJavaIdentifierStart ( this . complianceLevel , c ) ; } if ( isJavaIdStart ) return scanIdentifierOrKeywordWithBoundCheck ( ) ; return TokenNameERROR ; } } public int getNextToken ( ) throws InvalidInputException { this . wasAcr = false ; if ( this . diet ) { jumpOverMethodBody ( ) ; this . diet = false ; return this . currentPosition > this . eofPosition ? TokenNameEOF : TokenNameRBRACE ; } int whiteStart = <NUM_LIT:0> ; try { while ( true ) { this . withoutUnicodePtr = <NUM_LIT:0> ; whiteStart = this . currentPosition ; boolean isWhiteSpace , hasWhiteSpaces = false ; int offset ; int unicodePtr ; boolean checkIfUnicode = false ; do { unicodePtr = this . withoutUnicodePtr ; offset = this . currentPosition ; this . startPosition = this . currentPosition ; try { checkIfUnicode = ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ; } catch ( IndexOutOfBoundsException e ) { if ( this . tokenizeWhiteSpace && ( whiteStart != this . currentPosition - <NUM_LIT:1> ) ) { this . currentPosition -- ; this . startPosition = whiteStart ; return TokenNameWHITESPACE ; } if ( this . currentPosition > this . eofPosition ) return TokenNameEOF ; } if ( this . currentPosition > this . eofPosition ) { if ( this . tokenizeWhiteSpace && ( whiteStart != this . currentPosition - <NUM_LIT:1> ) ) { this . currentPosition -- ; this . startPosition = whiteStart ; return TokenNameWHITESPACE ; } return TokenNameEOF ; } if ( checkIfUnicode ) { isWhiteSpace = jumpOverUnicodeWhiteSpace ( ) ; offset = this . currentPosition - offset ; } else { offset = this . currentPosition - offset ; if ( ( this . currentCharacter == '<STR_LIT>' ) || ( this . currentCharacter == '<STR_LIT:\n>' ) ) { if ( this . recordLineSeparator ) { pushLineSeparator ( ) ; } } switch ( this . currentCharacter ) { case <NUM_LIT:10> : case <NUM_LIT:12> : case <NUM_LIT> : case <NUM_LIT:32> : case <NUM_LIT:9> : isWhiteSpace = true ; break ; default : isWhiteSpace = false ; } } if ( isWhiteSpace ) { hasWhiteSpaces = true ; } } while ( isWhiteSpace ) ; if ( hasWhiteSpaces ) { if ( this . tokenizeWhiteSpace ) { this . currentPosition -= offset ; this . startPosition = whiteStart ; if ( checkIfUnicode ) { this . withoutUnicodePtr = unicodePtr ; } return TokenNameWHITESPACE ; } else if ( checkIfUnicode ) { this . withoutUnicodePtr = <NUM_LIT:0> ; unicodeStore ( ) ; } else { this . withoutUnicodePtr = <NUM_LIT:0> ; } } switch ( this . currentCharacter ) { case '<CHAR_LIT>' : return TokenNameAT ; case '<CHAR_LIT:(>' : return TokenNameLPAREN ; case '<CHAR_LIT:)>' : return TokenNameRPAREN ; case '<CHAR_LIT>' : return TokenNameLBRACE ; case '<CHAR_LIT:}>' : return TokenNameRBRACE ; case '<CHAR_LIT:[>' : return TokenNameLBRACKET ; case '<CHAR_LIT:]>' : return TokenNameRBRACKET ; case '<CHAR_LIT:;>' : return TokenNameSEMICOLON ; case '<CHAR_LIT:U+002C>' : return TokenNameCOMMA ; case '<CHAR_LIT:.>' : if ( getNextCharAsDigit ( ) ) { return scanNumber ( true ) ; } int temp = this . currentPosition ; if ( getNextChar ( '<CHAR_LIT:.>' ) ) { if ( getNextChar ( '<CHAR_LIT:.>' ) ) { return TokenNameELLIPSIS ; } else { this . currentPosition = temp ; return TokenNameDOT ; } } else { this . currentPosition = temp ; return TokenNameDOT ; } case '<CHAR_LIT>' : { int test ; if ( ( test = getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT:=>' ) ) == <NUM_LIT:0> ) return TokenNamePLUS_PLUS ; if ( test > <NUM_LIT:0> ) return TokenNamePLUS_EQUAL ; return TokenNamePLUS ; } case '<CHAR_LIT:->' : { int test ; if ( ( test = getNextChar ( '<CHAR_LIT:->' , '<CHAR_LIT:=>' ) ) == <NUM_LIT:0> ) return TokenNameMINUS_MINUS ; if ( test > <NUM_LIT:0> ) return TokenNameMINUS_EQUAL ; return TokenNameMINUS ; } case '<CHAR_LIT>' : return TokenNameTWIDDLE ; case '<CHAR_LIT>' : if ( getNextChar ( '<CHAR_LIT:=>' ) ) return TokenNameNOT_EQUAL ; return TokenNameNOT ; case '<CHAR_LIT>' : if ( getNextChar ( '<CHAR_LIT:=>' ) ) return TokenNameMULTIPLY_EQUAL ; return TokenNameMULTIPLY ; case '<CHAR_LIT>' : if ( getNextChar ( '<CHAR_LIT:=>' ) ) return TokenNameREMAINDER_EQUAL ; return TokenNameREMAINDER ; case '<CHAR_LIT>' : { int test ; if ( ( test = getNextChar ( '<CHAR_LIT:=>' , '<CHAR_LIT>' ) ) == <NUM_LIT:0> ) return TokenNameLESS_EQUAL ; if ( test > <NUM_LIT:0> ) { if ( getNextChar ( '<CHAR_LIT:=>' ) ) return TokenNameLEFT_SHIFT_EQUAL ; return TokenNameLEFT_SHIFT ; } return TokenNameLESS ; } case '<CHAR_LIT:>>' : { int test ; if ( this . returnOnlyGreater ) { return TokenNameGREATER ; } if ( ( test = getNextChar ( '<CHAR_LIT:=>' , '<CHAR_LIT:>>' ) ) == <NUM_LIT:0> ) return TokenNameGREATER_EQUAL ; if ( test > <NUM_LIT:0> ) { if ( ( test = getNextChar ( '<CHAR_LIT:=>' , '<CHAR_LIT:>>' ) ) == <NUM_LIT:0> ) return TokenNameRIGHT_SHIFT_EQUAL ; if ( test > <NUM_LIT:0> ) { if ( getNextChar ( '<CHAR_LIT:=>' ) ) return TokenNameUNSIGNED_RIGHT_SHIFT_EQUAL ; return TokenNameUNSIGNED_RIGHT_SHIFT ; } return TokenNameRIGHT_SHIFT ; } return TokenNameGREATER ; } case '<CHAR_LIT:=>' : if ( getNextChar ( '<CHAR_LIT:=>' ) ) return TokenNameEQUAL_EQUAL ; return TokenNameEQUAL ; case '<CHAR_LIT>' : { int test ; if ( ( test = getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT:=>' ) ) == <NUM_LIT:0> ) return TokenNameAND_AND ; if ( test > <NUM_LIT:0> ) return TokenNameAND_EQUAL ; return TokenNameAND ; } case '<CHAR_LIT>' : { int test ; if ( ( test = getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT:=>' ) ) == <NUM_LIT:0> ) return TokenNameOR_OR ; if ( test > <NUM_LIT:0> ) return TokenNameOR_EQUAL ; return TokenNameOR ; } case '<CHAR_LIT>' : if ( getNextChar ( '<CHAR_LIT:=>' ) ) return TokenNameXOR_EQUAL ; return TokenNameXOR ; case '<CHAR_LIT>' : return TokenNameQUESTION ; case '<CHAR_LIT::>' : return TokenNameCOLON ; case '<STR_LIT>' : { int test ; if ( ( test = getNextChar ( '<STR_LIT:\n>' , '<STR_LIT>' ) ) == <NUM_LIT:0> ) { throw new InvalidInputException ( INVALID_CHARACTER_CONSTANT ) ; } if ( test > <NUM_LIT:0> ) { for ( int lookAhead = <NUM_LIT:0> ; lookAhead < <NUM_LIT:3> ; lookAhead ++ ) { if ( this . currentPosition + lookAhead == this . eofPosition ) break ; if ( this . source [ this . currentPosition + lookAhead ] == '<STR_LIT:\n>' ) break ; if ( this . source [ this . currentPosition + lookAhead ] == '<STR_LIT>' ) { this . currentPosition += lookAhead + <NUM_LIT:1> ; break ; } } throw new InvalidInputException ( INVALID_CHARACTER_CONSTANT ) ; } } if ( getNextChar ( '<STR_LIT>' ) ) { for ( int lookAhead = <NUM_LIT:0> ; lookAhead < <NUM_LIT:3> ; lookAhead ++ ) { if ( this . currentPosition + lookAhead == this . eofPosition ) break ; if ( this . source [ this . currentPosition + lookAhead ] == '<STR_LIT:\n>' ) break ; if ( this . source [ this . currentPosition + lookAhead ] == '<STR_LIT>' ) { this . currentPosition += lookAhead + <NUM_LIT:1> ; break ; } } throw new InvalidInputException ( INVALID_CHARACTER_CONSTANT ) ; } if ( getNextChar ( '<STR_LIT:\\>' ) ) { if ( this . unicodeAsBackSlash ) { this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; } else { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } } else { this . currentCharacter = this . source [ this . currentPosition ++ ] ; } scanEscapeCharacter ( ) ; } else { this . unicodeAsBackSlash = false ; checkIfUnicode = false ; try { checkIfUnicode = ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ; } catch ( IndexOutOfBoundsException e ) { this . currentPosition -- ; throw new InvalidInputException ( INVALID_CHARACTER_CONSTANT ) ; } if ( checkIfUnicode ) { getNextUnicodeChar ( ) ; } else { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } } if ( getNextChar ( '<STR_LIT>' ) ) return TokenNameCharacterLiteral ; for ( int lookAhead = <NUM_LIT:0> ; lookAhead < <NUM_LIT:20> ; lookAhead ++ ) { if ( this . currentPosition + lookAhead == this . eofPosition ) break ; if ( this . source [ this . currentPosition + lookAhead ] == '<STR_LIT:\n>' ) break ; if ( this . source [ this . currentPosition + lookAhead ] == '<STR_LIT>' ) { this . currentPosition += lookAhead + <NUM_LIT:1> ; break ; } } throw new InvalidInputException ( INVALID_CHARACTER_CONSTANT ) ; case '<CHAR_LIT:">' : try { this . unicodeAsBackSlash = false ; boolean isUnicode = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; isUnicode = true ; } else { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } while ( this . currentCharacter != '<CHAR_LIT:">' ) { if ( this . currentPosition >= this . eofPosition ) { throw new InvalidInputException ( UNTERMINATED_STRING ) ; } if ( ( this . currentCharacter == '<STR_LIT:\n>' ) || ( this . currentCharacter == '<STR_LIT>' ) ) { if ( isUnicode ) { int start = this . currentPosition ; for ( int lookAhead = <NUM_LIT:0> ; lookAhead < <NUM_LIT> ; lookAhead ++ ) { if ( this . currentPosition >= this . eofPosition ) { this . currentPosition = start ; break ; } if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { isUnicode = true ; getNextUnicodeChar ( ) ; } else { isUnicode = false ; } if ( ! isUnicode && this . currentCharacter == '<STR_LIT:\n>' ) { this . currentPosition -- ; break ; } if ( this . currentCharacter == '<STR_LIT:\">' ) { throw new InvalidInputException ( INVALID_CHAR_IN_STRING ) ; } } } else { this . currentPosition -- ; } throw new InvalidInputException ( INVALID_CHAR_IN_STRING ) ; } if ( this . currentCharacter == '<STR_LIT:\\>' ) { if ( this . unicodeAsBackSlash ) { this . withoutUnicodePtr -- ; this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; isUnicode = true ; this . withoutUnicodePtr -- ; } else { isUnicode = false ; } } else { if ( this . withoutUnicodePtr == <NUM_LIT:0> ) { unicodeInitializeBuffer ( this . currentPosition - this . startPosition ) ; } this . withoutUnicodePtr -- ; this . currentCharacter = this . source [ this . currentPosition ++ ] ; } scanEscapeCharacter ( ) ; if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; isUnicode = true ; } else { isUnicode = false ; if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } } } catch ( IndexOutOfBoundsException e ) { this . currentPosition -- ; throw new InvalidInputException ( UNTERMINATED_STRING ) ; } catch ( InvalidInputException e ) { if ( e . getMessage ( ) . equals ( INVALID_ESCAPE ) ) { for ( int lookAhead = <NUM_LIT:0> ; lookAhead < <NUM_LIT> ; lookAhead ++ ) { if ( this . currentPosition + lookAhead == this . eofPosition ) break ; if ( this . source [ this . currentPosition + lookAhead ] == '<STR_LIT:\n>' ) break ; if ( this . source [ this . currentPosition + lookAhead ] == '<STR_LIT:\">' ) { this . currentPosition += lookAhead + <NUM_LIT:1> ; break ; } } } throw e ; } return TokenNameStringLiteral ; case '<CHAR_LIT:/>' : if ( ! this . skipComments ) { int test = getNextChar ( '<CHAR_LIT:/>' , '<CHAR_LIT>' ) ; if ( test == <NUM_LIT:0> ) { this . lastCommentLinePosition = this . currentPosition ; try { if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; } if ( this . currentCharacter == '<STR_LIT:\\>' ) { if ( this . source [ this . currentPosition ] == '<STR_LIT:\\>' ) this . currentPosition ++ ; } boolean isUnicode = false ; while ( this . currentCharacter != '<STR_LIT>' && this . currentCharacter != '<STR_LIT:\n>' ) { if ( this . currentPosition >= this . eofPosition ) { this . lastCommentLinePosition = this . currentPosition ; this . currentPosition ++ ; throw new IndexOutOfBoundsException ( ) ; } this . lastCommentLinePosition = this . currentPosition ; isUnicode = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; isUnicode = true ; } if ( this . currentCharacter == '<STR_LIT:\\>' ) { if ( this . source [ this . currentPosition ] == '<STR_LIT:\\>' ) this . currentPosition ++ ; } } if ( this . currentCharacter == '<STR_LIT>' && this . eofPosition > this . currentPosition ) { if ( this . source [ this . currentPosition ] == '<STR_LIT:\n>' ) { this . currentPosition ++ ; this . currentCharacter = '<STR_LIT:\n>' ; } else if ( ( this . source [ this . currentPosition ] == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition + <NUM_LIT:1> ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; isUnicode = true ; } } recordComment ( TokenNameCOMMENT_LINE ) ; if ( this . taskTags != null ) checkTaskTag ( this . startPosition , this . currentPosition ) ; if ( ( this . currentCharacter == '<STR_LIT>' ) || ( this . currentCharacter == '<STR_LIT:\n>' ) ) { if ( this . checkNonExternalizedStringLiterals && this . lastPosition < this . currentPosition ) { parseTags ( ) ; } if ( this . recordLineSeparator ) { if ( isUnicode ) { pushUnicodeLineSeparator ( ) ; } else { pushLineSeparator ( ) ; } } } if ( this . tokenizeComments ) { return TokenNameCOMMENT_LINE ; } } catch ( IndexOutOfBoundsException e ) { this . currentPosition -- ; recordComment ( TokenNameCOMMENT_LINE ) ; if ( this . taskTags != null ) checkTaskTag ( this . startPosition , this . currentPosition ) ; if ( this . checkNonExternalizedStringLiterals && this . lastPosition < this . currentPosition ) { parseTags ( ) ; } if ( this . tokenizeComments ) { return TokenNameCOMMENT_LINE ; } else { this . currentPosition ++ ; } } break ; } if ( test > <NUM_LIT:0> ) { try { boolean isJavadoc = false , star = false ; boolean isUnicode = false ; int previous ; this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; isUnicode = true ; } else { isUnicode = false ; if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } if ( this . currentCharacter == '<CHAR_LIT>' ) { isJavadoc = true ; star = true ; } if ( ( this . currentCharacter == '<STR_LIT>' ) || ( this . currentCharacter == '<STR_LIT:\n>' ) ) { if ( this . recordLineSeparator ) { if ( isUnicode ) { pushUnicodeLineSeparator ( ) ; } else { pushLineSeparator ( ) ; } } } isUnicode = false ; previous = this . currentPosition ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; isUnicode = true ; } else { isUnicode = false ; } if ( this . currentCharacter == '<STR_LIT:\\>' ) { if ( this . source [ this . currentPosition ] == '<STR_LIT:\\>' ) this . currentPosition ++ ; } if ( this . currentCharacter == '<CHAR_LIT:/>' ) { isJavadoc = false ; } int firstTag = <NUM_LIT:0> ; while ( ( this . currentCharacter != '<CHAR_LIT:/>' ) || ( ! star ) ) { if ( this . currentPosition >= this . eofPosition ) { throw new InvalidInputException ( UNTERMINATED_COMMENT ) ; } if ( ( this . currentCharacter == '<STR_LIT>' ) || ( this . currentCharacter == '<STR_LIT:\n>' ) ) { if ( this . recordLineSeparator ) { if ( isUnicode ) { pushUnicodeLineSeparator ( ) ; } else { pushLineSeparator ( ) ; } } } switch ( this . currentCharacter ) { case '<CHAR_LIT>' : star = true ; break ; case '<CHAR_LIT>' : if ( firstTag == <NUM_LIT:0> && this . isFirstTag ( ) ) { firstTag = previous ; } default : star = false ; } previous = this . currentPosition ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; isUnicode = true ; } else { isUnicode = false ; } if ( this . currentCharacter == '<STR_LIT:\\>' ) { if ( this . source [ this . currentPosition ] == '<STR_LIT:\\>' ) this . currentPosition ++ ; } } int token = isJavadoc ? TokenNameCOMMENT_JAVADOC : TokenNameCOMMENT_BLOCK ; recordComment ( token ) ; this . commentTagStarts [ this . commentPtr ] = firstTag ; if ( this . taskTags != null ) checkTaskTag ( this . startPosition , this . currentPosition ) ; if ( this . tokenizeComments ) { return token ; } } catch ( IndexOutOfBoundsException e ) { this . currentPosition -- ; throw new InvalidInputException ( UNTERMINATED_COMMENT ) ; } break ; } } if ( getNextChar ( '<CHAR_LIT:=>' ) ) return TokenNameDIVIDE_EQUAL ; return TokenNameDIVIDE ; case '<CHAR_LIT>' : if ( atEnd ( ) ) return TokenNameEOF ; throw new InvalidInputException ( "<STR_LIT>" ) ; default : char c = this . currentCharacter ; if ( c < ScannerHelper . MAX_OBVIOUS ) { if ( ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] & ScannerHelper . C_IDENT_START ) != <NUM_LIT:0> ) { return scanIdentifierOrKeyword ( ) ; } else if ( ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] & ScannerHelper . C_DIGIT ) != <NUM_LIT:0> ) { return scanNumber ( false ) ; } else { return TokenNameERROR ; } } boolean isJavaIdStart ; if ( c >= HIGH_SURROGATE_MIN_VALUE && c <= HIGH_SURROGATE_MAX_VALUE ) { if ( this . complianceLevel < ClassFileConstants . JDK1_5 ) { throw new InvalidInputException ( INVALID_UNICODE_ESCAPE ) ; } char low = ( char ) getNextChar ( ) ; if ( low < LOW_SURROGATE_MIN_VALUE || low > LOW_SURROGATE_MAX_VALUE ) { throw new InvalidInputException ( INVALID_LOW_SURROGATE ) ; } isJavaIdStart = ScannerHelper . isJavaIdentifierStart ( this . complianceLevel , c , low ) ; } else if ( c >= LOW_SURROGATE_MIN_VALUE && c <= LOW_SURROGATE_MAX_VALUE ) { if ( this . complianceLevel < ClassFileConstants . JDK1_5 ) { throw new InvalidInputException ( INVALID_UNICODE_ESCAPE ) ; } throw new InvalidInputException ( INVALID_HIGH_SURROGATE ) ; } else { isJavaIdStart = ScannerHelper . isJavaIdentifierStart ( this . complianceLevel , c ) ; } if ( isJavaIdStart ) return scanIdentifierOrKeyword ( ) ; if ( ScannerHelper . isDigit ( this . currentCharacter ) ) { return scanNumber ( false ) ; } return TokenNameERROR ; } } } catch ( IndexOutOfBoundsException e ) { if ( this . tokenizeWhiteSpace && ( whiteStart != this . currentPosition - <NUM_LIT:1> ) ) { this . currentPosition -- ; this . startPosition = whiteStart ; return TokenNameWHITESPACE ; } } return TokenNameEOF ; } public void getNextUnicodeChar ( ) throws InvalidInputException { int c1 = <NUM_LIT:0> , c2 = <NUM_LIT:0> , c3 = <NUM_LIT:0> , c4 = <NUM_LIT:0> , unicodeSize = <NUM_LIT:6> ; this . currentPosition ++ ; if ( this . currentPosition < this . eofPosition ) { while ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) { this . currentPosition ++ ; if ( this . currentPosition >= this . eofPosition ) { this . currentPosition -- ; throw new InvalidInputException ( INVALID_UNICODE_ESCAPE ) ; } unicodeSize ++ ; } } else { this . currentPosition -- ; throw new InvalidInputException ( INVALID_UNICODE_ESCAPE ) ; } if ( ( this . currentPosition + <NUM_LIT:4> ) > this . eofPosition ) { this . currentPosition += ( this . eofPosition - this . currentPosition ) ; throw new InvalidInputException ( INVALID_UNICODE_ESCAPE ) ; } if ( ( c1 = ScannerHelper . getHexadecimalValue ( this . source [ this . currentPosition ++ ] ) ) > <NUM_LIT:15> || c1 < <NUM_LIT:0> || ( c2 = ScannerHelper . getHexadecimalValue ( this . source [ this . currentPosition ++ ] ) ) > <NUM_LIT:15> || c2 < <NUM_LIT:0> || ( c3 = ScannerHelper . getHexadecimalValue ( this . source [ this . currentPosition ++ ] ) ) > <NUM_LIT:15> || c3 < <NUM_LIT:0> || ( c4 = ScannerHelper . getHexadecimalValue ( this . source [ this . currentPosition ++ ] ) ) > <NUM_LIT:15> || c4 < <NUM_LIT:0> ) { throw new InvalidInputException ( INVALID_UNICODE_ESCAPE ) ; } this . currentCharacter = ( char ) ( ( ( c1 * <NUM_LIT:16> + c2 ) * <NUM_LIT:16> + c3 ) * <NUM_LIT:16> + c4 ) ; if ( this . withoutUnicodePtr == <NUM_LIT:0> ) { unicodeInitializeBuffer ( this . currentPosition - unicodeSize - this . startPosition ) ; } unicodeStore ( ) ; this . unicodeAsBackSlash = this . currentCharacter == '<STR_LIT:\\>' ; } public NLSTag [ ] getNLSTags ( ) { final int length = this . nlsTagsPtr ; if ( length != <NUM_LIT:0> ) { NLSTag [ ] result = new NLSTag [ length ] ; System . arraycopy ( this . nlsTags , <NUM_LIT:0> , result , <NUM_LIT:0> , length ) ; this . nlsTagsPtr = <NUM_LIT:0> ; return result ; } return null ; } public char [ ] getSource ( ) { return this . source ; } protected boolean isFirstTag ( ) { return true ; } public final void jumpOverMethodBody ( ) { this . wasAcr = false ; int found = <NUM_LIT:1> ; try { while ( true ) { this . withoutUnicodePtr = <NUM_LIT:0> ; boolean isWhiteSpace ; do { this . startPosition = this . currentPosition ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { isWhiteSpace = jumpOverUnicodeWhiteSpace ( ) ; } else { if ( this . recordLineSeparator && ( ( this . currentCharacter == '<STR_LIT>' ) || ( this . currentCharacter == '<STR_LIT:\n>' ) ) ) { pushLineSeparator ( ) ; } isWhiteSpace = CharOperation . isWhitespace ( this . currentCharacter ) ; } } while ( isWhiteSpace ) ; NextToken : switch ( this . currentCharacter ) { case '<CHAR_LIT>' : found ++ ; break NextToken ; case '<CHAR_LIT:}>' : found -- ; if ( found == <NUM_LIT:0> ) return ; break NextToken ; case '<STR_LIT>' : { boolean test ; test = getNextChar ( '<STR_LIT:\\>' ) ; if ( test ) { try { if ( this . unicodeAsBackSlash ) { this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; } else { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } } else { this . currentCharacter = this . source [ this . currentPosition ++ ] ; } scanEscapeCharacter ( ) ; } catch ( InvalidInputException ex ) { } } else { try { this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; } else { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } } catch ( InvalidInputException ex ) { } } getNextChar ( '<STR_LIT>' ) ; break NextToken ; } case '<CHAR_LIT:">' : try { try { this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; } else { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } } catch ( InvalidInputException ex ) { } while ( this . currentCharacter != '<CHAR_LIT:">' ) { if ( this . currentPosition >= this . eofPosition ) { return ; } if ( this . currentCharacter == '<STR_LIT>' ) { if ( this . source [ this . currentPosition ] == '<STR_LIT:\n>' ) this . currentPosition ++ ; break NextToken ; } if ( this . currentCharacter == '<STR_LIT:\n>' ) { break ; } if ( this . currentCharacter == '<STR_LIT:\\>' ) { try { if ( this . unicodeAsBackSlash ) { this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; } else { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } } else { this . currentCharacter = this . source [ this . currentPosition ++ ] ; } scanEscapeCharacter ( ) ; } catch ( InvalidInputException ex ) { } } try { this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; } else { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } } catch ( InvalidInputException ex ) { } } } catch ( IndexOutOfBoundsException e ) { return ; } break NextToken ; case '<CHAR_LIT:/>' : { int test ; if ( ( test = getNextChar ( '<CHAR_LIT:/>' , '<CHAR_LIT>' ) ) == <NUM_LIT:0> ) { try { this . lastCommentLinePosition = this . currentPosition ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; } if ( this . currentCharacter == '<STR_LIT:\\>' ) { if ( this . source [ this . currentPosition ] == '<STR_LIT:\\>' ) this . currentPosition ++ ; } boolean isUnicode = false ; while ( this . currentCharacter != '<STR_LIT>' && this . currentCharacter != '<STR_LIT:\n>' ) { if ( this . currentPosition >= this . eofPosition ) { this . lastCommentLinePosition = this . currentPosition ; this . currentPosition ++ ; throw new IndexOutOfBoundsException ( ) ; } this . lastCommentLinePosition = this . currentPosition ; isUnicode = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { isUnicode = true ; getNextUnicodeChar ( ) ; } if ( this . currentCharacter == '<STR_LIT:\\>' ) { if ( this . source [ this . currentPosition ] == '<STR_LIT:\\>' ) this . currentPosition ++ ; } } if ( this . currentCharacter == '<STR_LIT>' && this . eofPosition > this . currentPosition ) { if ( this . source [ this . currentPosition ] == '<STR_LIT:\n>' ) { this . currentPosition ++ ; this . currentCharacter = '<STR_LIT:\n>' ; } else if ( ( this . source [ this . currentPosition ] == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition + <NUM_LIT:1> ] == '<CHAR_LIT>' ) ) { isUnicode = true ; getNextUnicodeChar ( ) ; } } recordComment ( TokenNameCOMMENT_LINE ) ; if ( this . recordLineSeparator && ( ( this . currentCharacter == '<STR_LIT>' ) || ( this . currentCharacter == '<STR_LIT:\n>' ) ) ) { if ( this . checkNonExternalizedStringLiterals && this . lastPosition < this . currentPosition ) { parseTags ( ) ; } if ( this . recordLineSeparator ) { if ( isUnicode ) { pushUnicodeLineSeparator ( ) ; } else { pushLineSeparator ( ) ; } } } } catch ( IndexOutOfBoundsException e ) { this . currentPosition -- ; recordComment ( TokenNameCOMMENT_LINE ) ; if ( this . checkNonExternalizedStringLiterals && this . lastPosition < this . currentPosition ) { parseTags ( ) ; } if ( ! this . tokenizeComments ) { this . currentPosition ++ ; } } break NextToken ; } if ( test > <NUM_LIT:0> ) { boolean isJavadoc = false ; try { boolean star = false ; int previous ; boolean isUnicode = false ; this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; isUnicode = true ; } else { isUnicode = false ; if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } if ( this . currentCharacter == '<CHAR_LIT>' ) { isJavadoc = true ; star = true ; } if ( ( this . currentCharacter == '<STR_LIT>' ) || ( this . currentCharacter == '<STR_LIT:\n>' ) ) { if ( this . recordLineSeparator ) { if ( isUnicode ) { pushUnicodeLineSeparator ( ) ; } else { pushLineSeparator ( ) ; } } } isUnicode = false ; previous = this . currentPosition ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; isUnicode = true ; } else { isUnicode = false ; } if ( this . currentCharacter == '<STR_LIT:\\>' ) { if ( this . source [ this . currentPosition ] == '<STR_LIT:\\>' ) this . currentPosition ++ ; } if ( this . currentCharacter == '<CHAR_LIT:/>' ) { isJavadoc = false ; } int firstTag = <NUM_LIT:0> ; while ( ( this . currentCharacter != '<CHAR_LIT:/>' ) || ( ! star ) ) { if ( this . currentPosition >= this . eofPosition ) { return ; } if ( ( this . currentCharacter == '<STR_LIT>' ) || ( this . currentCharacter == '<STR_LIT:\n>' ) ) { if ( this . recordLineSeparator ) { if ( isUnicode ) { pushUnicodeLineSeparator ( ) ; } else { pushLineSeparator ( ) ; } } } switch ( this . currentCharacter ) { case '<CHAR_LIT>' : star = true ; break ; case '<CHAR_LIT>' : if ( firstTag == <NUM_LIT:0> && this . isFirstTag ( ) ) { firstTag = previous ; } default : star = false ; } previous = this . currentPosition ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; isUnicode = true ; } else { isUnicode = false ; } if ( this . currentCharacter == '<STR_LIT:\\>' ) { if ( this . source [ this . currentPosition ] == '<STR_LIT:\\>' ) this . currentPosition ++ ; } } recordComment ( isJavadoc ? TokenNameCOMMENT_JAVADOC : TokenNameCOMMENT_BLOCK ) ; this . commentTagStarts [ this . commentPtr ] = firstTag ; } catch ( IndexOutOfBoundsException e ) { return ; } break NextToken ; } break NextToken ; } default : try { char c = this . currentCharacter ; if ( c < ScannerHelper . MAX_OBVIOUS ) { if ( ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] & ScannerHelper . C_IDENT_START ) != <NUM_LIT:0> ) { scanIdentifierOrKeyword ( ) ; break NextToken ; } else if ( ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] & ScannerHelper . C_DIGIT ) != <NUM_LIT:0> ) { scanNumber ( false ) ; break NextToken ; } else { break NextToken ; } } boolean isJavaIdStart ; if ( c >= HIGH_SURROGATE_MIN_VALUE && c <= HIGH_SURROGATE_MAX_VALUE ) { if ( this . complianceLevel < ClassFileConstants . JDK1_5 ) { throw new InvalidInputException ( INVALID_UNICODE_ESCAPE ) ; } char low = ( char ) getNextChar ( ) ; if ( low < LOW_SURROGATE_MIN_VALUE || low > LOW_SURROGATE_MAX_VALUE ) { break NextToken ; } isJavaIdStart = ScannerHelper . isJavaIdentifierStart ( this . complianceLevel , c , low ) ; } else if ( c >= LOW_SURROGATE_MIN_VALUE && c <= LOW_SURROGATE_MAX_VALUE ) { break NextToken ; } else { isJavaIdStart = ScannerHelper . isJavaIdentifierStart ( this . complianceLevel , c ) ; } if ( isJavaIdStart ) { scanIdentifierOrKeyword ( ) ; break NextToken ; } } catch ( InvalidInputException ex ) { } } } } catch ( IndexOutOfBoundsException e ) { } catch ( InvalidInputException e ) { } return ; } public final boolean jumpOverUnicodeWhiteSpace ( ) throws InvalidInputException { this . wasAcr = false ; getNextUnicodeChar ( ) ; return CharOperation . isWhitespace ( this . currentCharacter ) ; } final char [ ] optimizedCurrentTokenSource1 ( ) { char charOne = this . source [ this . startPosition ] ; switch ( charOne ) { case '<CHAR_LIT:a>' : return charArray_a ; case '<CHAR_LIT:b>' : return charArray_b ; case '<CHAR_LIT:c>' : return charArray_c ; case '<CHAR_LIT>' : return charArray_d ; case '<CHAR_LIT:e>' : return charArray_e ; case '<CHAR_LIT>' : return charArray_f ; case '<CHAR_LIT>' : return charArray_g ; case '<CHAR_LIT>' : return charArray_h ; case '<CHAR_LIT>' : return charArray_i ; case '<CHAR_LIT>' : return charArray_j ; case '<CHAR_LIT>' : return charArray_k ; case '<CHAR_LIT>' : return charArray_l ; case '<CHAR_LIT>' : return charArray_m ; case '<CHAR_LIT>' : return charArray_n ; case '<CHAR_LIT>' : return charArray_o ; case '<CHAR_LIT>' : return charArray_p ; case '<CHAR_LIT>' : return charArray_q ; case '<CHAR_LIT>' : return charArray_r ; case '<CHAR_LIT>' : return charArray_s ; case '<CHAR_LIT>' : return charArray_t ; case '<CHAR_LIT>' : return charArray_u ; case '<CHAR_LIT>' : return charArray_v ; case '<CHAR_LIT>' : return charArray_w ; case '<CHAR_LIT>' : return charArray_x ; case '<CHAR_LIT>' : return charArray_y ; case '<CHAR_LIT>' : return charArray_z ; default : return new char [ ] { charOne } ; } } final char [ ] optimizedCurrentTokenSource2 ( ) { char [ ] src = this . source ; int start = this . startPosition ; char c0 , c1 ; int hash = ( ( ( c0 = src [ start ] ) << <NUM_LIT:6> ) + ( c1 = src [ start + <NUM_LIT:1> ] ) ) % TableSize ; char [ ] [ ] table = this . charArray_length [ <NUM_LIT:0> ] [ hash ] ; int i = this . newEntry2 ; while ( ++ i < InternalTableSize ) { char [ ] charArray = table [ i ] ; if ( ( c0 == charArray [ <NUM_LIT:0> ] ) && ( c1 == charArray [ <NUM_LIT:1> ] ) ) return charArray ; } i = - <NUM_LIT:1> ; int max = this . newEntry2 ; while ( ++ i <= max ) { char [ ] charArray = table [ i ] ; if ( ( c0 == charArray [ <NUM_LIT:0> ] ) && ( c1 == charArray [ <NUM_LIT:1> ] ) ) return charArray ; } if ( ++ max >= InternalTableSize ) max = <NUM_LIT:0> ; char [ ] r ; System . arraycopy ( src , start , r = new char [ <NUM_LIT:2> ] , <NUM_LIT:0> , <NUM_LIT:2> ) ; return table [ this . newEntry2 = max ] = r ; } final char [ ] optimizedCurrentTokenSource3 ( ) { char [ ] src = this . source ; int start = this . startPosition ; char c0 , c1 = src [ start + <NUM_LIT:1> ] , c2 ; int hash = ( ( ( c0 = src [ start ] ) << <NUM_LIT:6> ) + ( c2 = src [ start + <NUM_LIT:2> ] ) ) % TableSize ; char [ ] [ ] table = this . charArray_length [ <NUM_LIT:1> ] [ hash ] ; int i = this . newEntry3 ; while ( ++ i < InternalTableSize ) { char [ ] charArray = table [ i ] ; if ( ( c0 == charArray [ <NUM_LIT:0> ] ) && ( c1 == charArray [ <NUM_LIT:1> ] ) && ( c2 == charArray [ <NUM_LIT:2> ] ) ) return charArray ; } i = - <NUM_LIT:1> ; int max = this . newEntry3 ; while ( ++ i <= max ) { char [ ] charArray = table [ i ] ; if ( ( c0 == charArray [ <NUM_LIT:0> ] ) && ( c1 == charArray [ <NUM_LIT:1> ] ) && ( c2 == charArray [ <NUM_LIT:2> ] ) ) return charArray ; } if ( ++ max >= InternalTableSize ) max = <NUM_LIT:0> ; char [ ] r ; System . arraycopy ( src , start , r = new char [ <NUM_LIT:3> ] , <NUM_LIT:0> , <NUM_LIT:3> ) ; return table [ this . newEntry3 = max ] = r ; } final char [ ] optimizedCurrentTokenSource4 ( ) { char [ ] src = this . source ; int start = this . startPosition ; char c0 , c1 = src [ start + <NUM_LIT:1> ] , c2 , c3 = src [ start + <NUM_LIT:3> ] ; int hash = ( ( ( c0 = src [ start ] ) << <NUM_LIT:6> ) + ( c2 = src [ start + <NUM_LIT:2> ] ) ) % TableSize ; char [ ] [ ] table = this . charArray_length [ <NUM_LIT:2> ] [ hash ] ; int i = this . newEntry4 ; while ( ++ i < InternalTableSize ) { char [ ] charArray = table [ i ] ; if ( ( c0 == charArray [ <NUM_LIT:0> ] ) && ( c1 == charArray [ <NUM_LIT:1> ] ) && ( c2 == charArray [ <NUM_LIT:2> ] ) && ( c3 == charArray [ <NUM_LIT:3> ] ) ) return charArray ; } i = - <NUM_LIT:1> ; int max = this . newEntry4 ; while ( ++ i <= max ) { char [ ] charArray = table [ i ] ; if ( ( c0 == charArray [ <NUM_LIT:0> ] ) && ( c1 == charArray [ <NUM_LIT:1> ] ) && ( c2 == charArray [ <NUM_LIT:2> ] ) && ( c3 == charArray [ <NUM_LIT:3> ] ) ) return charArray ; } if ( ++ max >= InternalTableSize ) max = <NUM_LIT:0> ; char [ ] r ; System . arraycopy ( src , start , r = new char [ <NUM_LIT:4> ] , <NUM_LIT:0> , <NUM_LIT:4> ) ; return table [ this . newEntry4 = max ] = r ; } final char [ ] optimizedCurrentTokenSource5 ( ) { char [ ] src = this . source ; int start = this . startPosition ; char c0 , c1 = src [ start + <NUM_LIT:1> ] , c2 , c3 = src [ start + <NUM_LIT:3> ] , c4 ; int hash = ( ( ( c0 = src [ start ] ) << <NUM_LIT:12> ) + ( ( c2 = src [ start + <NUM_LIT:2> ] ) << <NUM_LIT:6> ) + ( c4 = src [ start + <NUM_LIT:4> ] ) ) % TableSize ; char [ ] [ ] table = this . charArray_length [ <NUM_LIT:3> ] [ hash ] ; int i = this . newEntry5 ; while ( ++ i < InternalTableSize ) { char [ ] charArray = table [ i ] ; if ( ( c0 == charArray [ <NUM_LIT:0> ] ) && ( c1 == charArray [ <NUM_LIT:1> ] ) && ( c2 == charArray [ <NUM_LIT:2> ] ) && ( c3 == charArray [ <NUM_LIT:3> ] ) && ( c4 == charArray [ <NUM_LIT:4> ] ) ) return charArray ; } i = - <NUM_LIT:1> ; int max = this . newEntry5 ; while ( ++ i <= max ) { char [ ] charArray = table [ i ] ; if ( ( c0 == charArray [ <NUM_LIT:0> ] ) && ( c1 == charArray [ <NUM_LIT:1> ] ) && ( c2 == charArray [ <NUM_LIT:2> ] ) && ( c3 == charArray [ <NUM_LIT:3> ] ) && ( c4 == charArray [ <NUM_LIT:4> ] ) ) return charArray ; } if ( ++ max >= InternalTableSize ) max = <NUM_LIT:0> ; char [ ] r ; System . arraycopy ( src , start , r = new char [ <NUM_LIT:5> ] , <NUM_LIT:0> , <NUM_LIT:5> ) ; return table [ this . newEntry5 = max ] = r ; } final char [ ] optimizedCurrentTokenSource6 ( ) { char [ ] src = this . source ; int start = this . startPosition ; char c0 , c1 = src [ start + <NUM_LIT:1> ] , c2 , c3 = src [ start + <NUM_LIT:3> ] , c4 , c5 = src [ start + <NUM_LIT:5> ] ; int hash = ( ( ( c0 = src [ start ] ) << <NUM_LIT:12> ) + ( ( c2 = src [ start + <NUM_LIT:2> ] ) << <NUM_LIT:6> ) + ( c4 = src [ start + <NUM_LIT:4> ] ) ) % TableSize ; char [ ] [ ] table = this . charArray_length [ <NUM_LIT:4> ] [ hash ] ; int i = this . newEntry6 ; while ( ++ i < InternalTableSize ) { char [ ] charArray = table [ i ] ; if ( ( c0 == charArray [ <NUM_LIT:0> ] ) && ( c1 == charArray [ <NUM_LIT:1> ] ) && ( c2 == charArray [ <NUM_LIT:2> ] ) && ( c3 == charArray [ <NUM_LIT:3> ] ) && ( c4 == charArray [ <NUM_LIT:4> ] ) && ( c5 == charArray [ <NUM_LIT:5> ] ) ) return charArray ; } i = - <NUM_LIT:1> ; int max = this . newEntry6 ; while ( ++ i <= max ) { char [ ] charArray = table [ i ] ; if ( ( c0 == charArray [ <NUM_LIT:0> ] ) && ( c1 == charArray [ <NUM_LIT:1> ] ) && ( c2 == charArray [ <NUM_LIT:2> ] ) && ( c3 == charArray [ <NUM_LIT:3> ] ) && ( c4 == charArray [ <NUM_LIT:4> ] ) && ( c5 == charArray [ <NUM_LIT:5> ] ) ) return charArray ; } if ( ++ max >= InternalTableSize ) max = <NUM_LIT:0> ; char [ ] r ; System . arraycopy ( src , start , r = new char [ <NUM_LIT:6> ] , <NUM_LIT:0> , <NUM_LIT:6> ) ; return table [ this . newEntry6 = max ] = r ; } private void parseTags ( ) { int position = <NUM_LIT:0> ; final int currentStartPosition = this . startPosition ; final int currentLinePtr = this . linePtr ; if ( currentLinePtr >= <NUM_LIT:0> ) { position = this . lineEnds [ currentLinePtr ] + <NUM_LIT:1> ; } while ( ScannerHelper . isWhitespace ( this . source [ position ] ) ) { position ++ ; } if ( currentStartPosition == position ) { return ; } char [ ] s = null ; int sourceEnd = this . currentPosition ; int sourceStart = currentStartPosition ; int sourceDelta = <NUM_LIT:0> ; if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { System . arraycopy ( this . withoutUnicodeBuffer , <NUM_LIT:1> , s = new char [ this . withoutUnicodePtr ] , <NUM_LIT:0> , this . withoutUnicodePtr ) ; sourceEnd = this . withoutUnicodePtr ; sourceStart = <NUM_LIT:1> ; sourceDelta = currentStartPosition ; } else { s = this . source ; } int pos = CharOperation . indexOf ( TAG_PREFIX , s , true , sourceStart , sourceEnd ) ; if ( pos != - <NUM_LIT:1> ) { if ( this . nlsTags == null ) { this . nlsTags = new NLSTag [ <NUM_LIT:10> ] ; this . nlsTagsPtr = <NUM_LIT:0> ; } while ( pos != - <NUM_LIT:1> ) { int start = pos + TAG_PREFIX_LENGTH ; int end = CharOperation . indexOf ( TAG_POSTFIX , s , start , sourceEnd ) ; if ( end != - <NUM_LIT:1> ) { NLSTag currentTag = null ; final int currentLine = currentLinePtr + <NUM_LIT:1> ; try { currentTag = new NLSTag ( pos + sourceDelta , end + sourceDelta , currentLine , extractInt ( s , start , end ) ) ; } catch ( NumberFormatException e ) { currentTag = new NLSTag ( pos + sourceDelta , end + sourceDelta , currentLine , - <NUM_LIT:1> ) ; } if ( this . nlsTagsPtr == this . nlsTags . length ) { System . arraycopy ( this . nlsTags , <NUM_LIT:0> , ( this . nlsTags = new NLSTag [ this . nlsTagsPtr + <NUM_LIT:10> ] ) , <NUM_LIT:0> , this . nlsTagsPtr ) ; } this . nlsTags [ this . nlsTagsPtr ++ ] = currentTag ; } else { end = start ; } pos = CharOperation . indexOf ( TAG_PREFIX , s , true , end , sourceEnd ) ; } } } private int extractInt ( char [ ] array , int start , int end ) { int value = <NUM_LIT:0> ; for ( int i = start ; i < end ; i ++ ) { final char currentChar = array [ i ] ; int digit = <NUM_LIT:0> ; switch ( currentChar ) { case '<CHAR_LIT:0>' : digit = <NUM_LIT:0> ; break ; case '<CHAR_LIT:1>' : digit = <NUM_LIT:1> ; break ; case '<CHAR_LIT>' : digit = <NUM_LIT:2> ; break ; case '<CHAR_LIT>' : digit = <NUM_LIT:3> ; break ; case '<CHAR_LIT>' : digit = <NUM_LIT:4> ; break ; case '<CHAR_LIT>' : digit = <NUM_LIT:5> ; break ; case '<CHAR_LIT>' : digit = <NUM_LIT:6> ; break ; case '<CHAR_LIT>' : digit = <NUM_LIT:7> ; break ; case '<CHAR_LIT>' : digit = <NUM_LIT:8> ; break ; case '<CHAR_LIT:9>' : digit = <NUM_LIT:9> ; break ; default : throw new NumberFormatException ( ) ; } value *= <NUM_LIT:10> ; if ( digit < <NUM_LIT:0> ) throw new NumberFormatException ( ) ; value += digit ; } return value ; } public final void pushLineSeparator ( ) { final int INCREMENT = <NUM_LIT> ; if ( this . currentCharacter == '<STR_LIT>' ) { int separatorPos = this . currentPosition - <NUM_LIT:1> ; if ( ( this . linePtr >= <NUM_LIT:0> ) && ( this . lineEnds [ this . linePtr ] >= separatorPos ) ) return ; int length = this . lineEnds . length ; if ( ++ this . linePtr >= length ) System . arraycopy ( this . lineEnds , <NUM_LIT:0> , this . lineEnds = new int [ length + INCREMENT ] , <NUM_LIT:0> , length ) ; this . lineEnds [ this . linePtr ] = separatorPos ; try { if ( this . source [ this . currentPosition ] == '<STR_LIT:\n>' ) { this . lineEnds [ this . linePtr ] = this . currentPosition ; this . currentPosition ++ ; this . wasAcr = false ; } else { this . wasAcr = true ; } } catch ( IndexOutOfBoundsException e ) { this . wasAcr = true ; } } else { if ( this . currentCharacter == '<STR_LIT:\n>' ) { if ( this . wasAcr && ( this . lineEnds [ this . linePtr ] == ( this . currentPosition - <NUM_LIT:2> ) ) ) { this . lineEnds [ this . linePtr ] = this . currentPosition - <NUM_LIT:1> ; } else { int separatorPos = this . currentPosition - <NUM_LIT:1> ; if ( ( this . linePtr >= <NUM_LIT:0> ) && ( this . lineEnds [ this . linePtr ] >= separatorPos ) ) return ; int length = this . lineEnds . length ; if ( ++ this . linePtr >= length ) System . arraycopy ( this . lineEnds , <NUM_LIT:0> , this . lineEnds = new int [ length + INCREMENT ] , <NUM_LIT:0> , length ) ; this . lineEnds [ this . linePtr ] = separatorPos ; } this . wasAcr = false ; } } } public final void pushUnicodeLineSeparator ( ) { if ( this . currentCharacter == '<STR_LIT>' ) { if ( this . source [ this . currentPosition ] == '<STR_LIT:\n>' ) { this . wasAcr = false ; } else { this . wasAcr = true ; } } else { if ( this . currentCharacter == '<STR_LIT:\n>' ) { this . wasAcr = false ; } } } public void recordComment ( int token ) { int commentStart = this . startPosition ; int stopPosition = this . currentPosition ; switch ( token ) { case TokenNameCOMMENT_LINE : commentStart = - this . startPosition ; stopPosition = - this . lastCommentLinePosition ; break ; case TokenNameCOMMENT_BLOCK : stopPosition = - this . currentPosition ; break ; } int length = this . commentStops . length ; if ( ++ this . commentPtr >= length ) { int newLength = length + COMMENT_ARRAYS_SIZE * <NUM_LIT:10> ; System . arraycopy ( this . commentStops , <NUM_LIT:0> , this . commentStops = new int [ newLength ] , <NUM_LIT:0> , length ) ; System . arraycopy ( this . commentStarts , <NUM_LIT:0> , this . commentStarts = new int [ newLength ] , <NUM_LIT:0> , length ) ; System . arraycopy ( this . commentTagStarts , <NUM_LIT:0> , this . commentTagStarts = new int [ newLength ] , <NUM_LIT:0> , length ) ; } this . commentStops [ this . commentPtr ] = stopPosition ; this . commentStarts [ this . commentPtr ] = commentStart ; } public void resetTo ( int begin , int end ) { this . diet = false ; this . initialPosition = this . startPosition = this . currentPosition = begin ; if ( this . source != null && this . source . length < end ) { this . eofPosition = this . source . length ; } else { this . eofPosition = end < Integer . MAX_VALUE ? end + <NUM_LIT:1> : end ; } this . commentPtr = - <NUM_LIT:1> ; this . foundTaskCount = <NUM_LIT:0> ; } protected final void scanEscapeCharacter ( ) throws InvalidInputException { switch ( this . currentCharacter ) { case '<CHAR_LIT:b>' : this . currentCharacter = '<STR_LIT>' ; break ; case '<CHAR_LIT>' : this . currentCharacter = '<STR_LIT:\t>' ; break ; case '<CHAR_LIT>' : this . currentCharacter = '<STR_LIT:\n>' ; break ; case '<CHAR_LIT>' : this . currentCharacter = '<STR_LIT>' ; break ; case '<CHAR_LIT>' : this . currentCharacter = '<STR_LIT>' ; break ; case '<STR_LIT:\">' : this . currentCharacter = '<STR_LIT:\">' ; break ; case '<STR_LIT>' : this . currentCharacter = '<STR_LIT>' ; break ; case '<STR_LIT:\\>' : this . currentCharacter = '<STR_LIT:\\>' ; break ; default : int number = ScannerHelper . getHexadecimalValue ( this . currentCharacter ) ; if ( number >= <NUM_LIT:0> && number <= <NUM_LIT:7> ) { boolean zeroToThreeNot = number > <NUM_LIT:3> ; if ( ScannerHelper . isDigit ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) ) { int digit = ScannerHelper . getHexadecimalValue ( this . currentCharacter ) ; if ( digit >= <NUM_LIT:0> && digit <= <NUM_LIT:7> ) { number = ( number * <NUM_LIT:8> ) + digit ; if ( ScannerHelper . isDigit ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) ) { if ( zeroToThreeNot ) { this . currentPosition -- ; } else { digit = ScannerHelper . getHexadecimalValue ( this . currentCharacter ) ; if ( digit >= <NUM_LIT:0> && digit <= <NUM_LIT:7> ) { number = ( number * <NUM_LIT:8> ) + digit ; } else { this . currentPosition -- ; } } } else { this . currentPosition -- ; } } else { this . currentPosition -- ; } } else { this . currentPosition -- ; } if ( number > <NUM_LIT:255> ) throw new InvalidInputException ( INVALID_ESCAPE ) ; this . currentCharacter = ( char ) number ; } else throw new InvalidInputException ( INVALID_ESCAPE ) ; } } public int scanIdentifierOrKeywordWithBoundCheck ( ) { this . useAssertAsAnIndentifier = false ; this . useEnumAsAnIndentifier = false ; char [ ] src = this . source ; identLoop : { int pos ; int srcLength = this . eofPosition ; while ( true ) { if ( ( pos = this . currentPosition ) >= srcLength ) break identLoop ; char c = src [ pos ] ; if ( c < ScannerHelper . MAX_OBVIOUS ) { if ( ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] & ( ScannerHelper . C_UPPER_LETTER | ScannerHelper . C_LOWER_LETTER | ScannerHelper . C_IDENT_PART | ScannerHelper . C_DIGIT ) ) != <NUM_LIT:0> ) { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { this . currentCharacter = c ; unicodeStore ( ) ; } this . currentPosition ++ ; } else if ( ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] & ( ScannerHelper . C_SEPARATOR | ScannerHelper . C_JLS_SPACE ) ) != <NUM_LIT:0> ) { this . currentCharacter = c ; break identLoop ; } else { while ( getNextCharAsJavaIdentifierPartWithBoundCheck ( ) ) { } break identLoop ; } } else { while ( getNextCharAsJavaIdentifierPartWithBoundCheck ( ) ) { } break identLoop ; } } } int index , length ; char [ ] data ; if ( this . withoutUnicodePtr == <NUM_LIT:0> ) { if ( ( length = this . currentPosition - this . startPosition ) == <NUM_LIT:1> ) { return TokenNameIdentifier ; } data = this . source ; index = this . startPosition ; } else { if ( ( length = this . withoutUnicodePtr ) == <NUM_LIT:1> ) return TokenNameIdentifier ; data = this . withoutUnicodeBuffer ; index = <NUM_LIT:1> ; } return internalScanIdentifierOrKeyword ( index , length , data ) ; } public int scanIdentifierOrKeyword ( ) { this . useAssertAsAnIndentifier = false ; this . useEnumAsAnIndentifier = false ; char [ ] src = this . source ; identLoop : { int pos ; int srcLength = this . eofPosition ; while ( true ) { if ( ( pos = this . currentPosition ) >= srcLength ) break identLoop ; char c = src [ pos ] ; if ( c < ScannerHelper . MAX_OBVIOUS ) { if ( ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] & ( ScannerHelper . C_UPPER_LETTER | ScannerHelper . C_LOWER_LETTER | ScannerHelper . C_IDENT_PART | ScannerHelper . C_DIGIT ) ) != <NUM_LIT:0> ) { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { this . currentCharacter = c ; unicodeStore ( ) ; } this . currentPosition ++ ; } else if ( ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] & ( ScannerHelper . C_SEPARATOR | ScannerHelper . C_JLS_SPACE ) ) != <NUM_LIT:0> ) { this . currentCharacter = c ; break identLoop ; } else { while ( getNextCharAsJavaIdentifierPart ( ) ) { } break identLoop ; } } else { while ( getNextCharAsJavaIdentifierPart ( ) ) { } break identLoop ; } } } int index , length ; char [ ] data ; if ( this . withoutUnicodePtr == <NUM_LIT:0> ) { if ( ( length = this . currentPosition - this . startPosition ) == <NUM_LIT:1> ) { return TokenNameIdentifier ; } data = this . source ; index = this . startPosition ; } else { if ( ( length = this . withoutUnicodePtr ) == <NUM_LIT:1> ) return TokenNameIdentifier ; data = this . withoutUnicodeBuffer ; index = <NUM_LIT:1> ; } return internalScanIdentifierOrKeyword ( index , length , data ) ; } private int internalScanIdentifierOrKeyword ( int index , int length , char [ ] data ) { switch ( data [ index ] ) { case '<CHAR_LIT:a>' : switch ( length ) { case <NUM_LIT:8> : if ( ( data [ ++ index ] == '<CHAR_LIT:b>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT:c>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) { return TokenNameabstract ; } else { return TokenNameIdentifier ; } case <NUM_LIT:6> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) { if ( this . sourceLevel >= ClassFileConstants . JDK1_4 ) { this . containsAssertKeyword = true ; return TokenNameassert ; } else { this . useAssertAsAnIndentifier = true ; return TokenNameIdentifier ; } } else { return TokenNameIdentifier ; } default : return TokenNameIdentifier ; } case '<CHAR_LIT:b>' : switch ( length ) { case <NUM_LIT:4> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) ) return TokenNamebyte ; else return TokenNameIdentifier ; case <NUM_LIT:5> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) && ( data [ ++ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNamebreak ; else return TokenNameIdentifier ; case <NUM_LIT:7> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) && ( data [ ++ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNameboolean ; else return TokenNameIdentifier ; default : return TokenNameIdentifier ; } case '<CHAR_LIT:c>' : switch ( length ) { case <NUM_LIT:4> : if ( data [ ++ index ] == '<CHAR_LIT:a>' ) if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) ) return TokenNamecase ; else return TokenNameIdentifier ; else if ( ( data [ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNamechar ; else return TokenNameIdentifier ; case <NUM_LIT:5> : if ( data [ ++ index ] == '<CHAR_LIT:a>' ) if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:c>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNamecatch ; else return TokenNameIdentifier ; else if ( data [ index ] == '<CHAR_LIT>' ) if ( ( data [ ++ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNameclass ; else return TokenNameIdentifier ; else if ( ( data [ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNameconst ; else return TokenNameIdentifier ; case <NUM_LIT:8> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) ) return TokenNamecontinue ; else return TokenNameIdentifier ; default : return TokenNameIdentifier ; } case '<CHAR_LIT>' : switch ( length ) { case <NUM_LIT:2> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNamedo ; else return TokenNameIdentifier ; case <NUM_LIT:6> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:b>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) ) return TokenNamedouble ; else return TokenNameIdentifier ; case <NUM_LIT:7> : if ( ( data [ ++ index ] == '<CHAR_LIT:e>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNamedefault ; else return TokenNameIdentifier ; default : return TokenNameIdentifier ; } case '<CHAR_LIT:e>' : switch ( length ) { case <NUM_LIT:4> : if ( data [ ++ index ] == '<CHAR_LIT>' ) { if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) ) { return TokenNameelse ; } else { return TokenNameIdentifier ; } } else if ( ( data [ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) { if ( this . sourceLevel >= ClassFileConstants . JDK1_5 ) { return TokenNameenum ; } else { this . useEnumAsAnIndentifier = true ; return TokenNameIdentifier ; } } return TokenNameIdentifier ; case <NUM_LIT:7> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNameextends ; else return TokenNameIdentifier ; default : return TokenNameIdentifier ; } case '<CHAR_LIT>' : switch ( length ) { case <NUM_LIT:3> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNamefor ; else return TokenNameIdentifier ; case <NUM_LIT:5> : if ( data [ ++ index ] == '<CHAR_LIT>' ) if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) { return TokenNamefinal ; } else return TokenNameIdentifier ; else if ( data [ index ] == '<CHAR_LIT>' ) if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNamefloat ; else return TokenNameIdentifier ; else if ( ( data [ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) ) return TokenNamefalse ; else return TokenNameIdentifier ; case <NUM_LIT:7> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNamefinally ; else return TokenNameIdentifier ; default : return TokenNameIdentifier ; } case '<CHAR_LIT>' : if ( length == <NUM_LIT:4> ) { if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) { return TokenNamegoto ; } } return TokenNameIdentifier ; case '<CHAR_LIT>' : switch ( length ) { case <NUM_LIT:2> : if ( data [ ++ index ] == '<CHAR_LIT>' ) return TokenNameif ; else return TokenNameIdentifier ; case <NUM_LIT:3> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNameint ; else return TokenNameIdentifier ; case <NUM_LIT:6> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNameimport ; else return TokenNameIdentifier ; case <NUM_LIT:9> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT:c>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) ) return TokenNameinterface ; else return TokenNameIdentifier ; case <NUM_LIT:10> : if ( data [ ++ index ] == '<CHAR_LIT>' ) if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNameimplements ; else return TokenNameIdentifier ; else if ( ( data [ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:c>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNameinstanceof ; else return TokenNameIdentifier ; default : return TokenNameIdentifier ; } case '<CHAR_LIT>' : if ( length == <NUM_LIT:4> ) { if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) { return TokenNamelong ; } } return TokenNameIdentifier ; case '<CHAR_LIT>' : switch ( length ) { case <NUM_LIT:3> : if ( ( data [ ++ index ] == '<CHAR_LIT:e>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNamenew ; else return TokenNameIdentifier ; case <NUM_LIT:4> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNamenull ; else return TokenNameIdentifier ; case <NUM_LIT:6> : if ( ( data [ ++ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) ) { return TokenNamenative ; } else return TokenNameIdentifier ; default : return TokenNameIdentifier ; } case '<CHAR_LIT>' : switch ( length ) { case <NUM_LIT:6> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:b>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:c>' ) ) { return TokenNamepublic ; } else return TokenNameIdentifier ; case <NUM_LIT:7> : if ( data [ ++ index ] == '<CHAR_LIT:a>' ) if ( ( data [ ++ index ] == '<CHAR_LIT:c>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) ) return TokenNamepackage ; else return TokenNameIdentifier ; else if ( ( data [ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) ) { return TokenNameprivate ; } else return TokenNameIdentifier ; case <NUM_LIT:9> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) && ( data [ ++ index ] == '<CHAR_LIT:c>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) { return TokenNameprotected ; } else return TokenNameIdentifier ; default : return TokenNameIdentifier ; } case '<CHAR_LIT>' : if ( length == <NUM_LIT:6> ) { if ( ( data [ ++ index ] == '<CHAR_LIT:e>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) { return TokenNamereturn ; } } return TokenNameIdentifier ; case '<CHAR_LIT>' : switch ( length ) { case <NUM_LIT:5> : if ( data [ ++ index ] == '<CHAR_LIT>' ) if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNameshort ; else return TokenNameIdentifier ; else if ( ( data [ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNamesuper ; else return TokenNameIdentifier ; case <NUM_LIT:6> : if ( data [ ++ index ] == '<CHAR_LIT>' ) if ( ( data [ ++ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:c>' ) ) { return TokenNamestatic ; } else return TokenNameIdentifier ; else if ( ( data [ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:c>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNameswitch ; else return TokenNameIdentifier ; case <NUM_LIT:8> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:c>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNamestrictfp ; else return TokenNameIdentifier ; case <NUM_LIT:12> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:c>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) { return TokenNamesynchronized ; } else return TokenNameIdentifier ; default : return TokenNameIdentifier ; } case '<CHAR_LIT>' : switch ( length ) { case <NUM_LIT:3> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNametry ; else return TokenNameIdentifier ; case <NUM_LIT:4> : if ( data [ ++ index ] == '<CHAR_LIT>' ) if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNamethis ; else return TokenNameIdentifier ; else if ( ( data [ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) ) return TokenNametrue ; else return TokenNameIdentifier ; case <NUM_LIT:5> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNamethrow ; else return TokenNameIdentifier ; case <NUM_LIT:6> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNamethrows ; else return TokenNameIdentifier ; case <NUM_LIT:9> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) { return TokenNametransient ; } else return TokenNameIdentifier ; default : return TokenNameIdentifier ; } case '<CHAR_LIT>' : switch ( length ) { case <NUM_LIT:4> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNamevoid ; else return TokenNameIdentifier ; case <NUM_LIT:8> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) ) { return TokenNamevolatile ; } else return TokenNameIdentifier ; default : return TokenNameIdentifier ; } case '<CHAR_LIT>' : switch ( length ) { case <NUM_LIT:5> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) ) return TokenNamewhile ; else return TokenNameIdentifier ; default : return TokenNameIdentifier ; } default : return TokenNameIdentifier ; } } public int scanNumber ( boolean dotPrefix ) throws InvalidInputException { boolean floating = dotPrefix ; if ( ! dotPrefix && ( this . currentCharacter == '<CHAR_LIT:0>' ) ) { if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) { int start = this . currentPosition ; consumeDigits ( <NUM_LIT:16> , true ) ; int end = this . currentPosition ; if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) { if ( end == start ) { throw new InvalidInputException ( INVALID_HEXA ) ; } return TokenNameLongLiteral ; } else if ( getNextChar ( '<CHAR_LIT:.>' ) ) { boolean hasNoDigitsBeforeDot = end == start ; start = this . currentPosition ; consumeDigits ( <NUM_LIT:16> , true ) ; end = this . currentPosition ; if ( hasNoDigitsBeforeDot && end == start ) { if ( this . sourceLevel < ClassFileConstants . JDK1_5 ) { throw new InvalidInputException ( ILLEGAL_HEXA_LITERAL ) ; } throw new InvalidInputException ( INVALID_HEXA ) ; } if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) { this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; } else { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } if ( ( this . currentCharacter == '<CHAR_LIT:->' ) || ( this . currentCharacter == '<CHAR_LIT>' ) ) { this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; } else { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } } if ( ! ScannerHelper . isDigit ( this . currentCharacter ) ) { if ( this . sourceLevel < ClassFileConstants . JDK1_5 ) { throw new InvalidInputException ( ILLEGAL_HEXA_LITERAL ) ; } if ( this . currentCharacter == '<CHAR_LIT:_>' ) { consumeDigits ( <NUM_LIT:10> ) ; throw new InvalidInputException ( INVALID_UNDERSCORE ) ; } throw new InvalidInputException ( INVALID_HEXA ) ; } consumeDigits ( <NUM_LIT:10> ) ; if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) { if ( this . sourceLevel < ClassFileConstants . JDK1_5 ) { throw new InvalidInputException ( ILLEGAL_HEXA_LITERAL ) ; } return TokenNameFloatingPointLiteral ; } if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) { if ( this . sourceLevel < ClassFileConstants . JDK1_5 ) { throw new InvalidInputException ( ILLEGAL_HEXA_LITERAL ) ; } return TokenNameDoubleLiteral ; } if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) { if ( this . sourceLevel < ClassFileConstants . JDK1_5 ) { throw new InvalidInputException ( ILLEGAL_HEXA_LITERAL ) ; } throw new InvalidInputException ( INVALID_HEXA ) ; } if ( this . sourceLevel < ClassFileConstants . JDK1_5 ) { throw new InvalidInputException ( ILLEGAL_HEXA_LITERAL ) ; } return TokenNameDoubleLiteral ; } else { if ( this . sourceLevel < ClassFileConstants . JDK1_5 ) { throw new InvalidInputException ( ILLEGAL_HEXA_LITERAL ) ; } throw new InvalidInputException ( INVALID_HEXA ) ; } } else if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) { this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; } else { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } if ( ( this . currentCharacter == '<CHAR_LIT:->' ) || ( this . currentCharacter == '<CHAR_LIT>' ) ) { this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; } else { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } } if ( ! ScannerHelper . isDigit ( this . currentCharacter ) ) { if ( this . sourceLevel < ClassFileConstants . JDK1_5 ) { throw new InvalidInputException ( ILLEGAL_HEXA_LITERAL ) ; } if ( this . currentCharacter == '<CHAR_LIT:_>' ) { consumeDigits ( <NUM_LIT:10> ) ; throw new InvalidInputException ( INVALID_UNDERSCORE ) ; } throw new InvalidInputException ( INVALID_FLOAT ) ; } consumeDigits ( <NUM_LIT:10> ) ; if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) { if ( this . sourceLevel < ClassFileConstants . JDK1_5 ) { throw new InvalidInputException ( ILLEGAL_HEXA_LITERAL ) ; } return TokenNameFloatingPointLiteral ; } if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) { if ( this . sourceLevel < ClassFileConstants . JDK1_5 ) { throw new InvalidInputException ( ILLEGAL_HEXA_LITERAL ) ; } return TokenNameDoubleLiteral ; } if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) { if ( this . sourceLevel < ClassFileConstants . JDK1_5 ) { throw new InvalidInputException ( ILLEGAL_HEXA_LITERAL ) ; } throw new InvalidInputException ( INVALID_HEXA ) ; } if ( this . sourceLevel < ClassFileConstants . JDK1_5 ) { throw new InvalidInputException ( ILLEGAL_HEXA_LITERAL ) ; } return TokenNameDoubleLiteral ; } else { if ( end == start ) throw new InvalidInputException ( INVALID_HEXA ) ; return TokenNameIntegerLiteral ; } } else if ( getNextChar ( '<CHAR_LIT:b>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) { int start = this . currentPosition ; consumeDigits ( <NUM_LIT:2> , true ) ; int end = this . currentPosition ; if ( end == start ) { if ( this . sourceLevel < ClassFileConstants . JDK1_7 ) { throw new InvalidInputException ( BINARY_LITERAL_NOT_BELOW_17 ) ; } throw new InvalidInputException ( INVALID_BINARY ) ; } if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) { if ( this . sourceLevel < ClassFileConstants . JDK1_7 ) { throw new InvalidInputException ( BINARY_LITERAL_NOT_BELOW_17 ) ; } return TokenNameLongLiteral ; } if ( this . sourceLevel < ClassFileConstants . JDK1_7 ) { throw new InvalidInputException ( BINARY_LITERAL_NOT_BELOW_17 ) ; } return TokenNameIntegerLiteral ; } if ( getNextCharAsDigit ( ) ) { consumeDigits ( <NUM_LIT:10> ) ; if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) { return TokenNameLongLiteral ; } if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) { return TokenNameFloatingPointLiteral ; } if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) { return TokenNameDoubleLiteral ; } else { boolean isInteger = true ; if ( getNextChar ( '<CHAR_LIT:.>' ) ) { isInteger = false ; consumeDigits ( <NUM_LIT:10> ) ; } if ( getNextChar ( '<CHAR_LIT:e>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) { isInteger = false ; this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; } else { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } if ( ( this . currentCharacter == '<CHAR_LIT:->' ) || ( this . currentCharacter == '<CHAR_LIT>' ) ) { this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; } else { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } } if ( ! ScannerHelper . isDigit ( this . currentCharacter ) ) { if ( this . currentCharacter == '<CHAR_LIT:_>' ) { consumeDigits ( <NUM_LIT:10> ) ; throw new InvalidInputException ( INVALID_UNDERSCORE ) ; } throw new InvalidInputException ( INVALID_FLOAT ) ; } consumeDigits ( <NUM_LIT:10> ) ; } if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) return TokenNameFloatingPointLiteral ; if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> || ! isInteger ) return TokenNameDoubleLiteral ; return TokenNameIntegerLiteral ; } } else { } } consumeDigits ( <NUM_LIT:10> ) ; if ( ( ! dotPrefix ) && ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) ) return TokenNameLongLiteral ; if ( ( ! dotPrefix ) && ( getNextChar ( '<CHAR_LIT:.>' ) ) ) { consumeDigits ( <NUM_LIT:10> , true ) ; floating = true ; } if ( getNextChar ( '<CHAR_LIT:e>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) { floating = true ; this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; } else { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } if ( ( this . currentCharacter == '<CHAR_LIT:->' ) || ( this . currentCharacter == '<CHAR_LIT>' ) ) { this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; } else { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } } if ( ! ScannerHelper . isDigit ( this . currentCharacter ) ) { if ( this . currentCharacter == '<CHAR_LIT:_>' ) { consumeDigits ( <NUM_LIT:10> ) ; throw new InvalidInputException ( INVALID_UNDERSCORE ) ; } throw new InvalidInputException ( INVALID_FLOAT ) ; } consumeDigits ( <NUM_LIT:10> ) ; } if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) return TokenNameDoubleLiteral ; if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) return TokenNameFloatingPointLiteral ; return floating ? TokenNameDoubleLiteral : TokenNameIntegerLiteral ; } public final int getLineNumber ( int position ) { return Util . getLineNumber ( position , this . lineEnds , <NUM_LIT:0> , this . linePtr ) ; } public final void setSource ( char [ ] sourceString ) { int sourceLength ; if ( sourceString == null ) { this . source = CharOperation . NO_CHAR ; sourceLength = <NUM_LIT:0> ; } else { this . source = sourceString ; sourceLength = sourceString . length ; } this . startPosition = - <NUM_LIT:1> ; this . eofPosition = sourceLength ; this . initialPosition = this . currentPosition = <NUM_LIT:0> ; this . containsAssertKeyword = false ; this . linePtr = - <NUM_LIT:1> ; } public final void setSource ( char [ ] contents , CompilationResult compilationResult ) { if ( contents == null ) { char [ ] cuContents = compilationResult . compilationUnit . getContents ( ) ; setSource ( cuContents ) ; } else { setSource ( contents ) ; } int [ ] lineSeparatorPositions = compilationResult . lineSeparatorPositions ; if ( lineSeparatorPositions != null ) { this . lineEnds = lineSeparatorPositions ; this . linePtr = lineSeparatorPositions . length - <NUM_LIT:1> ; } } public final void setSource ( CompilationResult compilationResult ) { setSource ( null , compilationResult ) ; } public String toString ( ) { if ( this . startPosition == this . eofPosition ) return "<STR_LIT>" + new String ( this . source ) ; if ( this . currentPosition > this . eofPosition ) return "<STR_LIT>" + new String ( this . source ) ; if ( this . currentPosition <= <NUM_LIT:0> ) return "<STR_LIT>" + new String ( this . source ) ; StringBuffer buffer = new StringBuffer ( ) ; if ( this . startPosition < <NUM_LIT:1000> ) { buffer . append ( this . source , <NUM_LIT:0> , this . startPosition ) ; } else { buffer . append ( "<STR_LIT>" ) ; int line = Util . getLineNumber ( this . startPosition - <NUM_LIT:1000> , this . lineEnds , <NUM_LIT:0> , this . linePtr ) ; int lineStart = getLineStart ( line ) ; buffer . append ( this . source , lineStart , this . startPosition - lineStart ) ; } buffer . append ( "<STR_LIT>" ) ; int middleLength = ( this . currentPosition - <NUM_LIT:1> ) - this . startPosition + <NUM_LIT:1> ; if ( middleLength > - <NUM_LIT:1> ) { buffer . append ( this . source , this . startPosition , middleLength ) ; } buffer . append ( "<STR_LIT>" ) ; buffer . append ( this . source , ( this . currentPosition - <NUM_LIT:1> ) + <NUM_LIT:1> , this . eofPosition - ( this . currentPosition - <NUM_LIT:1> ) - <NUM_LIT:1> ) ; return buffer . toString ( ) ; } public String toStringAction ( int act ) { switch ( act ) { case TokenNameIdentifier : return "<STR_LIT>" + new String ( getCurrentTokenSource ( ) ) + "<STR_LIT:)>" ; case TokenNameabstract : return "<STR_LIT>" ; case TokenNameboolean : return "<STR_LIT:boolean>" ; case TokenNamebreak : return "<STR_LIT>" ; case TokenNamebyte : return "<STR_LIT>" ; case TokenNamecase : return "<STR_LIT>" ; case TokenNamecatch : return "<STR_LIT>" ; case TokenNamechar : return "<STR_LIT>" ; case TokenNameclass : return "<STR_LIT:class>" ; case TokenNamecontinue : return "<STR_LIT>" ; case TokenNamedefault : return "<STR_LIT:default>" ; case TokenNamedo : return "<STR_LIT>" ; case TokenNamedouble : return "<STR_LIT:double>" ; case TokenNameelse : return "<STR_LIT>" ; case TokenNameextends : return "<STR_LIT>" ; case TokenNamefalse : return "<STR_LIT:false>" ; case TokenNamefinal : return "<STR_LIT>" ; case TokenNamefinally : return "<STR_LIT>" ; case TokenNamefloat : return "<STR_LIT:float>" ; case TokenNamefor : return "<STR_LIT>" ; case TokenNameif : return "<STR_LIT>" ; case TokenNameimplements : return "<STR_LIT>" ; case TokenNameimport : return "<STR_LIT>" ; case TokenNameinstanceof : return "<STR_LIT>" ; case TokenNameint : return "<STR_LIT:int>" ; case TokenNameinterface : return "<STR_LIT>" ; case TokenNamelong : return "<STR_LIT:long>" ; case TokenNamenative : return "<STR_LIT>" ; case TokenNamenew : return "<STR_LIT>" ; case TokenNamenull : return "<STR_LIT:null>" ; case TokenNamepackage : return "<STR_LIT>" ; case TokenNameprivate : return "<STR_LIT>" ; case TokenNameprotected : return "<STR_LIT>" ; case TokenNamepublic : return "<STR_LIT>" ; case TokenNamereturn : return "<STR_LIT>" ; case TokenNameshort : return "<STR_LIT>" ; case TokenNamestatic : return "<STR_LIT>" ; case TokenNamesuper : return "<STR_LIT>" ; case TokenNameswitch : return "<STR_LIT>" ; case TokenNamesynchronized : return "<STR_LIT>" ; case TokenNamethis : return "<STR_LIT>" ; case TokenNamethrow : return "<STR_LIT>" ; case TokenNamethrows : return "<STR_LIT>" ; case TokenNametransient : return "<STR_LIT>" ; case TokenNametrue : return "<STR_LIT:true>" ; case TokenNametry : return "<STR_LIT>" ; case TokenNamevoid : return "<STR_LIT>" ; case TokenNamevolatile : return "<STR_LIT>" ; case TokenNamewhile : return "<STR_LIT>" ; case TokenNameIntegerLiteral : return "<STR_LIT>" + new String ( getCurrentTokenSource ( ) ) + "<STR_LIT:)>" ; case TokenNameLongLiteral : return "<STR_LIT>" + new String ( getCurrentTokenSource ( ) ) + "<STR_LIT:)>" ; case TokenNameFloatingPointLiteral : return "<STR_LIT>" + new String ( getCurrentTokenSource ( ) ) + "<STR_LIT:)>" ; case TokenNameDoubleLiteral : return "<STR_LIT>" + new String ( getCurrentTokenSource ( ) ) + "<STR_LIT:)>" ; case TokenNameCharacterLiteral : return "<STR_LIT>" + new String ( getCurrentTokenSource ( ) ) + "<STR_LIT:)>" ; case TokenNameStringLiteral : return "<STR_LIT>" + new String ( getCurrentTokenSource ( ) ) + "<STR_LIT:)>" ; case TokenNamePLUS_PLUS : return "<STR_LIT>" ; case TokenNameMINUS_MINUS : return "<STR_LIT:-->" ; case TokenNameEQUAL_EQUAL : return "<STR_LIT>" ; case TokenNameLESS_EQUAL : return "<STR_LIT>" ; case TokenNameGREATER_EQUAL : return "<STR_LIT>" ; case TokenNameNOT_EQUAL : return "<STR_LIT>" ; case TokenNameLEFT_SHIFT : return "<STR_LIT>" ; case TokenNameRIGHT_SHIFT : return "<STR_LIT>" ; case TokenNameUNSIGNED_RIGHT_SHIFT : return "<STR_LIT>" ; case TokenNamePLUS_EQUAL : return "<STR_LIT>" ; case TokenNameMINUS_EQUAL : return "<STR_LIT>" ; case TokenNameMULTIPLY_EQUAL : return "<STR_LIT>" ; case TokenNameDIVIDE_EQUAL : return "<STR_LIT>" ; case TokenNameAND_EQUAL : return "<STR_LIT>" ; case TokenNameOR_EQUAL : return "<STR_LIT>" ; case TokenNameXOR_EQUAL : return "<STR_LIT>" ; case TokenNameREMAINDER_EQUAL : return "<STR_LIT>" ; case TokenNameLEFT_SHIFT_EQUAL : return "<STR_LIT>" ; case TokenNameRIGHT_SHIFT_EQUAL : return "<STR_LIT>" ; case TokenNameUNSIGNED_RIGHT_SHIFT_EQUAL : return "<STR_LIT>" ; case TokenNameOR_OR : return "<STR_LIT>" ; case TokenNameAND_AND : return "<STR_LIT>" ; case TokenNamePLUS : return "<STR_LIT:+>" ; case TokenNameMINUS : return "<STR_LIT:->" ; case TokenNameNOT : return "<STR_LIT:!>" ; case TokenNameREMAINDER : return "<STR_LIT:%>" ; case TokenNameXOR : return "<STR_LIT>" ; case TokenNameAND : return "<STR_LIT:&>" ; case TokenNameMULTIPLY : return "<STR_LIT:*>" ; case TokenNameOR : return "<STR_LIT:|>" ; case TokenNameTWIDDLE : return "<STR_LIT>" ; case TokenNameDIVIDE : return "<STR_LIT:/>" ; case TokenNameGREATER : return "<STR_LIT:>>" ; case TokenNameLESS : return "<STR_LIT:<>" ; case TokenNameLPAREN : return "<STR_LIT:(>" ; case TokenNameRPAREN : return "<STR_LIT:)>" ; case TokenNameLBRACE : return "<STR_LIT:{>" ; case TokenNameRBRACE : return "<STR_LIT:}>" ; case TokenNameLBRACKET : return "<STR_LIT:[>" ; case TokenNameRBRACKET : return "<STR_LIT:]>" ; case TokenNameSEMICOLON : return "<STR_LIT:;>" ; case TokenNameQUESTION : return "<STR_LIT:?>" ; case TokenNameCOLON : return "<STR_LIT::>" ; case TokenNameCOMMA : return "<STR_LIT:U+002C>" ; case TokenNameDOT : return "<STR_LIT:.>" ; case TokenNameEQUAL : return "<STR_LIT:=>" ; case TokenNameEOF : return "<STR_LIT>" ; case TokenNameWHITESPACE : return "<STR_LIT>" + new String ( getCurrentTokenSource ( ) ) + "<STR_LIT:)>" ; default : return "<STR_LIT>" ; } } public void unicodeInitializeBuffer ( int length ) { this . withoutUnicodePtr = length ; if ( this . withoutUnicodeBuffer == null ) this . withoutUnicodeBuffer = new char [ length + ( <NUM_LIT:1> + <NUM_LIT:10> ) ] ; int bLength = this . withoutUnicodeBuffer . length ; if ( <NUM_LIT:1> + length >= bLength ) { System . arraycopy ( this . withoutUnicodeBuffer , <NUM_LIT:0> , this . withoutUnicodeBuffer = new char [ length + ( <NUM_LIT:1> + <NUM_LIT:10> ) ] , <NUM_LIT:0> , bLength ) ; } System . arraycopy ( this . source , this . startPosition , this . withoutUnicodeBuffer , <NUM_LIT:1> , length ) ; } public void unicodeStore ( ) { int pos = ++ this . withoutUnicodePtr ; if ( this . withoutUnicodeBuffer == null ) this . withoutUnicodeBuffer = new char [ <NUM_LIT:10> ] ; int length = this . withoutUnicodeBuffer . length ; if ( pos == length ) { System . arraycopy ( this . withoutUnicodeBuffer , <NUM_LIT:0> , this . withoutUnicodeBuffer = new char [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; } this . withoutUnicodeBuffer [ pos ] = this . currentCharacter ; } public void unicodeStore ( char character ) { int pos = ++ this . withoutUnicodePtr ; if ( this . withoutUnicodeBuffer == null ) this . withoutUnicodeBuffer = new char [ <NUM_LIT:10> ] ; int length = this . withoutUnicodeBuffer . length ; if ( pos == length ) { System . arraycopy ( this . withoutUnicodeBuffer , <NUM_LIT:0> , this . withoutUnicodeBuffer = new char [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; } this . withoutUnicodeBuffer [ pos ] = character ; } public static boolean isIdentifier ( int token ) { return token == TerminalTokens . TokenNameIdentifier ; } public static boolean isLiteral ( int token ) { switch ( token ) { case TerminalTokens . TokenNameIntegerLiteral : case TerminalTokens . TokenNameLongLiteral : case TerminalTokens . TokenNameFloatingPointLiteral : case TerminalTokens . TokenNameDoubleLiteral : case TerminalTokens . TokenNameStringLiteral : case TerminalTokens . TokenNameCharacterLiteral : return true ; default : return false ; } } public static boolean isKeyword ( int token ) { switch ( token ) { case TerminalTokens . TokenNameabstract : case TerminalTokens . TokenNameassert : case TerminalTokens . TokenNamebyte : case TerminalTokens . TokenNamebreak : case TerminalTokens . TokenNameboolean : case TerminalTokens . TokenNamecase : case TerminalTokens . TokenNamechar : case TerminalTokens . TokenNamecatch : case TerminalTokens . TokenNameclass : case TerminalTokens . TokenNamecontinue : case TerminalTokens . TokenNamedo : case TerminalTokens . TokenNamedouble : case TerminalTokens . TokenNamedefault : case TerminalTokens . TokenNameelse : case TerminalTokens . TokenNameextends : case TerminalTokens . TokenNamefor : case TerminalTokens . TokenNamefinal : case TerminalTokens . TokenNamefloat : case TerminalTokens . TokenNamefalse : case TerminalTokens . TokenNamefinally : case TerminalTokens . TokenNameif : case TerminalTokens . TokenNameint : case TerminalTokens . TokenNameimport : case TerminalTokens . TokenNameinterface : case TerminalTokens . TokenNameimplements : case TerminalTokens . TokenNameinstanceof : case TerminalTokens . TokenNamelong : case TerminalTokens . TokenNamenew : case TerminalTokens . TokenNamenull : case TerminalTokens . TokenNamenative : case TerminalTokens . TokenNamepublic : case TerminalTokens . TokenNamepackage : case TerminalTokens . TokenNameprivate : case TerminalTokens . TokenNameprotected : case TerminalTokens . TokenNamereturn : case TerminalTokens . TokenNameshort : case TerminalTokens . TokenNamesuper : case TerminalTokens . TokenNamestatic : case TerminalTokens . TokenNameswitch : case TerminalTokens . TokenNamestrictfp : case TerminalTokens . TokenNamesynchronized : case TerminalTokens . TokenNametry : case TerminalTokens . TokenNamethis : case TerminalTokens . TokenNametrue : case TerminalTokens . TokenNamethrow : case TerminalTokens . TokenNamethrows : case TerminalTokens . TokenNametransient : case TerminalTokens . TokenNamevoid : case TerminalTokens . TokenNamevolatile : case TerminalTokens . TokenNamewhile : return true ; default : return false ; } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . parser ; import java . util . ArrayList ; 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 . util . Util ; public abstract class AbstractCommentParser implements JavadocTagConstants { public final static int COMPIL_PARSER = <NUM_LIT> ; public final static int DOM_PARSER = <NUM_LIT> ; public final static int SELECTION_PARSER = <NUM_LIT> ; public final static int COMPLETION_PARSER = <NUM_LIT> ; public final static int SOURCE_PARSER = <NUM_LIT> ; public final static int FORMATTER_COMMENT_PARSER = <NUM_LIT> ; protected final static int PARSER_KIND = <NUM_LIT> ; protected final static int TEXT_PARSE = <NUM_LIT> ; protected final static int TEXT_VERIF = <NUM_LIT> ; protected final static int QUALIFIED_NAME_RECOVERY = <NUM_LIT:1> ; protected final static int ARGUMENT_RECOVERY = <NUM_LIT:2> ; protected final static int ARGUMENT_TYPE_RECOVERY = <NUM_LIT:3> ; protected final static int EMPTY_ARGUMENT_RECOVERY = <NUM_LIT:4> ; public Scanner scanner ; public char [ ] source ; protected Parser sourceParser ; private int currentTokenType = - <NUM_LIT:1> ; public boolean checkDocComment = false ; public boolean setJavadocPositions = false ; public boolean reportProblems ; protected long complianceLevel ; protected long sourceLevel ; protected long [ ] inheritedPositions ; protected int inheritedPositionsPtr ; private final static int INHERITED_POSITIONS_ARRAY_INCREMENT = <NUM_LIT:4> ; protected boolean deprecated ; protected Object returnStatement ; protected int javadocStart , javadocEnd ; protected int javadocTextStart , javadocTextEnd = - <NUM_LIT:1> ; protected int firstTagPosition ; protected int index , lineEnd ; protected int tokenPreviousPosition , lastIdentifierEndPosition , starPosition ; protected int textStart , memberStart ; protected int tagSourceStart , tagSourceEnd ; protected int inlineTagStart ; protected int [ ] lineEnds ; protected boolean lineStarted = false ; protected boolean inlineTagStarted = false ; protected boolean abort = false ; protected int kind ; protected int tagValue = NO_TAG_VALUE ; protected int lastBlockTagValue = NO_TAG_VALUE ; private int linePtr , lastLinePtr ; protected int identifierPtr ; protected char [ ] [ ] identifierStack ; protected int identifierLengthPtr ; protected int [ ] identifierLengthStack ; protected long [ ] identifierPositionStack ; protected final static int AST_STACK_INCREMENT = <NUM_LIT:10> ; protected int astPtr ; protected Object [ ] astStack ; protected int astLengthPtr ; protected int [ ] astLengthStack ; protected AbstractCommentParser ( Parser sourceParser ) { this . sourceParser = sourceParser ; this . scanner = new Scanner ( false , false , false , ClassFileConstants . JDK1_3 , null , null , true ) ; this . identifierStack = new char [ <NUM_LIT:20> ] [ ] ; this . identifierPositionStack = new long [ <NUM_LIT:20> ] ; this . identifierLengthStack = new int [ <NUM_LIT:10> ] ; this . astStack = new Object [ <NUM_LIT:30> ] ; this . astLengthStack = new int [ <NUM_LIT:20> ] ; this . reportProblems = sourceParser != null ; if ( sourceParser != null ) { this . checkDocComment = this . sourceParser . options . docCommentSupport ; this . sourceLevel = this . sourceParser . options . sourceLevel ; this . scanner . sourceLevel = this . sourceLevel ; this . complianceLevel = this . sourceParser . options . complianceLevel ; } } protected boolean commentParse ( ) { boolean validComment = true ; try { this . astLengthPtr = - <NUM_LIT:1> ; this . astPtr = - <NUM_LIT:1> ; this . identifierPtr = - <NUM_LIT:1> ; this . currentTokenType = - <NUM_LIT:1> ; setInlineTagStarted ( false ) ; this . inlineTagStart = - <NUM_LIT:1> ; this . lineStarted = false ; this . returnStatement = null ; this . inheritedPositions = null ; this . lastBlockTagValue = NO_TAG_VALUE ; this . deprecated = false ; this . lastLinePtr = getLineNumber ( this . javadocEnd ) ; this . textStart = - <NUM_LIT:1> ; this . abort = false ; char previousChar = <NUM_LIT:0> ; int invalidTagLineEnd = - <NUM_LIT:1> ; int invalidInlineTagLineEnd = - <NUM_LIT:1> ; boolean lineHasStar = true ; boolean verifText = ( this . kind & TEXT_VERIF ) != <NUM_LIT:0> ; boolean isDomParser = ( this . kind & DOM_PARSER ) != <NUM_LIT:0> ; boolean isFormatterParser = ( this . kind & FORMATTER_COMMENT_PARSER ) != <NUM_LIT:0> ; int lastStarPosition = - <NUM_LIT:1> ; this . linePtr = getLineNumber ( this . firstTagPosition ) ; int realStart = this . linePtr == <NUM_LIT:1> ? this . javadocStart : this . scanner . getLineEnd ( this . linePtr - <NUM_LIT:1> ) + <NUM_LIT:1> ; if ( realStart < this . javadocStart ) realStart = this . javadocStart ; this . scanner . resetTo ( realStart , this . javadocEnd ) ; this . index = realStart ; if ( realStart == this . javadocStart ) { readChar ( ) ; readChar ( ) ; } int previousPosition = this . index ; char nextCharacter = <NUM_LIT:0> ; if ( realStart == this . javadocStart ) { nextCharacter = readChar ( ) ; while ( peekChar ( ) == '<CHAR_LIT>' ) { nextCharacter = readChar ( ) ; } this . javadocTextStart = this . index ; } this . lineEnd = ( this . linePtr == this . lastLinePtr ) ? this . javadocEnd : this . scanner . getLineEnd ( this . linePtr ) - <NUM_LIT:1> ; this . javadocTextEnd = this . javadocEnd - <NUM_LIT:2> ; int textEndPosition = - <NUM_LIT:1> ; while ( ! this . abort && this . index < this . javadocEnd ) { previousPosition = this . index ; previousChar = nextCharacter ; if ( this . index > ( this . lineEnd + <NUM_LIT:1> ) ) { updateLineEnd ( ) ; } if ( this . currentTokenType < <NUM_LIT:0> ) { nextCharacter = readChar ( ) ; } else { previousPosition = this . scanner . getCurrentTokenStartPosition ( ) ; switch ( this . currentTokenType ) { case TerminalTokens . TokenNameRBRACE : nextCharacter = '<CHAR_LIT:}>' ; break ; case TerminalTokens . TokenNameMULTIPLY : nextCharacter = '<CHAR_LIT>' ; break ; default : nextCharacter = this . scanner . currentCharacter ; } consumeToken ( ) ; } switch ( nextCharacter ) { case '<CHAR_LIT>' : if ( ( ! this . lineStarted || previousChar == '<CHAR_LIT>' ) ) { if ( this . inlineTagStarted ) { setInlineTagStarted ( false ) ; if ( this . reportProblems ) { int end = previousPosition < invalidInlineTagLineEnd ? previousPosition : invalidInlineTagLineEnd ; this . sourceParser . problemReporter ( ) . javadocUnterminatedInlineTag ( this . inlineTagStart , end ) ; } validComment = false ; if ( this . textStart != - <NUM_LIT:1> && this . textStart < textEndPosition ) { pushText ( this . textStart , textEndPosition ) ; } if ( isDomParser || isFormatterParser ) { refreshInlineTagPosition ( textEndPosition ) ; } } if ( previousChar == '<CHAR_LIT>' ) { if ( this . textStart != - <NUM_LIT:1> ) { if ( this . textStart < textEndPosition ) { pushText ( this . textStart , textEndPosition ) ; } } setInlineTagStarted ( true ) ; invalidInlineTagLineEnd = this . lineEnd ; } else if ( this . textStart != - <NUM_LIT:1> && this . textStart < invalidTagLineEnd ) { pushText ( this . textStart , invalidTagLineEnd ) ; } this . scanner . resetTo ( this . index , this . javadocEnd ) ; this . currentTokenType = - <NUM_LIT:1> ; try { if ( ! parseTag ( previousPosition ) ) { validComment = false ; if ( isDomParser ) { createTag ( ) ; } this . textStart = this . tagSourceEnd + <NUM_LIT:1> ; invalidTagLineEnd = this . lineEnd ; textEndPosition = this . index ; } } catch ( InvalidInputException e ) { consumeToken ( ) ; } } else { textEndPosition = this . index ; if ( verifText && this . tagValue == TAG_RETURN_VALUE && this . returnStatement != null ) { refreshReturnStatement ( ) ; } else if ( isFormatterParser ) { if ( this . textStart == - <NUM_LIT:1> ) this . textStart = previousPosition ; } } this . lineStarted = true ; break ; case '<STR_LIT>' : case '<STR_LIT:\n>' : if ( this . lineStarted ) { if ( isFormatterParser && ! ScannerHelper . isWhitespace ( previousChar ) ) { textEndPosition = previousPosition ; } if ( this . textStart != - <NUM_LIT:1> && this . textStart < textEndPosition ) { pushText ( this . textStart , textEndPosition ) ; } } this . lineStarted = false ; lineHasStar = false ; this . textStart = - <NUM_LIT:1> ; break ; case '<CHAR_LIT:}>' : if ( verifText && this . tagValue == TAG_RETURN_VALUE && this . returnStatement != null ) { refreshReturnStatement ( ) ; } if ( this . inlineTagStarted ) { textEndPosition = this . index - <NUM_LIT:1> ; if ( this . lineStarted && this . textStart != - <NUM_LIT:1> && this . textStart < textEndPosition ) { pushText ( this . textStart , textEndPosition ) ; } refreshInlineTagPosition ( previousPosition ) ; if ( ! isFormatterParser ) this . textStart = this . index ; setInlineTagStarted ( false ) ; } else { if ( ! this . lineStarted ) { this . textStart = previousPosition ; } } this . lineStarted = true ; textEndPosition = this . index ; break ; case '<CHAR_LIT>' : if ( verifText && this . tagValue == TAG_RETURN_VALUE && this . returnStatement != null ) { refreshReturnStatement ( ) ; } if ( this . inlineTagStarted ) { setInlineTagStarted ( false ) ; if ( this . reportProblems ) { int end = previousPosition < invalidInlineTagLineEnd ? previousPosition : invalidInlineTagLineEnd ; this . sourceParser . problemReporter ( ) . javadocUnterminatedInlineTag ( this . inlineTagStart , end ) ; } if ( this . lineStarted && this . textStart != - <NUM_LIT:1> && this . textStart < textEndPosition ) { pushText ( this . textStart , textEndPosition ) ; } refreshInlineTagPosition ( textEndPosition ) ; textEndPosition = this . index ; } else if ( peekChar ( ) != '<CHAR_LIT>' ) { if ( this . textStart == - <NUM_LIT:1> ) this . textStart = previousPosition ; textEndPosition = this . index ; } if ( ! this . lineStarted ) { this . textStart = previousPosition ; } this . lineStarted = true ; this . inlineTagStart = previousPosition ; break ; case '<CHAR_LIT>' : lastStarPosition = previousPosition ; if ( previousChar != '<CHAR_LIT>' ) { this . starPosition = previousPosition ; if ( isDomParser || isFormatterParser ) { if ( lineHasStar ) { this . lineStarted = true ; if ( this . textStart == - <NUM_LIT:1> ) { this . textStart = previousPosition ; if ( this . index <= this . javadocTextEnd ) textEndPosition = this . index ; } } if ( ! this . lineStarted ) { lineHasStar = true ; } } } break ; case '<CHAR_LIT>' : case '<CHAR_LIT:U+0020>' : case '<STR_LIT:\t>' : if ( isFormatterParser ) { if ( ! ScannerHelper . isWhitespace ( previousChar ) ) { textEndPosition = previousPosition ; } } else if ( this . lineStarted && isDomParser ) { textEndPosition = this . index ; } break ; case '<CHAR_LIT:/>' : if ( previousChar == '<CHAR_LIT>' ) { break ; } default : if ( isFormatterParser && nextCharacter == '<CHAR_LIT>' ) { int initialIndex = this . index ; this . scanner . resetTo ( this . index , this . javadocEnd ) ; if ( ! ScannerHelper . isWhitespace ( previousChar ) ) { textEndPosition = previousPosition ; } if ( parseHtmlTag ( previousPosition , textEndPosition ) ) { break ; } if ( this . abort ) return false ; this . scanner . currentPosition = initialIndex ; this . index = initialIndex ; } if ( verifText && this . tagValue == TAG_RETURN_VALUE && this . returnStatement != null ) { refreshReturnStatement ( ) ; } if ( ! this . lineStarted || this . textStart == - <NUM_LIT:1> ) { this . textStart = previousPosition ; } this . lineStarted = true ; textEndPosition = this . index ; break ; } } this . javadocTextEnd = this . starPosition - <NUM_LIT:1> ; if ( this . inlineTagStarted ) { if ( this . reportProblems ) { int end = this . javadocTextEnd < invalidInlineTagLineEnd ? this . javadocTextEnd : invalidInlineTagLineEnd ; if ( this . index >= this . javadocEnd ) end = invalidInlineTagLineEnd ; this . sourceParser . problemReporter ( ) . javadocUnterminatedInlineTag ( this . inlineTagStart , end ) ; } if ( this . lineStarted && this . textStart != - <NUM_LIT:1> && this . textStart < textEndPosition ) { pushText ( this . textStart , textEndPosition ) ; } refreshInlineTagPosition ( textEndPosition ) ; setInlineTagStarted ( false ) ; } else if ( this . lineStarted && this . textStart != - <NUM_LIT:1> && this . textStart <= textEndPosition && ( this . textStart < this . starPosition || this . starPosition == lastStarPosition ) ) { pushText ( this . textStart , textEndPosition ) ; } updateDocComment ( ) ; } catch ( Exception ex ) { validComment = false ; } return validComment ; } protected void consumeToken ( ) { this . currentTokenType = - <NUM_LIT:1> ; updateLineEnd ( ) ; } protected abstract Object createArgumentReference ( char [ ] name , int dim , boolean isVarargs , Object typeRef , long [ ] dimPos , long argNamePos ) throws InvalidInputException ; protected boolean createFakeReference ( int start ) { return true ; } protected abstract Object createFieldReference ( Object receiver ) throws InvalidInputException ; protected abstract Object createMethodReference ( Object receiver , List arguments ) throws InvalidInputException ; protected Object createReturnStatement ( ) { return null ; } protected abstract void createTag ( ) ; protected abstract Object createTypeReference ( int primitiveToken ) ; private int getIndexPosition ( ) { if ( this . index > this . lineEnd ) { return this . lineEnd ; } else { return this . index - <NUM_LIT:1> ; } } private int getLineNumber ( int position ) { if ( this . scanner . linePtr != - <NUM_LIT:1> ) { return Util . getLineNumber ( position , this . scanner . lineEnds , <NUM_LIT:0> , this . scanner . linePtr ) ; } if ( this . lineEnds == null ) return <NUM_LIT:1> ; return Util . getLineNumber ( position , this . lineEnds , <NUM_LIT:0> , this . lineEnds . length - <NUM_LIT:1> ) ; } private int getTokenEndPosition ( ) { if ( this . scanner . getCurrentTokenEndPosition ( ) > this . lineEnd ) { return this . lineEnd ; } else { return this . scanner . getCurrentTokenEndPosition ( ) ; } } protected int getCurrentTokenType ( ) { return this . currentTokenType ; } protected Object parseArguments ( Object receiver ) throws InvalidInputException { int modulo = <NUM_LIT:0> ; int iToken = <NUM_LIT:0> ; char [ ] argName = null ; List arguments = new ArrayList ( <NUM_LIT:10> ) ; int start = this . scanner . getCurrentTokenStartPosition ( ) ; Object typeRef = null ; int dim = <NUM_LIT:0> ; boolean isVarargs = false ; long [ ] dimPositions = new long [ <NUM_LIT:20> ] ; char [ ] name = null ; long argNamePos = - <NUM_LIT:1> ; nextArg : while ( this . index < this . scanner . eofPosition ) { try { typeRef = parseQualifiedName ( false ) ; if ( this . abort ) return null ; } catch ( InvalidInputException e ) { break nextArg ; } boolean firstArg = modulo == <NUM_LIT:0> ; if ( firstArg ) { if ( iToken != <NUM_LIT:0> ) break nextArg ; } else if ( ( iToken % modulo ) != <NUM_LIT:0> ) { break nextArg ; } if ( typeRef == null ) { if ( firstArg && this . currentTokenType == TerminalTokens . TokenNameRPAREN ) { if ( ! verifySpaceOrEndComment ( ) ) { int end = this . starPosition == - <NUM_LIT:1> ? this . lineEnd : this . starPosition ; if ( this . source [ end ] == '<STR_LIT:\n>' ) end -- ; if ( this . reportProblems ) this . sourceParser . problemReporter ( ) . javadocMalformedSeeReference ( start , end ) ; return null ; } this . lineStarted = true ; return createMethodReference ( receiver , null ) ; } break nextArg ; } iToken ++ ; dim = <NUM_LIT:0> ; isVarargs = false ; if ( readToken ( ) == TerminalTokens . TokenNameLBRACKET ) { int dimStart = this . scanner . getCurrentTokenStartPosition ( ) ; while ( readToken ( ) == TerminalTokens . TokenNameLBRACKET ) { consumeToken ( ) ; if ( readToken ( ) != TerminalTokens . TokenNameRBRACKET ) { break nextArg ; } consumeToken ( ) ; dimPositions [ dim ++ ] = ( ( ( long ) dimStart ) << <NUM_LIT:32> ) + this . scanner . getCurrentTokenEndPosition ( ) ; } } else if ( readToken ( ) == TerminalTokens . TokenNameELLIPSIS ) { int dimStart = this . scanner . getCurrentTokenStartPosition ( ) ; dimPositions [ dim ++ ] = ( ( ( long ) dimStart ) << <NUM_LIT:32> ) + this . scanner . getCurrentTokenEndPosition ( ) ; consumeToken ( ) ; isVarargs = true ; } argNamePos = - <NUM_LIT:1> ; if ( readToken ( ) == TerminalTokens . TokenNameIdentifier ) { consumeToken ( ) ; if ( firstArg ) { if ( iToken != <NUM_LIT:1> ) break nextArg ; } else if ( ( iToken % modulo ) != <NUM_LIT:1> ) { break nextArg ; } if ( argName == null ) { if ( ! firstArg ) { break nextArg ; } } argName = this . scanner . getCurrentIdentifierSource ( ) ; argNamePos = ( ( ( long ) this . scanner . getCurrentTokenStartPosition ( ) ) << <NUM_LIT:32> ) + this . scanner . getCurrentTokenEndPosition ( ) ; iToken ++ ; } else if ( argName != null ) { break nextArg ; } if ( firstArg ) { modulo = iToken + <NUM_LIT:1> ; } else { if ( ( iToken % modulo ) != ( modulo - <NUM_LIT:1> ) ) { break nextArg ; } } int token = readToken ( ) ; name = argName == null ? CharOperation . NO_CHAR : argName ; if ( token == TerminalTokens . TokenNameCOMMA ) { Object argument = createArgumentReference ( name , dim , isVarargs , typeRef , dimPositions , argNamePos ) ; if ( this . abort ) return null ; arguments . add ( argument ) ; consumeToken ( ) ; iToken ++ ; } else if ( token == TerminalTokens . TokenNameRPAREN ) { if ( ! verifySpaceOrEndComment ( ) ) { int end = this . starPosition == - <NUM_LIT:1> ? this . lineEnd : this . starPosition ; if ( this . source [ end ] == '<STR_LIT:\n>' ) end -- ; if ( this . reportProblems ) this . sourceParser . problemReporter ( ) . javadocMalformedSeeReference ( start , end ) ; return null ; } Object argument = createArgumentReference ( name , dim , isVarargs , typeRef , dimPositions , argNamePos ) ; if ( this . abort ) return null ; arguments . add ( argument ) ; consumeToken ( ) ; return createMethodReference ( receiver , arguments ) ; } else { break nextArg ; } } throw new InvalidInputException ( ) ; } protected boolean parseHtmlTag ( int previousPosition , int endTextPosition ) throws InvalidInputException { return false ; } protected boolean parseHref ( ) throws InvalidInputException { boolean skipComments = this . scanner . skipComments ; this . scanner . skipComments = true ; try { int start = this . scanner . getCurrentTokenStartPosition ( ) ; char currentChar = readChar ( ) ; if ( currentChar == '<CHAR_LIT:a>' || currentChar == '<CHAR_LIT:A>' ) { this . scanner . currentPosition = this . index ; if ( readToken ( ) == TerminalTokens . TokenNameIdentifier ) { consumeToken ( ) ; try { if ( CharOperation . equals ( this . scanner . getCurrentIdentifierSource ( ) , HREF_TAG , false ) && readToken ( ) == TerminalTokens . TokenNameEQUAL ) { consumeToken ( ) ; if ( readToken ( ) == TerminalTokens . TokenNameStringLiteral ) { consumeToken ( ) ; while ( this . index < this . javadocEnd ) { while ( readToken ( ) != TerminalTokens . TokenNameGREATER ) { if ( this . scanner . currentPosition >= this . scanner . eofPosition || this . scanner . currentCharacter == '<CHAR_LIT>' || ( this . inlineTagStarted && this . scanner . currentCharacter == '<CHAR_LIT:}>' ) ) { this . index = this . tokenPreviousPosition ; this . scanner . currentPosition = this . tokenPreviousPosition ; this . currentTokenType = - <NUM_LIT:1> ; if ( this . tagValue != TAG_VALUE_VALUE ) { if ( this . reportProblems ) this . sourceParser . problemReporter ( ) . javadocInvalidSeeHref ( start , this . lineEnd ) ; } return false ; } this . currentTokenType = - <NUM_LIT:1> ; } consumeToken ( ) ; while ( readToken ( ) != TerminalTokens . TokenNameLESS ) { if ( this . scanner . currentPosition >= this . scanner . eofPosition || this . scanner . currentCharacter == '<CHAR_LIT>' || ( this . inlineTagStarted && this . scanner . currentCharacter == '<CHAR_LIT:}>' ) ) { this . index = this . tokenPreviousPosition ; this . scanner . currentPosition = this . tokenPreviousPosition ; this . currentTokenType = - <NUM_LIT:1> ; if ( this . tagValue != TAG_VALUE_VALUE ) { if ( this . reportProblems ) this . sourceParser . problemReporter ( ) . javadocInvalidSeeHref ( start , this . lineEnd ) ; } return false ; } consumeToken ( ) ; } consumeToken ( ) ; start = this . scanner . getCurrentTokenStartPosition ( ) ; currentChar = readChar ( ) ; if ( currentChar == '<CHAR_LIT:/>' ) { currentChar = readChar ( ) ; if ( currentChar == '<CHAR_LIT:a>' || currentChar == '<CHAR_LIT:A>' ) { currentChar = readChar ( ) ; if ( currentChar == '<CHAR_LIT:>>' ) { return true ; } } } if ( currentChar == '<STR_LIT>' || currentChar == '<STR_LIT:\n>' || currentChar == '<STR_LIT:\t>' || currentChar == '<CHAR_LIT:U+0020>' ) { break ; } } } } } catch ( InvalidInputException ex ) { } } } this . index = this . tokenPreviousPosition ; this . scanner . currentPosition = this . tokenPreviousPosition ; this . currentTokenType = - <NUM_LIT:1> ; if ( this . tagValue != TAG_VALUE_VALUE ) { if ( this . reportProblems ) this . sourceParser . problemReporter ( ) . javadocInvalidSeeHref ( start , this . lineEnd ) ; } } finally { this . scanner . skipComments = skipComments ; } return false ; } protected boolean parseIdentifierTag ( boolean report ) { int token = readTokenSafely ( ) ; switch ( token ) { case TerminalTokens . TokenNameIdentifier : pushIdentifier ( true , false ) ; return true ; } if ( report ) { this . sourceParser . problemReporter ( ) . javadocMissingIdentifier ( this . tagSourceStart , this . tagSourceEnd , this . sourceParser . modifiers ) ; } return false ; } protected Object parseMember ( Object receiver ) throws InvalidInputException { this . identifierPtr = - <NUM_LIT:1> ; this . identifierLengthPtr = - <NUM_LIT:1> ; int start = this . scanner . getCurrentTokenStartPosition ( ) ; this . memberStart = start ; if ( readToken ( ) == TerminalTokens . TokenNameIdentifier ) { if ( this . scanner . currentCharacter == '<CHAR_LIT:.>' ) { parseQualifiedName ( true ) ; } else { consumeToken ( ) ; pushIdentifier ( true , false ) ; } int previousPosition = this . index ; if ( readToken ( ) == TerminalTokens . TokenNameLPAREN ) { consumeToken ( ) ; start = this . scanner . getCurrentTokenStartPosition ( ) ; try { return parseArguments ( receiver ) ; } catch ( InvalidInputException e ) { int end = this . scanner . getCurrentTokenEndPosition ( ) < this . lineEnd ? this . scanner . getCurrentTokenEndPosition ( ) : this . scanner . getCurrentTokenStartPosition ( ) ; end = end < this . lineEnd ? end : this . lineEnd ; if ( this . reportProblems ) this . sourceParser . problemReporter ( ) . javadocInvalidSeeReferenceArgs ( start , end ) ; } return null ; } this . index = previousPosition ; this . scanner . currentPosition = previousPosition ; this . currentTokenType = - <NUM_LIT:1> ; if ( ! verifySpaceOrEndComment ( ) ) { int end = this . starPosition == - <NUM_LIT:1> ? this . lineEnd : this . starPosition ; if ( this . source [ end ] == '<STR_LIT:\n>' ) end -- ; if ( this . reportProblems ) this . sourceParser . problemReporter ( ) . javadocMalformedSeeReference ( start , end ) ; return null ; } return createFieldReference ( receiver ) ; } int end = getTokenEndPosition ( ) - <NUM_LIT:1> ; end = start > end ? start : end ; if ( this . reportProblems ) this . sourceParser . problemReporter ( ) . javadocInvalidReference ( start , end ) ; this . index = this . tokenPreviousPosition ; this . scanner . currentPosition = this . tokenPreviousPosition ; this . currentTokenType = - <NUM_LIT:1> ; return null ; } protected boolean parseParam ( ) throws InvalidInputException { int start = this . tagSourceStart ; int end = this . tagSourceEnd ; boolean tokenWhiteSpace = this . scanner . tokenizeWhiteSpace ; this . scanner . tokenizeWhiteSpace = true ; try { boolean isCompletionParser = ( this . kind & COMPLETION_PARSER ) != <NUM_LIT:0> ; if ( this . scanner . currentCharacter != '<CHAR_LIT:U+0020>' && ! ScannerHelper . isWhitespace ( this . scanner . currentCharacter ) ) { if ( this . reportProblems ) this . sourceParser . problemReporter ( ) . javadocInvalidTag ( start , this . scanner . getCurrentTokenEndPosition ( ) ) ; if ( ! isCompletionParser ) { this . scanner . currentPosition = start ; this . index = start ; } this . currentTokenType = - <NUM_LIT:1> ; return false ; } this . identifierPtr = - <NUM_LIT:1> ; this . identifierLengthPtr = - <NUM_LIT:1> ; boolean hasMultiLines = this . scanner . currentPosition > ( this . lineEnd + <NUM_LIT:1> ) ; boolean isTypeParam = false ; boolean valid = true , empty = true ; boolean mayBeGeneric = this . sourceLevel >= ClassFileConstants . JDK1_5 ; int token = - <NUM_LIT:1> ; nextToken : while ( true ) { this . currentTokenType = - <NUM_LIT:1> ; try { token = readToken ( ) ; } catch ( InvalidInputException e ) { valid = false ; } switch ( token ) { case TerminalTokens . TokenNameIdentifier : if ( valid ) { pushIdentifier ( true , false ) ; start = this . scanner . getCurrentTokenStartPosition ( ) ; end = hasMultiLines ? this . lineEnd : this . scanner . getCurrentTokenEndPosition ( ) ; break nextToken ; } case TerminalTokens . TokenNameLESS : if ( valid && mayBeGeneric ) { pushIdentifier ( true , true ) ; start = this . scanner . getCurrentTokenStartPosition ( ) ; end = hasMultiLines ? this . lineEnd : this . scanner . getCurrentTokenEndPosition ( ) ; isTypeParam = true ; break nextToken ; } default : if ( token == TerminalTokens . TokenNameLEFT_SHIFT ) isTypeParam = true ; if ( valid && ! hasMultiLines ) start = this . scanner . getCurrentTokenStartPosition ( ) ; valid = false ; if ( ! hasMultiLines ) { empty = false ; end = hasMultiLines ? this . lineEnd : this . scanner . getCurrentTokenEndPosition ( ) ; break ; } end = this . lineEnd ; case TerminalTokens . TokenNameWHITESPACE : if ( this . scanner . currentPosition > ( this . lineEnd + <NUM_LIT:1> ) ) hasMultiLines = true ; if ( valid ) break ; case TerminalTokens . TokenNameEOF : if ( this . reportProblems ) if ( empty ) this . sourceParser . problemReporter ( ) . javadocMissingParamName ( start , end , this . sourceParser . modifiers ) ; else if ( mayBeGeneric && isTypeParam ) this . sourceParser . problemReporter ( ) . javadocInvalidParamTypeParameter ( start , end ) ; else this . sourceParser . problemReporter ( ) . javadocInvalidParamTagName ( start , end ) ; if ( ! isCompletionParser ) { this . scanner . currentPosition = start ; this . index = start ; } this . currentTokenType = - <NUM_LIT:1> ; return false ; } } if ( isTypeParam && mayBeGeneric ) { nextToken : while ( true ) { this . currentTokenType = - <NUM_LIT:1> ; try { token = readToken ( ) ; } catch ( InvalidInputException e ) { valid = false ; } switch ( token ) { case TerminalTokens . TokenNameWHITESPACE : if ( valid && this . scanner . currentPosition <= ( this . lineEnd + <NUM_LIT:1> ) ) { break ; } case TerminalTokens . TokenNameEOF : if ( this . reportProblems ) this . sourceParser . problemReporter ( ) . javadocInvalidParamTypeParameter ( start , end ) ; if ( ! isCompletionParser ) { this . scanner . currentPosition = start ; this . index = start ; } this . currentTokenType = - <NUM_LIT:1> ; return false ; case TerminalTokens . TokenNameIdentifier : end = hasMultiLines ? this . lineEnd : this . scanner . getCurrentTokenEndPosition ( ) ; if ( valid ) { pushIdentifier ( false , false ) ; break nextToken ; } break ; default : end = hasMultiLines ? this . lineEnd : this . scanner . getCurrentTokenEndPosition ( ) ; valid = false ; break ; } } boolean spaces = false ; nextToken : while ( true ) { this . currentTokenType = - <NUM_LIT:1> ; try { token = readToken ( ) ; } catch ( InvalidInputException e ) { valid = false ; } switch ( token ) { case TerminalTokens . TokenNameWHITESPACE : if ( this . scanner . currentPosition > ( this . lineEnd + <NUM_LIT:1> ) ) { hasMultiLines = true ; valid = false ; } spaces = true ; if ( valid ) break ; case TerminalTokens . TokenNameEOF : if ( this . reportProblems ) this . sourceParser . problemReporter ( ) . javadocInvalidParamTypeParameter ( start , end ) ; if ( ! isCompletionParser ) { this . scanner . currentPosition = start ; this . index = start ; } this . currentTokenType = - <NUM_LIT:1> ; return false ; case TerminalTokens . TokenNameGREATER : end = hasMultiLines ? this . lineEnd : this . scanner . getCurrentTokenEndPosition ( ) ; if ( valid ) { pushIdentifier ( false , true ) ; break nextToken ; } break ; default : if ( ! spaces ) end = hasMultiLines ? this . lineEnd : this . scanner . getCurrentTokenEndPosition ( ) ; valid = false ; break ; } } } if ( valid ) { this . currentTokenType = - <NUM_LIT:1> ; int restart = this . scanner . currentPosition ; try { token = readTokenAndConsume ( ) ; } catch ( InvalidInputException e ) { valid = false ; } if ( token == TerminalTokens . TokenNameWHITESPACE ) { this . scanner . resetTo ( restart , this . javadocEnd ) ; this . index = restart ; return pushParamName ( isTypeParam ) ; } } this . currentTokenType = - <NUM_LIT:1> ; if ( isCompletionParser ) return false ; if ( this . reportProblems ) { end = hasMultiLines ? this . lineEnd : this . scanner . getCurrentTokenEndPosition ( ) ; try { while ( ( token = readToken ( ) ) != TerminalTokens . TokenNameWHITESPACE && token != TerminalTokens . TokenNameEOF ) { this . currentTokenType = - <NUM_LIT:1> ; end = hasMultiLines ? this . lineEnd : this . scanner . getCurrentTokenEndPosition ( ) ; } } catch ( InvalidInputException e ) { end = this . lineEnd ; } if ( mayBeGeneric && isTypeParam ) this . sourceParser . problemReporter ( ) . javadocInvalidParamTypeParameter ( start , end ) ; else this . sourceParser . problemReporter ( ) . javadocInvalidParamTagName ( start , end ) ; } this . scanner . currentPosition = start ; this . index = start ; this . currentTokenType = - <NUM_LIT:1> ; return false ; } finally { this . scanner . tokenizeWhiteSpace = tokenWhiteSpace ; } } protected Object parseQualifiedName ( boolean reset ) throws InvalidInputException { if ( reset ) { this . identifierPtr = - <NUM_LIT:1> ; this . identifierLengthPtr = - <NUM_LIT:1> ; } int primitiveToken = - <NUM_LIT:1> ; int parserKind = this . kind & PARSER_KIND ; nextToken : for ( int iToken = <NUM_LIT:0> ; ; iToken ++ ) { int token = readTokenSafely ( ) ; switch ( token ) { case TerminalTokens . TokenNameIdentifier : if ( ( ( iToken & <NUM_LIT:1> ) != <NUM_LIT:0> ) ) { break nextToken ; } pushIdentifier ( iToken == <NUM_LIT:0> , false ) ; consumeToken ( ) ; break ; case TerminalTokens . TokenNameDOT : if ( ( iToken & <NUM_LIT:1> ) == <NUM_LIT:0> ) { throw new InvalidInputException ( ) ; } consumeToken ( ) ; break ; case TerminalTokens . TokenNameabstract : case TerminalTokens . TokenNameassert : case TerminalTokens . TokenNameboolean : case TerminalTokens . TokenNamebreak : case TerminalTokens . TokenNamebyte : case TerminalTokens . TokenNamecase : case TerminalTokens . TokenNamecatch : case TerminalTokens . TokenNamechar : case TerminalTokens . TokenNameclass : case TerminalTokens . TokenNamecontinue : case TerminalTokens . TokenNamedefault : case TerminalTokens . TokenNamedo : case TerminalTokens . TokenNamedouble : case TerminalTokens . TokenNameelse : case TerminalTokens . TokenNameextends : case TerminalTokens . TokenNamefalse : case TerminalTokens . TokenNamefinal : case TerminalTokens . TokenNamefinally : case TerminalTokens . TokenNamefloat : case TerminalTokens . TokenNamefor : case TerminalTokens . TokenNameif : case TerminalTokens . TokenNameimplements : case TerminalTokens . TokenNameimport : case TerminalTokens . TokenNameinstanceof : case TerminalTokens . TokenNameint : case TerminalTokens . TokenNameinterface : case TerminalTokens . TokenNamelong : case TerminalTokens . TokenNamenative : case TerminalTokens . TokenNamenew : case TerminalTokens . TokenNamenull : case TerminalTokens . TokenNamepackage : case TerminalTokens . TokenNameprivate : case TerminalTokens . TokenNameprotected : case TerminalTokens . TokenNamepublic : case TerminalTokens . TokenNameshort : case TerminalTokens . TokenNamestatic : case TerminalTokens . TokenNamestrictfp : case TerminalTokens . TokenNamesuper : case TerminalTokens . TokenNameswitch : case TerminalTokens . TokenNamesynchronized : case TerminalTokens . TokenNamethis : case TerminalTokens . TokenNamethrow : case TerminalTokens . TokenNametransient : case TerminalTokens . TokenNametrue : case TerminalTokens . TokenNametry : case TerminalTokens . TokenNamevoid : case TerminalTokens . TokenNamevolatile : case TerminalTokens . TokenNamewhile : if ( iToken == <NUM_LIT:0> ) { pushIdentifier ( true , true ) ; primitiveToken = token ; consumeToken ( ) ; break nextToken ; } default : if ( iToken == <NUM_LIT:0> ) { if ( this . identifierPtr >= <NUM_LIT:0> ) { this . lastIdentifierEndPosition = ( int ) this . identifierPositionStack [ this . identifierPtr ] ; } return null ; } if ( ( iToken & <NUM_LIT:1> ) == <NUM_LIT:0> ) { switch ( parserKind ) { case COMPLETION_PARSER : if ( this . identifierPtr >= <NUM_LIT:0> ) { this . lastIdentifierEndPosition = ( int ) this . identifierPositionStack [ this . identifierPtr ] ; } return syntaxRecoverQualifiedName ( primitiveToken ) ; case DOM_PARSER : if ( this . currentTokenType != - <NUM_LIT:1> ) { this . index = this . tokenPreviousPosition ; this . scanner . currentPosition = this . tokenPreviousPosition ; this . currentTokenType = - <NUM_LIT:1> ; } default : throw new InvalidInputException ( ) ; } } break nextToken ; } } if ( parserKind != COMPLETION_PARSER && this . currentTokenType != - <NUM_LIT:1> ) { this . index = this . tokenPreviousPosition ; this . scanner . currentPosition = this . tokenPreviousPosition ; this . currentTokenType = - <NUM_LIT:1> ; } if ( this . identifierPtr >= <NUM_LIT:0> ) { this . lastIdentifierEndPosition = ( int ) this . identifierPositionStack [ this . identifierPtr ] ; } return createTypeReference ( primitiveToken ) ; } protected boolean parseReference ( ) throws InvalidInputException { int currentPosition = this . scanner . currentPosition ; try { Object typeRef = null ; Object reference = null ; int previousPosition = - <NUM_LIT:1> ; int typeRefStartPosition = - <NUM_LIT:1> ; nextToken : while ( this . index < this . scanner . eofPosition ) { previousPosition = this . index ; int token = readTokenSafely ( ) ; switch ( token ) { case TerminalTokens . TokenNameStringLiteral : if ( typeRef != null ) break nextToken ; consumeToken ( ) ; int start = this . scanner . getCurrentTokenStartPosition ( ) ; if ( this . tagValue == TAG_VALUE_VALUE ) { if ( this . reportProblems ) this . sourceParser . problemReporter ( ) . javadocInvalidValueReference ( start , getTokenEndPosition ( ) , this . sourceParser . modifiers ) ; return false ; } if ( verifyEndLine ( previousPosition ) ) { return createFakeReference ( start ) ; } if ( this . reportProblems ) this . sourceParser . problemReporter ( ) . javadocUnexpectedText ( this . scanner . currentPosition , this . lineEnd ) ; return false ; case TerminalTokens . TokenNameLESS : if ( typeRef != null ) break nextToken ; consumeToken ( ) ; start = this . scanner . getCurrentTokenStartPosition ( ) ; if ( parseHref ( ) ) { consumeToken ( ) ; if ( this . tagValue == TAG_VALUE_VALUE ) { if ( this . reportProblems ) this . sourceParser . problemReporter ( ) . javadocInvalidValueReference ( start , getIndexPosition ( ) , this . sourceParser . modifiers ) ; return false ; } if ( verifyEndLine ( previousPosition ) ) { return createFakeReference ( start ) ; } if ( this . reportProblems ) this . sourceParser . problemReporter ( ) . javadocUnexpectedText ( this . scanner . currentPosition , this . lineEnd ) ; } else if ( this . tagValue == TAG_VALUE_VALUE ) { if ( this . reportProblems ) this . sourceParser . problemReporter ( ) . javadocInvalidValueReference ( start , getIndexPosition ( ) , this . sourceParser . modifiers ) ; } return false ; case TerminalTokens . TokenNameERROR : consumeToken ( ) ; if ( this . scanner . currentCharacter == '<CHAR_LIT>' ) { reference = parseMember ( typeRef ) ; if ( reference != null ) { return pushSeeRef ( reference ) ; } return false ; } char [ ] currentError = this . scanner . getCurrentIdentifierSource ( ) ; if ( currentError . length > <NUM_LIT:0> && currentError [ <NUM_LIT:0> ] == '<CHAR_LIT:">' ) { if ( this . reportProblems ) { boolean isUrlRef = false ; if ( this . tagValue == TAG_SEE_VALUE ) { int length = currentError . length , i = <NUM_LIT:1> ; while ( i < length && ScannerHelper . isLetter ( currentError [ i ] ) ) { i ++ ; } if ( i < ( length - <NUM_LIT:2> ) && currentError [ i ] == '<CHAR_LIT::>' && currentError [ i + <NUM_LIT:1> ] == '<CHAR_LIT:/>' && currentError [ i + <NUM_LIT:2> ] == '<CHAR_LIT:/>' ) { isUrlRef = true ; } } if ( isUrlRef ) { this . sourceParser . problemReporter ( ) . javadocInvalidSeeUrlReference ( this . scanner . getCurrentTokenStartPosition ( ) , getTokenEndPosition ( ) ) ; } else { this . sourceParser . problemReporter ( ) . javadocInvalidReference ( this . scanner . getCurrentTokenStartPosition ( ) , getTokenEndPosition ( ) ) ; } } return false ; } break nextToken ; case TerminalTokens . TokenNameIdentifier : if ( typeRef == null ) { typeRefStartPosition = this . scanner . getCurrentTokenStartPosition ( ) ; typeRef = parseQualifiedName ( true ) ; if ( this . abort ) return false ; break ; } break nextToken ; default : break nextToken ; } } if ( reference == null ) reference = typeRef ; if ( reference == null ) { this . index = this . tokenPreviousPosition ; this . scanner . currentPosition = this . tokenPreviousPosition ; this . currentTokenType = - <NUM_LIT:1> ; if ( this . tagValue == TAG_VALUE_VALUE ) { if ( ( this . kind & DOM_PARSER ) != <NUM_LIT:0> ) createTag ( ) ; return true ; } if ( this . reportProblems ) { this . sourceParser . problemReporter ( ) . javadocMissingReference ( this . tagSourceStart , this . tagSourceEnd , this . sourceParser . modifiers ) ; } return false ; } if ( this . lastIdentifierEndPosition > this . javadocStart ) { this . index = this . lastIdentifierEndPosition + <NUM_LIT:1> ; this . scanner . currentPosition = this . index ; } this . currentTokenType = - <NUM_LIT:1> ; if ( this . tagValue == TAG_VALUE_VALUE ) { if ( this . reportProblems ) this . sourceParser . problemReporter ( ) . javadocInvalidReference ( typeRefStartPosition , this . lineEnd ) ; return false ; } int currentIndex = this . index ; char ch = readChar ( ) ; switch ( ch ) { case '<CHAR_LIT:(>' : if ( this . reportProblems ) this . sourceParser . problemReporter ( ) . javadocMissingHashCharacter ( typeRefStartPosition , this . lineEnd , String . valueOf ( this . source , typeRefStartPosition , this . lineEnd - typeRefStartPosition + <NUM_LIT:1> ) ) ; return false ; case '<CHAR_LIT::>' : ch = readChar ( ) ; if ( ch == '<CHAR_LIT:/>' && ch == readChar ( ) ) { if ( this . reportProblems ) { this . sourceParser . problemReporter ( ) . javadocInvalidSeeUrlReference ( typeRefStartPosition , this . lineEnd ) ; return false ; } } } this . index = currentIndex ; if ( ! verifySpaceOrEndComment ( ) ) { this . index = this . tokenPreviousPosition ; this . scanner . currentPosition = this . tokenPreviousPosition ; this . currentTokenType = - <NUM_LIT:1> ; int end = this . starPosition == - <NUM_LIT:1> ? this . lineEnd : this . starPosition ; if ( this . source [ end ] == '<STR_LIT:\n>' ) end -- ; if ( this . reportProblems ) this . sourceParser . problemReporter ( ) . javadocMalformedSeeReference ( typeRefStartPosition , end ) ; return false ; } return pushSeeRef ( reference ) ; } catch ( InvalidInputException ex ) { if ( this . reportProblems ) this . sourceParser . problemReporter ( ) . javadocInvalidReference ( currentPosition , getTokenEndPosition ( ) ) ; } this . index = this . tokenPreviousPosition ; this . scanner . currentPosition = this . tokenPreviousPosition ; this . currentTokenType = - <NUM_LIT:1> ; return false ; } protected abstract boolean parseTag ( int previousPosition ) throws InvalidInputException ; protected boolean parseThrows ( ) { int start = this . scanner . currentPosition ; try { Object typeRef = parseQualifiedName ( true ) ; if ( this . abort ) return false ; if ( typeRef == null ) { if ( this . reportProblems ) this . sourceParser . problemReporter ( ) . javadocMissingThrowsClassName ( this . tagSourceStart , this . tagSourceEnd , this . sourceParser . modifiers ) ; } else { return pushThrowName ( typeRef ) ; } } catch ( InvalidInputException ex ) { if ( this . reportProblems ) this . sourceParser . problemReporter ( ) . javadocInvalidThrowsClass ( start , getTokenEndPosition ( ) ) ; } return false ; } protected char peekChar ( ) { int idx = this . index ; char c = this . source [ idx ++ ] ; if ( c == '<STR_LIT:\\>' && this . source [ idx ] == '<CHAR_LIT>' ) { int c1 , c2 , c3 , c4 ; idx ++ ; while ( this . source [ idx ] == '<CHAR_LIT>' ) idx ++ ; if ( ! ( ( ( c1 = ScannerHelper . getHexadecimalValue ( this . source [ idx ++ ] ) ) > <NUM_LIT:15> || c1 < <NUM_LIT:0> ) || ( ( c2 = ScannerHelper . getHexadecimalValue ( this . source [ idx ++ ] ) ) > <NUM_LIT:15> || c2 < <NUM_LIT:0> ) || ( ( c3 = ScannerHelper . getHexadecimalValue ( this . source [ idx ++ ] ) ) > <NUM_LIT:15> || c3 < <NUM_LIT:0> ) || ( ( c4 = ScannerHelper . getHexadecimalValue ( this . source [ idx ++ ] ) ) > <NUM_LIT:15> || c4 < <NUM_LIT:0> ) ) ) { c = ( char ) ( ( ( c1 * <NUM_LIT:16> + c2 ) * <NUM_LIT:16> + c3 ) * <NUM_LIT:16> + c4 ) ; } } return c ; } protected void pushIdentifier ( boolean newLength , boolean isToken ) { int stackLength = this . identifierStack . length ; if ( ++ this . identifierPtr >= stackLength ) { System . arraycopy ( this . identifierStack , <NUM_LIT:0> , this . identifierStack = new char [ stackLength + <NUM_LIT:10> ] [ ] , <NUM_LIT:0> , stackLength ) ; System . arraycopy ( this . identifierPositionStack , <NUM_LIT:0> , this . identifierPositionStack = new long [ stackLength + <NUM_LIT:10> ] , <NUM_LIT:0> , stackLength ) ; } this . identifierStack [ this . identifierPtr ] = isToken ? this . scanner . getCurrentTokenSource ( ) : this . scanner . getCurrentIdentifierSource ( ) ; this . identifierPositionStack [ this . identifierPtr ] = ( ( ( long ) this . scanner . startPosition ) << <NUM_LIT:32> ) + ( this . scanner . currentPosition - <NUM_LIT:1> ) ; if ( newLength ) { stackLength = this . identifierLengthStack . length ; if ( ++ this . identifierLengthPtr >= stackLength ) { System . arraycopy ( this . identifierLengthStack , <NUM_LIT:0> , this . identifierLengthStack = new int [ stackLength + <NUM_LIT:10> ] , <NUM_LIT:0> , stackLength ) ; } this . identifierLengthStack [ this . identifierLengthPtr ] = <NUM_LIT:1> ; } else { this . identifierLengthStack [ this . identifierLengthPtr ] ++ ; } } protected void pushOnAstStack ( Object node , boolean newLength ) { if ( node == null ) { int stackLength = this . astLengthStack . length ; if ( ++ this . astLengthPtr >= stackLength ) { System . arraycopy ( this . astLengthStack , <NUM_LIT:0> , this . astLengthStack = new int [ stackLength + AST_STACK_INCREMENT ] , <NUM_LIT:0> , stackLength ) ; } this . astLengthStack [ this . astLengthPtr ] = <NUM_LIT:0> ; return ; } int stackLength = this . astStack . length ; if ( ++ this . astPtr >= stackLength ) { System . arraycopy ( this . astStack , <NUM_LIT:0> , this . astStack = new Object [ stackLength + AST_STACK_INCREMENT ] , <NUM_LIT:0> , stackLength ) ; this . astPtr = stackLength ; } this . astStack [ this . astPtr ] = node ; if ( newLength ) { stackLength = this . astLengthStack . length ; if ( ++ this . astLengthPtr >= stackLength ) { System . arraycopy ( this . astLengthStack , <NUM_LIT:0> , this . astLengthStack = new int [ stackLength + AST_STACK_INCREMENT ] , <NUM_LIT:0> , stackLength ) ; } this . astLengthStack [ this . astLengthPtr ] = <NUM_LIT:1> ; } else { this . astLengthStack [ this . astLengthPtr ] ++ ; } } protected abstract boolean pushParamName ( boolean isTypeParam ) ; protected abstract boolean pushSeeRef ( Object statement ) ; protected void pushText ( int start , int end ) { } protected abstract boolean pushThrowName ( Object typeRef ) ; protected char readChar ( ) { char c = this . source [ this . index ++ ] ; if ( c == '<STR_LIT:\\>' && this . source [ this . index ] == '<CHAR_LIT>' ) { int c1 , c2 , c3 , c4 ; int pos = this . index ; this . index ++ ; while ( this . source [ this . index ] == '<CHAR_LIT>' ) this . index ++ ; if ( ! ( ( ( c1 = ScannerHelper . getHexadecimalValue ( this . source [ this . index ++ ] ) ) > <NUM_LIT:15> || c1 < <NUM_LIT:0> ) || ( ( c2 = ScannerHelper . getHexadecimalValue ( this . source [ this . index ++ ] ) ) > <NUM_LIT:15> || c2 < <NUM_LIT:0> ) || ( ( c3 = ScannerHelper . getHexadecimalValue ( this . source [ this . index ++ ] ) ) > <NUM_LIT:15> || c3 < <NUM_LIT:0> ) || ( ( c4 = ScannerHelper . getHexadecimalValue ( this . source [ this . index ++ ] ) ) > <NUM_LIT:15> || c4 < <NUM_LIT:0> ) ) ) { c = ( char ) ( ( ( c1 * <NUM_LIT:16> + c2 ) * <NUM_LIT:16> + c3 ) * <NUM_LIT:16> + c4 ) ; } else { this . index = pos ; } } return c ; } protected int readToken ( ) throws InvalidInputException { if ( this . currentTokenType < <NUM_LIT:0> ) { this . tokenPreviousPosition = this . scanner . currentPosition ; this . currentTokenType = this . scanner . getNextToken ( ) ; if ( this . scanner . currentPosition > ( this . lineEnd + <NUM_LIT:1> ) ) { this . lineStarted = false ; while ( this . currentTokenType == TerminalTokens . TokenNameMULTIPLY ) { this . currentTokenType = this . scanner . getNextToken ( ) ; } } this . index = this . scanner . currentPosition ; this . lineStarted = true ; } return this . currentTokenType ; } protected int readTokenAndConsume ( ) throws InvalidInputException { int token = readToken ( ) ; consumeToken ( ) ; return token ; } protected int readTokenSafely ( ) { int token = TerminalTokens . TokenNameERROR ; try { token = readToken ( ) ; } catch ( InvalidInputException iie ) { } return token ; } protected void recordInheritedPosition ( long position ) { if ( this . inheritedPositions == null ) { this . inheritedPositions = new long [ INHERITED_POSITIONS_ARRAY_INCREMENT ] ; this . inheritedPositionsPtr = <NUM_LIT:0> ; } else { if ( this . inheritedPositionsPtr == this . inheritedPositions . length ) { System . arraycopy ( this . inheritedPositions , <NUM_LIT:0> , this . inheritedPositions = new long [ this . inheritedPositionsPtr + INHERITED_POSITIONS_ARRAY_INCREMENT ] , <NUM_LIT:0> , this . inheritedPositionsPtr ) ; } } this . inheritedPositions [ this . inheritedPositionsPtr ++ ] = position ; } protected void refreshInlineTagPosition ( int previousPosition ) { } protected void refreshReturnStatement ( ) { } protected void setInlineTagStarted ( boolean started ) { this . inlineTagStarted = started ; } protected Object syntaxRecoverQualifiedName ( int primitiveToken ) throws InvalidInputException { return null ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; int startPos = this . scanner . currentPosition < this . index ? this . scanner . currentPosition : this . index ; int endPos = this . scanner . currentPosition < this . index ? this . index : this . scanner . currentPosition ; if ( startPos == this . source . length ) return "<STR_LIT>" + new String ( this . source ) ; if ( endPos > this . source . length ) return "<STR_LIT>" + new String ( this . source ) ; char front [ ] = new char [ startPos ] ; System . arraycopy ( this . source , <NUM_LIT:0> , front , <NUM_LIT:0> , startPos ) ; int middleLength = ( endPos - <NUM_LIT:1> ) - startPos + <NUM_LIT:1> ; char middle [ ] ; if ( middleLength > - <NUM_LIT:1> ) { middle = new char [ middleLength ] ; System . arraycopy ( this . source , startPos , middle , <NUM_LIT:0> , middleLength ) ; } else { middle = CharOperation . NO_CHAR ; } char end [ ] = new char [ this . source . length - ( endPos - <NUM_LIT:1> ) ] ; System . arraycopy ( this . source , ( endPos - <NUM_LIT:1> ) + <NUM_LIT:1> , end , <NUM_LIT:0> , this . source . length - ( endPos - <NUM_LIT:1> ) - <NUM_LIT:1> ) ; buffer . append ( front ) ; if ( this . scanner . currentPosition < this . index ) { buffer . append ( "<STR_LIT>" ) ; } else { buffer . append ( "<STR_LIT>" ) ; } buffer . append ( middle ) ; if ( this . scanner . currentPosition < this . index ) { buffer . append ( "<STR_LIT>" ) ; } else { buffer . append ( "<STR_LIT>" ) ; } buffer . append ( end ) ; return buffer . toString ( ) ; } protected abstract void updateDocComment ( ) ; protected void updateLineEnd ( ) { while ( this . index > ( this . lineEnd + <NUM_LIT:1> ) ) { if ( this . linePtr < this . lastLinePtr ) { this . lineEnd = this . scanner . getLineEnd ( ++ this . linePtr ) - <NUM_LIT:1> ; } else { this . lineEnd = this . javadocEnd ; return ; } } } protected boolean verifyEndLine ( int textPosition ) { boolean domParser = ( this . kind & DOM_PARSER ) != <NUM_LIT:0> ; if ( this . inlineTagStarted ) { if ( peekChar ( ) == '<CHAR_LIT:}>' ) { if ( domParser ) { createTag ( ) ; pushText ( textPosition , this . starPosition ) ; } return true ; } return false ; } int startPosition = this . index ; int previousPosition = this . index ; this . starPosition = - <NUM_LIT:1> ; char ch = readChar ( ) ; nextChar : while ( true ) { switch ( ch ) { case '<STR_LIT>' : case '<STR_LIT:\n>' : if ( domParser ) { createTag ( ) ; pushText ( textPosition , previousPosition ) ; } this . index = previousPosition ; return true ; case '<CHAR_LIT>' : case '<CHAR_LIT:U+0020>' : case '<STR_LIT:\t>' : if ( this . starPosition >= <NUM_LIT:0> ) break nextChar ; break ; case '<CHAR_LIT>' : this . starPosition = previousPosition ; break ; case '<CHAR_LIT:/>' : if ( this . starPosition >= textPosition ) { if ( domParser ) { createTag ( ) ; pushText ( textPosition , this . starPosition ) ; } return true ; } break nextChar ; default : break nextChar ; } previousPosition = this . index ; ch = readChar ( ) ; } this . index = startPosition ; return false ; } protected boolean verifySpaceOrEndComment ( ) { this . starPosition = - <NUM_LIT:1> ; int startPosition = this . index ; char ch = peekChar ( ) ; switch ( ch ) { case '<CHAR_LIT:}>' : return this . inlineTagStarted ; default : if ( ScannerHelper . isWhitespace ( ch ) ) { return true ; } } int previousPosition = this . index ; ch = readChar ( ) ; while ( this . index < this . source . length ) { switch ( ch ) { case '<CHAR_LIT>' : this . starPosition = previousPosition ; break ; case '<CHAR_LIT:/>' : if ( this . starPosition >= startPosition ) { return true ; } default : this . index = startPosition ; return false ; } previousPosition = this . index ; ch = readChar ( ) ; } this . index = startPosition ; return false ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . parser ; public interface ParserBasicInformation { int ERROR_SYMBOL = <NUM_LIT> , MAX_NAME_LENGTH = <NUM_LIT> , NUM_STATES = <NUM_LIT> , NT_OFFSET = <NUM_LIT> , SCOPE_UBOUND = <NUM_LIT> , SCOPE_SIZE = <NUM_LIT> , LA_STATE_OFFSET = <NUM_LIT> , MAX_LA = <NUM_LIT:1> , NUM_RULES = <NUM_LIT> , NUM_TERMINALS = <NUM_LIT> , NUM_NON_TERMINALS = <NUM_LIT> , NUM_SYMBOLS = <NUM_LIT> , START_STATE = <NUM_LIT> , EOFT_SYMBOL = <NUM_LIT> , EOLT_SYMBOL = <NUM_LIT> , ACCEPT_ACTION = <NUM_LIT> , ERROR_ACTION = <NUM_LIT> ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . parser ; public interface TerminalTokens { int TokenNameWHITESPACE = <NUM_LIT:1000> , TokenNameCOMMENT_LINE = <NUM_LIT> , TokenNameCOMMENT_BLOCK = <NUM_LIT> , TokenNameCOMMENT_JAVADOC = <NUM_LIT> ; int TokenNameIdentifier = <NUM_LIT> , TokenNameabstract = <NUM_LIT> , TokenNameassert = <NUM_LIT> , TokenNameboolean = <NUM_LIT:32> , TokenNamebreak = <NUM_LIT> , TokenNamebyte = <NUM_LIT> , TokenNamecase = <NUM_LIT> , TokenNamecatch = <NUM_LIT:100> , TokenNamechar = <NUM_LIT> , TokenNameclass = <NUM_LIT> , TokenNamecontinue = <NUM_LIT> , TokenNameconst = <NUM_LIT> , TokenNamedefault = <NUM_LIT> , TokenNamedo = <NUM_LIT> , TokenNamedouble = <NUM_LIT> , TokenNameelse = <NUM_LIT> , TokenNameenum = <NUM_LIT> , TokenNameextends = <NUM_LIT> , TokenNamefalse = <NUM_LIT> , TokenNamefinal = <NUM_LIT> , TokenNamefinally = <NUM_LIT> , TokenNamefloat = <NUM_LIT> , TokenNamefor = <NUM_LIT> , TokenNamegoto = <NUM_LIT> , TokenNameif = <NUM_LIT> , TokenNameimplements = <NUM_LIT> , TokenNameimport = <NUM_LIT> , TokenNameinstanceof = <NUM_LIT> , TokenNameint = <NUM_LIT> , TokenNameinterface = <NUM_LIT> , TokenNamelong = <NUM_LIT> , TokenNamenative = <NUM_LIT> , TokenNamenew = <NUM_LIT> , TokenNamenull = <NUM_LIT> , TokenNamepackage = <NUM_LIT> , TokenNameprivate = <NUM_LIT> , TokenNameprotected = <NUM_LIT> , TokenNamepublic = <NUM_LIT> , TokenNamereturn = <NUM_LIT> , TokenNameshort = <NUM_LIT> , TokenNamestatic = <NUM_LIT> , TokenNamestrictfp = <NUM_LIT> , TokenNamesuper = <NUM_LIT> , TokenNameswitch = <NUM_LIT> , TokenNamesynchronized = <NUM_LIT> , TokenNamethis = <NUM_LIT> , TokenNamethrow = <NUM_LIT> , TokenNamethrows = <NUM_LIT> , TokenNametransient = <NUM_LIT> , TokenNametrue = <NUM_LIT> , TokenNametry = <NUM_LIT> , TokenNamevoid = <NUM_LIT> , TokenNamevolatile = <NUM_LIT> , TokenNamewhile = <NUM_LIT> , TokenNameIntegerLiteral = <NUM_LIT> , TokenNameLongLiteral = <NUM_LIT> , TokenNameFloatingPointLiteral = <NUM_LIT> , TokenNameDoubleLiteral = <NUM_LIT> , TokenNameCharacterLiteral = <NUM_LIT> , TokenNameStringLiteral = <NUM_LIT> , TokenNamePLUS_PLUS = <NUM_LIT:8> , TokenNameMINUS_MINUS = <NUM_LIT:9> , TokenNameEQUAL_EQUAL = <NUM_LIT> , TokenNameLESS_EQUAL = <NUM_LIT> , TokenNameGREATER_EQUAL = <NUM_LIT:15> , TokenNameNOT_EQUAL = <NUM_LIT> , TokenNameLEFT_SHIFT = <NUM_LIT> , TokenNameRIGHT_SHIFT = <NUM_LIT:10> , TokenNameUNSIGNED_RIGHT_SHIFT = <NUM_LIT:12> , TokenNamePLUS_EQUAL = <NUM_LIT> , TokenNameMINUS_EQUAL = <NUM_LIT> , TokenNameMULTIPLY_EQUAL = <NUM_LIT> , TokenNameDIVIDE_EQUAL = <NUM_LIT> , TokenNameAND_EQUAL = <NUM_LIT> , TokenNameOR_EQUAL = <NUM_LIT> , TokenNameXOR_EQUAL = <NUM_LIT> , TokenNameREMAINDER_EQUAL = <NUM_LIT> , TokenNameLEFT_SHIFT_EQUAL = <NUM_LIT> , TokenNameRIGHT_SHIFT_EQUAL = <NUM_LIT> , TokenNameUNSIGNED_RIGHT_SHIFT_EQUAL = <NUM_LIT> , TokenNameOR_OR = <NUM_LIT> , TokenNameAND_AND = <NUM_LIT:24> , TokenNamePLUS = <NUM_LIT:1> , TokenNameMINUS = <NUM_LIT:2> , TokenNameNOT = <NUM_LIT> , TokenNameREMAINDER = <NUM_LIT:5> , TokenNameXOR = <NUM_LIT> , TokenNameAND = <NUM_LIT:20> , TokenNameMULTIPLY = <NUM_LIT:4> , TokenNameOR = <NUM_LIT> , TokenNameTWIDDLE = <NUM_LIT> , TokenNameDIVIDE = <NUM_LIT:6> , TokenNameGREATER = <NUM_LIT:11> , TokenNameLESS = <NUM_LIT:7> , TokenNameLPAREN = <NUM_LIT> , TokenNameRPAREN = <NUM_LIT> , TokenNameLBRACE = <NUM_LIT> , TokenNameRBRACE = <NUM_LIT:31> , TokenNameLBRACKET = <NUM_LIT:16> , TokenNameRBRACKET = <NUM_LIT> , TokenNameSEMICOLON = <NUM_LIT> , TokenNameQUESTION = <NUM_LIT> , TokenNameCOLON = <NUM_LIT> , TokenNameCOMMA = <NUM_LIT:30> , TokenNameDOT = <NUM_LIT:3> , TokenNameEQUAL = <NUM_LIT> , TokenNameAT = <NUM_LIT> , TokenNameELLIPSIS = <NUM_LIT> , TokenNameEOF = <NUM_LIT> , TokenNameERROR = <NUM_LIT> ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . parser ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . ImportReference ; public class RecoveredImport extends RecoveredElement { public ImportReference importReference ; public RecoveredImport ( ImportReference importReference , RecoveredElement parent , int bracketBalance ) { super ( parent , bracketBalance ) ; this . importReference = importReference ; } public ASTNode parseTree ( ) { return this . importReference ; } public int sourceEnd ( ) { return this . importReference . declarationSourceEnd ; } public String toString ( int tab ) { return tabString ( tab ) + "<STR_LIT>" + this . importReference . toString ( ) ; } public ImportReference updatedImportReference ( ) { return this . importReference ; } public void updateParseTree ( ) { updatedImportReference ( ) ; } public void updateSourceEndIfNecessary ( int bodyStart , int bodyEnd ) { if ( this . importReference . declarationSourceEnd == <NUM_LIT:0> ) { this . importReference . declarationSourceEnd = bodyEnd ; this . importReference . declarationEnd = bodyEnd ; } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . parser ; import java . util . HashSet ; import java . util . Set ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . AbstractVariableDeclaration ; import org . eclipse . jdt . internal . compiler . ast . Annotation ; import org . eclipse . jdt . internal . compiler . ast . ArrayQualifiedTypeReference ; import org . eclipse . jdt . internal . compiler . ast . ArrayTypeReference ; import org . eclipse . jdt . internal . compiler . ast . Expression ; import org . eclipse . jdt . internal . compiler . ast . FieldDeclaration ; import org . eclipse . jdt . internal . compiler . ast . Statement ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; public class RecoveredField extends RecoveredElement { public FieldDeclaration fieldDeclaration ; boolean alreadyCompletedFieldInitialization ; public RecoveredAnnotation [ ] annotations ; public int annotationCount ; public int modifiers ; public int modifiersStart ; public RecoveredType [ ] anonymousTypes ; public int anonymousTypeCount ; public RecoveredField ( FieldDeclaration fieldDeclaration , RecoveredElement parent , int bracketBalance ) { this ( fieldDeclaration , parent , bracketBalance , null ) ; } public RecoveredField ( FieldDeclaration fieldDeclaration , RecoveredElement parent , int bracketBalance , Parser parser ) { super ( parent , bracketBalance , parser ) ; this . fieldDeclaration = fieldDeclaration ; this . alreadyCompletedFieldInitialization = fieldDeclaration . initialization != null ; } public RecoveredElement add ( FieldDeclaration addedfieldDeclaration , int bracketBalanceValue ) { resetPendingModifiers ( ) ; if ( this . parent == null ) return this ; if ( this . fieldDeclaration . declarationSourceStart == addedfieldDeclaration . declarationSourceStart ) { if ( this . fieldDeclaration . initialization != null ) { this . updateSourceEndIfNecessary ( this . fieldDeclaration . initialization . sourceEnd ) ; } else { this . updateSourceEndIfNecessary ( this . fieldDeclaration . sourceEnd ) ; } } else { this . updateSourceEndIfNecessary ( previousAvailableLineEnd ( addedfieldDeclaration . declarationSourceStart - <NUM_LIT:1> ) ) ; } return this . parent . add ( addedfieldDeclaration , bracketBalanceValue ) ; } public RecoveredElement add ( Statement statement , int bracketBalanceValue ) { if ( this . alreadyCompletedFieldInitialization || ! ( statement instanceof Expression ) ) { return super . add ( statement , bracketBalanceValue ) ; } else { if ( statement . sourceEnd > <NUM_LIT:0> ) this . alreadyCompletedFieldInitialization = true ; this . fieldDeclaration . initialization = ( Expression ) statement ; this . fieldDeclaration . declarationSourceEnd = statement . sourceEnd ; this . fieldDeclaration . declarationEnd = statement . sourceEnd ; return this ; } } public RecoveredElement add ( TypeDeclaration typeDeclaration , int bracketBalanceValue ) { if ( this . alreadyCompletedFieldInitialization || ( ( typeDeclaration . bits & ASTNode . IsAnonymousType ) == <NUM_LIT:0> ) || ( this . fieldDeclaration . declarationSourceEnd != <NUM_LIT:0> && typeDeclaration . sourceStart > this . fieldDeclaration . declarationSourceEnd ) ) { return super . add ( typeDeclaration , bracketBalanceValue ) ; } else { if ( this . anonymousTypes == null ) { this . anonymousTypes = new RecoveredType [ <NUM_LIT:5> ] ; this . anonymousTypeCount = <NUM_LIT:0> ; } else { if ( this . anonymousTypeCount == this . anonymousTypes . length ) { System . arraycopy ( this . anonymousTypes , <NUM_LIT:0> , ( this . anonymousTypes = new RecoveredType [ <NUM_LIT:2> * this . anonymousTypeCount ] ) , <NUM_LIT:0> , this . anonymousTypeCount ) ; } } RecoveredType element = new RecoveredType ( typeDeclaration , this , bracketBalanceValue ) ; this . anonymousTypes [ this . anonymousTypeCount ++ ] = element ; return element ; } } public void attach ( RecoveredAnnotation [ ] annots , int annotCount , int mods , int modsSourceStart ) { if ( annotCount > <NUM_LIT:0> ) { Annotation [ ] existingAnnotations = this . fieldDeclaration . annotations ; if ( existingAnnotations != null ) { this . annotations = new RecoveredAnnotation [ annotCount ] ; this . annotationCount = <NUM_LIT:0> ; next : for ( int i = <NUM_LIT:0> ; i < annotCount ; i ++ ) { for ( int j = <NUM_LIT:0> ; j < existingAnnotations . length ; j ++ ) { if ( annots [ i ] . annotation == existingAnnotations [ j ] ) continue next ; } this . annotations [ this . annotationCount ++ ] = annots [ i ] ; } } else { this . annotations = annots ; this . annotationCount = annotCount ; } } if ( mods != <NUM_LIT:0> ) { this . modifiers = mods ; this . modifiersStart = modsSourceStart ; } } public ASTNode parseTree ( ) { return this . fieldDeclaration ; } public int sourceEnd ( ) { return this . fieldDeclaration . declarationSourceEnd ; } public String toString ( int tab ) { StringBuffer buffer = new StringBuffer ( tabString ( tab ) ) ; buffer . append ( "<STR_LIT>" ) ; this . fieldDeclaration . print ( tab + <NUM_LIT:1> , buffer ) ; if ( this . annotations != null ) { for ( int i = <NUM_LIT:0> ; i < this . annotationCount ; i ++ ) { buffer . append ( "<STR_LIT:n>" ) ; buffer . append ( this . annotations [ i ] . toString ( tab + <NUM_LIT:1> ) ) ; } } if ( this . anonymousTypes != null ) { for ( int i = <NUM_LIT:0> ; i < this . anonymousTypeCount ; i ++ ) { buffer . append ( "<STR_LIT:n>" ) ; buffer . append ( this . anonymousTypes [ i ] . toString ( tab + <NUM_LIT:1> ) ) ; } } return buffer . toString ( ) ; } public FieldDeclaration updatedFieldDeclaration ( int depth , Set knownTypes ) { if ( this . modifiers != <NUM_LIT:0> ) { this . fieldDeclaration . modifiers |= this . modifiers ; if ( this . modifiersStart < this . fieldDeclaration . declarationSourceStart ) { this . fieldDeclaration . declarationSourceStart = this . modifiersStart ; } } if ( this . annotationCount > <NUM_LIT:0> ) { int existingCount = this . fieldDeclaration . annotations == null ? <NUM_LIT:0> : this . fieldDeclaration . annotations . length ; Annotation [ ] annotationReferences = new Annotation [ existingCount + this . annotationCount ] ; if ( existingCount > <NUM_LIT:0> ) { System . arraycopy ( this . fieldDeclaration . annotations , <NUM_LIT:0> , annotationReferences , this . annotationCount , existingCount ) ; } for ( int i = <NUM_LIT:0> ; i < this . annotationCount ; i ++ ) { annotationReferences [ i ] = this . annotations [ i ] . updatedAnnotationReference ( ) ; } this . fieldDeclaration . annotations = annotationReferences ; int start = this . annotations [ <NUM_LIT:0> ] . annotation . sourceStart ; if ( start < this . fieldDeclaration . declarationSourceStart ) { this . fieldDeclaration . declarationSourceStart = start ; } } if ( this . anonymousTypes != null ) { if ( this . fieldDeclaration . initialization == null ) { for ( int i = <NUM_LIT:0> ; i < this . anonymousTypeCount ; i ++ ) { RecoveredType recoveredType = this . anonymousTypes [ i ] ; TypeDeclaration typeDeclaration = recoveredType . typeDeclaration ; if ( typeDeclaration . declarationSourceEnd == <NUM_LIT:0> ) { typeDeclaration . declarationSourceEnd = this . fieldDeclaration . declarationSourceEnd ; typeDeclaration . bodyEnd = this . fieldDeclaration . declarationSourceEnd ; } if ( recoveredType . preserveContent ) { TypeDeclaration anonymousType = recoveredType . updatedTypeDeclaration ( depth + <NUM_LIT:1> , knownTypes ) ; if ( anonymousType != null ) { this . fieldDeclaration . initialization = anonymousType . allocation ; int end = anonymousType . declarationSourceEnd ; if ( end > this . fieldDeclaration . declarationSourceEnd ) { this . fieldDeclaration . declarationSourceEnd = end ; this . fieldDeclaration . declarationEnd = end ; } } } } if ( this . anonymousTypeCount > <NUM_LIT:0> ) this . fieldDeclaration . bits |= ASTNode . HasLocalType ; } else if ( this . fieldDeclaration . getKind ( ) == AbstractVariableDeclaration . ENUM_CONSTANT ) { for ( int i = <NUM_LIT:0> ; i < this . anonymousTypeCount ; i ++ ) { RecoveredType recoveredType = this . anonymousTypes [ i ] ; TypeDeclaration typeDeclaration = recoveredType . typeDeclaration ; if ( typeDeclaration . declarationSourceEnd == <NUM_LIT:0> ) { typeDeclaration . declarationSourceEnd = this . fieldDeclaration . declarationSourceEnd ; typeDeclaration . bodyEnd = this . fieldDeclaration . declarationSourceEnd ; } recoveredType . updatedTypeDeclaration ( depth , knownTypes ) ; } } } return this . fieldDeclaration ; } public RecoveredElement updateOnClosingBrace ( int braceStart , int braceEnd ) { if ( this . bracketBalance > <NUM_LIT:0> ) { this . bracketBalance -- ; if ( this . bracketBalance == <NUM_LIT:0> ) { if ( this . fieldDeclaration . getKind ( ) == AbstractVariableDeclaration . ENUM_CONSTANT ) { updateSourceEndIfNecessary ( braceEnd - <NUM_LIT:1> ) ; return this . parent ; } else { if ( this . fieldDeclaration . declarationSourceEnd > <NUM_LIT:0> ) this . alreadyCompletedFieldInitialization = true ; } } return this ; } else if ( this . bracketBalance == <NUM_LIT:0> ) { this . alreadyCompletedFieldInitialization = true ; updateSourceEndIfNecessary ( braceEnd - <NUM_LIT:1> ) ; } if ( this . parent != null ) { return this . parent . updateOnClosingBrace ( braceStart , braceEnd ) ; } return this ; } public RecoveredElement updateOnOpeningBrace ( int braceStart , int braceEnd ) { if ( this . fieldDeclaration . declarationSourceEnd == <NUM_LIT:0> ) { if ( this . fieldDeclaration . type instanceof ArrayTypeReference || this . fieldDeclaration . type instanceof ArrayQualifiedTypeReference ) { if ( ! this . alreadyCompletedFieldInitialization ) { this . bracketBalance ++ ; return null ; } } else { this . bracketBalance ++ ; return null ; } } if ( this . fieldDeclaration . declarationSourceEnd == <NUM_LIT:0> && this . fieldDeclaration . getKind ( ) == AbstractVariableDeclaration . ENUM_CONSTANT ) { this . bracketBalance ++ ; return null ; } this . updateSourceEndIfNecessary ( braceStart - <NUM_LIT:1> , braceEnd - <NUM_LIT:1> ) ; return this . parent . updateOnOpeningBrace ( braceStart , braceEnd ) ; } public void updateParseTree ( ) { updatedFieldDeclaration ( <NUM_LIT:0> , new HashSet ( ) ) ; } public void updateSourceEndIfNecessary ( int bodyStart , int bodyEnd ) { if ( this . fieldDeclaration . declarationSourceEnd == <NUM_LIT:0> ) { this . fieldDeclaration . declarationSourceEnd = bodyEnd ; this . fieldDeclaration . declarationEnd = bodyEnd ; } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . parser ; public class RecoveryScannerData { public int insertedTokensPtr = - <NUM_LIT:1> ; public int [ ] [ ] insertedTokens ; public int [ ] insertedTokensPosition ; public boolean [ ] insertedTokenUsed ; public int replacedTokensPtr = - <NUM_LIT:1> ; public int [ ] [ ] replacedTokens ; public int [ ] replacedTokensStart ; public int [ ] replacedTokensEnd ; public boolean [ ] replacedTokenUsed ; public int removedTokensPtr = - <NUM_LIT:1> ; public int [ ] removedTokensStart ; public int [ ] removedTokensEnd ; public boolean [ ] removedTokenUsed ; public RecoveryScannerData removeUnused ( ) { if ( this . insertedTokens != null ) { int newInsertedTokensPtr = - <NUM_LIT:1> ; for ( int i = <NUM_LIT:0> ; i <= this . insertedTokensPtr ; i ++ ) { if ( this . insertedTokenUsed [ i ] ) { newInsertedTokensPtr ++ ; this . insertedTokens [ newInsertedTokensPtr ] = this . insertedTokens [ i ] ; this . insertedTokensPosition [ newInsertedTokensPtr ] = this . insertedTokensPosition [ i ] ; this . insertedTokenUsed [ newInsertedTokensPtr ] = this . insertedTokenUsed [ i ] ; } } this . insertedTokensPtr = newInsertedTokensPtr ; } if ( this . replacedTokens != null ) { int newReplacedTokensPtr = - <NUM_LIT:1> ; for ( int i = <NUM_LIT:0> ; i <= this . replacedTokensPtr ; i ++ ) { if ( this . replacedTokenUsed [ i ] ) { newReplacedTokensPtr ++ ; this . replacedTokens [ newReplacedTokensPtr ] = this . replacedTokens [ i ] ; this . replacedTokensStart [ newReplacedTokensPtr ] = this . replacedTokensStart [ i ] ; this . replacedTokensEnd [ newReplacedTokensPtr ] = this . replacedTokensEnd [ i ] ; this . replacedTokenUsed [ newReplacedTokensPtr ] = this . replacedTokenUsed [ i ] ; } } this . replacedTokensPtr = newReplacedTokensPtr ; } if ( this . removedTokensStart != null ) { int newRemovedTokensPtr = - <NUM_LIT:1> ; for ( int i = <NUM_LIT:0> ; i <= this . removedTokensPtr ; i ++ ) { if ( this . removedTokenUsed [ i ] ) { newRemovedTokensPtr ++ ; this . removedTokensStart [ newRemovedTokensPtr ] = this . removedTokensStart [ i ] ; this . removedTokensEnd [ newRemovedTokensPtr ] = this . removedTokensEnd [ i ] ; this . removedTokenUsed [ newRemovedTokensPtr ] = this . removedTokenUsed [ i ] ; } } this . removedTokensPtr = newRemovedTokensPtr ; } return this ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . parser ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . core . compiler . InvalidInputException ; public class RecoveryScanner extends Scanner { public static final char [ ] FAKE_IDENTIFIER = "<STR_LIT>" . toCharArray ( ) ; private RecoveryScannerData data ; private int [ ] pendingTokens ; private int pendingTokensPtr = - <NUM_LIT:1> ; private char [ ] fakeTokenSource = null ; private boolean isInserted = true ; private boolean precededByRemoved = false ; private int skipNextInsertedTokens = - <NUM_LIT:1> ; public boolean record = true ; public RecoveryScanner ( Scanner scanner , RecoveryScannerData data ) { super ( false , scanner . tokenizeWhiteSpace , scanner . checkNonExternalizedStringLiterals , scanner . sourceLevel , scanner . complianceLevel , scanner . taskTags , scanner . taskPriorities , scanner . isTaskCaseSensitive ) ; setData ( data ) ; } public RecoveryScanner ( boolean tokenizeWhiteSpace , boolean checkNonExternalizedStringLiterals , long sourceLevel , long complianceLevel , char [ ] [ ] taskTags , char [ ] [ ] taskPriorities , boolean isTaskCaseSensitive , RecoveryScannerData data ) { super ( false , tokenizeWhiteSpace , checkNonExternalizedStringLiterals , sourceLevel , complianceLevel , taskTags , taskPriorities , isTaskCaseSensitive ) ; setData ( data ) ; } public void insertToken ( int token , int completedToken , int position ) { insertTokens ( new int [ ] { token } , completedToken , position ) ; } private int [ ] reverse ( int [ ] tokens ) { int length = tokens . length ; for ( int i = <NUM_LIT:0> , max = length / <NUM_LIT:2> ; i < max ; i ++ ) { int tmp = tokens [ i ] ; tokens [ i ] = tokens [ length - i - <NUM_LIT:1> ] ; tokens [ length - i - <NUM_LIT:1> ] = tmp ; } return tokens ; } public void insertTokens ( int [ ] tokens , int completedToken , int position ) { if ( ! this . record ) return ; if ( completedToken > - <NUM_LIT:1> && Parser . statements_recovery_filter [ completedToken ] != <NUM_LIT:0> ) return ; this . data . insertedTokensPtr ++ ; if ( this . data . insertedTokens == null ) { this . data . insertedTokens = new int [ <NUM_LIT:10> ] [ ] ; this . data . insertedTokensPosition = new int [ <NUM_LIT:10> ] ; this . data . insertedTokenUsed = new boolean [ <NUM_LIT:10> ] ; } else if ( this . data . insertedTokens . length == this . data . insertedTokensPtr ) { int length = this . data . insertedTokens . length ; System . arraycopy ( this . data . insertedTokens , <NUM_LIT:0> , this . data . insertedTokens = new int [ length * <NUM_LIT:2> ] [ ] , <NUM_LIT:0> , length ) ; System . arraycopy ( this . data . insertedTokensPosition , <NUM_LIT:0> , this . data . insertedTokensPosition = new int [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; System . arraycopy ( this . data . insertedTokenUsed , <NUM_LIT:0> , this . data . insertedTokenUsed = new boolean [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; } this . data . insertedTokens [ this . data . insertedTokensPtr ] = reverse ( tokens ) ; this . data . insertedTokensPosition [ this . data . insertedTokensPtr ] = position ; this . data . insertedTokenUsed [ this . data . insertedTokensPtr ] = false ; } public void replaceTokens ( int token , int start , int end ) { replaceTokens ( new int [ ] { token } , start , end ) ; } public void replaceTokens ( int [ ] tokens , int start , int end ) { if ( ! this . record ) return ; this . data . replacedTokensPtr ++ ; if ( this . data . replacedTokensStart == null ) { this . data . replacedTokens = new int [ <NUM_LIT:10> ] [ ] ; this . data . replacedTokensStart = new int [ <NUM_LIT:10> ] ; this . data . replacedTokensEnd = new int [ <NUM_LIT:10> ] ; this . data . replacedTokenUsed = new boolean [ <NUM_LIT:10> ] ; } else if ( this . data . replacedTokensStart . length == this . data . replacedTokensPtr ) { int length = this . data . replacedTokensStart . length ; System . arraycopy ( this . data . replacedTokens , <NUM_LIT:0> , this . data . replacedTokens = new int [ length * <NUM_LIT:2> ] [ ] , <NUM_LIT:0> , length ) ; System . arraycopy ( this . data . replacedTokensStart , <NUM_LIT:0> , this . data . replacedTokensStart = new int [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; System . arraycopy ( this . data . replacedTokensEnd , <NUM_LIT:0> , this . data . replacedTokensEnd = new int [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; System . arraycopy ( this . data . replacedTokenUsed , <NUM_LIT:0> , this . data . replacedTokenUsed = new boolean [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; } this . data . replacedTokens [ this . data . replacedTokensPtr ] = reverse ( tokens ) ; this . data . replacedTokensStart [ this . data . replacedTokensPtr ] = start ; this . data . replacedTokensEnd [ this . data . replacedTokensPtr ] = end ; this . data . replacedTokenUsed [ this . data . replacedTokensPtr ] = false ; } public void removeTokens ( int start , int end ) { if ( ! this . record ) return ; this . data . removedTokensPtr ++ ; if ( this . data . removedTokensStart == null ) { this . data . removedTokensStart = new int [ <NUM_LIT:10> ] ; this . data . removedTokensEnd = new int [ <NUM_LIT:10> ] ; this . data . removedTokenUsed = new boolean [ <NUM_LIT:10> ] ; } else if ( this . data . removedTokensStart . length == this . data . removedTokensPtr ) { int length = this . data . removedTokensStart . length ; System . arraycopy ( this . data . removedTokensStart , <NUM_LIT:0> , this . data . removedTokensStart = new int [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; System . arraycopy ( this . data . removedTokensEnd , <NUM_LIT:0> , this . data . removedTokensEnd = new int [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; System . arraycopy ( this . data . removedTokenUsed , <NUM_LIT:0> , this . data . removedTokenUsed = new boolean [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; } this . data . removedTokensStart [ this . data . removedTokensPtr ] = start ; this . data . removedTokensEnd [ this . data . removedTokensPtr ] = end ; this . data . removedTokenUsed [ this . data . removedTokensPtr ] = false ; } public int getNextToken ( ) throws InvalidInputException { if ( this . pendingTokensPtr > - <NUM_LIT:1> ) { int nextToken = this . pendingTokens [ this . pendingTokensPtr -- ] ; if ( nextToken == TerminalTokens . TokenNameIdentifier ) { this . fakeTokenSource = FAKE_IDENTIFIER ; } else { this . fakeTokenSource = CharOperation . NO_CHAR ; } return nextToken ; } this . fakeTokenSource = null ; this . precededByRemoved = false ; if ( this . data . insertedTokens != null ) { for ( int i = <NUM_LIT:0> ; i <= this . data . insertedTokensPtr ; i ++ ) { if ( this . data . insertedTokensPosition [ i ] == this . currentPosition - <NUM_LIT:1> && i > this . skipNextInsertedTokens ) { this . data . insertedTokenUsed [ i ] = true ; this . pendingTokens = this . data . insertedTokens [ i ] ; this . pendingTokensPtr = this . data . insertedTokens [ i ] . length - <NUM_LIT:1> ; this . isInserted = true ; this . startPosition = this . currentPosition ; this . skipNextInsertedTokens = i ; int nextToken = this . pendingTokens [ this . pendingTokensPtr -- ] ; if ( nextToken == TerminalTokens . TokenNameIdentifier ) { this . fakeTokenSource = FAKE_IDENTIFIER ; } else { this . fakeTokenSource = CharOperation . NO_CHAR ; } return nextToken ; } } this . skipNextInsertedTokens = - <NUM_LIT:1> ; } int previousLocation = this . currentPosition ; int currentToken = super . getNextToken ( ) ; if ( this . data . replacedTokens != null ) { for ( int i = <NUM_LIT:0> ; i <= this . data . replacedTokensPtr ; i ++ ) { if ( this . data . replacedTokensStart [ i ] >= previousLocation && this . data . replacedTokensStart [ i ] <= this . startPosition && this . data . replacedTokensEnd [ i ] >= this . currentPosition - <NUM_LIT:1> ) { this . data . replacedTokenUsed [ i ] = true ; this . pendingTokens = this . data . replacedTokens [ i ] ; this . pendingTokensPtr = this . data . replacedTokens [ i ] . length - <NUM_LIT:1> ; this . fakeTokenSource = FAKE_IDENTIFIER ; this . isInserted = false ; this . currentPosition = this . data . replacedTokensEnd [ i ] + <NUM_LIT:1> ; int nextToken = this . pendingTokens [ this . pendingTokensPtr -- ] ; if ( nextToken == TerminalTokens . TokenNameIdentifier ) { this . fakeTokenSource = FAKE_IDENTIFIER ; } else { this . fakeTokenSource = CharOperation . NO_CHAR ; } return nextToken ; } } } if ( this . data . removedTokensStart != null ) { for ( int i = <NUM_LIT:0> ; i <= this . data . removedTokensPtr ; i ++ ) { if ( this . data . removedTokensStart [ i ] >= previousLocation && this . data . removedTokensStart [ i ] <= this . startPosition && this . data . removedTokensEnd [ i ] >= this . currentPosition - <NUM_LIT:1> ) { this . data . removedTokenUsed [ i ] = true ; this . currentPosition = this . data . removedTokensEnd [ i ] + <NUM_LIT:1> ; this . precededByRemoved = false ; return getNextToken ( ) ; } } } return currentToken ; } public char [ ] getCurrentIdentifierSource ( ) { if ( this . fakeTokenSource != null ) return this . fakeTokenSource ; return super . getCurrentIdentifierSource ( ) ; } public char [ ] getCurrentTokenSourceString ( ) { if ( this . fakeTokenSource != null ) return this . fakeTokenSource ; return super . getCurrentTokenSourceString ( ) ; } public char [ ] getCurrentTokenSource ( ) { if ( this . fakeTokenSource != null ) return this . fakeTokenSource ; return super . getCurrentTokenSource ( ) ; } public RecoveryScannerData getData ( ) { return this . data ; } public boolean isFakeToken ( ) { return this . fakeTokenSource != null ; } public boolean isInsertedToken ( ) { return this . fakeTokenSource != null && this . isInserted ; } public boolean isReplacedToken ( ) { return this . fakeTokenSource != null && ! this . isInserted ; } public boolean isPrecededByRemovedToken ( ) { return this . precededByRemoved ; } public void setData ( RecoveryScannerData data ) { if ( data == null ) { this . data = new RecoveryScannerData ( ) ; } else { this . data = data ; } } public void setPendingTokens ( int [ ] pendingTokens ) { this . pendingTokens = pendingTokens ; this . pendingTokensPtr = pendingTokens . length - <NUM_LIT:1> ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . parser ; import java . util . HashSet ; import java . util . Set ; import org . eclipse . jdt . internal . compiler . ast . AbstractMethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . AbstractVariableDeclaration ; import org . eclipse . jdt . internal . compiler . ast . Annotation ; import org . eclipse . jdt . internal . compiler . ast . Block ; import org . eclipse . jdt . internal . compiler . ast . FieldDeclaration ; import org . eclipse . jdt . internal . compiler . ast . Initializer ; import org . eclipse . jdt . internal . compiler . ast . QualifiedAllocationExpression ; import org . eclipse . jdt . internal . compiler . ast . Statement ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; import org . eclipse . jdt . internal . compiler . ast . TypeParameter ; import org . eclipse . jdt . internal . compiler . ast . TypeReference ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; public class RecoveredType extends RecoveredStatement implements TerminalTokens { public static final int MAX_TYPE_DEPTH = <NUM_LIT> ; public TypeDeclaration typeDeclaration ; public RecoveredAnnotation [ ] annotations ; public int annotationCount ; public int modifiers ; public int modifiersStart ; public RecoveredType [ ] memberTypes ; public int memberTypeCount ; public RecoveredField [ ] fields ; public int fieldCount ; public RecoveredMethod [ ] methods ; public int methodCount ; public boolean preserveContent = false ; public int bodyEnd ; public boolean insideEnumConstantPart = false ; public TypeParameter [ ] pendingTypeParameters ; public int pendingTypeParametersStart ; int pendingModifiers ; int pendingModifersSourceStart = - <NUM_LIT:1> ; RecoveredAnnotation [ ] pendingAnnotations ; int pendingAnnotationCount ; public RecoveredType ( TypeDeclaration typeDeclaration , RecoveredElement parent , int bracketBalance ) { super ( typeDeclaration , parent , bracketBalance ) ; this . typeDeclaration = typeDeclaration ; if ( typeDeclaration . allocation != null && typeDeclaration . allocation . type == null ) { this . foundOpeningBrace = true ; } else { this . foundOpeningBrace = ! bodyStartsAtHeaderEnd ( ) ; } this . insideEnumConstantPart = TypeDeclaration . kind ( typeDeclaration . modifiers ) == TypeDeclaration . ENUM_DECL ; if ( this . foundOpeningBrace ) { this . bracketBalance ++ ; } this . preserveContent = parser ( ) . methodRecoveryActivated || parser ( ) . statementRecoveryActivated ; } public RecoveredElement add ( AbstractMethodDeclaration methodDeclaration , int bracketBalanceValue ) { if ( this . typeDeclaration . declarationSourceEnd != <NUM_LIT:0> && methodDeclaration . declarationSourceStart > this . typeDeclaration . declarationSourceEnd ) { this . pendingTypeParameters = null ; resetPendingModifiers ( ) ; return this . parent . add ( methodDeclaration , bracketBalanceValue ) ; } if ( this . methods == null ) { this . methods = new RecoveredMethod [ <NUM_LIT:5> ] ; this . methodCount = <NUM_LIT:0> ; } else { if ( this . methodCount == this . methods . length ) { System . arraycopy ( this . methods , <NUM_LIT:0> , ( this . methods = new RecoveredMethod [ <NUM_LIT:2> * this . methodCount ] ) , <NUM_LIT:0> , this . methodCount ) ; } } RecoveredMethod element = new RecoveredMethod ( methodDeclaration , this , bracketBalanceValue , this . recoveringParser ) ; this . methods [ this . methodCount ++ ] = element ; if ( this . pendingTypeParameters != null ) { element . attach ( this . pendingTypeParameters , this . pendingTypeParametersStart ) ; this . pendingTypeParameters = null ; } if ( this . pendingAnnotationCount > <NUM_LIT:0> ) { element . attach ( this . pendingAnnotations , this . pendingAnnotationCount , this . pendingModifiers , this . pendingModifersSourceStart ) ; } resetPendingModifiers ( ) ; this . insideEnumConstantPart = false ; if ( ! this . foundOpeningBrace ) { this . foundOpeningBrace = true ; this . bracketBalance ++ ; } if ( methodDeclaration . declarationSourceEnd == <NUM_LIT:0> ) return element ; return this ; } public RecoveredElement add ( Block nestedBlockDeclaration , int bracketBalanceValue ) { this . pendingTypeParameters = null ; resetPendingModifiers ( ) ; int mods = ClassFileConstants . AccDefault ; if ( parser ( ) . recoveredStaticInitializerStart != <NUM_LIT:0> ) { mods = ClassFileConstants . AccStatic ; } return this . add ( new Initializer ( nestedBlockDeclaration , mods ) , bracketBalanceValue ) ; } public RecoveredElement add ( FieldDeclaration fieldDeclaration , int bracketBalanceValue ) { this . pendingTypeParameters = null ; if ( this . typeDeclaration . declarationSourceEnd != <NUM_LIT:0> && fieldDeclaration . declarationSourceStart > this . typeDeclaration . declarationSourceEnd ) { resetPendingModifiers ( ) ; return this . parent . add ( fieldDeclaration , bracketBalanceValue ) ; } if ( this . fields == null ) { this . fields = new RecoveredField [ <NUM_LIT:5> ] ; this . fieldCount = <NUM_LIT:0> ; } else { if ( this . fieldCount == this . fields . length ) { System . arraycopy ( this . fields , <NUM_LIT:0> , ( this . fields = new RecoveredField [ <NUM_LIT:2> * this . fieldCount ] ) , <NUM_LIT:0> , this . fieldCount ) ; } } RecoveredField element ; switch ( fieldDeclaration . getKind ( ) ) { case AbstractVariableDeclaration . FIELD : case AbstractVariableDeclaration . ENUM_CONSTANT : element = new RecoveredField ( fieldDeclaration , this , bracketBalanceValue ) ; break ; case AbstractVariableDeclaration . INITIALIZER : element = new RecoveredInitializer ( fieldDeclaration , this , bracketBalanceValue ) ; break ; default : return this ; } this . fields [ this . fieldCount ++ ] = element ; if ( this . pendingAnnotationCount > <NUM_LIT:0> ) { element . attach ( this . pendingAnnotations , this . pendingAnnotationCount , this . pendingModifiers , this . pendingModifersSourceStart ) ; } resetPendingModifiers ( ) ; if ( ! this . foundOpeningBrace ) { this . foundOpeningBrace = true ; this . bracketBalance ++ ; } if ( fieldDeclaration . declarationSourceEnd == <NUM_LIT:0> ) return element ; return this ; } public RecoveredElement add ( TypeDeclaration memberTypeDeclaration , int bracketBalanceValue ) { this . pendingTypeParameters = null ; if ( this . typeDeclaration . declarationSourceEnd != <NUM_LIT:0> && memberTypeDeclaration . declarationSourceStart > this . typeDeclaration . declarationSourceEnd ) { resetPendingModifiers ( ) ; return this . parent . add ( memberTypeDeclaration , bracketBalanceValue ) ; } this . insideEnumConstantPart = false ; if ( ( memberTypeDeclaration . bits & ASTNode . IsAnonymousType ) != <NUM_LIT:0> ) { if ( this . methodCount > <NUM_LIT:0> ) { RecoveredMethod lastMethod = this . methods [ this . methodCount - <NUM_LIT:1> ] ; lastMethod . methodDeclaration . bodyEnd = <NUM_LIT:0> ; lastMethod . methodDeclaration . declarationSourceEnd = <NUM_LIT:0> ; lastMethod . bracketBalance ++ ; resetPendingModifiers ( ) ; return lastMethod . add ( memberTypeDeclaration , bracketBalanceValue ) ; } else { return this ; } } if ( this . memberTypes == null ) { this . memberTypes = new RecoveredType [ <NUM_LIT:5> ] ; this . memberTypeCount = <NUM_LIT:0> ; } else { if ( this . memberTypeCount == this . memberTypes . length ) { System . arraycopy ( this . memberTypes , <NUM_LIT:0> , ( this . memberTypes = new RecoveredType [ <NUM_LIT:2> * this . memberTypeCount ] ) , <NUM_LIT:0> , this . memberTypeCount ) ; } } RecoveredType element = new RecoveredType ( memberTypeDeclaration , this , bracketBalanceValue ) ; this . memberTypes [ this . memberTypeCount ++ ] = element ; if ( this . pendingAnnotationCount > <NUM_LIT:0> ) { element . attach ( this . pendingAnnotations , this . pendingAnnotationCount , this . pendingModifiers , this . pendingModifersSourceStart ) ; } resetPendingModifiers ( ) ; if ( ! this . foundOpeningBrace ) { this . foundOpeningBrace = true ; this . bracketBalance ++ ; } if ( memberTypeDeclaration . declarationSourceEnd == <NUM_LIT:0> ) return element ; return this ; } public void add ( TypeParameter [ ] parameters , int startPos ) { this . pendingTypeParameters = parameters ; this . pendingTypeParametersStart = startPos ; } public RecoveredElement addAnnotationName ( int identifierPtr , int identifierLengthPtr , int annotationStart , int bracketBalanceValue ) { if ( this . pendingAnnotations == null ) { this . pendingAnnotations = new RecoveredAnnotation [ <NUM_LIT:5> ] ; this . pendingAnnotationCount = <NUM_LIT:0> ; } else { if ( this . pendingAnnotationCount == this . pendingAnnotations . length ) { System . arraycopy ( this . pendingAnnotations , <NUM_LIT:0> , ( this . pendingAnnotations = new RecoveredAnnotation [ <NUM_LIT:2> * this . pendingAnnotationCount ] ) , <NUM_LIT:0> , this . pendingAnnotationCount ) ; } } RecoveredAnnotation element = new RecoveredAnnotation ( identifierPtr , identifierLengthPtr , annotationStart , this , bracketBalanceValue ) ; this . pendingAnnotations [ this . pendingAnnotationCount ++ ] = element ; return element ; } public void addModifier ( int flag , int modifiersSourceStart ) { this . pendingModifiers |= flag ; if ( this . pendingModifersSourceStart < <NUM_LIT:0> ) { this . pendingModifersSourceStart = modifiersSourceStart ; } } public void attach ( RecoveredAnnotation [ ] annots , int annotCount , int mods , int modsSourceStart ) { if ( annotCount > <NUM_LIT:0> ) { Annotation [ ] existingAnnotations = this . typeDeclaration . annotations ; if ( existingAnnotations != null ) { this . annotations = new RecoveredAnnotation [ annotCount ] ; this . annotationCount = <NUM_LIT:0> ; next : for ( int i = <NUM_LIT:0> ; i < annotCount ; i ++ ) { for ( int j = <NUM_LIT:0> ; j < existingAnnotations . length ; j ++ ) { if ( annots [ i ] . annotation == existingAnnotations [ j ] ) continue next ; } this . annotations [ this . annotationCount ++ ] = annots [ i ] ; } } else { this . annotations = annots ; this . annotationCount = annotCount ; } } if ( mods != <NUM_LIT:0> ) { this . modifiers = mods ; this . modifiersStart = modsSourceStart ; } } public int bodyEnd ( ) { if ( this . bodyEnd == <NUM_LIT:0> ) return this . typeDeclaration . declarationSourceEnd ; return this . bodyEnd ; } public boolean bodyStartsAtHeaderEnd ( ) { if ( this . typeDeclaration . superInterfaces == null ) { if ( this . typeDeclaration . superclass == null ) { if ( this . typeDeclaration . typeParameters == null ) { return this . typeDeclaration . bodyStart == this . typeDeclaration . sourceEnd + <NUM_LIT:1> ; } else { return this . typeDeclaration . bodyStart == this . typeDeclaration . typeParameters [ this . typeDeclaration . typeParameters . length - <NUM_LIT:1> ] . sourceEnd + <NUM_LIT:1> ; } } else { return this . typeDeclaration . bodyStart == this . typeDeclaration . superclass . sourceEnd + <NUM_LIT:1> ; } } else { return this . typeDeclaration . bodyStart == this . typeDeclaration . superInterfaces [ this . typeDeclaration . superInterfaces . length - <NUM_LIT:1> ] . sourceEnd + <NUM_LIT:1> ; } } public RecoveredType enclosingType ( ) { RecoveredElement current = this . parent ; while ( current != null ) { if ( current instanceof RecoveredType ) { return ( RecoveredType ) current ; } current = current . parent ; } return null ; } public int lastMemberEnd ( ) { int lastMemberEnd = this . typeDeclaration . bodyStart ; if ( this . fieldCount > <NUM_LIT:0> ) { FieldDeclaration lastField = this . fields [ this . fieldCount - <NUM_LIT:1> ] . fieldDeclaration ; if ( lastMemberEnd < lastField . declarationSourceEnd && lastField . declarationSourceEnd != <NUM_LIT:0> ) { lastMemberEnd = lastField . declarationSourceEnd ; } } if ( this . methodCount > <NUM_LIT:0> ) { AbstractMethodDeclaration lastMethod = this . methods [ this . methodCount - <NUM_LIT:1> ] . methodDeclaration ; if ( lastMemberEnd < lastMethod . declarationSourceEnd && lastMethod . declarationSourceEnd != <NUM_LIT:0> ) { lastMemberEnd = lastMethod . declarationSourceEnd ; } } if ( this . memberTypeCount > <NUM_LIT:0> ) { TypeDeclaration lastType = this . memberTypes [ this . memberTypeCount - <NUM_LIT:1> ] . typeDeclaration ; if ( lastMemberEnd < lastType . declarationSourceEnd && lastType . declarationSourceEnd != <NUM_LIT:0> ) { lastMemberEnd = lastType . declarationSourceEnd ; } } return lastMemberEnd ; } public char [ ] name ( ) { return this . typeDeclaration . name ; } public ASTNode parseTree ( ) { return this . typeDeclaration ; } public void resetPendingModifiers ( ) { this . pendingAnnotations = null ; this . pendingAnnotationCount = <NUM_LIT:0> ; this . pendingModifiers = <NUM_LIT:0> ; this . pendingModifersSourceStart = - <NUM_LIT:1> ; } public int sourceEnd ( ) { return this . typeDeclaration . declarationSourceEnd ; } public String toString ( int tab ) { StringBuffer result = new StringBuffer ( tabString ( tab ) ) ; result . append ( "<STR_LIT>" ) ; if ( ( this . typeDeclaration . bits & ASTNode . IsAnonymousType ) != <NUM_LIT:0> ) { result . append ( tabString ( tab ) ) ; result . append ( "<STR_LIT:U+0020>" ) ; } this . typeDeclaration . print ( tab + <NUM_LIT:1> , result ) ; if ( this . annotations != null ) { for ( int i = <NUM_LIT:0> ; i < this . annotationCount ; i ++ ) { result . append ( "<STR_LIT:n>" ) ; result . append ( this . annotations [ i ] . toString ( tab + <NUM_LIT:1> ) ) ; } } if ( this . memberTypes != null ) { for ( int i = <NUM_LIT:0> ; i < this . memberTypeCount ; i ++ ) { result . append ( "<STR_LIT:n>" ) ; result . append ( this . memberTypes [ i ] . toString ( tab + <NUM_LIT:1> ) ) ; } } if ( this . fields != null ) { for ( int i = <NUM_LIT:0> ; i < this . fieldCount ; i ++ ) { result . append ( "<STR_LIT:n>" ) ; result . append ( this . fields [ i ] . toString ( tab + <NUM_LIT:1> ) ) ; } } if ( this . methods != null ) { for ( int i = <NUM_LIT:0> ; i < this . methodCount ; i ++ ) { result . append ( "<STR_LIT:n>" ) ; result . append ( this . methods [ i ] . toString ( tab + <NUM_LIT:1> ) ) ; } } return result . toString ( ) ; } public void updateBodyStart ( int bodyStart ) { this . foundOpeningBrace = true ; this . typeDeclaration . bodyStart = bodyStart ; } public Statement updatedStatement ( int depth , Set knownTypes ) { if ( ( this . typeDeclaration . bits & ASTNode . IsAnonymousType ) != <NUM_LIT:0> && ! this . preserveContent ) { return null ; } TypeDeclaration updatedType = updatedTypeDeclaration ( depth + <NUM_LIT:1> , knownTypes ) ; if ( updatedType != null && ( updatedType . bits & ASTNode . IsAnonymousType ) != <NUM_LIT:0> ) { QualifiedAllocationExpression allocation = updatedType . allocation ; if ( allocation . statementEnd == - <NUM_LIT:1> ) { allocation . statementEnd = updatedType . declarationSourceEnd ; } return allocation ; } return updatedType ; } public TypeDeclaration updatedTypeDeclaration ( int depth , Set knownTypes ) { if ( depth >= MAX_TYPE_DEPTH ) return null ; if ( knownTypes . contains ( this . typeDeclaration ) ) return null ; knownTypes . add ( this . typeDeclaration ) ; int lastEnd = this . typeDeclaration . bodyStart ; if ( this . modifiers != <NUM_LIT:0> ) { this . typeDeclaration . modifiers |= this . modifiers ; if ( this . modifiersStart < this . typeDeclaration . declarationSourceStart ) { this . typeDeclaration . declarationSourceStart = this . modifiersStart ; } } if ( this . annotationCount > <NUM_LIT:0> ) { int existingCount = this . typeDeclaration . annotations == null ? <NUM_LIT:0> : this . typeDeclaration . annotations . length ; Annotation [ ] annotationReferences = new Annotation [ existingCount + this . annotationCount ] ; if ( existingCount > <NUM_LIT:0> ) { System . arraycopy ( this . typeDeclaration . annotations , <NUM_LIT:0> , annotationReferences , this . annotationCount , existingCount ) ; } for ( int i = <NUM_LIT:0> ; i < this . annotationCount ; i ++ ) { annotationReferences [ i ] = this . annotations [ i ] . updatedAnnotationReference ( ) ; } this . typeDeclaration . annotations = annotationReferences ; int start = this . annotations [ <NUM_LIT:0> ] . annotation . sourceStart ; if ( start < this . typeDeclaration . declarationSourceStart ) { this . typeDeclaration . declarationSourceStart = start ; } } if ( this . memberTypeCount > <NUM_LIT:0> ) { int existingCount = this . typeDeclaration . memberTypes == null ? <NUM_LIT:0> : this . typeDeclaration . memberTypes . length ; TypeDeclaration [ ] memberTypeDeclarations = new TypeDeclaration [ existingCount + this . memberTypeCount ] ; if ( existingCount > <NUM_LIT:0> ) { System . arraycopy ( this . typeDeclaration . memberTypes , <NUM_LIT:0> , memberTypeDeclarations , <NUM_LIT:0> , existingCount ) ; } if ( this . memberTypes [ this . memberTypeCount - <NUM_LIT:1> ] . typeDeclaration . declarationSourceEnd == <NUM_LIT:0> ) { int bodyEndValue = bodyEnd ( ) ; this . memberTypes [ this . memberTypeCount - <NUM_LIT:1> ] . typeDeclaration . declarationSourceEnd = bodyEndValue ; this . memberTypes [ this . memberTypeCount - <NUM_LIT:1> ] . typeDeclaration . bodyEnd = bodyEndValue ; } int updatedCount = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < this . memberTypeCount ; i ++ ) { TypeDeclaration updatedTypeDeclaration = this . memberTypes [ i ] . updatedTypeDeclaration ( depth + <NUM_LIT:1> , knownTypes ) ; if ( updatedTypeDeclaration != null ) { memberTypeDeclarations [ existingCount + ( updatedCount ++ ) ] = updatedTypeDeclaration ; } } if ( updatedCount < this . memberTypeCount ) { int length = existingCount + updatedCount ; System . arraycopy ( memberTypeDeclarations , <NUM_LIT:0> , memberTypeDeclarations = new TypeDeclaration [ length ] , <NUM_LIT:0> , length ) ; } if ( memberTypeDeclarations . length > <NUM_LIT:0> ) { this . typeDeclaration . memberTypes = memberTypeDeclarations ; if ( memberTypeDeclarations [ memberTypeDeclarations . length - <NUM_LIT:1> ] . declarationSourceEnd > lastEnd ) { lastEnd = memberTypeDeclarations [ memberTypeDeclarations . length - <NUM_LIT:1> ] . declarationSourceEnd ; } } } if ( this . fieldCount > <NUM_LIT:0> ) { int existingCount = this . typeDeclaration . fields == null ? <NUM_LIT:0> : this . typeDeclaration . fields . length ; FieldDeclaration [ ] fieldDeclarations = new FieldDeclaration [ existingCount + this . fieldCount ] ; if ( existingCount > <NUM_LIT:0> ) { System . arraycopy ( this . typeDeclaration . fields , <NUM_LIT:0> , fieldDeclarations , <NUM_LIT:0> , existingCount ) ; } if ( this . fields [ this . fieldCount - <NUM_LIT:1> ] . fieldDeclaration . declarationSourceEnd == <NUM_LIT:0> ) { int temp = bodyEnd ( ) ; this . fields [ this . fieldCount - <NUM_LIT:1> ] . fieldDeclaration . declarationSourceEnd = temp ; this . fields [ this . fieldCount - <NUM_LIT:1> ] . fieldDeclaration . declarationEnd = temp ; } for ( int i = <NUM_LIT:0> ; i < this . fieldCount ; i ++ ) { fieldDeclarations [ existingCount + i ] = this . fields [ i ] . updatedFieldDeclaration ( depth , knownTypes ) ; } for ( int i = this . fieldCount - <NUM_LIT:1> ; <NUM_LIT:0> < i ; i -- ) { if ( fieldDeclarations [ existingCount + i - <NUM_LIT:1> ] . declarationSourceStart == fieldDeclarations [ existingCount + i ] . declarationSourceStart ) { fieldDeclarations [ existingCount + i - <NUM_LIT:1> ] . declarationSourceEnd = fieldDeclarations [ existingCount + i ] . declarationSourceEnd ; fieldDeclarations [ existingCount + i - <NUM_LIT:1> ] . declarationEnd = fieldDeclarations [ existingCount + i ] . declarationEnd ; } } this . typeDeclaration . fields = fieldDeclarations ; if ( fieldDeclarations [ fieldDeclarations . length - <NUM_LIT:1> ] . declarationSourceEnd > lastEnd ) { lastEnd = fieldDeclarations [ fieldDeclarations . length - <NUM_LIT:1> ] . declarationSourceEnd ; } } int existingCount = this . typeDeclaration . methods == null ? <NUM_LIT:0> : this . typeDeclaration . methods . length ; boolean hasConstructor = false , hasRecoveredConstructor = false ; boolean hasAbstractMethods = false ; int defaultConstructorIndex = - <NUM_LIT:1> ; if ( this . methodCount > <NUM_LIT:0> ) { AbstractMethodDeclaration [ ] methodDeclarations = new AbstractMethodDeclaration [ existingCount + this . methodCount ] ; for ( int i = <NUM_LIT:0> ; i < existingCount ; i ++ ) { AbstractMethodDeclaration m = this . typeDeclaration . methods [ i ] ; if ( m . isDefaultConstructor ( ) ) defaultConstructorIndex = i ; if ( m . isAbstract ( ) ) hasAbstractMethods = true ; methodDeclarations [ i ] = m ; } if ( this . methods [ this . methodCount - <NUM_LIT:1> ] . methodDeclaration . declarationSourceEnd == <NUM_LIT:0> ) { int bodyEndValue = bodyEnd ( ) ; this . methods [ this . methodCount - <NUM_LIT:1> ] . methodDeclaration . declarationSourceEnd = bodyEndValue ; this . methods [ this . methodCount - <NUM_LIT:1> ] . methodDeclaration . bodyEnd = bodyEndValue ; } for ( int i = <NUM_LIT:0> ; i < this . methodCount ; i ++ ) { AbstractMethodDeclaration updatedMethod = this . methods [ i ] . updatedMethodDeclaration ( depth , knownTypes ) ; if ( updatedMethod . isConstructor ( ) ) hasRecoveredConstructor = true ; if ( updatedMethod . isAbstract ( ) ) hasAbstractMethods = true ; methodDeclarations [ existingCount + i ] = updatedMethod ; } this . typeDeclaration . methods = methodDeclarations ; if ( methodDeclarations [ methodDeclarations . length - <NUM_LIT:1> ] . declarationSourceEnd > lastEnd ) { lastEnd = methodDeclarations [ methodDeclarations . length - <NUM_LIT:1> ] . declarationSourceEnd ; } if ( hasAbstractMethods ) this . typeDeclaration . bits |= ASTNode . HasAbstractMethods ; hasConstructor = this . typeDeclaration . checkConstructors ( parser ( ) ) ; } else { for ( int i = <NUM_LIT:0> ; i < existingCount ; i ++ ) { if ( this . typeDeclaration . methods [ i ] . isConstructor ( ) ) hasConstructor = true ; } } if ( this . typeDeclaration . needClassInitMethod ( ) ) { boolean alreadyHasClinit = false ; for ( int i = <NUM_LIT:0> ; i < existingCount ; i ++ ) { if ( this . typeDeclaration . methods [ i ] . isClinit ( ) ) { alreadyHasClinit = true ; break ; } } if ( ! alreadyHasClinit ) this . typeDeclaration . addClinit ( ) ; } if ( defaultConstructorIndex >= <NUM_LIT:0> && hasRecoveredConstructor ) { AbstractMethodDeclaration [ ] methodDeclarations = new AbstractMethodDeclaration [ this . typeDeclaration . methods . length - <NUM_LIT:1> ] ; if ( defaultConstructorIndex != <NUM_LIT:0> ) { System . arraycopy ( this . typeDeclaration . methods , <NUM_LIT:0> , methodDeclarations , <NUM_LIT:0> , defaultConstructorIndex ) ; } if ( defaultConstructorIndex != this . typeDeclaration . methods . length - <NUM_LIT:1> ) { System . arraycopy ( this . typeDeclaration . methods , defaultConstructorIndex + <NUM_LIT:1> , methodDeclarations , defaultConstructorIndex , this . typeDeclaration . methods . length - defaultConstructorIndex - <NUM_LIT:1> ) ; } this . typeDeclaration . methods = methodDeclarations ; } else { int kind = TypeDeclaration . kind ( this . typeDeclaration . modifiers ) ; if ( ! hasConstructor && kind != TypeDeclaration . INTERFACE_DECL && kind != TypeDeclaration . ANNOTATION_TYPE_DECL && this . typeDeclaration . allocation == null ) { boolean insideFieldInitializer = false ; RecoveredElement parentElement = this . parent ; while ( parentElement != null ) { if ( parentElement instanceof RecoveredField ) { insideFieldInitializer = true ; break ; } parentElement = parentElement . parent ; } this . typeDeclaration . createDefaultConstructor ( ! parser ( ) . diet || insideFieldInitializer , true ) ; } } if ( this . parent instanceof RecoveredType ) { this . typeDeclaration . bits |= ASTNode . IsMemberType ; } else if ( this . parent instanceof RecoveredMethod ) { this . typeDeclaration . bits |= ASTNode . IsLocalType ; } if ( this . typeDeclaration . declarationSourceEnd == <NUM_LIT:0> ) { this . typeDeclaration . declarationSourceEnd = lastEnd ; this . typeDeclaration . bodyEnd = lastEnd ; } return this . typeDeclaration ; } public void updateFromParserState ( ) { if ( bodyStartsAtHeaderEnd ( ) && this . typeDeclaration . allocation == null ) { Parser parser = parser ( ) ; if ( parser . listLength > <NUM_LIT:0> && parser . astLengthPtr > <NUM_LIT:0> ) { int length = parser . astLengthStack [ parser . astLengthPtr ] ; int astPtr = parser . astPtr - length ; boolean canConsume = astPtr >= <NUM_LIT:0> ; if ( canConsume ) { if ( ( ! ( parser . astStack [ astPtr ] instanceof TypeDeclaration ) ) ) { canConsume = false ; } for ( int i = <NUM_LIT:1> , max = length + <NUM_LIT:1> ; i < max ; i ++ ) { if ( ! ( parser . astStack [ astPtr + i ] instanceof TypeReference ) ) { canConsume = false ; } } } if ( canConsume ) { parser . consumeClassHeaderImplements ( ) ; } } else if ( parser . listTypeParameterLength > <NUM_LIT:0> ) { int length = parser . listTypeParameterLength ; int genericsPtr = parser . genericsPtr ; boolean canConsume = genericsPtr + <NUM_LIT:1> >= length && parser . astPtr > - <NUM_LIT:1> ; if ( canConsume ) { if ( ! ( parser . astStack [ parser . astPtr ] instanceof TypeDeclaration ) ) { canConsume = false ; } while ( genericsPtr + <NUM_LIT:1> > length && ! ( parser . genericsStack [ genericsPtr ] instanceof TypeParameter ) ) { genericsPtr -- ; } for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( ! ( parser . genericsStack [ genericsPtr - i ] instanceof TypeParameter ) ) { canConsume = false ; } } } if ( canConsume ) { TypeDeclaration typeDecl = ( TypeDeclaration ) parser . astStack [ parser . astPtr ] ; System . arraycopy ( parser . genericsStack , genericsPtr - length + <NUM_LIT:1> , typeDecl . typeParameters = new TypeParameter [ length ] , <NUM_LIT:0> , length ) ; typeDecl . bodyStart = typeDecl . typeParameters [ length - <NUM_LIT:1> ] . declarationSourceEnd + <NUM_LIT:1> ; parser . listTypeParameterLength = <NUM_LIT:0> ; parser . lastCheckPoint = typeDecl . bodyStart ; } } } } public RecoveredElement updateOnClosingBrace ( int braceStart , int braceEnd ) { if ( ( -- this . bracketBalance <= <NUM_LIT:0> ) && ( this . parent != null ) ) { this . updateSourceEndIfNecessary ( braceStart , braceEnd ) ; this . bodyEnd = braceStart - <NUM_LIT:1> ; return this . parent ; } return this ; } public RecoveredElement updateOnOpeningBrace ( int braceStart , int braceEnd ) { if ( this . bracketBalance == <NUM_LIT:0> ) { Parser parser = parser ( ) ; switch ( parser . lastIgnoredToken ) { case - <NUM_LIT:1> : case TokenNameextends : case TokenNameimplements : case TokenNameGREATER : case TokenNameRIGHT_SHIFT : case TokenNameUNSIGNED_RIGHT_SHIFT : if ( parser . recoveredStaticInitializerStart == <NUM_LIT:0> ) break ; default : this . foundOpeningBrace = true ; this . bracketBalance = <NUM_LIT:1> ; } } if ( this . bracketBalance == <NUM_LIT:1> ) { Block block = new Block ( <NUM_LIT:0> ) ; Parser parser = parser ( ) ; block . sourceStart = parser . scanner . startPosition ; Initializer init ; if ( parser . recoveredStaticInitializerStart == <NUM_LIT:0> ) { init = new Initializer ( block , ClassFileConstants . AccDefault ) ; } else { init = new Initializer ( block , ClassFileConstants . AccStatic ) ; init . declarationSourceStart = parser . recoveredStaticInitializerStart ; } init . bodyStart = parser . scanner . currentPosition ; return this . add ( init , <NUM_LIT:1> ) ; } return super . updateOnOpeningBrace ( braceStart , braceEnd ) ; } public void updateParseTree ( ) { updatedTypeDeclaration ( <NUM_LIT:0> , new HashSet ( ) ) ; } public void updateSourceEndIfNecessary ( int start , int end ) { if ( this . typeDeclaration . declarationSourceEnd == <NUM_LIT:0> ) { this . bodyEnd = <NUM_LIT:0> ; this . typeDeclaration . declarationSourceEnd = end ; this . typeDeclaration . bodyEnd = end ; } } public void annotationsConsumed ( Annotation [ ] consumedAnnotations ) { RecoveredAnnotation [ ] keep = new RecoveredAnnotation [ this . pendingAnnotationCount ] ; int numKeep = <NUM_LIT:0> ; int pendingCount = this . pendingAnnotationCount ; int consumedLength = consumedAnnotations . length ; outerLoop : for ( int i = <NUM_LIT:0> ; i < pendingCount ; i ++ ) { Annotation pendingAnnotationAST = this . pendingAnnotations [ i ] . annotation ; for ( int j = <NUM_LIT:0> ; j < consumedLength ; j ++ ) { if ( consumedAnnotations [ j ] == pendingAnnotationAST ) continue outerLoop ; } keep [ numKeep ++ ] = this . pendingAnnotations [ i ] ; } if ( numKeep != this . pendingAnnotationCount ) { this . pendingAnnotations = keep ; this . pendingAnnotationCount = numKeep ; } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . parser ; import java . io . * ; import java . util . ArrayList ; import java . util . Collections ; import java . util . Iterator ; import java . util . List ; import java . util . Properties ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . core . compiler . InvalidInputException ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . CompilationResult ; import org . eclipse . jdt . internal . compiler . ast . * ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . env . ICompilationUnit ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . impl . ReferenceContext ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . ClassScope ; import org . eclipse . jdt . internal . compiler . lookup . Binding ; import org . eclipse . jdt . internal . compiler . lookup . ExtraCompilerModifiers ; import org . eclipse . jdt . internal . compiler . lookup . MethodScope ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; import org . eclipse . jdt . internal . compiler . parser . diagnose . DiagnoseParser ; import org . eclipse . jdt . internal . compiler . problem . AbortCompilation ; import org . eclipse . jdt . internal . compiler . problem . AbortCompilationUnit ; import org . eclipse . jdt . internal . compiler . problem . ProblemReporter ; import org . eclipse . jdt . internal . compiler . problem . ProblemSeverities ; import org . eclipse . jdt . internal . compiler . util . Messages ; import org . eclipse . jdt . internal . compiler . util . Util ; public class Parser implements ParserBasicInformation , TerminalTokens , OperatorIds , TypeIds { protected static final int THIS_CALL = ExplicitConstructorCall . This ; protected static final int SUPER_CALL = ExplicitConstructorCall . Super ; public static final char [ ] FALL_THROUGH_TAG = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] CASES_OMITTED_TAG = "<STR_LIT>" . toCharArray ( ) ; public static char asb [ ] = null ; public static char asr [ ] = null ; protected final static int AstStackIncrement = <NUM_LIT:100> ; public static char base_action [ ] = null ; public static final int BracketKinds = <NUM_LIT:3> ; public static short check_table [ ] = null ; public static final int CurlyBracket = <NUM_LIT:2> ; private static final boolean DEBUG = false ; private static final boolean DEBUG_AUTOMATON = false ; private static final String EOF_TOKEN = "<STR_LIT>" ; private static final String ERROR_TOKEN = "<STR_LIT>" ; protected final static int ExpressionStackIncrement = <NUM_LIT:100> ; protected final static int GenericsStackIncrement = <NUM_LIT:10> ; private final static String FILEPREFIX = "<STR_LIT>" ; public static char in_symb [ ] = null ; private static final String INVALID_CHARACTER = "<STR_LIT>" ; public static char lhs [ ] = null ; public static String name [ ] = null ; public static char nasb [ ] = null ; public static char nasr [ ] = null ; public static char non_terminal_index [ ] = null ; private final static String READABLE_NAMES_FILE = "<STR_LIT>" ; public static String readableName [ ] = null ; public static byte rhs [ ] = null ; public static int [ ] reverse_index = null ; public static char [ ] recovery_templates_index = null ; public static char [ ] recovery_templates = null ; public static char [ ] statements_recovery_filter = null ; public static long rules_compliance [ ] = null ; public static final int RoundBracket = <NUM_LIT:0> ; public static byte scope_la [ ] = null ; public static char scope_lhs [ ] = null ; public static char scope_prefix [ ] = null ; public static char scope_rhs [ ] = null ; public static char scope_state [ ] = null ; public static char scope_state_set [ ] = null ; public static char scope_suffix [ ] = null ; public static final int SquareBracket = <NUM_LIT:1> ; protected final static int StackIncrement = <NUM_LIT:255> ; public static char term_action [ ] = null ; public static byte term_check [ ] = null ; public static char terminal_index [ ] = null ; private static final String UNEXPECTED_EOF = "<STR_LIT>" ; public static boolean VERBOSE_RECOVERY = false ; static { try { initTables ( ) ; } catch ( java . io . IOException ex ) { throw new ExceptionInInitializerError ( ex . getMessage ( ) ) ; } } public static int asi ( int state ) { return asb [ original_state ( state ) ] ; } public final static short base_check ( int i ) { return check_table [ i - ( NUM_RULES + <NUM_LIT:1> ) ] ; } private final static void buildFile ( String filename , List listToDump ) { BufferedWriter writer = null ; try { writer = new BufferedWriter ( new FileWriter ( filename ) ) ; for ( Iterator iterator = listToDump . iterator ( ) ; iterator . hasNext ( ) ; ) { writer . write ( String . valueOf ( iterator . next ( ) ) ) ; } writer . flush ( ) ; } catch ( IOException e ) { } finally { if ( writer != null ) { try { writer . close ( ) ; } catch ( IOException e1 ) { } } } System . out . println ( filename + "<STR_LIT>" ) ; } private static void buildFileForCompliance ( String file , int length , String [ ] tokens ) { byte [ ] result = new byte [ length * <NUM_LIT:8> ] ; for ( int i = <NUM_LIT:0> ; i < tokens . length ; i = i + <NUM_LIT:3> ) { if ( "<STR_LIT:2>" . equals ( tokens [ i ] ) ) { int index = Integer . parseInt ( tokens [ i + <NUM_LIT:1> ] ) ; String token = tokens [ i + <NUM_LIT:2> ] . trim ( ) ; long compliance = <NUM_LIT:0> ; if ( "<STR_LIT>" . equals ( token ) ) { compliance = ClassFileConstants . JDK1_4 ; } else if ( "<STR_LIT>" . equals ( token ) ) { compliance = ClassFileConstants . JDK1_5 ; } else if ( "<STR_LIT>" . equals ( token ) ) { compliance = ClassFileConstants . JDK_DEFERRED ; } int j = index * <NUM_LIT:8> ; result [ j ] = ( byte ) ( compliance > > > <NUM_LIT> ) ; result [ j + <NUM_LIT:1> ] = ( byte ) ( compliance > > > <NUM_LIT> ) ; result [ j + <NUM_LIT:2> ] = ( byte ) ( compliance > > > <NUM_LIT> ) ; result [ j + <NUM_LIT:3> ] = ( byte ) ( compliance > > > <NUM_LIT:32> ) ; result [ j + <NUM_LIT:4> ] = ( byte ) ( compliance > > > <NUM_LIT:24> ) ; result [ j + <NUM_LIT:5> ] = ( byte ) ( compliance > > > <NUM_LIT:16> ) ; result [ j + <NUM_LIT:6> ] = ( byte ) ( compliance > > > <NUM_LIT:8> ) ; result [ j + <NUM_LIT:7> ] = ( byte ) ( compliance ) ; } } buildFileForTable ( file , result ) ; } private final static String [ ] buildFileForName ( String filename , String contents ) { String [ ] result = new String [ contents . length ( ) ] ; result [ <NUM_LIT:0> ] = null ; int resultCount = <NUM_LIT:1> ; StringBuffer buffer = new StringBuffer ( ) ; int start = contents . indexOf ( "<STR_LIT>" ) ; start = contents . indexOf ( '<STR_LIT:\">' , start ) ; int end = contents . indexOf ( "<STR_LIT>" , start ) ; contents = contents . substring ( start , end ) ; boolean addLineSeparator = false ; int tokenStart = - <NUM_LIT:1> ; StringBuffer currentToken = new StringBuffer ( ) ; for ( int i = <NUM_LIT:0> ; i < contents . length ( ) ; i ++ ) { char c = contents . charAt ( i ) ; if ( c == '<STR_LIT:\">' ) { if ( tokenStart == - <NUM_LIT:1> ) { tokenStart = i + <NUM_LIT:1> ; } else { if ( addLineSeparator ) { buffer . append ( '<STR_LIT:\n>' ) ; result [ resultCount ++ ] = currentToken . toString ( ) ; currentToken = new StringBuffer ( ) ; } String token = contents . substring ( tokenStart , i ) ; if ( token . equals ( ERROR_TOKEN ) ) { token = INVALID_CHARACTER ; } else if ( token . equals ( EOF_TOKEN ) ) { token = UNEXPECTED_EOF ; } buffer . append ( token ) ; currentToken . append ( token ) ; addLineSeparator = true ; tokenStart = - <NUM_LIT:1> ; } } if ( tokenStart == - <NUM_LIT:1> && c == '<CHAR_LIT>' ) { addLineSeparator = false ; } } if ( currentToken . length ( ) > <NUM_LIT:0> ) { result [ resultCount ++ ] = currentToken . toString ( ) ; } buildFileForTable ( filename , buffer . toString ( ) . toCharArray ( ) ) ; System . arraycopy ( result , <NUM_LIT:0> , result = new String [ resultCount ] , <NUM_LIT:0> , resultCount ) ; return result ; } private static void buildFileForReadableName ( String file , char [ ] newLhs , char [ ] newNonTerminalIndex , String [ ] newName , String [ ] tokens ) { ArrayList entries = new ArrayList ( ) ; boolean [ ] alreadyAdded = new boolean [ newName . length ] ; for ( int i = <NUM_LIT:0> ; i < tokens . length ; i = i + <NUM_LIT:3> ) { if ( "<STR_LIT:1>" . equals ( tokens [ i ] ) ) { int index = newNonTerminalIndex [ newLhs [ Integer . parseInt ( tokens [ i + <NUM_LIT:1> ] ) ] ] ; StringBuffer buffer = new StringBuffer ( ) ; if ( ! alreadyAdded [ index ] ) { alreadyAdded [ index ] = true ; buffer . append ( newName [ index ] ) ; buffer . append ( '<CHAR_LIT:=>' ) ; buffer . append ( tokens [ i + <NUM_LIT:2> ] . trim ( ) ) ; buffer . append ( '<STR_LIT:\n>' ) ; entries . add ( String . valueOf ( buffer ) ) ; } } } int i = <NUM_LIT:1> ; while ( ! INVALID_CHARACTER . equals ( newName [ i ] ) ) i ++ ; i ++ ; for ( ; i < alreadyAdded . length ; i ++ ) { if ( ! alreadyAdded [ i ] ) { System . out . println ( newName [ i ] + "<STR_LIT>" ) ; } } Collections . sort ( entries ) ; buildFile ( file , entries ) ; } private final static void buildFileForTable ( String filename , byte [ ] bytes ) { java . io . FileOutputStream stream = null ; try { stream = new java . io . FileOutputStream ( filename ) ; stream . write ( bytes ) ; } catch ( IOException e ) { } finally { if ( stream != null ) { try { stream . close ( ) ; } catch ( IOException e ) { } } } System . out . println ( filename + "<STR_LIT>" ) ; } private final static void buildFileForTable ( String filename , char [ ] chars ) { byte [ ] bytes = new byte [ chars . length * <NUM_LIT:2> ] ; for ( int i = <NUM_LIT:0> ; i < chars . length ; i ++ ) { bytes [ <NUM_LIT:2> * i ] = ( byte ) ( chars [ i ] > > > <NUM_LIT:8> ) ; bytes [ <NUM_LIT:2> * i + <NUM_LIT:1> ] = ( byte ) ( chars [ i ] & <NUM_LIT> ) ; } java . io . FileOutputStream stream = null ; try { stream = new java . io . FileOutputStream ( filename ) ; stream . write ( bytes ) ; } catch ( IOException e ) { } finally { if ( stream != null ) { try { stream . close ( ) ; } catch ( IOException e ) { } } } System . out . println ( filename + "<STR_LIT>" ) ; } private final static byte [ ] buildFileOfByteFor ( String filename , String tag , String [ ] tokens ) { int i = <NUM_LIT:0> ; while ( ! tokens [ i ++ ] . equals ( tag ) ) { } byte [ ] bytes = new byte [ tokens . length ] ; int ic = <NUM_LIT:0> ; String token ; while ( ! ( token = tokens [ i ++ ] ) . equals ( "<STR_LIT:}>" ) ) { int c = Integer . parseInt ( token ) ; bytes [ ic ++ ] = ( byte ) c ; } System . arraycopy ( bytes , <NUM_LIT:0> , bytes = new byte [ ic ] , <NUM_LIT:0> , ic ) ; buildFileForTable ( filename , bytes ) ; return bytes ; } private final static char [ ] buildFileOfIntFor ( String filename , String tag , String [ ] tokens ) { int i = <NUM_LIT:0> ; while ( ! tokens [ i ++ ] . equals ( tag ) ) { } char [ ] chars = new char [ tokens . length ] ; int ic = <NUM_LIT:0> ; String token ; while ( ! ( token = tokens [ i ++ ] ) . equals ( "<STR_LIT:}>" ) ) { int c = Integer . parseInt ( token ) ; chars [ ic ++ ] = ( char ) c ; } System . arraycopy ( chars , <NUM_LIT:0> , chars = new char [ ic ] , <NUM_LIT:0> , ic ) ; buildFileForTable ( filename , chars ) ; return chars ; } private final static void buildFileOfShortFor ( String filename , String tag , String [ ] tokens ) { int i = <NUM_LIT:0> ; while ( ! tokens [ i ++ ] . equals ( tag ) ) { } char [ ] chars = new char [ tokens . length ] ; int ic = <NUM_LIT:0> ; String token ; while ( ! ( token = tokens [ i ++ ] ) . equals ( "<STR_LIT:}>" ) ) { int c = Integer . parseInt ( token ) ; chars [ ic ++ ] = ( char ) ( c + <NUM_LIT> ) ; } System . arraycopy ( chars , <NUM_LIT:0> , chars = new char [ ic ] , <NUM_LIT:0> , ic ) ; buildFileForTable ( filename , chars ) ; } private static void buildFilesForRecoveryTemplates ( String indexFilename , String templatesFilename , char [ ] newTerminalIndex , char [ ] newNonTerminalIndex , String [ ] newName , char [ ] newLhs , String [ ] tokens ) { int [ ] newReverse = computeReverseTable ( newTerminalIndex , newNonTerminalIndex , newName ) ; char [ ] newRecoveyTemplatesIndex = new char [ newNonTerminalIndex . length ] ; char [ ] newRecoveyTemplates = new char [ newNonTerminalIndex . length ] ; int newRecoveyTemplatesPtr = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < tokens . length ; i = i + <NUM_LIT:3> ) { if ( "<STR_LIT:3>" . equals ( tokens [ i ] ) ) { int length = newRecoveyTemplates . length ; if ( length == newRecoveyTemplatesPtr + <NUM_LIT:1> ) { System . arraycopy ( newRecoveyTemplates , <NUM_LIT:0> , newRecoveyTemplates = new char [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; } newRecoveyTemplates [ newRecoveyTemplatesPtr ++ ] = <NUM_LIT:0> ; int index = newLhs [ Integer . parseInt ( tokens [ i + <NUM_LIT:1> ] ) ] ; newRecoveyTemplatesIndex [ index ] = ( char ) newRecoveyTemplatesPtr ; String token = tokens [ i + <NUM_LIT:2> ] . trim ( ) ; java . util . StringTokenizer st = new java . util . StringTokenizer ( token , "<STR_LIT:U+0020>" ) ; String [ ] terminalNames = new String [ st . countTokens ( ) ] ; int t = <NUM_LIT:0> ; while ( st . hasMoreTokens ( ) ) { terminalNames [ t ++ ] = st . nextToken ( ) ; } for ( int j = <NUM_LIT:0> ; j < terminalNames . length ; j ++ ) { int symbol = getSymbol ( terminalNames [ j ] , newName , newReverse ) ; if ( symbol > - <NUM_LIT:1> ) { length = newRecoveyTemplates . length ; if ( length == newRecoveyTemplatesPtr + <NUM_LIT:1> ) { System . arraycopy ( newRecoveyTemplates , <NUM_LIT:0> , newRecoveyTemplates = new char [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; } newRecoveyTemplates [ newRecoveyTemplatesPtr ++ ] = ( char ) symbol ; } } } } newRecoveyTemplates [ newRecoveyTemplatesPtr ++ ] = <NUM_LIT:0> ; System . arraycopy ( newRecoveyTemplates , <NUM_LIT:0> , newRecoveyTemplates = new char [ newRecoveyTemplatesPtr ] , <NUM_LIT:0> , newRecoveyTemplatesPtr ) ; buildFileForTable ( indexFilename , newRecoveyTemplatesIndex ) ; buildFileForTable ( templatesFilename , newRecoveyTemplates ) ; } private static void buildFilesForStatementsRecoveryFilter ( String filename , char [ ] newNonTerminalIndex , char [ ] newLhs , String [ ] tokens ) { char [ ] newStatementsRecoveryFilter = new char [ newNonTerminalIndex . length ] ; for ( int i = <NUM_LIT:0> ; i < tokens . length ; i = i + <NUM_LIT:3> ) { if ( "<STR_LIT:4>" . equals ( tokens [ i ] ) ) { int index = newLhs [ Integer . parseInt ( tokens [ i + <NUM_LIT:1> ] ) ] ; newStatementsRecoveryFilter [ index ] = <NUM_LIT:1> ; } } buildFileForTable ( filename , newStatementsRecoveryFilter ) ; } public final static void buildFilesFromLPG ( String dataFilename , String dataFilename2 ) { char [ ] contents = CharOperation . NO_CHAR ; try { contents = Util . getFileCharContent ( new File ( dataFilename ) , null ) ; } catch ( IOException ex ) { System . out . println ( Messages . parser_incorrectPath ) ; return ; } java . util . StringTokenizer st = new java . util . StringTokenizer ( new String ( contents ) , "<STR_LIT>" ) ; String [ ] tokens = new String [ st . countTokens ( ) ] ; int j = <NUM_LIT:0> ; while ( st . hasMoreTokens ( ) ) { tokens [ j ++ ] = st . nextToken ( ) ; } final String prefix = FILEPREFIX ; int i = <NUM_LIT:0> ; char [ ] newLhs = buildFileOfIntFor ( prefix + ( ++ i ) + "<STR_LIT>" , "<STR_LIT>" , tokens ) ; buildFileOfShortFor ( prefix + ( ++ i ) + "<STR_LIT>" , "<STR_LIT>" , tokens ) ; buildFileOfIntFor ( prefix + ( ++ i ) + "<STR_LIT>" , "<STR_LIT>" , tokens ) ; buildFileOfIntFor ( prefix + ( ++ i ) + "<STR_LIT>" , "<STR_LIT>" , tokens ) ; buildFileOfIntFor ( prefix + ( ++ i ) + "<STR_LIT>" , "<STR_LIT>" , tokens ) ; buildFileOfIntFor ( prefix + ( ++ i ) + "<STR_LIT>" , "<STR_LIT>" , tokens ) ; char [ ] newTerminalIndex = buildFileOfIntFor ( prefix + ( ++ i ) + "<STR_LIT>" , "<STR_LIT>" , tokens ) ; char [ ] newNonTerminalIndex = buildFileOfIntFor ( prefix + ( ++ i ) + "<STR_LIT>" , "<STR_LIT>" , tokens ) ; buildFileOfIntFor ( prefix + ( ++ i ) + "<STR_LIT>" , "<STR_LIT>" , tokens ) ; buildFileOfIntFor ( prefix + ( ++ i ) + "<STR_LIT>" , "<STR_LIT>" , tokens ) ; buildFileOfIntFor ( prefix + ( ++ i ) + "<STR_LIT>" , "<STR_LIT>" , tokens ) ; buildFileOfIntFor ( prefix + ( ++ i ) + "<STR_LIT>" , "<STR_LIT>" , tokens ) ; buildFileOfIntFor ( prefix + ( ++ i ) + "<STR_LIT>" , "<STR_LIT>" , tokens ) ; buildFileOfIntFor ( prefix + ( ++ i ) + "<STR_LIT>" , "<STR_LIT>" , tokens ) ; buildFileOfIntFor ( prefix + ( ++ i ) + "<STR_LIT>" , "<STR_LIT>" , tokens ) ; buildFileOfIntFor ( prefix + ( ++ i ) + "<STR_LIT>" , "<STR_LIT>" , tokens ) ; byte [ ] newRhs = buildFileOfByteFor ( prefix + ( ++ i ) + "<STR_LIT>" , "<STR_LIT>" , tokens ) ; buildFileOfByteFor ( prefix + ( ++ i ) + "<STR_LIT>" , "<STR_LIT>" , tokens ) ; buildFileOfByteFor ( prefix + ( ++ i ) + "<STR_LIT>" , "<STR_LIT>" , tokens ) ; String [ ] newName = buildFileForName ( prefix + ( ++ i ) + "<STR_LIT>" , new String ( contents ) ) ; contents = CharOperation . NO_CHAR ; try { contents = Util . getFileCharContent ( new File ( dataFilename2 ) , null ) ; } catch ( IOException ex ) { System . out . println ( Messages . parser_incorrectPath ) ; return ; } st = new java . util . StringTokenizer ( new String ( contents ) , "<STR_LIT>" ) ; tokens = new String [ st . countTokens ( ) ] ; j = <NUM_LIT:0> ; while ( st . hasMoreTokens ( ) ) { tokens [ j ++ ] = st . nextToken ( ) ; } buildFileForCompliance ( prefix + ( ++ i ) + "<STR_LIT>" , newRhs . length , tokens ) ; buildFileForReadableName ( READABLE_NAMES_FILE + "<STR_LIT>" , newLhs , newNonTerminalIndex , newName , tokens ) ; buildFilesForRecoveryTemplates ( prefix + ( ++ i ) + "<STR_LIT>" , prefix + ( ++ i ) + "<STR_LIT>" , newTerminalIndex , newNonTerminalIndex , newName , newLhs , tokens ) ; buildFilesForStatementsRecoveryFilter ( prefix + ( ++ i ) + "<STR_LIT>" , newNonTerminalIndex , newLhs , tokens ) ; System . out . println ( Messages . parser_moveFiles ) ; } protected static int [ ] computeReverseTable ( char [ ] newTerminalIndex , char [ ] newNonTerminalIndex , String [ ] newName ) { int [ ] newReverseTable = new int [ newName . length ] ; for ( int j = <NUM_LIT:0> ; j < newName . length ; j ++ ) { found : { for ( int k = <NUM_LIT:0> ; k < newTerminalIndex . length ; k ++ ) { if ( newTerminalIndex [ k ] == j ) { newReverseTable [ j ] = k ; break found ; } } for ( int k = <NUM_LIT:0> ; k < newNonTerminalIndex . length ; k ++ ) { if ( newNonTerminalIndex [ k ] == j ) { newReverseTable [ j ] = - k ; break found ; } } } } return newReverseTable ; } private static int getSymbol ( String terminalName , String [ ] newName , int [ ] newReverse ) { for ( int j = <NUM_LIT:0> ; j < newName . length ; j ++ ) { if ( terminalName . equals ( newName [ j ] ) ) { return newReverse [ j ] ; } } return - <NUM_LIT:1> ; } public static int in_symbol ( int state ) { return in_symb [ original_state ( state ) ] ; } public final static void initTables ( ) throws java . io . IOException { final String prefix = FILEPREFIX ; int i = <NUM_LIT:0> ; lhs = readTable ( prefix + ( ++ i ) + "<STR_LIT>" ) ; char [ ] chars = readTable ( prefix + ( ++ i ) + "<STR_LIT>" ) ; check_table = new short [ chars . length ] ; for ( int c = chars . length ; c -- > <NUM_LIT:0> ; ) { check_table [ c ] = ( short ) ( chars [ c ] - <NUM_LIT> ) ; } asb = readTable ( prefix + ( ++ i ) + "<STR_LIT>" ) ; asr = readTable ( prefix + ( ++ i ) + "<STR_LIT>" ) ; nasb = readTable ( prefix + ( ++ i ) + "<STR_LIT>" ) ; nasr = readTable ( prefix + ( ++ i ) + "<STR_LIT>" ) ; terminal_index = readTable ( prefix + ( ++ i ) + "<STR_LIT>" ) ; non_terminal_index = readTable ( prefix + ( ++ i ) + "<STR_LIT>" ) ; term_action = readTable ( prefix + ( ++ i ) + "<STR_LIT>" ) ; scope_prefix = readTable ( prefix + ( ++ i ) + "<STR_LIT>" ) ; scope_suffix = readTable ( prefix + ( ++ i ) + "<STR_LIT>" ) ; scope_lhs = readTable ( prefix + ( ++ i ) + "<STR_LIT>" ) ; scope_state_set = readTable ( prefix + ( ++ i ) + "<STR_LIT>" ) ; scope_rhs = readTable ( prefix + ( ++ i ) + "<STR_LIT>" ) ; scope_state = readTable ( prefix + ( ++ i ) + "<STR_LIT>" ) ; in_symb = readTable ( prefix + ( ++ i ) + "<STR_LIT>" ) ; rhs = readByteTable ( prefix + ( ++ i ) + "<STR_LIT>" ) ; term_check = readByteTable ( prefix + ( ++ i ) + "<STR_LIT>" ) ; scope_la = readByteTable ( prefix + ( ++ i ) + "<STR_LIT>" ) ; name = readNameTable ( prefix + ( ++ i ) + "<STR_LIT>" ) ; rules_compliance = readLongTable ( prefix + ( ++ i ) + "<STR_LIT>" ) ; readableName = readReadableNameTable ( READABLE_NAMES_FILE + "<STR_LIT>" ) ; reverse_index = computeReverseTable ( terminal_index , non_terminal_index , name ) ; recovery_templates_index = readTable ( prefix + ( ++ i ) + "<STR_LIT>" ) ; recovery_templates = readTable ( prefix + ( ++ i ) + "<STR_LIT>" ) ; statements_recovery_filter = readTable ( prefix + ( ++ i ) + "<STR_LIT>" ) ; base_action = lhs ; } public static int nasi ( int state ) { return nasb [ original_state ( state ) ] ; } public static int ntAction ( int state , int sym ) { return base_action [ state + sym ] ; } protected static int original_state ( int state ) { return - base_check ( state ) ; } protected static byte [ ] readByteTable ( String filename ) throws java . io . IOException { InputStream stream = Parser . class . getResourceAsStream ( filename ) ; if ( stream == null ) { throw new java . io . IOException ( Messages . bind ( Messages . parser_missingFile , filename ) ) ; } byte [ ] bytes = null ; try { stream = new BufferedInputStream ( stream ) ; bytes = Util . getInputStreamAsByteArray ( stream , - <NUM_LIT:1> ) ; } finally { try { stream . close ( ) ; } catch ( IOException e ) { } } return bytes ; } protected static long [ ] readLongTable ( String filename ) throws java . io . IOException { InputStream stream = Parser . class . getResourceAsStream ( filename ) ; if ( stream == null ) { throw new java . io . IOException ( Messages . bind ( Messages . parser_missingFile , filename ) ) ; } byte [ ] bytes = null ; try { stream = new BufferedInputStream ( stream ) ; bytes = Util . getInputStreamAsByteArray ( stream , - <NUM_LIT:1> ) ; } finally { try { stream . close ( ) ; } catch ( IOException e ) { } } int length = bytes . length ; if ( length % <NUM_LIT:8> != <NUM_LIT:0> ) throw new java . io . IOException ( Messages . bind ( Messages . parser_corruptedFile , filename ) ) ; long [ ] longs = new long [ length / <NUM_LIT:8> ] ; int i = <NUM_LIT:0> ; int longIndex = <NUM_LIT:0> ; while ( true ) { longs [ longIndex ++ ] = ( ( ( long ) ( bytes [ i ++ ] & <NUM_LIT> ) ) << <NUM_LIT> ) + ( ( ( long ) ( bytes [ i ++ ] & <NUM_LIT> ) ) << <NUM_LIT> ) + ( ( ( long ) ( bytes [ i ++ ] & <NUM_LIT> ) ) << <NUM_LIT> ) + ( ( ( long ) ( bytes [ i ++ ] & <NUM_LIT> ) ) << <NUM_LIT:32> ) + ( ( ( long ) ( bytes [ i ++ ] & <NUM_LIT> ) ) << <NUM_LIT:24> ) + ( ( ( long ) ( bytes [ i ++ ] & <NUM_LIT> ) ) << <NUM_LIT:16> ) + ( ( ( long ) ( bytes [ i ++ ] & <NUM_LIT> ) ) << <NUM_LIT:8> ) + ( bytes [ i ++ ] & <NUM_LIT> ) ; if ( i == length ) break ; } return longs ; } protected static String [ ] readNameTable ( String filename ) throws java . io . IOException { char [ ] contents = readTable ( filename ) ; char [ ] [ ] nameAsChar = CharOperation . splitOn ( '<STR_LIT:\n>' , contents ) ; String [ ] result = new String [ nameAsChar . length + <NUM_LIT:1> ] ; result [ <NUM_LIT:0> ] = null ; for ( int i = <NUM_LIT:0> ; i < nameAsChar . length ; i ++ ) { result [ i + <NUM_LIT:1> ] = new String ( nameAsChar [ i ] ) ; } return result ; } protected static String [ ] readReadableNameTable ( String filename ) { String [ ] result = new String [ name . length ] ; InputStream is = Parser . class . getResourceAsStream ( filename ) ; Properties props = new Properties ( ) ; try { props . load ( is ) ; } catch ( IOException e ) { result = name ; return result ; } for ( int i = <NUM_LIT:0> ; i < NT_OFFSET + <NUM_LIT:1> ; i ++ ) { result [ i ] = name [ i ] ; } for ( int i = NT_OFFSET ; i < name . length ; i ++ ) { String n = props . getProperty ( name [ i ] ) ; if ( n != null && n . length ( ) > <NUM_LIT:0> ) { result [ i ] = n ; } else { result [ i ] = name [ i ] ; } } return result ; } protected static char [ ] readTable ( String filename ) throws java . io . IOException { InputStream stream = Parser . class . getResourceAsStream ( filename ) ; if ( stream == null ) { throw new java . io . IOException ( Messages . bind ( Messages . parser_missingFile , filename ) ) ; } byte [ ] bytes = null ; try { stream = new BufferedInputStream ( stream ) ; bytes = Util . getInputStreamAsByteArray ( stream , - <NUM_LIT:1> ) ; } finally { try { stream . close ( ) ; } catch ( IOException e ) { } } int length = bytes . length ; if ( ( length & <NUM_LIT:1> ) != <NUM_LIT:0> ) throw new java . io . IOException ( Messages . bind ( Messages . parser_corruptedFile , filename ) ) ; char [ ] chars = new char [ length / <NUM_LIT:2> ] ; int i = <NUM_LIT:0> ; int charIndex = <NUM_LIT:0> ; while ( true ) { chars [ charIndex ++ ] = ( char ) ( ( ( bytes [ i ++ ] & <NUM_LIT> ) << <NUM_LIT:8> ) + ( bytes [ i ++ ] & <NUM_LIT> ) ) ; if ( i == length ) break ; } return chars ; } public static int tAction ( int state , int sym ) { return term_action [ term_check [ base_action [ state ] + sym ] == sym ? base_action [ state ] + sym : base_action [ state ] ] ; } protected int astLengthPtr ; protected int [ ] astLengthStack ; protected int astPtr ; protected ASTNode [ ] astStack = new ASTNode [ AstStackIncrement ] ; public CompilationUnitDeclaration compilationUnit ; protected RecoveredElement currentElement ; public int currentToken ; protected boolean diet = false ; protected int dietInt = <NUM_LIT:0> ; protected int endPosition ; protected int endStatementPosition ; protected int expressionLengthPtr ; protected int [ ] expressionLengthStack ; protected int expressionPtr ; protected Expression [ ] expressionStack = new Expression [ ExpressionStackIncrement ] ; public int firstToken ; protected int genericsIdentifiersLengthPtr ; protected int [ ] genericsIdentifiersLengthStack = new int [ GenericsStackIncrement ] ; protected int genericsLengthPtr ; protected int [ ] genericsLengthStack = new int [ GenericsStackIncrement ] ; protected int genericsPtr ; protected ASTNode [ ] genericsStack = new ASTNode [ GenericsStackIncrement ] ; protected boolean hasError ; protected boolean hasReportedError ; protected int identifierLengthPtr ; protected int [ ] identifierLengthStack ; protected long [ ] identifierPositionStack ; protected int identifierPtr ; protected char [ ] [ ] identifierStack ; protected boolean ignoreNextOpeningBrace ; protected int intPtr ; protected int [ ] intStack ; public int lastAct ; protected int lastCheckPoint ; protected int lastErrorEndPosition ; protected int lastErrorEndPositionBeforeRecovery = - <NUM_LIT:1> ; protected int lastIgnoredToken , nextIgnoredToken ; protected int listLength ; protected int listTypeParameterLength ; protected int lParenPos , rParenPos ; protected int modifiers ; protected int modifiersSourceStart ; protected int [ ] nestedMethod ; protected int nestedType , dimensions ; ASTNode [ ] noAstNodes = new ASTNode [ AstStackIncrement ] ; Expression [ ] noExpressions = new Expression [ ExpressionStackIncrement ] ; protected boolean optimizeStringLiterals = true ; protected CompilerOptions options ; protected ProblemReporter problemReporter ; protected int rBraceStart , rBraceEnd , rBraceSuccessorStart ; protected int realBlockPtr ; protected int [ ] realBlockStack ; protected int recoveredStaticInitializerStart ; public ReferenceContext referenceContext ; public boolean reportOnlyOneSyntaxError = false ; public boolean reportSyntaxErrorIsRequired = true ; protected boolean restartRecovery ; protected boolean annotationRecoveryActivated = true ; protected int lastPosistion ; public boolean methodRecoveryActivated = false ; protected boolean statementRecoveryActivated = false ; protected TypeDeclaration [ ] recoveredTypes ; protected int recoveredTypePtr ; protected int nextTypeStart ; protected TypeDeclaration pendingRecoveredType ; public RecoveryScanner recoveryScanner ; public Scanner scanner ; protected int [ ] stack = new int [ StackIncrement ] ; protected int stateStackTop ; protected int synchronizedBlockSourceStart ; protected int [ ] variablesCounter ; protected boolean checkExternalizeStrings ; protected boolean recordStringLiterals ; public Javadoc javadoc ; public JavadocParser javadocParser ; protected int lastJavadocEnd ; public org . eclipse . jdt . internal . compiler . ReadManager readManager ; private boolean shouldDeferRecovery = false ; public Parser ( ProblemReporter problemReporter , boolean optimizeStringLiterals ) { this . problemReporter = problemReporter ; this . options = problemReporter . options ; this . optimizeStringLiterals = optimizeStringLiterals ; initializeScanner ( ) ; this . astLengthStack = new int [ <NUM_LIT> ] ; this . expressionLengthStack = new int [ <NUM_LIT:30> ] ; this . intStack = new int [ <NUM_LIT> ] ; this . identifierStack = new char [ <NUM_LIT:30> ] [ ] ; this . identifierLengthStack = new int [ <NUM_LIT:30> ] ; this . nestedMethod = new int [ <NUM_LIT:30> ] ; this . realBlockStack = new int [ <NUM_LIT:30> ] ; this . identifierPositionStack = new long [ <NUM_LIT:30> ] ; this . variablesCounter = new int [ <NUM_LIT:30> ] ; this . javadocParser = createJavadocParser ( ) ; } protected void annotationRecoveryCheckPoint ( int start , int end ) { if ( this . lastCheckPoint < end ) { this . lastCheckPoint = end + <NUM_LIT:1> ; } } public void arrayInitializer ( int length ) { ArrayInitializer ai = new ArrayInitializer ( ) ; if ( length != <NUM_LIT:0> ) { this . expressionPtr -= length ; System . arraycopy ( this . expressionStack , this . expressionPtr + <NUM_LIT:1> , ai . expressions = new Expression [ length ] , <NUM_LIT:0> , length ) ; } pushOnExpressionStack ( ai ) ; ai . sourceEnd = this . endStatementPosition ; ai . sourceStart = this . intStack [ this . intPtr -- ] ; } protected void blockReal ( ) { this . realBlockStack [ this . realBlockPtr ] ++ ; } public RecoveredElement buildInitialRecoveryState ( ) { this . lastCheckPoint = <NUM_LIT:0> ; this . lastErrorEndPositionBeforeRecovery = this . scanner . currentPosition ; RecoveredElement element = null ; if ( this . referenceContext instanceof CompilationUnitDeclaration ) { element = new RecoveredUnit ( this . compilationUnit , <NUM_LIT:0> , this ) ; this . compilationUnit . currentPackage = null ; this . compilationUnit . imports = null ; this . compilationUnit . types = null ; this . currentToken = <NUM_LIT:0> ; this . listLength = <NUM_LIT:0> ; this . listTypeParameterLength = <NUM_LIT:0> ; this . endPosition = <NUM_LIT:0> ; this . endStatementPosition = <NUM_LIT:0> ; return element ; } else { if ( this . referenceContext instanceof AbstractMethodDeclaration ) { element = new RecoveredMethod ( ( AbstractMethodDeclaration ) this . referenceContext , null , <NUM_LIT:0> , this ) ; this . lastCheckPoint = ( ( AbstractMethodDeclaration ) this . referenceContext ) . bodyStart ; if ( this . statementRecoveryActivated ) { element = element . add ( new Block ( <NUM_LIT:0> ) , <NUM_LIT:0> ) ; } } else { if ( this . referenceContext instanceof TypeDeclaration ) { TypeDeclaration type = ( TypeDeclaration ) this . referenceContext ; FieldDeclaration [ ] fieldDeclarations = type . fields ; int length = fieldDeclarations == null ? <NUM_LIT:0> : fieldDeclarations . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { FieldDeclaration field = fieldDeclarations [ i ] ; if ( field != null && field . getKind ( ) == AbstractVariableDeclaration . INITIALIZER && ( ( Initializer ) field ) . block != null && field . declarationSourceStart <= this . scanner . initialPosition && this . scanner . initialPosition <= field . declarationSourceEnd && this . scanner . eofPosition <= field . declarationSourceEnd + <NUM_LIT:1> ) { element = new RecoveredInitializer ( field , null , <NUM_LIT:1> , this ) ; this . lastCheckPoint = field . declarationSourceStart ; break ; } } } } } if ( element == null ) return element ; for ( int i = <NUM_LIT:0> ; i <= this . astPtr ; i ++ ) { ASTNode node = this . astStack [ i ] ; if ( node instanceof AbstractMethodDeclaration ) { AbstractMethodDeclaration method = ( AbstractMethodDeclaration ) node ; if ( method . declarationSourceEnd == <NUM_LIT:0> ) { element = element . add ( method , <NUM_LIT:0> ) ; this . lastCheckPoint = method . bodyStart ; } else { element = element . add ( method , <NUM_LIT:0> ) ; this . lastCheckPoint = method . declarationSourceEnd + <NUM_LIT:1> ; } continue ; } if ( node instanceof Initializer ) { Initializer initializer = ( Initializer ) node ; if ( initializer . block == null ) continue ; if ( initializer . declarationSourceEnd == <NUM_LIT:0> ) { element = element . add ( initializer , <NUM_LIT:1> ) ; this . lastCheckPoint = initializer . sourceStart ; } else { element = element . add ( initializer , <NUM_LIT:0> ) ; this . lastCheckPoint = initializer . declarationSourceEnd + <NUM_LIT:1> ; } continue ; } if ( node instanceof FieldDeclaration ) { FieldDeclaration field = ( FieldDeclaration ) node ; if ( field . declarationSourceEnd == <NUM_LIT:0> ) { element = element . add ( field , <NUM_LIT:0> ) ; if ( field . initialization == null ) { this . lastCheckPoint = field . sourceEnd + <NUM_LIT:1> ; } else { this . lastCheckPoint = field . initialization . sourceEnd + <NUM_LIT:1> ; } } else { element = element . add ( field , <NUM_LIT:0> ) ; this . lastCheckPoint = field . declarationSourceEnd + <NUM_LIT:1> ; } continue ; } if ( node instanceof TypeDeclaration ) { TypeDeclaration type = ( TypeDeclaration ) node ; if ( ( type . modifiers & ClassFileConstants . AccEnum ) != <NUM_LIT:0> ) { continue ; } if ( type . declarationSourceEnd == <NUM_LIT:0> ) { element = element . add ( type , <NUM_LIT:0> ) ; this . lastCheckPoint = type . bodyStart ; } else { element = element . add ( type , <NUM_LIT:0> ) ; this . lastCheckPoint = type . declarationSourceEnd + <NUM_LIT:1> ; } continue ; } if ( node instanceof ImportReference ) { ImportReference importRef = ( ImportReference ) node ; element = element . add ( importRef , <NUM_LIT:0> ) ; this . lastCheckPoint = importRef . declarationSourceEnd + <NUM_LIT:1> ; } if ( this . statementRecoveryActivated ) { if ( node instanceof Block ) { Block block = ( Block ) node ; element = element . add ( block , <NUM_LIT:0> ) ; this . lastCheckPoint = block . sourceEnd + <NUM_LIT:1> ; } else if ( node instanceof LocalDeclaration ) { LocalDeclaration statement = ( LocalDeclaration ) node ; element = element . add ( statement , <NUM_LIT:0> ) ; this . lastCheckPoint = statement . sourceEnd + <NUM_LIT:1> ; } else if ( node instanceof Expression ) { if ( node instanceof Assignment || node instanceof PrefixExpression || node instanceof PostfixExpression || node instanceof MessageSend || node instanceof AllocationExpression ) { Expression statement = ( Expression ) node ; element = element . add ( statement , <NUM_LIT:0> ) ; if ( statement . statementEnd != - <NUM_LIT:1> ) { this . lastCheckPoint = statement . statementEnd + <NUM_LIT:1> ; } else { this . lastCheckPoint = statement . sourceEnd + <NUM_LIT:1> ; } } } else if ( node instanceof Statement ) { Statement statement = ( Statement ) node ; element = element . add ( statement , <NUM_LIT:0> ) ; this . lastCheckPoint = statement . sourceEnd + <NUM_LIT:1> ; } } } if ( this . statementRecoveryActivated ) { if ( this . pendingRecoveredType != null && this . scanner . startPosition - <NUM_LIT:1> <= this . pendingRecoveredType . declarationSourceEnd ) { element = element . add ( this . pendingRecoveredType , <NUM_LIT:0> ) ; this . lastCheckPoint = this . pendingRecoveredType . declarationSourceEnd + <NUM_LIT:1> ; this . pendingRecoveredType = null ; } } return element ; } protected void checkAndSetModifiers ( int flag ) { if ( ( this . modifiers & flag ) != <NUM_LIT:0> ) { this . modifiers |= ExtraCompilerModifiers . AccAlternateModifierProblem ; } this . modifiers |= flag ; if ( this . modifiersSourceStart < <NUM_LIT:0> ) this . modifiersSourceStart = this . scanner . startPosition ; if ( this . currentElement != null && this . annotationRecoveryActivated ) { this . currentElement . addModifier ( flag , this . modifiersSourceStart ) ; } } public void checkComment ( ) { if ( ! ( this . diet && this . dietInt == <NUM_LIT:0> ) && this . scanner . commentPtr >= <NUM_LIT:0> ) { flushCommentsDefinedPriorTo ( this . endStatementPosition ) ; } int lastComment = this . scanner . commentPtr ; if ( this . modifiersSourceStart >= <NUM_LIT:0> ) { while ( lastComment >= <NUM_LIT:0> ) { int commentSourceStart = this . scanner . commentStarts [ lastComment ] ; if ( commentSourceStart < <NUM_LIT:0> ) commentSourceStart = - commentSourceStart ; if ( commentSourceStart <= this . modifiersSourceStart ) break ; lastComment -- ; } } if ( lastComment >= <NUM_LIT:0> ) { this . modifiersSourceStart = this . scanner . commentStarts [ <NUM_LIT:0> ] ; if ( this . modifiersSourceStart < <NUM_LIT:0> ) this . modifiersSourceStart = - this . modifiersSourceStart ; while ( lastComment >= <NUM_LIT:0> && this . scanner . commentStops [ lastComment ] < <NUM_LIT:0> ) lastComment -- ; if ( lastComment >= <NUM_LIT:0> && this . javadocParser != null ) { int commentEnd = this . scanner . commentStops [ lastComment ] - <NUM_LIT:1> ; if ( this . javadocParser . shouldReportProblems ) { this . javadocParser . reportProblems = this . currentElement == null || commentEnd > this . lastJavadocEnd ; } else { this . javadocParser . reportProblems = false ; } if ( this . javadocParser . checkDeprecation ( lastComment ) ) { checkAndSetModifiers ( ClassFileConstants . AccDeprecated ) ; } this . javadoc = this . javadocParser . docComment ; if ( this . currentElement == null ) this . lastJavadocEnd = commentEnd ; } } } protected void checkNonNLSAfterBodyEnd ( int declarationEnd ) { if ( this . scanner . currentPosition - <NUM_LIT:1> <= declarationEnd ) { this . scanner . eofPosition = declarationEnd < Integer . MAX_VALUE ? declarationEnd + <NUM_LIT:1> : declarationEnd ; try { while ( this . scanner . getNextToken ( ) != TokenNameEOF ) { } } catch ( InvalidInputException e ) { } } } protected void classInstanceCreation ( boolean isQualified ) { AllocationExpression alloc ; int length ; if ( ( ( length = this . astLengthStack [ this . astLengthPtr -- ] ) == <NUM_LIT:1> ) && ( this . astStack [ this . astPtr ] == null ) ) { this . astPtr -- ; if ( isQualified ) { alloc = new QualifiedAllocationExpression ( ) ; } else { alloc = new AllocationExpression ( ) ; } alloc . sourceEnd = this . endPosition ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != <NUM_LIT:0> ) { this . expressionPtr -= length ; System . arraycopy ( this . expressionStack , this . expressionPtr + <NUM_LIT:1> , alloc . arguments = new Expression [ length ] , <NUM_LIT:0> , length ) ; } alloc . type = getTypeReference ( <NUM_LIT:0> ) ; checkForDiamond ( alloc . type ) ; alloc . sourceStart = this . intStack [ this . intPtr -- ] ; pushOnExpressionStack ( alloc ) ; } else { dispatchDeclarationInto ( length ) ; TypeDeclaration anonymousTypeDeclaration = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; anonymousTypeDeclaration . declarationSourceEnd = this . endStatementPosition ; anonymousTypeDeclaration . bodyEnd = this . endStatementPosition ; if ( anonymousTypeDeclaration . allocation != null ) { anonymousTypeDeclaration . allocation . sourceEnd = this . endStatementPosition ; checkForDiamond ( anonymousTypeDeclaration . allocation . type ) ; } if ( length == <NUM_LIT:0> && ! containsComment ( anonymousTypeDeclaration . bodyStart , anonymousTypeDeclaration . bodyEnd ) ) { anonymousTypeDeclaration . bits |= ASTNode . UndocumentedEmptyBlock ; } this . astPtr -- ; this . astLengthPtr -- ; } } protected void checkForDiamond ( TypeReference allocType ) { if ( allocType instanceof ParameterizedSingleTypeReference ) { ParameterizedSingleTypeReference type = ( ParameterizedSingleTypeReference ) allocType ; if ( type . typeArguments == TypeReference . NO_TYPE_ARGUMENTS ) { if ( this . options . sourceLevel < ClassFileConstants . JDK1_7 ) { problemReporter ( ) . diamondNotBelow17 ( allocType ) ; } if ( this . options . sourceLevel > ClassFileConstants . JDK1_4 ) { type . bits |= ASTNode . IsDiamond ; } } } else if ( allocType instanceof ParameterizedQualifiedTypeReference ) { ParameterizedQualifiedTypeReference type = ( ParameterizedQualifiedTypeReference ) allocType ; if ( type . typeArguments [ type . typeArguments . length - <NUM_LIT:1> ] == TypeReference . NO_TYPE_ARGUMENTS ) { if ( this . options . sourceLevel < ClassFileConstants . JDK1_7 ) { problemReporter ( ) . diamondNotBelow17 ( allocType , type . typeArguments . length - <NUM_LIT:1> ) ; } if ( this . options . sourceLevel > ClassFileConstants . JDK1_4 ) { type . bits |= ASTNode . IsDiamond ; } } } } protected ParameterizedQualifiedTypeReference computeQualifiedGenericsFromRightSide ( TypeReference rightSide , int dim ) { int nameSize = this . identifierLengthStack [ this . identifierLengthPtr ] ; int tokensSize = nameSize ; if ( rightSide instanceof ParameterizedSingleTypeReference ) { tokensSize ++ ; } else if ( rightSide instanceof SingleTypeReference ) { tokensSize ++ ; } else if ( rightSide instanceof ParameterizedQualifiedTypeReference ) { tokensSize += ( ( QualifiedTypeReference ) rightSide ) . tokens . length ; } else if ( rightSide instanceof QualifiedTypeReference ) { tokensSize += ( ( QualifiedTypeReference ) rightSide ) . tokens . length ; } TypeReference [ ] [ ] typeArguments = new TypeReference [ tokensSize ] [ ] ; char [ ] [ ] tokens = new char [ tokensSize ] [ ] ; long [ ] positions = new long [ tokensSize ] ; if ( rightSide instanceof ParameterizedSingleTypeReference ) { ParameterizedSingleTypeReference singleParameterizedTypeReference = ( ParameterizedSingleTypeReference ) rightSide ; tokens [ nameSize ] = singleParameterizedTypeReference . token ; positions [ nameSize ] = ( ( ( long ) singleParameterizedTypeReference . sourceStart ) << <NUM_LIT:32> ) + singleParameterizedTypeReference . sourceEnd ; typeArguments [ nameSize ] = singleParameterizedTypeReference . typeArguments ; } else if ( rightSide instanceof SingleTypeReference ) { SingleTypeReference singleTypeReference = ( SingleTypeReference ) rightSide ; tokens [ nameSize ] = singleTypeReference . token ; positions [ nameSize ] = ( ( ( long ) singleTypeReference . sourceStart ) << <NUM_LIT:32> ) + singleTypeReference . sourceEnd ; } else if ( rightSide instanceof ParameterizedQualifiedTypeReference ) { ParameterizedQualifiedTypeReference parameterizedTypeReference = ( ParameterizedQualifiedTypeReference ) rightSide ; TypeReference [ ] [ ] rightSideTypeArguments = parameterizedTypeReference . typeArguments ; System . arraycopy ( rightSideTypeArguments , <NUM_LIT:0> , typeArguments , nameSize , rightSideTypeArguments . length ) ; char [ ] [ ] rightSideTokens = parameterizedTypeReference . tokens ; System . arraycopy ( rightSideTokens , <NUM_LIT:0> , tokens , nameSize , rightSideTokens . length ) ; long [ ] rightSidePositions = parameterizedTypeReference . sourcePositions ; System . arraycopy ( rightSidePositions , <NUM_LIT:0> , positions , nameSize , rightSidePositions . length ) ; } else if ( rightSide instanceof QualifiedTypeReference ) { QualifiedTypeReference qualifiedTypeReference = ( QualifiedTypeReference ) rightSide ; char [ ] [ ] rightSideTokens = qualifiedTypeReference . tokens ; System . arraycopy ( rightSideTokens , <NUM_LIT:0> , tokens , nameSize , rightSideTokens . length ) ; long [ ] rightSidePositions = qualifiedTypeReference . sourcePositions ; System . arraycopy ( rightSidePositions , <NUM_LIT:0> , positions , nameSize , rightSidePositions . length ) ; } int currentTypeArgumentsLength = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; TypeReference [ ] currentTypeArguments = new TypeReference [ currentTypeArgumentsLength ] ; this . genericsPtr -= currentTypeArgumentsLength ; System . arraycopy ( this . genericsStack , this . genericsPtr + <NUM_LIT:1> , currentTypeArguments , <NUM_LIT:0> , currentTypeArgumentsLength ) ; if ( nameSize == <NUM_LIT:1> ) { tokens [ <NUM_LIT:0> ] = this . identifierStack [ this . identifierPtr ] ; positions [ <NUM_LIT:0> ] = this . identifierPositionStack [ this . identifierPtr -- ] ; typeArguments [ <NUM_LIT:0> ] = currentTypeArguments ; } else { this . identifierPtr -= nameSize ; System . arraycopy ( this . identifierStack , this . identifierPtr + <NUM_LIT:1> , tokens , <NUM_LIT:0> , nameSize ) ; System . arraycopy ( this . identifierPositionStack , this . identifierPtr + <NUM_LIT:1> , positions , <NUM_LIT:0> , nameSize ) ; typeArguments [ nameSize - <NUM_LIT:1> ] = currentTypeArguments ; } this . identifierLengthPtr -- ; return new ParameterizedQualifiedTypeReference ( tokens , typeArguments , dim , positions ) ; } protected void concatExpressionLists ( ) { this . expressionLengthStack [ -- this . expressionLengthPtr ] ++ ; } protected void concatGenericsLists ( ) { this . genericsLengthStack [ this . genericsLengthPtr - <NUM_LIT:1> ] += this . genericsLengthStack [ this . genericsLengthPtr -- ] ; } protected void concatNodeLists ( ) { this . astLengthStack [ this . astLengthPtr - <NUM_LIT:1> ] += this . astLengthStack [ this . astLengthPtr -- ] ; } protected void consumeAdditionalBound ( ) { pushOnGenericsStack ( getTypeReference ( this . intStack [ this . intPtr -- ] ) ) ; } protected void consumeAdditionalBound1 ( ) { } protected void consumeAdditionalBoundList ( ) { concatGenericsLists ( ) ; } protected void consumeAdditionalBoundList1 ( ) { concatGenericsLists ( ) ; } protected void consumeAllocationHeader ( ) { if ( this . currentElement == null ) { return ; } if ( this . currentToken == TokenNameLBRACE ) { TypeDeclaration anonymousType = new TypeDeclaration ( this . compilationUnit . compilationResult ) ; anonymousType . name = CharOperation . NO_CHAR ; anonymousType . bits |= ( ASTNode . IsAnonymousType | ASTNode . IsLocalType ) ; anonymousType . sourceStart = this . intStack [ this . intPtr -- ] ; anonymousType . declarationSourceStart = anonymousType . sourceStart ; anonymousType . sourceEnd = this . rParenPos ; QualifiedAllocationExpression alloc = new QualifiedAllocationExpression ( anonymousType ) ; alloc . type = getTypeReference ( <NUM_LIT:0> ) ; alloc . sourceStart = anonymousType . sourceStart ; alloc . sourceEnd = anonymousType . sourceEnd ; this . lastCheckPoint = anonymousType . bodyStart = this . scanner . currentPosition ; this . currentElement = this . currentElement . add ( anonymousType , <NUM_LIT:0> ) ; this . lastIgnoredToken = - <NUM_LIT:1> ; this . currentToken = <NUM_LIT:0> ; return ; } this . lastCheckPoint = this . scanner . startPosition ; this . restartRecovery = true ; } protected void consumeAnnotationAsModifier ( ) { Expression expression = this . expressionStack [ this . expressionPtr ] ; int sourceStart = expression . sourceStart ; if ( this . modifiersSourceStart < <NUM_LIT:0> ) { this . modifiersSourceStart = sourceStart ; } } protected void consumeAnnotationName ( ) { if ( this . currentElement != null ) { int start = this . intStack [ this . intPtr ] ; int end = ( int ) ( this . identifierPositionStack [ this . identifierPtr ] & <NUM_LIT> ) ; annotationRecoveryCheckPoint ( start , end ) ; if ( this . annotationRecoveryActivated ) { this . currentElement = this . currentElement . addAnnotationName ( this . identifierPtr , this . identifierLengthPtr , start , <NUM_LIT:0> ) ; } } this . recordStringLiterals = false ; } protected void consumeAnnotationTypeDeclaration ( ) { int length ; if ( ( length = this . astLengthStack [ this . astLengthPtr -- ] ) != <NUM_LIT:0> ) { dispatchDeclarationInto ( length ) ; } TypeDeclaration typeDecl = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; typeDecl . checkConstructors ( this ) ; if ( this . scanner . containsAssertKeyword ) { typeDecl . bits |= ASTNode . ContainsAssertion ; } typeDecl . addClinit ( ) ; typeDecl . bodyEnd = this . endStatementPosition ; if ( length == <NUM_LIT:0> && ! containsComment ( typeDecl . bodyStart , typeDecl . bodyEnd ) ) { typeDecl . bits |= ASTNode . UndocumentedEmptyBlock ; } typeDecl . declarationSourceEnd = flushCommentsDefinedPriorTo ( this . endStatementPosition ) ; } protected void consumeAnnotationTypeDeclarationHeader ( ) { TypeDeclaration annotationTypeDeclaration = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; if ( this . currentToken == TokenNameLBRACE ) { annotationTypeDeclaration . bodyStart = this . scanner . currentPosition ; } if ( this . currentElement != null ) { this . restartRecovery = true ; } this . scanner . commentPtr = - <NUM_LIT:1> ; } protected void consumeAnnotationTypeDeclarationHeaderName ( ) { TypeDeclaration annotationTypeDeclaration = new TypeDeclaration ( this . compilationUnit . compilationResult ) ; if ( this . nestedMethod [ this . nestedType ] == <NUM_LIT:0> ) { if ( this . nestedType != <NUM_LIT:0> ) { annotationTypeDeclaration . bits |= ASTNode . IsMemberType ; } } else { annotationTypeDeclaration . bits |= ASTNode . IsLocalType ; markEnclosingMemberWithLocalType ( ) ; blockReal ( ) ; } long pos = this . identifierPositionStack [ this . identifierPtr ] ; annotationTypeDeclaration . sourceEnd = ( int ) pos ; annotationTypeDeclaration . sourceStart = ( int ) ( pos > > > <NUM_LIT:32> ) ; annotationTypeDeclaration . name = this . identifierStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; this . intPtr -- ; this . intPtr -- ; annotationTypeDeclaration . modifiersSourceStart = this . intStack [ this . intPtr -- ] ; annotationTypeDeclaration . modifiers = this . intStack [ this . intPtr -- ] | ClassFileConstants . AccAnnotation | ClassFileConstants . AccInterface ; if ( annotationTypeDeclaration . modifiersSourceStart >= <NUM_LIT:0> ) { annotationTypeDeclaration . declarationSourceStart = annotationTypeDeclaration . modifiersSourceStart ; this . intPtr -- ; } else { int atPosition = this . intStack [ this . intPtr -- ] ; annotationTypeDeclaration . declarationSourceStart = atPosition ; } if ( ( annotationTypeDeclaration . bits & ASTNode . IsMemberType ) == <NUM_LIT:0> && ( annotationTypeDeclaration . bits & ASTNode . IsLocalType ) == <NUM_LIT:0> ) { if ( this . compilationUnit != null && ! CharOperation . equals ( annotationTypeDeclaration . name , this . compilationUnit . getMainTypeName ( ) ) ) { annotationTypeDeclaration . bits |= ASTNode . IsSecondaryType ; } } int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != <NUM_LIT:0> ) { System . arraycopy ( this . expressionStack , ( this . expressionPtr -= length ) + <NUM_LIT:1> , annotationTypeDeclaration . annotations = new Annotation [ length ] , <NUM_LIT:0> , length ) ; } annotationTypeDeclaration . bodyStart = annotationTypeDeclaration . sourceEnd + <NUM_LIT:1> ; annotationTypeDeclaration . javadoc = this . javadoc ; this . javadoc = null ; pushOnAstStack ( annotationTypeDeclaration ) ; if ( ! this . statementRecoveryActivated && this . options . sourceLevel < ClassFileConstants . JDK1_5 && this . lastErrorEndPositionBeforeRecovery < this . scanner . currentPosition ) { problemReporter ( ) . invalidUsageOfAnnotationDeclarations ( annotationTypeDeclaration ) ; } if ( this . currentElement != null ) { this . lastCheckPoint = annotationTypeDeclaration . bodyStart ; this . currentElement = this . currentElement . add ( annotationTypeDeclaration , <NUM_LIT:0> ) ; this . lastIgnoredToken = - <NUM_LIT:1> ; } } protected void consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters ( ) { TypeDeclaration annotationTypeDeclaration = new TypeDeclaration ( this . compilationUnit . compilationResult ) ; int length = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; this . genericsPtr -= length ; System . arraycopy ( this . genericsStack , this . genericsPtr + <NUM_LIT:1> , annotationTypeDeclaration . typeParameters = new TypeParameter [ length ] , <NUM_LIT:0> , length ) ; problemReporter ( ) . invalidUsageOfTypeParametersForAnnotationDeclaration ( annotationTypeDeclaration ) ; annotationTypeDeclaration . bodyStart = annotationTypeDeclaration . typeParameters [ length - <NUM_LIT:1> ] . declarationSourceEnd + <NUM_LIT:1> ; this . listTypeParameterLength = <NUM_LIT:0> ; if ( this . nestedMethod [ this . nestedType ] == <NUM_LIT:0> ) { if ( this . nestedType != <NUM_LIT:0> ) { annotationTypeDeclaration . bits |= ASTNode . IsMemberType ; } } else { annotationTypeDeclaration . bits |= ASTNode . IsLocalType ; markEnclosingMemberWithLocalType ( ) ; blockReal ( ) ; } long pos = this . identifierPositionStack [ this . identifierPtr ] ; annotationTypeDeclaration . sourceEnd = ( int ) pos ; annotationTypeDeclaration . sourceStart = ( int ) ( pos > > > <NUM_LIT:32> ) ; annotationTypeDeclaration . name = this . identifierStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; this . intPtr -- ; this . intPtr -- ; annotationTypeDeclaration . modifiersSourceStart = this . intStack [ this . intPtr -- ] ; annotationTypeDeclaration . modifiers = this . intStack [ this . intPtr -- ] | ClassFileConstants . AccAnnotation | ClassFileConstants . AccInterface ; if ( annotationTypeDeclaration . modifiersSourceStart >= <NUM_LIT:0> ) { annotationTypeDeclaration . declarationSourceStart = annotationTypeDeclaration . modifiersSourceStart ; this . intPtr -- ; } else { int atPosition = this . intStack [ this . intPtr -- ] ; annotationTypeDeclaration . declarationSourceStart = atPosition ; } if ( ( annotationTypeDeclaration . bits & ASTNode . IsMemberType ) == <NUM_LIT:0> && ( annotationTypeDeclaration . bits & ASTNode . IsLocalType ) == <NUM_LIT:0> ) { if ( this . compilationUnit != null && ! CharOperation . equals ( annotationTypeDeclaration . name , this . compilationUnit . getMainTypeName ( ) ) ) { annotationTypeDeclaration . bits |= ASTNode . IsSecondaryType ; } } if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != <NUM_LIT:0> ) { System . arraycopy ( this . expressionStack , ( this . expressionPtr -= length ) + <NUM_LIT:1> , annotationTypeDeclaration . annotations = new Annotation [ length ] , <NUM_LIT:0> , length ) ; } annotationTypeDeclaration . javadoc = this . javadoc ; this . javadoc = null ; pushOnAstStack ( annotationTypeDeclaration ) ; if ( ! this . statementRecoveryActivated && this . options . sourceLevel < ClassFileConstants . JDK1_5 && this . lastErrorEndPositionBeforeRecovery < this . scanner . currentPosition ) { problemReporter ( ) . invalidUsageOfAnnotationDeclarations ( annotationTypeDeclaration ) ; } if ( this . currentElement != null ) { this . lastCheckPoint = annotationTypeDeclaration . bodyStart ; this . currentElement = this . currentElement . add ( annotationTypeDeclaration , <NUM_LIT:0> ) ; this . lastIgnoredToken = - <NUM_LIT:1> ; } } protected void consumeAnnotationTypeMemberDeclaration ( ) { AnnotationMethodDeclaration annotationTypeMemberDeclaration = ( AnnotationMethodDeclaration ) this . astStack [ this . astPtr ] ; annotationTypeMemberDeclaration . modifiers |= ExtraCompilerModifiers . AccSemicolonBody ; int declarationEndPosition = flushCommentsDefinedPriorTo ( this . endStatementPosition ) ; annotationTypeMemberDeclaration . bodyStart = this . endStatementPosition ; annotationTypeMemberDeclaration . bodyEnd = declarationEndPosition ; annotationTypeMemberDeclaration . declarationSourceEnd = declarationEndPosition ; } protected void consumeAnnotationTypeMemberDeclarations ( ) { concatNodeLists ( ) ; } protected void consumeAnnotationTypeMemberDeclarationsopt ( ) { this . nestedType -- ; } protected void consumeArgumentList ( ) { concatExpressionLists ( ) ; } protected void consumeArguments ( ) { pushOnIntStack ( this . rParenPos ) ; } protected void consumeArrayAccess ( boolean unspecifiedReference ) { Expression exp ; if ( unspecifiedReference ) { exp = this . expressionStack [ this . expressionPtr ] = new ArrayReference ( getUnspecifiedReferenceOptimized ( ) , this . expressionStack [ this . expressionPtr ] ) ; } else { this . expressionPtr -- ; this . expressionLengthPtr -- ; exp = this . expressionStack [ this . expressionPtr ] = new ArrayReference ( this . expressionStack [ this . expressionPtr ] , this . expressionStack [ this . expressionPtr + <NUM_LIT:1> ] ) ; } exp . sourceEnd = this . endStatementPosition ; } protected void consumeArrayCreationExpressionWithInitializer ( ) { int length ; ArrayAllocationExpression arrayAllocation = new ArrayAllocationExpression ( ) ; this . expressionLengthPtr -- ; arrayAllocation . initializer = ( ArrayInitializer ) this . expressionStack [ this . expressionPtr -- ] ; arrayAllocation . type = getTypeReference ( <NUM_LIT:0> ) ; arrayAllocation . type . bits |= ASTNode . IgnoreRawTypeCheck ; length = ( this . expressionLengthStack [ this . expressionLengthPtr -- ] ) ; this . expressionPtr -= length ; System . arraycopy ( this . expressionStack , this . expressionPtr + <NUM_LIT:1> , arrayAllocation . dimensions = new Expression [ length ] , <NUM_LIT:0> , length ) ; arrayAllocation . sourceStart = this . intStack [ this . intPtr -- ] ; if ( arrayAllocation . initializer == null ) { arrayAllocation . sourceEnd = this . endStatementPosition ; } else { arrayAllocation . sourceEnd = arrayAllocation . initializer . sourceEnd ; } pushOnExpressionStack ( arrayAllocation ) ; } protected void consumeArrayCreationExpressionWithoutInitializer ( ) { int length ; ArrayAllocationExpression arrayAllocation = new ArrayAllocationExpression ( ) ; arrayAllocation . type = getTypeReference ( <NUM_LIT:0> ) ; arrayAllocation . type . bits |= ASTNode . IgnoreRawTypeCheck ; length = ( this . expressionLengthStack [ this . expressionLengthPtr -- ] ) ; this . expressionPtr -= length ; System . arraycopy ( this . expressionStack , this . expressionPtr + <NUM_LIT:1> , arrayAllocation . dimensions = new Expression [ length ] , <NUM_LIT:0> , length ) ; arrayAllocation . sourceStart = this . intStack [ this . intPtr -- ] ; if ( arrayAllocation . initializer == null ) { arrayAllocation . sourceEnd = this . endStatementPosition ; } else { arrayAllocation . sourceEnd = arrayAllocation . initializer . sourceEnd ; } pushOnExpressionStack ( arrayAllocation ) ; } protected void consumeArrayCreationHeader ( ) { } protected void consumeArrayInitializer ( ) { arrayInitializer ( this . expressionLengthStack [ this . expressionLengthPtr -- ] ) ; } protected void consumeArrayTypeWithTypeArgumentsName ( ) { this . genericsIdentifiersLengthStack [ this . genericsIdentifiersLengthPtr ] += this . identifierLengthStack [ this . identifierLengthPtr ] ; pushOnGenericsLengthStack ( <NUM_LIT:0> ) ; } protected void consumeAssertStatement ( ) { this . expressionLengthPtr -= <NUM_LIT:2> ; pushOnAstStack ( new AssertStatement ( this . expressionStack [ this . expressionPtr -- ] , this . expressionStack [ this . expressionPtr -- ] , this . intStack [ this . intPtr -- ] ) ) ; } protected void consumeAssignment ( ) { int op = this . intStack [ this . intPtr -- ] ; this . expressionPtr -- ; this . expressionLengthPtr -- ; Expression expression = this . expressionStack [ this . expressionPtr + <NUM_LIT:1> ] ; this . expressionStack [ this . expressionPtr ] = ( op != EQUAL ) ? new CompoundAssignment ( this . expressionStack [ this . expressionPtr ] , expression , op , expression . sourceEnd ) : new Assignment ( this . expressionStack [ this . expressionPtr ] , expression , expression . sourceEnd ) ; if ( this . pendingRecoveredType != null ) { if ( this . pendingRecoveredType . allocation != null && this . scanner . startPosition - <NUM_LIT:1> <= this . pendingRecoveredType . declarationSourceEnd ) { this . expressionStack [ this . expressionPtr ] = this . pendingRecoveredType . allocation ; this . pendingRecoveredType = null ; return ; } this . pendingRecoveredType = null ; } } protected void consumeAssignmentOperator ( int pos ) { pushOnIntStack ( pos ) ; } protected void consumeBinaryExpression ( int op ) { this . expressionPtr -- ; this . expressionLengthPtr -- ; Expression expr1 = this . expressionStack [ this . expressionPtr ] ; Expression expr2 = this . expressionStack [ this . expressionPtr + <NUM_LIT:1> ] ; switch ( op ) { case OR_OR : this . expressionStack [ this . expressionPtr ] = new OR_OR_Expression ( expr1 , expr2 , op ) ; break ; case AND_AND : this . expressionStack [ this . expressionPtr ] = new AND_AND_Expression ( expr1 , expr2 , op ) ; break ; case PLUS : if ( this . optimizeStringLiterals ) { if ( expr1 instanceof StringLiteral ) { if ( ( ( expr1 . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ) == <NUM_LIT:0> ) { if ( expr2 instanceof CharLiteral ) { this . expressionStack [ this . expressionPtr ] = ( ( StringLiteral ) expr1 ) . extendWith ( ( CharLiteral ) expr2 ) ; } else if ( expr2 instanceof StringLiteral ) { this . expressionStack [ this . expressionPtr ] = ( ( StringLiteral ) expr1 ) . extendWith ( ( StringLiteral ) expr2 ) ; } else { this . expressionStack [ this . expressionPtr ] = new BinaryExpression ( expr1 , expr2 , PLUS ) ; } } else { this . expressionStack [ this . expressionPtr ] = new BinaryExpression ( expr1 , expr2 , PLUS ) ; } } else if ( expr1 instanceof CombinedBinaryExpression ) { CombinedBinaryExpression cursor ; if ( ( cursor = ( CombinedBinaryExpression ) expr1 ) . arity < cursor . arityMax ) { cursor . left = new BinaryExpression ( cursor ) ; cursor . arity ++ ; } else { cursor . left = new CombinedBinaryExpression ( cursor ) ; cursor . arity = <NUM_LIT:0> ; cursor . tuneArityMax ( ) ; } cursor . right = expr2 ; cursor . sourceEnd = expr2 . sourceEnd ; this . expressionStack [ this . expressionPtr ] = cursor ; } else if ( expr1 instanceof BinaryExpression && ( ( expr1 . bits & ASTNode . OperatorMASK ) > > ASTNode . OperatorSHIFT ) == OperatorIds . PLUS ) { this . expressionStack [ this . expressionPtr ] = new CombinedBinaryExpression ( expr1 , expr2 , PLUS , <NUM_LIT:1> ) ; } else { this . expressionStack [ this . expressionPtr ] = new BinaryExpression ( expr1 , expr2 , PLUS ) ; } } else if ( expr1 instanceof StringLiteral ) { if ( expr2 instanceof StringLiteral && ( ( expr1 . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ) == <NUM_LIT:0> ) { this . expressionStack [ this . expressionPtr ] = ( ( StringLiteral ) expr1 ) . extendsWith ( ( StringLiteral ) expr2 ) ; } else { this . expressionStack [ this . expressionPtr ] = new BinaryExpression ( expr1 , expr2 , PLUS ) ; } } else if ( expr1 instanceof CombinedBinaryExpression ) { CombinedBinaryExpression cursor ; if ( ( cursor = ( CombinedBinaryExpression ) expr1 ) . arity < cursor . arityMax ) { cursor . left = new BinaryExpression ( cursor ) ; cursor . bits &= ~ ASTNode . ParenthesizedMASK ; cursor . arity ++ ; } else { cursor . left = new CombinedBinaryExpression ( cursor ) ; cursor . bits &= ~ ASTNode . ParenthesizedMASK ; cursor . arity = <NUM_LIT:0> ; cursor . tuneArityMax ( ) ; } cursor . right = expr2 ; cursor . sourceEnd = expr2 . sourceEnd ; this . expressionStack [ this . expressionPtr ] = cursor ; } else if ( expr1 instanceof BinaryExpression && ( ( expr1 . bits & ASTNode . OperatorMASK ) > > ASTNode . OperatorSHIFT ) == OperatorIds . PLUS ) { this . expressionStack [ this . expressionPtr ] = new CombinedBinaryExpression ( expr1 , expr2 , PLUS , <NUM_LIT:1> ) ; } else { this . expressionStack [ this . expressionPtr ] = new BinaryExpression ( expr1 , expr2 , PLUS ) ; } break ; case LESS : case MULTIPLY : this . intPtr -- ; this . expressionStack [ this . expressionPtr ] = new BinaryExpression ( expr1 , expr2 , op ) ; break ; default : this . expressionStack [ this . expressionPtr ] = new BinaryExpression ( expr1 , expr2 , op ) ; } } protected void consumeBinaryExpressionWithName ( int op ) { pushOnExpressionStack ( getUnspecifiedReferenceOptimized ( ) ) ; this . expressionPtr -- ; this . expressionLengthPtr -- ; Expression expr1 = this . expressionStack [ this . expressionPtr + <NUM_LIT:1> ] ; Expression expr2 = this . expressionStack [ this . expressionPtr ] ; switch ( op ) { case OR_OR : this . expressionStack [ this . expressionPtr ] = new OR_OR_Expression ( expr1 , expr2 , op ) ; break ; case AND_AND : this . expressionStack [ this . expressionPtr ] = new AND_AND_Expression ( expr1 , expr2 , op ) ; break ; case PLUS : if ( this . optimizeStringLiterals ) { if ( expr1 instanceof StringLiteral && ( ( expr1 . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ) == <NUM_LIT:0> ) { if ( expr2 instanceof CharLiteral ) { this . expressionStack [ this . expressionPtr ] = ( ( StringLiteral ) expr1 ) . extendWith ( ( CharLiteral ) expr2 ) ; } else if ( expr2 instanceof StringLiteral ) { this . expressionStack [ this . expressionPtr ] = ( ( StringLiteral ) expr1 ) . extendWith ( ( StringLiteral ) expr2 ) ; } else { this . expressionStack [ this . expressionPtr ] = new BinaryExpression ( expr1 , expr2 , PLUS ) ; } } else { this . expressionStack [ this . expressionPtr ] = new BinaryExpression ( expr1 , expr2 , PLUS ) ; } } else if ( expr1 instanceof StringLiteral ) { if ( expr2 instanceof StringLiteral && ( ( expr1 . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ) == <NUM_LIT:0> ) { this . expressionStack [ this . expressionPtr ] = ( ( StringLiteral ) expr1 ) . extendsWith ( ( StringLiteral ) expr2 ) ; } else { this . expressionStack [ this . expressionPtr ] = new BinaryExpression ( expr1 , expr2 , op ) ; } } else { this . expressionStack [ this . expressionPtr ] = new BinaryExpression ( expr1 , expr2 , op ) ; } break ; case LESS : case MULTIPLY : this . intPtr -- ; this . expressionStack [ this . expressionPtr ] = new BinaryExpression ( expr1 , expr2 , op ) ; break ; default : this . expressionStack [ this . expressionPtr ] = new BinaryExpression ( expr1 , expr2 , op ) ; } } protected void consumeBlock ( ) { int statementsLength = this . astLengthStack [ this . astLengthPtr -- ] ; Block block ; if ( statementsLength == <NUM_LIT:0> ) { block = new Block ( <NUM_LIT:0> ) ; block . sourceStart = this . intStack [ this . intPtr -- ] ; block . sourceEnd = this . endStatementPosition ; if ( ! containsComment ( block . sourceStart , block . sourceEnd ) ) { block . bits |= ASTNode . UndocumentedEmptyBlock ; } this . realBlockPtr -- ; } else { block = new Block ( this . realBlockStack [ this . realBlockPtr -- ] ) ; this . astPtr -= statementsLength ; System . arraycopy ( this . astStack , this . astPtr + <NUM_LIT:1> , block . statements = new Statement [ statementsLength ] , <NUM_LIT:0> , statementsLength ) ; block . sourceStart = this . intStack [ this . intPtr -- ] ; block . sourceEnd = this . endStatementPosition ; } pushOnAstStack ( block ) ; } protected void consumeBlockStatements ( ) { concatNodeLists ( ) ; } protected void consumeCaseLabel ( ) { this . expressionLengthPtr -- ; Expression expression = this . expressionStack [ this . expressionPtr -- ] ; CaseStatement caseStatement = new CaseStatement ( expression , expression . sourceEnd , this . intStack [ this . intPtr -- ] ) ; if ( hasLeadingTagComment ( FALL_THROUGH_TAG , caseStatement . sourceStart ) ) { caseStatement . bits |= ASTNode . DocumentedFallthrough ; } pushOnAstStack ( caseStatement ) ; } protected void consumeCastExpressionLL1 ( ) { Expression cast ; Expression exp ; this . expressionPtr -- ; this . expressionStack [ this . expressionPtr ] = cast = new CastExpression ( exp = this . expressionStack [ this . expressionPtr + <NUM_LIT:1> ] , ( TypeReference ) this . expressionStack [ this . expressionPtr ] ) ; this . expressionLengthPtr -- ; updateSourcePosition ( cast ) ; cast . sourceEnd = exp . sourceEnd ; } protected void consumeCastExpressionWithGenericsArray ( ) { Expression exp ; Expression cast ; TypeReference castType ; int end = this . intStack [ this . intPtr -- ] ; int dim = this . intStack [ this . intPtr -- ] ; pushOnGenericsIdentifiersLengthStack ( this . identifierLengthStack [ this . identifierLengthPtr ] ) ; this . expressionStack [ this . expressionPtr ] = cast = new CastExpression ( exp = this . expressionStack [ this . expressionPtr ] , castType = getTypeReference ( dim ) ) ; this . intPtr -- ; castType . sourceEnd = end - <NUM_LIT:1> ; castType . sourceStart = ( cast . sourceStart = this . intStack [ this . intPtr -- ] ) + <NUM_LIT:1> ; cast . sourceEnd = exp . sourceEnd ; } protected void consumeCastExpressionWithNameArray ( ) { Expression exp ; Expression cast ; TypeReference castType ; int end = this . intStack [ this . intPtr -- ] ; pushOnGenericsLengthStack ( <NUM_LIT:0> ) ; pushOnGenericsIdentifiersLengthStack ( this . identifierLengthStack [ this . identifierLengthPtr ] ) ; this . expressionStack [ this . expressionPtr ] = cast = new CastExpression ( exp = this . expressionStack [ this . expressionPtr ] , castType = getTypeReference ( this . intStack [ this . intPtr -- ] ) ) ; castType . sourceEnd = end - <NUM_LIT:1> ; castType . sourceStart = ( cast . sourceStart = this . intStack [ this . intPtr -- ] ) + <NUM_LIT:1> ; cast . sourceEnd = exp . sourceEnd ; } protected void consumeCastExpressionWithPrimitiveType ( ) { Expression exp ; Expression cast ; TypeReference castType ; int end = this . intStack [ this . intPtr -- ] ; this . expressionStack [ this . expressionPtr ] = cast = new CastExpression ( exp = this . expressionStack [ this . expressionPtr ] , castType = getTypeReference ( this . intStack [ this . intPtr -- ] ) ) ; castType . sourceEnd = end - <NUM_LIT:1> ; castType . sourceStart = ( cast . sourceStart = this . intStack [ this . intPtr -- ] ) + <NUM_LIT:1> ; cast . sourceEnd = exp . sourceEnd ; } protected void consumeCastExpressionWithQualifiedGenericsArray ( ) { Expression exp ; Expression cast ; TypeReference castType ; int end = this . intStack [ this . intPtr -- ] ; int dim = this . intStack [ this . intPtr -- ] ; TypeReference rightSide = getTypeReference ( <NUM_LIT:0> ) ; ParameterizedQualifiedTypeReference qualifiedParameterizedTypeReference = computeQualifiedGenericsFromRightSide ( rightSide , dim ) ; this . intPtr -- ; this . expressionStack [ this . expressionPtr ] = cast = new CastExpression ( exp = this . expressionStack [ this . expressionPtr ] , castType = qualifiedParameterizedTypeReference ) ; castType . sourceEnd = end - <NUM_LIT:1> ; castType . sourceStart = ( cast . sourceStart = this . intStack [ this . intPtr -- ] ) + <NUM_LIT:1> ; cast . sourceEnd = exp . sourceEnd ; } protected void consumeCatches ( ) { optimizedConcatNodeLists ( ) ; } protected void consumeCatchFormalParameter ( ) { this . identifierLengthPtr -- ; char [ ] identifierName = this . identifierStack [ this . identifierPtr ] ; long namePositions = this . identifierPositionStack [ this . identifierPtr -- ] ; int extendedDimensions = this . intStack [ this . intPtr -- ] ; TypeReference type = ( TypeReference ) this . astStack [ this . astPtr -- ] ; if ( extendedDimensions > <NUM_LIT:0> ) { type = type . copyDims ( type . dimensions ( ) + extendedDimensions ) ; type . sourceEnd = this . endPosition ; } this . astLengthPtr -- ; int modifierPositions = this . intStack [ this . intPtr -- ] ; this . intPtr -- ; Argument arg = new Argument ( identifierName , namePositions , type , this . intStack [ this . intPtr + <NUM_LIT:1> ] & ~ ClassFileConstants . AccDeprecated ) ; arg . bits &= ~ ASTNode . IsArgument ; arg . declarationSourceStart = modifierPositions ; int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != <NUM_LIT:0> ) { System . arraycopy ( this . expressionStack , ( this . expressionPtr -= length ) + <NUM_LIT:1> , arg . annotations = new Annotation [ length ] , <NUM_LIT:0> , length ) ; } pushOnAstStack ( arg ) ; this . listLength ++ ; } protected void consumeCatchHeader ( ) { if ( this . currentElement == null ) { return ; } if ( ! ( this . currentElement instanceof RecoveredBlock ) ) { if ( ! ( this . currentElement instanceof RecoveredMethod ) ) { return ; } RecoveredMethod rMethod = ( RecoveredMethod ) this . currentElement ; if ( ! ( rMethod . methodBody == null && rMethod . bracketBalance > <NUM_LIT:0> ) ) { return ; } } Argument arg = ( Argument ) this . astStack [ this . astPtr -- ] ; LocalDeclaration localDeclaration = new LocalDeclaration ( arg . name , arg . sourceStart , arg . sourceEnd ) ; localDeclaration . type = arg . type ; localDeclaration . declarationSourceStart = arg . declarationSourceStart ; localDeclaration . declarationSourceEnd = arg . declarationSourceEnd ; this . currentElement = this . currentElement . add ( localDeclaration , <NUM_LIT:0> ) ; this . lastCheckPoint = this . scanner . startPosition ; this . restartRecovery = true ; this . lastIgnoredToken = - <NUM_LIT:1> ; } protected void consumeCatchType ( ) { int length = this . astLengthStack [ this . astLengthPtr -- ] ; if ( length != <NUM_LIT:1> ) { TypeReference [ ] typeReferences ; System . arraycopy ( this . astStack , ( this . astPtr -= length ) + <NUM_LIT:1> , ( typeReferences = new TypeReference [ length ] ) , <NUM_LIT:0> , length ) ; UnionTypeReference typeReference = new UnionTypeReference ( typeReferences ) ; pushOnAstStack ( typeReference ) ; if ( this . options . sourceLevel < ClassFileConstants . JDK1_7 ) { problemReporter ( ) . multiCatchNotBelow17 ( typeReference ) ; } } else { pushOnAstLengthStack ( <NUM_LIT:1> ) ; } } protected void consumeClassBodyDeclaration ( ) { this . nestedMethod [ this . nestedType ] -- ; Block block = ( Block ) this . astStack [ this . astPtr -- ] ; this . astLengthPtr -- ; if ( this . diet ) block . bits &= ~ ASTNode . UndocumentedEmptyBlock ; Initializer initializer = ( Initializer ) this . astStack [ this . astPtr ] ; initializer . declarationSourceStart = initializer . sourceStart = block . sourceStart ; initializer . block = block ; this . intPtr -- ; initializer . bodyStart = this . intStack [ this . intPtr -- ] ; this . realBlockPtr -- ; int javadocCommentStart = this . intStack [ this . intPtr -- ] ; if ( javadocCommentStart != - <NUM_LIT:1> ) { initializer . declarationSourceStart = javadocCommentStart ; initializer . javadoc = this . javadoc ; this . javadoc = null ; } initializer . bodyEnd = this . endPosition ; initializer . sourceEnd = this . endStatementPosition ; initializer . declarationSourceEnd = flushCommentsDefinedPriorTo ( this . endStatementPosition ) ; } protected void consumeClassBodyDeclarations ( ) { concatNodeLists ( ) ; } protected void consumeClassBodyDeclarationsopt ( ) { this . nestedType -- ; } protected void consumeClassBodyopt ( ) { pushOnAstStack ( null ) ; this . endPosition = this . rParenPos ; this . shouldDeferRecovery = false ; } protected void consumeClassDeclaration ( ) { int length ; if ( ( length = this . astLengthStack [ this . astLengthPtr -- ] ) != <NUM_LIT:0> ) { dispatchDeclarationInto ( length ) ; } TypeDeclaration typeDecl = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; boolean hasConstructor = typeDecl . checkConstructors ( this ) ; if ( ! hasConstructor ) { switch ( TypeDeclaration . kind ( typeDecl . modifiers ) ) { case TypeDeclaration . CLASS_DECL : case TypeDeclaration . ENUM_DECL : boolean insideFieldInitializer = false ; if ( this . diet ) { for ( int i = this . nestedType ; i > <NUM_LIT:0> ; i -- ) { if ( this . variablesCounter [ i ] > <NUM_LIT:0> ) { insideFieldInitializer = true ; break ; } } } typeDecl . createDefaultConstructor ( ! this . diet || insideFieldInitializer , true ) ; } } if ( this . scanner . containsAssertKeyword ) { typeDecl . bits |= ASTNode . ContainsAssertion ; } typeDecl . addClinit ( ) ; typeDecl . bodyEnd = this . endStatementPosition ; if ( length == <NUM_LIT:0> && ! containsComment ( typeDecl . bodyStart , typeDecl . bodyEnd ) ) { typeDecl . bits |= ASTNode . UndocumentedEmptyBlock ; } typeDecl . declarationSourceEnd = flushCommentsDefinedPriorTo ( this . endStatementPosition ) ; } protected void consumeClassHeader ( ) { TypeDeclaration typeDecl = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; if ( this . currentToken == TokenNameLBRACE ) { typeDecl . bodyStart = this . scanner . currentPosition ; } if ( this . currentElement != null ) { this . restartRecovery = true ; } this . scanner . commentPtr = - <NUM_LIT:1> ; } protected void consumeClassHeaderExtends ( ) { TypeReference superClass = getTypeReference ( <NUM_LIT:0> ) ; TypeDeclaration typeDecl = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; typeDecl . superclass = superClass ; superClass . bits |= ASTNode . IsSuperType ; typeDecl . bodyStart = typeDecl . superclass . sourceEnd + <NUM_LIT:1> ; if ( this . currentElement != null ) { this . lastCheckPoint = typeDecl . bodyStart ; } } protected void consumeClassHeaderImplements ( ) { int length = this . astLengthStack [ this . astLengthPtr -- ] ; this . astPtr -= length ; TypeDeclaration typeDecl = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; System . arraycopy ( this . astStack , this . astPtr + <NUM_LIT:1> , typeDecl . superInterfaces = new TypeReference [ length ] , <NUM_LIT:0> , length ) ; for ( int i = <NUM_LIT:0> , max = typeDecl . superInterfaces . length ; i < max ; i ++ ) { typeDecl . superInterfaces [ i ] . bits |= ASTNode . IsSuperType ; } typeDecl . bodyStart = typeDecl . superInterfaces [ length - <NUM_LIT:1> ] . sourceEnd + <NUM_LIT:1> ; this . listLength = <NUM_LIT:0> ; if ( this . currentElement != null ) { this . lastCheckPoint = typeDecl . bodyStart ; } } protected void consumeClassHeaderName1 ( ) { TypeDeclaration typeDecl = new TypeDeclaration ( this . compilationUnit . compilationResult ) ; if ( this . nestedMethod [ this . nestedType ] == <NUM_LIT:0> ) { if ( this . nestedType != <NUM_LIT:0> ) { typeDecl . bits |= ASTNode . IsMemberType ; } } else { typeDecl . bits |= ASTNode . IsLocalType ; markEnclosingMemberWithLocalType ( ) ; blockReal ( ) ; } long pos = this . identifierPositionStack [ this . identifierPtr ] ; typeDecl . sourceEnd = ( int ) pos ; typeDecl . sourceStart = ( int ) ( pos > > > <NUM_LIT:32> ) ; typeDecl . name = this . identifierStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; typeDecl . declarationSourceStart = this . intStack [ this . intPtr -- ] ; this . intPtr -- ; typeDecl . modifiersSourceStart = this . intStack [ this . intPtr -- ] ; typeDecl . modifiers = this . intStack [ this . intPtr -- ] ; if ( typeDecl . modifiersSourceStart >= <NUM_LIT:0> ) { typeDecl . declarationSourceStart = typeDecl . modifiersSourceStart ; } if ( ( typeDecl . bits & ASTNode . IsMemberType ) == <NUM_LIT:0> && ( typeDecl . bits & ASTNode . IsLocalType ) == <NUM_LIT:0> ) { if ( this . compilationUnit != null && ! CharOperation . equals ( typeDecl . name , this . compilationUnit . getMainTypeName ( ) ) ) { typeDecl . bits |= ASTNode . IsSecondaryType ; } } int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != <NUM_LIT:0> ) { System . arraycopy ( this . expressionStack , ( this . expressionPtr -= length ) + <NUM_LIT:1> , typeDecl . annotations = new Annotation [ length ] , <NUM_LIT:0> , length ) ; } typeDecl . bodyStart = typeDecl . sourceEnd + <NUM_LIT:1> ; pushOnAstStack ( typeDecl ) ; this . listLength = <NUM_LIT:0> ; if ( this . currentElement != null ) { this . lastCheckPoint = typeDecl . bodyStart ; this . currentElement = this . currentElement . add ( typeDecl , <NUM_LIT:0> ) ; this . lastIgnoredToken = - <NUM_LIT:1> ; } typeDecl . javadoc = this . javadoc ; this . javadoc = null ; } protected void consumeClassInstanceCreationExpression ( ) { classInstanceCreation ( false ) ; } protected void consumeClassInstanceCreationExpressionName ( ) { pushOnExpressionStack ( getUnspecifiedReferenceOptimized ( ) ) ; } protected void consumeClassInstanceCreationExpressionQualified ( ) { classInstanceCreation ( true ) ; QualifiedAllocationExpression qae = ( QualifiedAllocationExpression ) this . expressionStack [ this . expressionPtr ] ; if ( qae . anonymousType == null ) { this . expressionLengthPtr -- ; this . expressionPtr -- ; qae . enclosingInstance = this . expressionStack [ this . expressionPtr ] ; this . expressionStack [ this . expressionPtr ] = qae ; } qae . sourceStart = qae . enclosingInstance . sourceStart ; } protected void consumeClassInstanceCreationExpressionQualifiedWithTypeArguments ( ) { QualifiedAllocationExpression alloc ; int length ; if ( ( ( length = this . astLengthStack [ this . astLengthPtr -- ] ) == <NUM_LIT:1> ) && ( this . astStack [ this . astPtr ] == null ) ) { this . astPtr -- ; alloc = new QualifiedAllocationExpression ( ) ; alloc . sourceEnd = this . endPosition ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != <NUM_LIT:0> ) { this . expressionPtr -= length ; System . arraycopy ( this . expressionStack , this . expressionPtr + <NUM_LIT:1> , alloc . arguments = new Expression [ length ] , <NUM_LIT:0> , length ) ; } alloc . type = getTypeReference ( <NUM_LIT:0> ) ; checkForDiamond ( alloc . type ) ; length = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; this . genericsPtr -= length ; System . arraycopy ( this . genericsStack , this . genericsPtr + <NUM_LIT:1> , alloc . typeArguments = new TypeReference [ length ] , <NUM_LIT:0> , length ) ; this . intPtr -- ; alloc . sourceStart = this . intStack [ this . intPtr -- ] ; pushOnExpressionStack ( alloc ) ; } else { dispatchDeclarationInto ( length ) ; TypeDeclaration anonymousTypeDeclaration = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; anonymousTypeDeclaration . declarationSourceEnd = this . endStatementPosition ; anonymousTypeDeclaration . bodyEnd = this . endStatementPosition ; if ( length == <NUM_LIT:0> && ! containsComment ( anonymousTypeDeclaration . bodyStart , anonymousTypeDeclaration . bodyEnd ) ) { anonymousTypeDeclaration . bits |= ASTNode . UndocumentedEmptyBlock ; } this . astPtr -- ; this . astLengthPtr -- ; QualifiedAllocationExpression allocationExpression = anonymousTypeDeclaration . allocation ; if ( allocationExpression != null ) { allocationExpression . sourceEnd = this . endStatementPosition ; length = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; this . genericsPtr -= length ; System . arraycopy ( this . genericsStack , this . genericsPtr + <NUM_LIT:1> , allocationExpression . typeArguments = new TypeReference [ length ] , <NUM_LIT:0> , length ) ; allocationExpression . sourceStart = this . intStack [ this . intPtr -- ] ; checkForDiamond ( allocationExpression . type ) ; } } QualifiedAllocationExpression qae = ( QualifiedAllocationExpression ) this . expressionStack [ this . expressionPtr ] ; if ( qae . anonymousType == null ) { this . expressionLengthPtr -- ; this . expressionPtr -- ; qae . enclosingInstance = this . expressionStack [ this . expressionPtr ] ; this . expressionStack [ this . expressionPtr ] = qae ; } qae . sourceStart = qae . enclosingInstance . sourceStart ; } protected void consumeClassInstanceCreationExpressionWithTypeArguments ( ) { AllocationExpression alloc ; int length ; if ( ( ( length = this . astLengthStack [ this . astLengthPtr -- ] ) == <NUM_LIT:1> ) && ( this . astStack [ this . astPtr ] == null ) ) { this . astPtr -- ; alloc = new AllocationExpression ( ) ; alloc . sourceEnd = this . endPosition ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != <NUM_LIT:0> ) { this . expressionPtr -= length ; System . arraycopy ( this . expressionStack , this . expressionPtr + <NUM_LIT:1> , alloc . arguments = new Expression [ length ] , <NUM_LIT:0> , length ) ; } alloc . type = getTypeReference ( <NUM_LIT:0> ) ; checkForDiamond ( alloc . type ) ; length = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; this . genericsPtr -= length ; System . arraycopy ( this . genericsStack , this . genericsPtr + <NUM_LIT:1> , alloc . typeArguments = new TypeReference [ length ] , <NUM_LIT:0> , length ) ; this . intPtr -- ; alloc . sourceStart = this . intStack [ this . intPtr -- ] ; pushOnExpressionStack ( alloc ) ; } else { dispatchDeclarationInto ( length ) ; TypeDeclaration anonymousTypeDeclaration = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; anonymousTypeDeclaration . declarationSourceEnd = this . endStatementPosition ; anonymousTypeDeclaration . bodyEnd = this . endStatementPosition ; if ( length == <NUM_LIT:0> && ! containsComment ( anonymousTypeDeclaration . bodyStart , anonymousTypeDeclaration . bodyEnd ) ) { anonymousTypeDeclaration . bits |= ASTNode . UndocumentedEmptyBlock ; } this . astPtr -- ; this . astLengthPtr -- ; QualifiedAllocationExpression allocationExpression = anonymousTypeDeclaration . allocation ; if ( allocationExpression != null ) { allocationExpression . sourceEnd = this . endStatementPosition ; length = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; this . genericsPtr -= length ; System . arraycopy ( this . genericsStack , this . genericsPtr + <NUM_LIT:1> , allocationExpression . typeArguments = new TypeReference [ length ] , <NUM_LIT:0> , length ) ; allocationExpression . sourceStart = this . intStack [ this . intPtr -- ] ; checkForDiamond ( allocationExpression . type ) ; } } } protected void consumeClassOrInterface ( ) { this . genericsIdentifiersLengthStack [ this . genericsIdentifiersLengthPtr ] += this . identifierLengthStack [ this . identifierLengthPtr ] ; pushOnGenericsLengthStack ( <NUM_LIT:0> ) ; } protected void consumeClassOrInterfaceName ( ) { pushOnGenericsIdentifiersLengthStack ( this . identifierLengthStack [ this . identifierLengthPtr ] ) ; pushOnGenericsLengthStack ( <NUM_LIT:0> ) ; } protected void consumeClassTypeElt ( ) { pushOnAstStack ( getTypeReference ( <NUM_LIT:0> ) ) ; this . listLength ++ ; } protected void consumeClassTypeList ( ) { optimizedConcatNodeLists ( ) ; } protected void consumeCompilationUnit ( ) { } protected void consumeConditionalExpression ( int op ) { this . intPtr -= <NUM_LIT:2> ; this . expressionPtr -= <NUM_LIT:2> ; this . expressionLengthPtr -= <NUM_LIT:2> ; this . expressionStack [ this . expressionPtr ] = new ConditionalExpression ( this . expressionStack [ this . expressionPtr ] , this . expressionStack [ this . expressionPtr + <NUM_LIT:1> ] , this . expressionStack [ this . expressionPtr + <NUM_LIT:2> ] ) ; } protected void consumeConditionalExpressionWithName ( int op ) { this . intPtr -= <NUM_LIT:2> ; pushOnExpressionStack ( getUnspecifiedReferenceOptimized ( ) ) ; this . expressionPtr -= <NUM_LIT:2> ; this . expressionLengthPtr -= <NUM_LIT:2> ; this . expressionStack [ this . expressionPtr ] = new ConditionalExpression ( this . expressionStack [ this . expressionPtr + <NUM_LIT:2> ] , this . expressionStack [ this . expressionPtr ] , this . expressionStack [ this . expressionPtr + <NUM_LIT:1> ] ) ; } protected void consumeConstructorBlockStatements ( ) { concatNodeLists ( ) ; } protected void consumeConstructorBody ( ) { this . nestedMethod [ this . nestedType ] -- ; } protected void consumeConstructorDeclaration ( ) { int length ; this . intPtr -- ; this . intPtr -- ; this . realBlockPtr -- ; ExplicitConstructorCall constructorCall = null ; Statement [ ] statements = null ; if ( ( length = this . astLengthStack [ this . astLengthPtr -- ] ) != <NUM_LIT:0> ) { this . astPtr -= length ; if ( ! this . options . ignoreMethodBodies ) { if ( this . astStack [ this . astPtr + <NUM_LIT:1> ] instanceof ExplicitConstructorCall ) { System . arraycopy ( this . astStack , this . astPtr + <NUM_LIT:2> , statements = new Statement [ length - <NUM_LIT:1> ] , <NUM_LIT:0> , length - <NUM_LIT:1> ) ; constructorCall = ( ExplicitConstructorCall ) this . astStack [ this . astPtr + <NUM_LIT:1> ] ; } else { System . arraycopy ( this . astStack , this . astPtr + <NUM_LIT:1> , statements = new Statement [ length ] , <NUM_LIT:0> , length ) ; constructorCall = SuperReference . implicitSuperConstructorCall ( ) ; } } } else { boolean insideFieldInitializer = false ; if ( this . diet ) { for ( int i = this . nestedType ; i > <NUM_LIT:0> ; i -- ) { if ( this . variablesCounter [ i ] > <NUM_LIT:0> ) { insideFieldInitializer = true ; break ; } } } if ( ! this . diet || insideFieldInitializer ) { constructorCall = SuperReference . implicitSuperConstructorCall ( ) ; } } ConstructorDeclaration cd = ( ConstructorDeclaration ) this . astStack [ this . astPtr ] ; cd . constructorCall = constructorCall ; cd . statements = statements ; if ( constructorCall != null && cd . constructorCall . sourceEnd == <NUM_LIT:0> ) { cd . constructorCall . sourceEnd = cd . sourceEnd ; cd . constructorCall . sourceStart = cd . sourceStart ; } if ( ! ( this . diet && this . dietInt == <NUM_LIT:0> ) && statements == null && ( constructorCall == null || constructorCall . isImplicitSuper ( ) ) && ! containsComment ( cd . bodyStart , this . endPosition ) ) { cd . bits |= ASTNode . UndocumentedEmptyBlock ; } cd . bodyEnd = this . endPosition ; cd . declarationSourceEnd = flushCommentsDefinedPriorTo ( this . endStatementPosition ) ; } protected void consumeConstructorHeader ( ) { AbstractMethodDeclaration method = ( AbstractMethodDeclaration ) this . astStack [ this . astPtr ] ; if ( this . currentToken == TokenNameLBRACE ) { method . bodyStart = this . scanner . currentPosition ; } if ( this . currentElement != null ) { if ( this . currentToken == TokenNameSEMICOLON ) { method . modifiers |= ExtraCompilerModifiers . AccSemicolonBody ; method . declarationSourceEnd = this . scanner . currentPosition - <NUM_LIT:1> ; method . bodyEnd = this . scanner . currentPosition - <NUM_LIT:1> ; if ( this . currentElement . parseTree ( ) == method && this . currentElement . parent != null ) { this . currentElement = this . currentElement . parent ; } } this . restartRecovery = true ; } } protected void consumeConstructorHeaderName ( ) { if ( this . currentElement != null ) { if ( this . lastIgnoredToken == TokenNamenew ) { this . lastCheckPoint = this . scanner . startPosition ; this . restartRecovery = true ; return ; } } ConstructorDeclaration cd = new ConstructorDeclaration ( this . compilationUnit . compilationResult ) ; cd . selector = this . identifierStack [ this . identifierPtr ] ; long selectorSource = this . identifierPositionStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; cd . declarationSourceStart = this . intStack [ this . intPtr -- ] ; cd . modifiers = this . intStack [ this . intPtr -- ] ; int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != <NUM_LIT:0> ) { System . arraycopy ( this . expressionStack , ( this . expressionPtr -= length ) + <NUM_LIT:1> , cd . annotations = new Annotation [ length ] , <NUM_LIT:0> , length ) ; } cd . javadoc = this . javadoc ; this . javadoc = null ; cd . sourceStart = ( int ) ( selectorSource > > > <NUM_LIT:32> ) ; pushOnAstStack ( cd ) ; cd . sourceEnd = this . lParenPos ; cd . bodyStart = this . lParenPos + <NUM_LIT:1> ; this . listLength = <NUM_LIT:0> ; if ( this . currentElement != null ) { this . lastCheckPoint = cd . bodyStart ; if ( ( this . currentElement instanceof RecoveredType && this . lastIgnoredToken != TokenNameDOT ) || cd . modifiers != <NUM_LIT:0> ) { this . currentElement = this . currentElement . add ( cd , <NUM_LIT:0> ) ; this . lastIgnoredToken = - <NUM_LIT:1> ; } } } protected void consumeConstructorHeaderNameWithTypeParameters ( ) { if ( this . currentElement != null ) { if ( this . lastIgnoredToken == TokenNamenew ) { this . lastCheckPoint = this . scanner . startPosition ; this . restartRecovery = true ; return ; } } ConstructorDeclaration cd = new ConstructorDeclaration ( this . compilationUnit . compilationResult ) ; cd . selector = this . identifierStack [ this . identifierPtr ] ; long selectorSource = this . identifierPositionStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; int length = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; this . genericsPtr -= length ; System . arraycopy ( this . genericsStack , this . genericsPtr + <NUM_LIT:1> , cd . typeParameters = new TypeParameter [ length ] , <NUM_LIT:0> , length ) ; cd . declarationSourceStart = this . intStack [ this . intPtr -- ] ; cd . modifiers = this . intStack [ this . intPtr -- ] ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != <NUM_LIT:0> ) { System . arraycopy ( this . expressionStack , ( this . expressionPtr -= length ) + <NUM_LIT:1> , cd . annotations = new Annotation [ length ] , <NUM_LIT:0> , length ) ; } cd . javadoc = this . javadoc ; this . javadoc = null ; cd . sourceStart = ( int ) ( selectorSource > > > <NUM_LIT:32> ) ; pushOnAstStack ( cd ) ; cd . sourceEnd = this . lParenPos ; cd . bodyStart = this . lParenPos + <NUM_LIT:1> ; this . listLength = <NUM_LIT:0> ; if ( this . currentElement != null ) { this . lastCheckPoint = cd . bodyStart ; if ( ( this . currentElement instanceof RecoveredType && this . lastIgnoredToken != TokenNameDOT ) || cd . modifiers != <NUM_LIT:0> ) { this . currentElement = this . currentElement . add ( cd , <NUM_LIT:0> ) ; this . lastIgnoredToken = - <NUM_LIT:1> ; } } } protected void consumeCreateInitializer ( ) { pushOnAstStack ( new Initializer ( null , <NUM_LIT:0> ) ) ; } protected void consumeDefaultLabel ( ) { CaseStatement defaultStatement = new CaseStatement ( null , this . intStack [ this . intPtr -- ] , this . intStack [ this . intPtr -- ] ) ; if ( hasLeadingTagComment ( FALL_THROUGH_TAG , defaultStatement . sourceStart ) ) { defaultStatement . bits |= ASTNode . DocumentedFallthrough ; } if ( hasLeadingTagComment ( CASES_OMITTED_TAG , defaultStatement . sourceStart ) ) { defaultStatement . bits |= ASTNode . DocumentedCasesOmitted ; } pushOnAstStack ( defaultStatement ) ; } protected void consumeDefaultModifiers ( ) { checkComment ( ) ; pushOnIntStack ( this . modifiers ) ; pushOnIntStack ( this . modifiersSourceStart >= <NUM_LIT:0> ? this . modifiersSourceStart : this . scanner . startPosition ) ; resetModifiers ( ) ; pushOnExpressionStackLengthStack ( <NUM_LIT:0> ) ; } protected void consumeDiet ( ) { checkComment ( ) ; pushOnIntStack ( this . modifiersSourceStart ) ; resetModifiers ( ) ; jumpOverMethodBody ( ) ; } protected void consumeDims ( ) { pushOnIntStack ( this . dimensions ) ; this . dimensions = <NUM_LIT:0> ; } protected void consumeDimWithOrWithOutExpr ( ) { pushOnExpressionStack ( null ) ; if ( this . currentElement != null && this . currentToken == TokenNameLBRACE ) { this . ignoreNextOpeningBrace = true ; this . currentElement . bracketBalance ++ ; } } protected void consumeDimWithOrWithOutExprs ( ) { concatExpressionLists ( ) ; } protected void consumeUnionType ( ) { pushOnAstStack ( getTypeReference ( this . intStack [ this . intPtr -- ] ) ) ; optimizedConcatNodeLists ( ) ; } protected void consumeUnionTypeAsClassType ( ) { pushOnAstStack ( getTypeReference ( this . intStack [ this . intPtr -- ] ) ) ; } protected void consumeEmptyAnnotationTypeMemberDeclarationsopt ( ) { pushOnAstLengthStack ( <NUM_LIT:0> ) ; } protected void consumeEmptyArgumentListopt ( ) { pushOnExpressionStackLengthStack ( <NUM_LIT:0> ) ; } protected void consumeEmptyArguments ( ) { final FieldDeclaration fieldDeclaration = ( FieldDeclaration ) this . astStack [ this . astPtr ] ; pushOnIntStack ( fieldDeclaration . sourceEnd ) ; pushOnExpressionStackLengthStack ( <NUM_LIT:0> ) ; } protected void consumeEmptyArrayInitializer ( ) { arrayInitializer ( <NUM_LIT:0> ) ; } protected void consumeEmptyArrayInitializeropt ( ) { pushOnExpressionStackLengthStack ( <NUM_LIT:0> ) ; } protected void consumeEmptyBlockStatementsopt ( ) { pushOnAstLengthStack ( <NUM_LIT:0> ) ; } protected void consumeEmptyCatchesopt ( ) { pushOnAstLengthStack ( <NUM_LIT:0> ) ; } protected void consumeEmptyClassBodyDeclarationsopt ( ) { pushOnAstLengthStack ( <NUM_LIT:0> ) ; } protected void consumeEmptyDimsopt ( ) { pushOnIntStack ( <NUM_LIT:0> ) ; } protected void consumeEmptyEnumDeclarations ( ) { pushOnAstLengthStack ( <NUM_LIT:0> ) ; } protected void consumeEmptyExpression ( ) { pushOnExpressionStackLengthStack ( <NUM_LIT:0> ) ; } protected void consumeEmptyForInitopt ( ) { pushOnAstLengthStack ( <NUM_LIT:0> ) ; } protected void consumeEmptyForUpdateopt ( ) { pushOnExpressionStackLengthStack ( <NUM_LIT:0> ) ; } protected void consumeEmptyInterfaceMemberDeclarationsopt ( ) { pushOnAstLengthStack ( <NUM_LIT:0> ) ; } protected void consumeEmptyInternalCompilationUnit ( ) { if ( this . compilationUnit . isPackageInfo ( ) ) { this . compilationUnit . types = new TypeDeclaration [ <NUM_LIT:1> ] ; this . compilationUnit . createPackageInfoType ( ) ; } } protected void consumeEmptyMemberValueArrayInitializer ( ) { arrayInitializer ( <NUM_LIT:0> ) ; } protected void consumeEmptyMemberValuePairsopt ( ) { pushOnAstLengthStack ( <NUM_LIT:0> ) ; } protected void consumeEmptyMethodHeaderDefaultValue ( ) { AbstractMethodDeclaration method = ( AbstractMethodDeclaration ) this . astStack [ this . astPtr ] ; if ( method . isAnnotationMethod ( ) ) { pushOnExpressionStackLengthStack ( <NUM_LIT:0> ) ; } this . recordStringLiterals = true ; } protected void consumeEmptyStatement ( ) { char [ ] source = this . scanner . source ; if ( source [ this . endStatementPosition ] == '<CHAR_LIT:;>' ) { pushOnAstStack ( new EmptyStatement ( this . endStatementPosition , this . endStatementPosition ) ) ; } else { if ( source . length > <NUM_LIT:5> ) { int c1 = <NUM_LIT:0> , c2 = <NUM_LIT:0> , c3 = <NUM_LIT:0> , c4 = <NUM_LIT:0> ; int pos = this . endStatementPosition - <NUM_LIT:4> ; while ( source [ pos ] == '<CHAR_LIT>' ) { pos -- ; } if ( source [ pos ] == '<STR_LIT:\\>' && ! ( ( c1 = ScannerHelper . getHexadecimalValue ( source [ this . endStatementPosition - <NUM_LIT:3> ] ) ) > <NUM_LIT:15> || c1 < <NUM_LIT:0> || ( c2 = ScannerHelper . getHexadecimalValue ( source [ this . endStatementPosition - <NUM_LIT:2> ] ) ) > <NUM_LIT:15> || c2 < <NUM_LIT:0> || ( c3 = ScannerHelper . getHexadecimalValue ( source [ this . endStatementPosition - <NUM_LIT:1> ] ) ) > <NUM_LIT:15> || c3 < <NUM_LIT:0> || ( c4 = ScannerHelper . getHexadecimalValue ( source [ this . endStatementPosition ] ) ) > <NUM_LIT:15> || c4 < <NUM_LIT:0> ) && ( ( char ) ( ( ( c1 * <NUM_LIT:16> + c2 ) * <NUM_LIT:16> + c3 ) * <NUM_LIT:16> + c4 ) ) == '<CHAR_LIT:;>' ) { pushOnAstStack ( new EmptyStatement ( pos , this . endStatementPosition ) ) ; return ; } } pushOnAstStack ( new EmptyStatement ( this . endPosition + <NUM_LIT:1> , this . endStatementPosition ) ) ; } } protected void consumeEmptySwitchBlock ( ) { pushOnAstLengthStack ( <NUM_LIT:0> ) ; } protected void consumeEmptyTypeDeclaration ( ) { pushOnAstLengthStack ( <NUM_LIT:0> ) ; if ( ! this . statementRecoveryActivated ) problemReporter ( ) . superfluousSemicolon ( this . endPosition + <NUM_LIT:1> , this . endStatementPosition ) ; flushCommentsDefinedPriorTo ( this . endStatementPosition ) ; } protected void consumeEnhancedForStatement ( ) { this . astLengthPtr -- ; Statement statement = ( Statement ) this . astStack [ this . astPtr -- ] ; ForeachStatement foreachStatement = ( ForeachStatement ) this . astStack [ this . astPtr ] ; foreachStatement . action = statement ; if ( statement instanceof EmptyStatement ) statement . bits |= ASTNode . IsUsefulEmptyStatement ; foreachStatement . sourceEnd = this . endStatementPosition ; } protected void consumeEnhancedForStatementHeader ( ) { final ForeachStatement statement = ( ForeachStatement ) this . astStack [ this . astPtr ] ; this . expressionLengthPtr -- ; final Expression collection = this . expressionStack [ this . expressionPtr -- ] ; statement . collection = collection ; statement . sourceEnd = this . rParenPos ; if ( ! this . statementRecoveryActivated && this . options . sourceLevel < ClassFileConstants . JDK1_5 && this . lastErrorEndPositionBeforeRecovery < this . scanner . currentPosition ) { problemReporter ( ) . invalidUsageOfForeachStatements ( statement . elementVariable , collection ) ; } } protected void consumeEnhancedForStatementHeaderInit ( boolean hasModifiers ) { TypeReference type ; char [ ] identifierName = this . identifierStack [ this . identifierPtr ] ; long namePosition = this . identifierPositionStack [ this . identifierPtr ] ; LocalDeclaration localDeclaration = createLocalDeclaration ( identifierName , ( int ) ( namePosition > > > <NUM_LIT:32> ) , ( int ) namePosition ) ; localDeclaration . declarationSourceEnd = localDeclaration . declarationEnd ; int extraDims = this . intStack [ this . intPtr -- ] ; this . identifierPtr -- ; this . identifierLengthPtr -- ; int declarationSourceStart = <NUM_LIT:0> ; int modifiersValue = <NUM_LIT:0> ; if ( hasModifiers ) { declarationSourceStart = this . intStack [ this . intPtr -- ] ; modifiersValue = this . intStack [ this . intPtr -- ] ; } else { this . intPtr -= <NUM_LIT:2> ; } type = getTypeReference ( this . intStack [ this . intPtr -- ] + extraDims ) ; int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != <NUM_LIT:0> ) { System . arraycopy ( this . expressionStack , ( this . expressionPtr -= length ) + <NUM_LIT:1> , localDeclaration . annotations = new Annotation [ length ] , <NUM_LIT:0> , length ) ; } if ( hasModifiers ) { localDeclaration . declarationSourceStart = declarationSourceStart ; localDeclaration . modifiers = modifiersValue ; } else { localDeclaration . declarationSourceStart = type . sourceStart ; } localDeclaration . type = type ; ForeachStatement iteratorForStatement = new ForeachStatement ( localDeclaration , this . intStack [ this . intPtr -- ] ) ; pushOnAstStack ( iteratorForStatement ) ; iteratorForStatement . sourceEnd = localDeclaration . declarationSourceEnd ; } protected void consumeEnterAnonymousClassBody ( boolean qualified ) { this . shouldDeferRecovery = false ; TypeReference typeReference = getTypeReference ( <NUM_LIT:0> ) ; TypeDeclaration anonymousType = new TypeDeclaration ( this . compilationUnit . compilationResult ) ; anonymousType . name = CharOperation . NO_CHAR ; anonymousType . bits |= ( ASTNode . IsAnonymousType | ASTNode . IsLocalType ) ; QualifiedAllocationExpression alloc = new QualifiedAllocationExpression ( anonymousType ) ; markEnclosingMemberWithLocalType ( ) ; pushOnAstStack ( anonymousType ) ; alloc . sourceEnd = this . rParenPos ; int argumentLength ; if ( ( argumentLength = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != <NUM_LIT:0> ) { this . expressionPtr -= argumentLength ; System . arraycopy ( this . expressionStack , this . expressionPtr + <NUM_LIT:1> , alloc . arguments = new Expression [ argumentLength ] , <NUM_LIT:0> , argumentLength ) ; } if ( qualified ) { this . expressionLengthPtr -- ; alloc . enclosingInstance = this . expressionStack [ this . expressionPtr -- ] ; } alloc . type = typeReference ; anonymousType . sourceEnd = alloc . sourceEnd ; anonymousType . sourceStart = anonymousType . declarationSourceStart = alloc . type . sourceStart ; alloc . sourceStart = this . intStack [ this . intPtr -- ] ; pushOnExpressionStack ( alloc ) ; anonymousType . bodyStart = this . scanner . currentPosition ; this . listLength = <NUM_LIT:0> ; this . scanner . commentPtr = - <NUM_LIT:1> ; if ( this . currentElement != null ) { this . lastCheckPoint = anonymousType . bodyStart ; this . currentElement = this . currentElement . add ( anonymousType , <NUM_LIT:0> ) ; if ( ! ( this . currentElement instanceof RecoveredAnnotation ) ) { this . currentToken = <NUM_LIT:0> ; } else { this . ignoreNextOpeningBrace = true ; this . currentElement . bracketBalance ++ ; } this . lastIgnoredToken = - <NUM_LIT:1> ; } } protected void consumeEnterCompilationUnit ( ) { } protected void consumeEnterMemberValue ( ) { if ( this . currentElement != null && this . currentElement instanceof RecoveredAnnotation ) { RecoveredAnnotation recoveredAnnotation = ( RecoveredAnnotation ) this . currentElement ; recoveredAnnotation . hasPendingMemberValueName = true ; } } protected void consumeEnterMemberValueArrayInitializer ( ) { if ( this . currentElement != null ) { this . ignoreNextOpeningBrace = true ; this . currentElement . bracketBalance ++ ; } } protected void consumeEnterVariable ( ) { char [ ] identifierName = this . identifierStack [ this . identifierPtr ] ; long namePosition = this . identifierPositionStack [ this . identifierPtr ] ; int extendedDimension = this . intStack [ this . intPtr -- ] ; AbstractVariableDeclaration declaration ; boolean isLocalDeclaration = this . nestedMethod [ this . nestedType ] != <NUM_LIT:0> ; if ( isLocalDeclaration ) { declaration = createLocalDeclaration ( identifierName , ( int ) ( namePosition > > > <NUM_LIT:32> ) , ( int ) namePosition ) ; } else { declaration = createFieldDeclaration ( identifierName , ( int ) ( namePosition > > > <NUM_LIT:32> ) , ( int ) namePosition ) ; } this . identifierPtr -- ; this . identifierLengthPtr -- ; TypeReference type ; int variableIndex = this . variablesCounter [ this . nestedType ] ; int typeDim = <NUM_LIT:0> ; if ( variableIndex == <NUM_LIT:0> ) { if ( isLocalDeclaration ) { declaration . declarationSourceStart = this . intStack [ this . intPtr -- ] ; declaration . modifiers = this . intStack [ this . intPtr -- ] ; int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != <NUM_LIT:0> ) { System . arraycopy ( this . expressionStack , ( this . expressionPtr -= length ) + <NUM_LIT:1> , declaration . annotations = new Annotation [ length ] , <NUM_LIT:0> , length ) ; } type = getTypeReference ( typeDim = this . intStack [ this . intPtr -- ] ) ; if ( declaration . declarationSourceStart == - <NUM_LIT:1> ) { declaration . declarationSourceStart = type . sourceStart ; } pushOnAstStack ( type ) ; } else { type = getTypeReference ( typeDim = this . intStack [ this . intPtr -- ] ) ; pushOnAstStack ( type ) ; declaration . declarationSourceStart = this . intStack [ this . intPtr -- ] ; declaration . modifiers = this . intStack [ this . intPtr -- ] ; int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != <NUM_LIT:0> ) { System . arraycopy ( this . expressionStack , ( this . expressionPtr -= length ) + <NUM_LIT:1> , declaration . annotations = new Annotation [ length ] , <NUM_LIT:0> , length ) ; } FieldDeclaration fieldDeclaration = ( FieldDeclaration ) declaration ; fieldDeclaration . javadoc = this . javadoc ; } this . javadoc = null ; } else { type = ( TypeReference ) this . astStack [ this . astPtr - variableIndex ] ; typeDim = type . dimensions ( ) ; AbstractVariableDeclaration previousVariable = ( AbstractVariableDeclaration ) this . astStack [ this . astPtr ] ; declaration . declarationSourceStart = previousVariable . declarationSourceStart ; declaration . modifiers = previousVariable . modifiers ; final Annotation [ ] annotations = previousVariable . annotations ; if ( annotations != null ) { final int annotationsLength = annotations . length ; System . arraycopy ( annotations , <NUM_LIT:0> , declaration . annotations = new Annotation [ annotationsLength ] , <NUM_LIT:0> , annotationsLength ) ; } } if ( extendedDimension == <NUM_LIT:0> ) { declaration . type = type ; } else { int dimension = typeDim + extendedDimension ; declaration . type = copyDims ( type , dimension ) ; } this . variablesCounter [ this . nestedType ] ++ ; pushOnAstStack ( declaration ) ; if ( this . currentElement != null ) { if ( ! ( this . currentElement instanceof RecoveredType ) && ( this . currentToken == TokenNameDOT || ( Util . getLineNumber ( declaration . type . sourceStart , this . scanner . lineEnds , <NUM_LIT:0> , this . scanner . linePtr ) != Util . getLineNumber ( ( int ) ( namePosition > > > <NUM_LIT:32> ) , this . scanner . lineEnds , <NUM_LIT:0> , this . scanner . linePtr ) ) ) ) { this . lastCheckPoint = ( int ) ( namePosition > > > <NUM_LIT:32> ) ; this . restartRecovery = true ; return ; } if ( isLocalDeclaration ) { LocalDeclaration localDecl = ( LocalDeclaration ) this . astStack [ this . astPtr ] ; this . lastCheckPoint = localDecl . sourceEnd + <NUM_LIT:1> ; this . currentElement = this . currentElement . add ( localDecl , <NUM_LIT:0> ) ; } else { FieldDeclaration fieldDecl = ( FieldDeclaration ) this . astStack [ this . astPtr ] ; this . lastCheckPoint = fieldDecl . sourceEnd + <NUM_LIT:1> ; this . currentElement = this . currentElement . add ( fieldDecl , <NUM_LIT:0> ) ; } this . lastIgnoredToken = - <NUM_LIT:1> ; } } protected void consumeEnumBodyNoConstants ( ) { } protected void consumeEnumBodyWithConstants ( ) { concatNodeLists ( ) ; } protected void consumeEnumConstantHeader ( ) { FieldDeclaration enumConstant = ( FieldDeclaration ) this . astStack [ this . astPtr ] ; boolean foundOpeningBrace = this . currentToken == TokenNameLBRACE ; if ( foundOpeningBrace ) { TypeDeclaration anonymousType = new TypeDeclaration ( this . compilationUnit . compilationResult ) ; anonymousType . name = CharOperation . NO_CHAR ; anonymousType . bits |= ( ASTNode . IsAnonymousType | ASTNode . IsLocalType ) ; final int start = this . scanner . startPosition ; anonymousType . declarationSourceStart = start ; anonymousType . sourceStart = start ; anonymousType . sourceEnd = start ; anonymousType . modifiers = <NUM_LIT:0> ; anonymousType . bodyStart = this . scanner . currentPosition ; markEnclosingMemberWithLocalType ( ) ; consumeNestedType ( ) ; this . variablesCounter [ this . nestedType ] ++ ; pushOnAstStack ( anonymousType ) ; QualifiedAllocationExpression allocationExpression = new QualifiedAllocationExpression ( anonymousType ) ; allocationExpression . enumConstant = enumConstant ; int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != <NUM_LIT:0> ) { this . expressionPtr -= length ; System . arraycopy ( this . expressionStack , this . expressionPtr + <NUM_LIT:1> , allocationExpression . arguments = new Expression [ length ] , <NUM_LIT:0> , length ) ; } enumConstant . initialization = allocationExpression ; } else { AllocationExpression allocationExpression = new AllocationExpression ( ) ; allocationExpression . enumConstant = enumConstant ; int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != <NUM_LIT:0> ) { this . expressionPtr -= length ; System . arraycopy ( this . expressionStack , this . expressionPtr + <NUM_LIT:1> , allocationExpression . arguments = new Expression [ length ] , <NUM_LIT:0> , length ) ; } enumConstant . initialization = allocationExpression ; } enumConstant . initialization . sourceStart = enumConstant . declarationSourceStart ; if ( this . currentElement != null ) { if ( foundOpeningBrace ) { TypeDeclaration anonymousType = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; this . currentElement = this . currentElement . add ( anonymousType , <NUM_LIT:0> ) ; this . lastCheckPoint = anonymousType . bodyStart ; this . lastIgnoredToken = - <NUM_LIT:1> ; this . currentToken = <NUM_LIT:0> ; } else { if ( this . currentToken == TokenNameSEMICOLON ) { RecoveredType currentType = currentRecoveryType ( ) ; if ( currentType != null ) { currentType . insideEnumConstantPart = false ; } } this . lastCheckPoint = this . scanner . startPosition ; this . lastIgnoredToken = - <NUM_LIT:1> ; this . restartRecovery = true ; } } } protected void consumeEnumConstantHeaderName ( ) { if ( this . currentElement != null ) { if ( ! ( this . currentElement instanceof RecoveredType || ( this . currentElement instanceof RecoveredField && ( ( RecoveredField ) this . currentElement ) . fieldDeclaration . type == null ) ) || ( this . lastIgnoredToken == TokenNameDOT ) ) { this . lastCheckPoint = this . scanner . startPosition ; this . restartRecovery = true ; return ; } } long namePosition = this . identifierPositionStack [ this . identifierPtr ] ; char [ ] constantName = this . identifierStack [ this . identifierPtr ] ; final int sourceEnd = ( int ) namePosition ; FieldDeclaration enumConstant = createFieldDeclaration ( constantName , ( int ) ( namePosition > > > <NUM_LIT:32> ) , sourceEnd ) ; this . identifierPtr -- ; this . identifierLengthPtr -- ; enumConstant . modifiersSourceStart = this . intStack [ this . intPtr -- ] ; enumConstant . modifiers = this . intStack [ this . intPtr -- ] ; enumConstant . declarationSourceStart = enumConstant . modifiersSourceStart ; int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != <NUM_LIT:0> ) { System . arraycopy ( this . expressionStack , ( this . expressionPtr -= length ) + <NUM_LIT:1> , enumConstant . annotations = new Annotation [ length ] , <NUM_LIT:0> , length ) ; } pushOnAstStack ( enumConstant ) ; if ( this . currentElement != null ) { this . lastCheckPoint = enumConstant . sourceEnd + <NUM_LIT:1> ; this . currentElement = this . currentElement . add ( enumConstant , <NUM_LIT:0> ) ; } enumConstant . javadoc = this . javadoc ; this . javadoc = null ; } protected void consumeEnumConstantNoClassBody ( ) { int endOfEnumConstant = this . intStack [ this . intPtr -- ] ; final FieldDeclaration fieldDeclaration = ( FieldDeclaration ) this . astStack [ this . astPtr ] ; fieldDeclaration . declarationEnd = endOfEnumConstant ; fieldDeclaration . declarationSourceEnd = endOfEnumConstant ; ASTNode initialization = fieldDeclaration . initialization ; if ( initialization != null ) { initialization . sourceEnd = endOfEnumConstant ; } } protected void consumeEnumConstants ( ) { concatNodeLists ( ) ; } protected void consumeEnumConstantWithClassBody ( ) { dispatchDeclarationInto ( this . astLengthStack [ this . astLengthPtr -- ] ) ; TypeDeclaration anonymousType = ( TypeDeclaration ) this . astStack [ this . astPtr -- ] ; this . astLengthPtr -- ; anonymousType . bodyEnd = this . endPosition ; anonymousType . declarationSourceEnd = flushCommentsDefinedPriorTo ( this . endStatementPosition ) ; final FieldDeclaration fieldDeclaration = ( ( FieldDeclaration ) this . astStack [ this . astPtr ] ) ; fieldDeclaration . declarationEnd = this . endStatementPosition ; int declarationSourceEnd = anonymousType . declarationSourceEnd ; fieldDeclaration . declarationSourceEnd = declarationSourceEnd ; this . intPtr -- ; this . variablesCounter [ this . nestedType ] = <NUM_LIT:0> ; this . nestedType -- ; ASTNode initialization = fieldDeclaration . initialization ; if ( initialization != null ) { initialization . sourceEnd = declarationSourceEnd ; } } protected void consumeEnumDeclaration ( ) { int length ; if ( ( length = this . astLengthStack [ this . astLengthPtr -- ] ) != <NUM_LIT:0> ) { dispatchDeclarationIntoEnumDeclaration ( length ) ; } TypeDeclaration enumDeclaration = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; boolean hasConstructor = enumDeclaration . checkConstructors ( this ) ; if ( ! hasConstructor ) { boolean insideFieldInitializer = false ; if ( this . diet ) { for ( int i = this . nestedType ; i > <NUM_LIT:0> ; i -- ) { if ( this . variablesCounter [ i ] > <NUM_LIT:0> ) { insideFieldInitializer = true ; break ; } } } enumDeclaration . createDefaultConstructor ( ! this . diet || insideFieldInitializer , true ) ; } if ( this . scanner . containsAssertKeyword ) { enumDeclaration . bits |= ASTNode . ContainsAssertion ; } enumDeclaration . addClinit ( ) ; enumDeclaration . bodyEnd = this . endStatementPosition ; if ( length == <NUM_LIT:0> && ! containsComment ( enumDeclaration . bodyStart , enumDeclaration . bodyEnd ) ) { enumDeclaration . bits |= ASTNode . UndocumentedEmptyBlock ; } enumDeclaration . declarationSourceEnd = flushCommentsDefinedPriorTo ( this . endStatementPosition ) ; } protected void consumeEnumDeclarations ( ) { } protected void consumeEnumHeader ( ) { TypeDeclaration typeDecl = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; if ( this . currentToken == TokenNameLBRACE ) { typeDecl . bodyStart = this . scanner . currentPosition ; } if ( this . currentElement != null ) { this . restartRecovery = true ; } this . scanner . commentPtr = - <NUM_LIT:1> ; } protected void consumeEnumHeaderName ( ) { TypeDeclaration enumDeclaration = new TypeDeclaration ( this . compilationUnit . compilationResult ) ; if ( this . nestedMethod [ this . nestedType ] == <NUM_LIT:0> ) { if ( this . nestedType != <NUM_LIT:0> ) { enumDeclaration . bits |= ASTNode . IsMemberType ; } } else { blockReal ( ) ; } long pos = this . identifierPositionStack [ this . identifierPtr ] ; enumDeclaration . sourceEnd = ( int ) pos ; enumDeclaration . sourceStart = ( int ) ( pos > > > <NUM_LIT:32> ) ; enumDeclaration . name = this . identifierStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; enumDeclaration . declarationSourceStart = this . intStack [ this . intPtr -- ] ; this . intPtr -- ; enumDeclaration . modifiersSourceStart = this . intStack [ this . intPtr -- ] ; enumDeclaration . modifiers = this . intStack [ this . intPtr -- ] | ClassFileConstants . AccEnum ; if ( enumDeclaration . modifiersSourceStart >= <NUM_LIT:0> ) { enumDeclaration . declarationSourceStart = enumDeclaration . modifiersSourceStart ; } if ( ( enumDeclaration . bits & ASTNode . IsMemberType ) == <NUM_LIT:0> && ( enumDeclaration . bits & ASTNode . IsLocalType ) == <NUM_LIT:0> ) { if ( this . compilationUnit != null && ! CharOperation . equals ( enumDeclaration . name , this . compilationUnit . getMainTypeName ( ) ) ) { enumDeclaration . bits |= ASTNode . IsSecondaryType ; } } int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != <NUM_LIT:0> ) { System . arraycopy ( this . expressionStack , ( this . expressionPtr -= length ) + <NUM_LIT:1> , enumDeclaration . annotations = new Annotation [ length ] , <NUM_LIT:0> , length ) ; } enumDeclaration . bodyStart = enumDeclaration . sourceEnd + <NUM_LIT:1> ; pushOnAstStack ( enumDeclaration ) ; this . listLength = <NUM_LIT:0> ; if ( ! this . statementRecoveryActivated && this . options . sourceLevel < ClassFileConstants . JDK1_5 && this . lastErrorEndPositionBeforeRecovery < this . scanner . currentPosition ) { problemReporter ( ) . invalidUsageOfEnumDeclarations ( enumDeclaration ) ; } if ( this . currentElement != null ) { this . lastCheckPoint = enumDeclaration . bodyStart ; this . currentElement = this . currentElement . add ( enumDeclaration , <NUM_LIT:0> ) ; this . lastIgnoredToken = - <NUM_LIT:1> ; } enumDeclaration . javadoc = this . javadoc ; this . javadoc = null ; } protected void consumeEnumHeaderNameWithTypeParameters ( ) { TypeDeclaration enumDeclaration = new TypeDeclaration ( this . compilationUnit . compilationResult ) ; int length = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; this . genericsPtr -= length ; System . arraycopy ( this . genericsStack , this . genericsPtr + <NUM_LIT:1> , enumDeclaration . typeParameters = new TypeParameter [ length ] , <NUM_LIT:0> , length ) ; problemReporter ( ) . invalidUsageOfTypeParametersForEnumDeclaration ( enumDeclaration ) ; enumDeclaration . bodyStart = enumDeclaration . typeParameters [ length - <NUM_LIT:1> ] . declarationSourceEnd + <NUM_LIT:1> ; this . listTypeParameterLength = <NUM_LIT:0> ; if ( this . nestedMethod [ this . nestedType ] == <NUM_LIT:0> ) { if ( this . nestedType != <NUM_LIT:0> ) { enumDeclaration . bits |= ASTNode . IsMemberType ; } } else { blockReal ( ) ; } long pos = this . identifierPositionStack [ this . identifierPtr ] ; enumDeclaration . sourceEnd = ( int ) pos ; enumDeclaration . sourceStart = ( int ) ( pos > > > <NUM_LIT:32> ) ; enumDeclaration . name = this . identifierStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; enumDeclaration . declarationSourceStart = this . intStack [ this . intPtr -- ] ; this . intPtr -- ; enumDeclaration . modifiersSourceStart = this . intStack [ this . intPtr -- ] ; enumDeclaration . modifiers = this . intStack [ this . intPtr -- ] | ClassFileConstants . AccEnum ; if ( enumDeclaration . modifiersSourceStart >= <NUM_LIT:0> ) { enumDeclaration . declarationSourceStart = enumDeclaration . modifiersSourceStart ; } if ( ( enumDeclaration . bits & ASTNode . IsMemberType ) == <NUM_LIT:0> && ( enumDeclaration . bits & ASTNode . IsLocalType ) == <NUM_LIT:0> ) { if ( this . compilationUnit != null && ! CharOperation . equals ( enumDeclaration . name , this . compilationUnit . getMainTypeName ( ) ) ) { enumDeclaration . bits |= ASTNode . IsSecondaryType ; } } if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != <NUM_LIT:0> ) { System . arraycopy ( this . expressionStack , ( this . expressionPtr -= length ) + <NUM_LIT:1> , enumDeclaration . annotations = new Annotation [ length ] , <NUM_LIT:0> , length ) ; } enumDeclaration . bodyStart = enumDeclaration . sourceEnd + <NUM_LIT:1> ; pushOnAstStack ( enumDeclaration ) ; this . listLength = <NUM_LIT:0> ; if ( ! this . statementRecoveryActivated && this . options . sourceLevel < ClassFileConstants . JDK1_5 && this . lastErrorEndPositionBeforeRecovery < this . scanner . currentPosition ) { problemReporter ( ) . invalidUsageOfEnumDeclarations ( enumDeclaration ) ; } if ( this . currentElement != null ) { this . lastCheckPoint = enumDeclaration . bodyStart ; this . currentElement = this . currentElement . add ( enumDeclaration , <NUM_LIT:0> ) ; this . lastIgnoredToken = - <NUM_LIT:1> ; } enumDeclaration . javadoc = this . javadoc ; this . javadoc = null ; } protected void consumeEqualityExpression ( int op ) { this . expressionPtr -- ; this . expressionLengthPtr -- ; this . expressionStack [ this . expressionPtr ] = new EqualExpression ( this . expressionStack [ this . expressionPtr ] , this . expressionStack [ this . expressionPtr + <NUM_LIT:1> ] , op ) ; } protected void consumeEqualityExpressionWithName ( int op ) { pushOnExpressionStack ( getUnspecifiedReferenceOptimized ( ) ) ; this . expressionPtr -- ; this . expressionLengthPtr -- ; this . expressionStack [ this . expressionPtr ] = new EqualExpression ( this . expressionStack [ this . expressionPtr + <NUM_LIT:1> ] , this . expressionStack [ this . expressionPtr ] , op ) ; } protected void consumeExitMemberValue ( ) { if ( this . currentElement != null && this . currentElement instanceof RecoveredAnnotation ) { RecoveredAnnotation recoveredAnnotation = ( RecoveredAnnotation ) this . currentElement ; recoveredAnnotation . hasPendingMemberValueName = false ; recoveredAnnotation . memberValuPairEqualEnd = - <NUM_LIT:1> ; } } protected void consumeExitTryBlock ( ) { if ( this . currentElement != null ) { this . restartRecovery = true ; } } protected void consumeExitVariableWithInitialization ( ) { this . expressionLengthPtr -- ; AbstractVariableDeclaration variableDecl = ( AbstractVariableDeclaration ) this . astStack [ this . astPtr ] ; variableDecl . initialization = this . expressionStack [ this . expressionPtr -- ] ; variableDecl . declarationSourceEnd = variableDecl . initialization . sourceEnd ; variableDecl . declarationEnd = variableDecl . initialization . sourceEnd ; recoveryExitFromVariable ( ) ; } protected void consumeExitVariableWithoutInitialization ( ) { AbstractVariableDeclaration variableDecl = ( AbstractVariableDeclaration ) this . astStack [ this . astPtr ] ; variableDecl . declarationSourceEnd = variableDecl . declarationEnd ; if ( this . currentElement != null && this . currentElement instanceof RecoveredField ) { if ( this . endStatementPosition > variableDecl . sourceEnd ) { this . currentElement . updateSourceEndIfNecessary ( this . endStatementPosition ) ; } } recoveryExitFromVariable ( ) ; } protected void consumeExplicitConstructorInvocation ( int flag , int recFlag ) { int startPosition = this . intStack [ this . intPtr -- ] ; ExplicitConstructorCall ecc = new ExplicitConstructorCall ( recFlag ) ; int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != <NUM_LIT:0> ) { this . expressionPtr -= length ; System . arraycopy ( this . expressionStack , this . expressionPtr + <NUM_LIT:1> , ecc . arguments = new Expression [ length ] , <NUM_LIT:0> , length ) ; } switch ( flag ) { case <NUM_LIT:0> : ecc . sourceStart = startPosition ; break ; case <NUM_LIT:1> : this . expressionLengthPtr -- ; ecc . sourceStart = ( ecc . qualification = this . expressionStack [ this . expressionPtr -- ] ) . sourceStart ; break ; case <NUM_LIT:2> : ecc . sourceStart = ( ecc . qualification = getUnspecifiedReferenceOptimized ( ) ) . sourceStart ; break ; } pushOnAstStack ( ecc ) ; ecc . sourceEnd = this . endStatementPosition ; } protected void consumeExplicitConstructorInvocationWithTypeArguments ( int flag , int recFlag ) { int startPosition = this . intStack [ this . intPtr -- ] ; ExplicitConstructorCall ecc = new ExplicitConstructorCall ( recFlag ) ; int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != <NUM_LIT:0> ) { this . expressionPtr -= length ; System . arraycopy ( this . expressionStack , this . expressionPtr + <NUM_LIT:1> , ecc . arguments = new Expression [ length ] , <NUM_LIT:0> , length ) ; } length = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; this . genericsPtr -= length ; System . arraycopy ( this . genericsStack , this . genericsPtr + <NUM_LIT:1> , ecc . typeArguments = new TypeReference [ length ] , <NUM_LIT:0> , length ) ; ecc . typeArgumentsSourceStart = this . intStack [ this . intPtr -- ] ; switch ( flag ) { case <NUM_LIT:0> : ecc . sourceStart = startPosition ; break ; case <NUM_LIT:1> : this . expressionLengthPtr -- ; ecc . sourceStart = ( ecc . qualification = this . expressionStack [ this . expressionPtr -- ] ) . sourceStart ; break ; case <NUM_LIT:2> : ecc . sourceStart = ( ecc . qualification = getUnspecifiedReferenceOptimized ( ) ) . sourceStart ; break ; } pushOnAstStack ( ecc ) ; ecc . sourceEnd = this . endStatementPosition ; } protected void consumeExpressionStatement ( ) { this . expressionLengthPtr -- ; Expression expression = this . expressionStack [ this . expressionPtr -- ] ; expression . statementEnd = this . endStatementPosition ; expression . bits |= ASTNode . InsideExpressionStatement ; pushOnAstStack ( expression ) ; } protected void consumeFieldAccess ( boolean isSuperAccess ) { FieldReference fr = new FieldReference ( this . identifierStack [ this . identifierPtr ] , this . identifierPositionStack [ this . identifierPtr -- ] ) ; this . identifierLengthPtr -- ; if ( isSuperAccess ) { fr . sourceStart = this . intStack [ this . intPtr -- ] ; fr . receiver = new SuperReference ( fr . sourceStart , this . endPosition ) ; pushOnExpressionStack ( fr ) ; } else { fr . receiver = this . expressionStack [ this . expressionPtr ] ; fr . sourceStart = fr . receiver . sourceStart ; this . expressionStack [ this . expressionPtr ] = fr ; } } protected void consumeFieldDeclaration ( ) { int variableDeclaratorsCounter = this . astLengthStack [ this . astLengthPtr ] ; for ( int i = variableDeclaratorsCounter - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) { FieldDeclaration fieldDeclaration = ( FieldDeclaration ) this . astStack [ this . astPtr - i ] ; fieldDeclaration . declarationSourceEnd = this . endStatementPosition ; fieldDeclaration . declarationEnd = this . endStatementPosition ; } updateSourceDeclarationParts ( variableDeclaratorsCounter ) ; int endPos = flushCommentsDefinedPriorTo ( this . endStatementPosition ) ; if ( endPos != this . endStatementPosition ) { for ( int i = <NUM_LIT:0> ; i < variableDeclaratorsCounter ; i ++ ) { FieldDeclaration fieldDeclaration = ( FieldDeclaration ) this . astStack [ this . astPtr - i ] ; fieldDeclaration . declarationSourceEnd = endPos ; } } int startIndex = this . astPtr - this . variablesCounter [ this . nestedType ] + <NUM_LIT:1> ; System . arraycopy ( this . astStack , startIndex , this . astStack , startIndex - <NUM_LIT:1> , variableDeclaratorsCounter ) ; this . astPtr -- ; this . astLengthStack [ -- this . astLengthPtr ] = variableDeclaratorsCounter ; if ( this . currentElement != null ) { this . lastCheckPoint = endPos + <NUM_LIT:1> ; if ( this . currentElement . parent != null && this . currentElement instanceof RecoveredField ) { if ( ! ( this . currentElement instanceof RecoveredInitializer ) ) { this . currentElement = this . currentElement . parent ; } } this . restartRecovery = true ; } this . variablesCounter [ this . nestedType ] = <NUM_LIT:0> ; } protected void consumeForceNoDiet ( ) { this . dietInt ++ ; } protected void consumeForInit ( ) { pushOnAstLengthStack ( - <NUM_LIT:1> ) ; } protected void consumeFormalParameter ( boolean isVarArgs ) { this . identifierLengthPtr -- ; char [ ] identifierName = this . identifierStack [ this . identifierPtr ] ; long namePositions = this . identifierPositionStack [ this . identifierPtr -- ] ; int extendedDimensions = this . intStack [ this . intPtr -- ] ; int endOfEllipsis = <NUM_LIT:0> ; if ( isVarArgs ) { endOfEllipsis = this . intStack [ this . intPtr -- ] ; } int firstDimensions = this . intStack [ this . intPtr -- ] ; final int typeDimensions = firstDimensions + extendedDimensions ; TypeReference type = getTypeReference ( typeDimensions ) ; if ( isVarArgs ) { type = copyDims ( type , typeDimensions + <NUM_LIT:1> ) ; if ( extendedDimensions == <NUM_LIT:0> ) { type . sourceEnd = endOfEllipsis ; } type . bits |= ASTNode . IsVarArgs ; } int modifierPositions = this . intStack [ this . intPtr -- ] ; this . intPtr -- ; Argument arg = new Argument ( identifierName , namePositions , type , this . intStack [ this . intPtr + <NUM_LIT:1> ] & ~ ClassFileConstants . AccDeprecated ) ; arg . declarationSourceStart = modifierPositions ; int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != <NUM_LIT:0> ) { System . arraycopy ( this . expressionStack , ( this . expressionPtr -= length ) + <NUM_LIT:1> , arg . annotations = new Annotation [ length ] , <NUM_LIT:0> , length ) ; RecoveredType currentRecoveryType = this . currentRecoveryType ( ) ; if ( currentRecoveryType != null ) currentRecoveryType . annotationsConsumed ( arg . annotations ) ; } pushOnAstStack ( arg ) ; this . listLength ++ ; if ( isVarArgs ) { if ( ! this . statementRecoveryActivated && this . options . sourceLevel < ClassFileConstants . JDK1_5 && this . lastErrorEndPositionBeforeRecovery < this . scanner . currentPosition ) { problemReporter ( ) . invalidUsageOfVarargs ( arg ) ; } else if ( ! this . statementRecoveryActivated && extendedDimensions > <NUM_LIT:0> ) { problemReporter ( ) . illegalExtendedDimensions ( arg ) ; } } } protected void consumeFormalParameterList ( ) { optimizedConcatNodeLists ( ) ; } protected void consumeFormalParameterListopt ( ) { pushOnAstLengthStack ( <NUM_LIT:0> ) ; } protected void consumeGenericType ( ) { } protected void consumeGenericTypeArrayType ( ) { } protected void consumeGenericTypeNameArrayType ( ) { } protected void consumeGenericTypeWithDiamond ( ) { pushOnGenericsLengthStack ( - <NUM_LIT:1> ) ; concatGenericsLists ( ) ; this . intPtr -- ; } protected void consumeImportDeclaration ( ) { ImportReference impt = ( ImportReference ) this . astStack [ this . astPtr ] ; impt . declarationEnd = this . endStatementPosition ; impt . declarationSourceEnd = flushCommentsDefinedPriorTo ( impt . declarationSourceEnd ) ; if ( this . currentElement != null ) { this . lastCheckPoint = impt . declarationSourceEnd + <NUM_LIT:1> ; this . currentElement = this . currentElement . add ( impt , <NUM_LIT:0> ) ; this . lastIgnoredToken = - <NUM_LIT:1> ; this . restartRecovery = true ; } } protected void consumeImportDeclarations ( ) { optimizedConcatNodeLists ( ) ; } protected void consumeInsideCastExpression ( ) { } protected void consumeInsideCastExpressionLL1 ( ) { pushOnGenericsLengthStack ( <NUM_LIT:0> ) ; pushOnGenericsIdentifiersLengthStack ( this . identifierLengthStack [ this . identifierLengthPtr ] ) ; pushOnExpressionStack ( getTypeReference ( <NUM_LIT:0> ) ) ; } protected void consumeInsideCastExpressionWithQualifiedGenerics ( ) { } protected void consumeInstanceOfExpression ( ) { Expression exp ; this . expressionStack [ this . expressionPtr ] = exp = new InstanceOfExpression ( this . expressionStack [ this . expressionPtr ] , getTypeReference ( this . intStack [ this . intPtr -- ] ) ) ; if ( exp . sourceEnd == <NUM_LIT:0> ) { exp . sourceEnd = this . scanner . startPosition - <NUM_LIT:1> ; } } protected void consumeInstanceOfExpressionWithName ( ) { TypeReference reference = getTypeReference ( this . intStack [ this . intPtr -- ] ) ; pushOnExpressionStack ( getUnspecifiedReferenceOptimized ( ) ) ; Expression exp ; this . expressionStack [ this . expressionPtr ] = exp = new InstanceOfExpression ( this . expressionStack [ this . expressionPtr ] , reference ) ; if ( exp . sourceEnd == <NUM_LIT:0> ) { exp . sourceEnd = this . scanner . startPosition - <NUM_LIT:1> ; } } protected void consumeInterfaceDeclaration ( ) { int length ; if ( ( length = this . astLengthStack [ this . astLengthPtr -- ] ) != <NUM_LIT:0> ) { dispatchDeclarationInto ( length ) ; } TypeDeclaration typeDecl = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; typeDecl . checkConstructors ( this ) ; FieldDeclaration [ ] fields = typeDecl . fields ; int fieldCount = fields == null ? <NUM_LIT:0> : fields . length ; for ( int i = <NUM_LIT:0> ; i < fieldCount ; i ++ ) { FieldDeclaration field = fields [ i ] ; if ( field instanceof Initializer ) { problemReporter ( ) . interfaceCannotHaveInitializers ( typeDecl . name , field ) ; } } if ( this . scanner . containsAssertKeyword ) { typeDecl . bits |= ASTNode . ContainsAssertion ; } typeDecl . addClinit ( ) ; typeDecl . bodyEnd = this . endStatementPosition ; if ( length == <NUM_LIT:0> && ! containsComment ( typeDecl . bodyStart , typeDecl . bodyEnd ) ) { typeDecl . bits |= ASTNode . UndocumentedEmptyBlock ; } typeDecl . declarationSourceEnd = flushCommentsDefinedPriorTo ( this . endStatementPosition ) ; } protected void consumeInterfaceHeader ( ) { TypeDeclaration typeDecl = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; if ( this . currentToken == TokenNameLBRACE ) { typeDecl . bodyStart = this . scanner . currentPosition ; } if ( this . currentElement != null ) { this . restartRecovery = true ; } this . scanner . commentPtr = - <NUM_LIT:1> ; } protected void consumeInterfaceHeaderExtends ( ) { int length = this . astLengthStack [ this . astLengthPtr -- ] ; this . astPtr -= length ; TypeDeclaration typeDecl = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; System . arraycopy ( this . astStack , this . astPtr + <NUM_LIT:1> , typeDecl . superInterfaces = new TypeReference [ length ] , <NUM_LIT:0> , length ) ; for ( int i = <NUM_LIT:0> , max = typeDecl . superInterfaces . length ; i < max ; i ++ ) { typeDecl . superInterfaces [ i ] . bits |= ASTNode . IsSuperType ; } typeDecl . bodyStart = typeDecl . superInterfaces [ length - <NUM_LIT:1> ] . sourceEnd + <NUM_LIT:1> ; this . listLength = <NUM_LIT:0> ; if ( this . currentElement != null ) { this . lastCheckPoint = typeDecl . bodyStart ; } } protected void consumeInterfaceHeaderName1 ( ) { TypeDeclaration typeDecl = new TypeDeclaration ( this . compilationUnit . compilationResult ) ; if ( this . nestedMethod [ this . nestedType ] == <NUM_LIT:0> ) { if ( this . nestedType != <NUM_LIT:0> ) { typeDecl . bits |= ASTNode . IsMemberType ; } } else { typeDecl . bits |= ASTNode . IsLocalType ; markEnclosingMemberWithLocalType ( ) ; blockReal ( ) ; } long pos = this . identifierPositionStack [ this . identifierPtr ] ; typeDecl . sourceEnd = ( int ) pos ; typeDecl . sourceStart = ( int ) ( pos > > > <NUM_LIT:32> ) ; typeDecl . name = this . identifierStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; typeDecl . declarationSourceStart = this . intStack [ this . intPtr -- ] ; this . intPtr -- ; typeDecl . modifiersSourceStart = this . intStack [ this . intPtr -- ] ; typeDecl . modifiers = this . intStack [ this . intPtr -- ] | ClassFileConstants . AccInterface ; if ( typeDecl . modifiersSourceStart >= <NUM_LIT:0> ) { typeDecl . declarationSourceStart = typeDecl . modifiersSourceStart ; } if ( ( typeDecl . bits & ASTNode . IsMemberType ) == <NUM_LIT:0> && ( typeDecl . bits & ASTNode . IsLocalType ) == <NUM_LIT:0> ) { if ( this . compilationUnit != null && ! CharOperation . equals ( typeDecl . name , this . compilationUnit . getMainTypeName ( ) ) ) { typeDecl . bits |= ASTNode . IsSecondaryType ; } } int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != <NUM_LIT:0> ) { System . arraycopy ( this . expressionStack , ( this . expressionPtr -= length ) + <NUM_LIT:1> , typeDecl . annotations = new Annotation [ length ] , <NUM_LIT:0> , length ) ; } typeDecl . bodyStart = typeDecl . sourceEnd + <NUM_LIT:1> ; pushOnAstStack ( typeDecl ) ; this . listLength = <NUM_LIT:0> ; if ( this . currentElement != null ) { this . lastCheckPoint = typeDecl . bodyStart ; this . currentElement = this . currentElement . add ( typeDecl , <NUM_LIT:0> ) ; this . lastIgnoredToken = - <NUM_LIT:1> ; } typeDecl . javadoc = this . javadoc ; this . javadoc = null ; } protected void consumeInterfaceMemberDeclarations ( ) { concatNodeLists ( ) ; } protected void consumeInterfaceMemberDeclarationsopt ( ) { this . nestedType -- ; } protected void consumeInterfaceType ( ) { pushOnAstStack ( getTypeReference ( <NUM_LIT:0> ) ) ; this . listLength ++ ; } protected void consumeInterfaceTypeList ( ) { optimizedConcatNodeLists ( ) ; } protected void consumeInternalCompilationUnit ( ) { if ( this . compilationUnit . isPackageInfo ( ) ) { this . compilationUnit . types = new TypeDeclaration [ <NUM_LIT:1> ] ; this . compilationUnit . createPackageInfoType ( ) ; } } protected void consumeInternalCompilationUnitWithTypes ( ) { int length ; if ( ( length = this . astLengthStack [ this . astLengthPtr -- ] ) != <NUM_LIT:0> ) { if ( this . compilationUnit . isPackageInfo ( ) ) { this . compilationUnit . types = new TypeDeclaration [ length + <NUM_LIT:1> ] ; this . astPtr -= length ; System . arraycopy ( this . astStack , this . astPtr + <NUM_LIT:1> , this . compilationUnit . types , <NUM_LIT:1> , length ) ; this . compilationUnit . createPackageInfoType ( ) ; } else { this . compilationUnit . types = new TypeDeclaration [ length ] ; this . astPtr -= length ; System . arraycopy ( this . astStack , this . astPtr + <NUM_LIT:1> , this . compilationUnit . types , <NUM_LIT:0> , length ) ; } } } protected void consumeInvalidAnnotationTypeDeclaration ( ) { TypeDeclaration typeDecl = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; if ( ! this . statementRecoveryActivated ) problemReporter ( ) . illegalLocalTypeDeclaration ( typeDecl ) ; this . astPtr -- ; pushOnAstLengthStack ( - <NUM_LIT:1> ) ; concatNodeLists ( ) ; } protected void consumeInvalidConstructorDeclaration ( ) { ConstructorDeclaration cd = ( ConstructorDeclaration ) this . astStack [ this . astPtr ] ; cd . bodyEnd = this . endPosition ; cd . declarationSourceEnd = flushCommentsDefinedPriorTo ( this . endStatementPosition ) ; cd . modifiers |= ExtraCompilerModifiers . AccSemicolonBody ; } protected void consumeInvalidConstructorDeclaration ( boolean hasBody ) { if ( hasBody ) { this . intPtr -- ; } if ( hasBody ) { this . realBlockPtr -- ; } int length ; if ( hasBody && ( ( length = this . astLengthStack [ this . astLengthPtr -- ] ) != <NUM_LIT:0> ) ) { this . astPtr -= length ; } ConstructorDeclaration constructorDeclaration = ( ConstructorDeclaration ) this . astStack [ this . astPtr ] ; constructorDeclaration . bodyEnd = this . endStatementPosition ; constructorDeclaration . declarationSourceEnd = flushCommentsDefinedPriorTo ( this . endStatementPosition ) ; if ( ! hasBody ) { constructorDeclaration . modifiers |= ExtraCompilerModifiers . AccSemicolonBody ; } } protected void consumeInvalidEnumDeclaration ( ) { TypeDeclaration typeDecl = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; if ( ! this . statementRecoveryActivated ) problemReporter ( ) . illegalLocalTypeDeclaration ( typeDecl ) ; this . astPtr -- ; pushOnAstLengthStack ( - <NUM_LIT:1> ) ; concatNodeLists ( ) ; } protected void consumeInvalidInterfaceDeclaration ( ) { TypeDeclaration typeDecl = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; if ( ! this . statementRecoveryActivated ) problemReporter ( ) . illegalLocalTypeDeclaration ( typeDecl ) ; this . astPtr -- ; pushOnAstLengthStack ( - <NUM_LIT:1> ) ; concatNodeLists ( ) ; } protected void consumeInvalidMethodDeclaration ( ) { this . intPtr -- ; this . realBlockPtr -- ; int length ; if ( ( length = this . astLengthStack [ this . astLengthPtr -- ] ) != <NUM_LIT:0> ) { this . astPtr -= length ; } MethodDeclaration md = ( MethodDeclaration ) this . astStack [ this . astPtr ] ; md . bodyEnd = this . endPosition ; md . declarationSourceEnd = flushCommentsDefinedPriorTo ( this . endStatementPosition ) ; if ( ! this . statementRecoveryActivated ) problemReporter ( ) . abstractMethodNeedingNoBody ( md ) ; } protected void consumeLabel ( ) { } protected void consumeLeftParen ( ) { pushOnIntStack ( this . lParenPos ) ; } protected void consumeLocalVariableDeclaration ( ) { int variableDeclaratorsCounter = this . astLengthStack [ this . astLengthPtr ] ; int startIndex = this . astPtr - this . variablesCounter [ this . nestedType ] + <NUM_LIT:1> ; System . arraycopy ( this . astStack , startIndex , this . astStack , startIndex - <NUM_LIT:1> , variableDeclaratorsCounter ) ; this . astPtr -- ; this . astLengthStack [ -- this . astLengthPtr ] = variableDeclaratorsCounter ; this . variablesCounter [ this . nestedType ] = <NUM_LIT:0> ; } protected void consumeLocalVariableDeclarationStatement ( ) { this . realBlockStack [ this . realBlockPtr ] ++ ; int variableDeclaratorsCounter = this . astLengthStack [ this . astLengthPtr ] ; for ( int i = variableDeclaratorsCounter - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) { LocalDeclaration localDeclaration = ( LocalDeclaration ) this . astStack [ this . astPtr - i ] ; localDeclaration . declarationSourceEnd = this . endStatementPosition ; localDeclaration . declarationEnd = this . endStatementPosition ; } } protected void consumeMarkerAnnotation ( ) { MarkerAnnotation markerAnnotation = null ; int oldIndex = this . identifierPtr ; TypeReference typeReference = getAnnotationType ( ) ; markerAnnotation = new MarkerAnnotation ( typeReference , this . intStack [ this . intPtr -- ] ) ; markerAnnotation . declarationSourceEnd = markerAnnotation . sourceEnd ; pushOnExpressionStack ( markerAnnotation ) ; if ( ! this . statementRecoveryActivated && this . options . sourceLevel < ClassFileConstants . JDK1_5 && this . lastErrorEndPositionBeforeRecovery < this . scanner . currentPosition ) { problemReporter ( ) . invalidUsageOfAnnotation ( markerAnnotation ) ; } this . recordStringLiterals = true ; if ( this . currentElement != null && this . currentElement instanceof RecoveredAnnotation ) { this . currentElement = ( ( RecoveredAnnotation ) this . currentElement ) . addAnnotation ( markerAnnotation , oldIndex ) ; } } protected void consumeMemberValueArrayInitializer ( ) { arrayInitializer ( this . expressionLengthStack [ this . expressionLengthPtr -- ] ) ; } protected void consumeMemberValueAsName ( ) { pushOnExpressionStack ( getUnspecifiedReferenceOptimized ( ) ) ; } protected void consumeMemberValuePair ( ) { char [ ] simpleName = this . identifierStack [ this . identifierPtr ] ; long position = this . identifierPositionStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; int end = ( int ) position ; int start = ( int ) ( position > > > <NUM_LIT:32> ) ; Expression value = this . expressionStack [ this . expressionPtr -- ] ; this . expressionLengthPtr -- ; MemberValuePair memberValuePair = new MemberValuePair ( simpleName , start , end , value ) ; pushOnAstStack ( memberValuePair ) ; if ( this . currentElement != null && this . currentElement instanceof RecoveredAnnotation ) { RecoveredAnnotation recoveredAnnotation = ( RecoveredAnnotation ) this . currentElement ; recoveredAnnotation . setKind ( RecoveredAnnotation . NORMAL ) ; } } protected void consumeMemberValuePairs ( ) { concatNodeLists ( ) ; } protected void consumeMemberValues ( ) { concatExpressionLists ( ) ; } protected void consumeMethodBody ( ) { this . nestedMethod [ this . nestedType ] -- ; } protected void consumeMethodDeclaration ( boolean isNotAbstract ) { int length ; if ( isNotAbstract ) { this . intPtr -- ; this . intPtr -- ; } int explicitDeclarations = <NUM_LIT:0> ; Statement [ ] statements = null ; if ( isNotAbstract ) { explicitDeclarations = this . realBlockStack [ this . realBlockPtr -- ] ; if ( ! this . options . ignoreMethodBodies ) { if ( ( length = this . astLengthStack [ this . astLengthPtr -- ] ) != <NUM_LIT:0> ) { System . arraycopy ( this . astStack , ( this . astPtr -= length ) + <NUM_LIT:1> , statements = new Statement [ length ] , <NUM_LIT:0> , length ) ; } } else { length = this . astLengthStack [ this . astLengthPtr -- ] ; this . astPtr -= length ; } } MethodDeclaration md = ( MethodDeclaration ) this . astStack [ this . astPtr ] ; md . statements = statements ; md . explicitDeclarations = explicitDeclarations ; if ( ! isNotAbstract ) { md . modifiers |= ExtraCompilerModifiers . AccSemicolonBody ; } else if ( ! ( this . diet && this . dietInt == <NUM_LIT:0> ) && statements == null && ! containsComment ( md . bodyStart , this . endPosition ) ) { md . bits |= ASTNode . UndocumentedEmptyBlock ; } md . bodyEnd = this . endPosition ; md . declarationSourceEnd = flushCommentsDefinedPriorTo ( this . endStatementPosition ) ; } protected void consumeMethodHeader ( ) { AbstractMethodDeclaration method = ( AbstractMethodDeclaration ) this . astStack [ this . astPtr ] ; if ( this . currentToken == TokenNameLBRACE ) { method . bodyStart = this . scanner . currentPosition ; } if ( this . currentElement != null ) { if ( this . currentToken == TokenNameSEMICOLON ) { method . modifiers |= ExtraCompilerModifiers . AccSemicolonBody ; method . declarationSourceEnd = this . scanner . currentPosition - <NUM_LIT:1> ; method . bodyEnd = this . scanner . currentPosition - <NUM_LIT:1> ; if ( this . currentElement . parseTree ( ) == method && this . currentElement . parent != null ) { this . currentElement = this . currentElement . parent ; } } else if ( this . currentToken == TokenNameLBRACE ) { if ( this . currentElement instanceof RecoveredMethod && ( ( RecoveredMethod ) this . currentElement ) . methodDeclaration != method ) { this . ignoreNextOpeningBrace = true ; this . currentElement . bracketBalance ++ ; } } this . restartRecovery = true ; } } protected void consumeMethodHeaderDefaultValue ( ) { MethodDeclaration md = ( MethodDeclaration ) this . astStack [ this . astPtr ] ; int length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ; if ( length == <NUM_LIT:1> ) { this . intPtr -- ; this . intPtr -- ; if ( md . isAnnotationMethod ( ) ) { ( ( AnnotationMethodDeclaration ) md ) . defaultValue = this . expressionStack [ this . expressionPtr ] ; md . modifiers |= ClassFileConstants . AccAnnotationDefault ; } this . expressionPtr -- ; this . recordStringLiterals = true ; } if ( this . currentElement != null ) { if ( md . isAnnotationMethod ( ) ) { this . currentElement . updateSourceEndIfNecessary ( ( ( AnnotationMethodDeclaration ) md ) . defaultValue . sourceEnd ) ; } } } protected void consumeMethodHeaderExtendedDims ( ) { MethodDeclaration md = ( MethodDeclaration ) this . astStack [ this . astPtr ] ; int extendedDims = this . intStack [ this . intPtr -- ] ; if ( md . isAnnotationMethod ( ) ) { ( ( AnnotationMethodDeclaration ) md ) . extendedDimensions = extendedDims ; } if ( extendedDims != <NUM_LIT:0> ) { TypeReference returnType = md . returnType ; md . sourceEnd = this . endPosition ; int dims = returnType . dimensions ( ) + extendedDims ; md . returnType = copyDims ( returnType , dims ) ; if ( this . currentToken == TokenNameLBRACE ) { md . bodyStart = this . endPosition + <NUM_LIT:1> ; } if ( this . currentElement != null ) { this . lastCheckPoint = md . bodyStart ; } } } protected void consumeMethodHeaderName ( boolean isAnnotationMethod ) { MethodDeclaration md = null ; if ( isAnnotationMethod ) { md = new AnnotationMethodDeclaration ( this . compilationUnit . compilationResult ) ; this . recordStringLiterals = false ; } else { md = new MethodDeclaration ( this . compilationUnit . compilationResult ) ; } md . selector = this . identifierStack [ this . identifierPtr ] ; long selectorSource = this . identifierPositionStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; md . returnType = getTypeReference ( this . intStack [ this . intPtr -- ] ) ; md . declarationSourceStart = this . intStack [ this . intPtr -- ] ; md . modifiers = this . intStack [ this . intPtr -- ] ; int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != <NUM_LIT:0> ) { System . arraycopy ( this . expressionStack , ( this . expressionPtr -= length ) + <NUM_LIT:1> , md . annotations = new Annotation [ length ] , <NUM_LIT:0> , length ) ; } md . javadoc = this . javadoc ; this . javadoc = null ; md . sourceStart = ( int ) ( selectorSource > > > <NUM_LIT:32> ) ; pushOnAstStack ( md ) ; md . sourceEnd = this . lParenPos ; md . bodyStart = this . lParenPos + <NUM_LIT:1> ; this . listLength = <NUM_LIT:0> ; if ( this . currentElement != null ) { if ( this . currentElement instanceof RecoveredType || ( Util . getLineNumber ( md . returnType . sourceStart , this . scanner . lineEnds , <NUM_LIT:0> , this . scanner . linePtr ) == Util . getLineNumber ( md . sourceStart , this . scanner . lineEnds , <NUM_LIT:0> , this . scanner . linePtr ) ) ) { this . lastCheckPoint = md . bodyStart ; this . currentElement = this . currentElement . add ( md , <NUM_LIT:0> ) ; this . lastIgnoredToken = - <NUM_LIT:1> ; } else { this . lastCheckPoint = md . sourceStart ; this . restartRecovery = true ; } } } protected void consumeMethodHeaderNameWithTypeParameters ( boolean isAnnotationMethod ) { MethodDeclaration md = null ; if ( isAnnotationMethod ) { md = new AnnotationMethodDeclaration ( this . compilationUnit . compilationResult ) ; this . recordStringLiterals = false ; } else { md = new MethodDeclaration ( this . compilationUnit . compilationResult ) ; } md . selector = this . identifierStack [ this . identifierPtr ] ; long selectorSource = this . identifierPositionStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; md . returnType = getTypeReference ( this . intStack [ this . intPtr -- ] ) ; int length = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; this . genericsPtr -= length ; System . arraycopy ( this . genericsStack , this . genericsPtr + <NUM_LIT:1> , md . typeParameters = new TypeParameter [ length ] , <NUM_LIT:0> , length ) ; md . declarationSourceStart = this . intStack [ this . intPtr -- ] ; md . modifiers = this . intStack [ this . intPtr -- ] ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != <NUM_LIT:0> ) { System . arraycopy ( this . expressionStack , ( this . expressionPtr -= length ) + <NUM_LIT:1> , md . annotations = new Annotation [ length ] , <NUM_LIT:0> , length ) ; } md . javadoc = this . javadoc ; this . javadoc = null ; md . sourceStart = ( int ) ( selectorSource > > > <NUM_LIT:32> ) ; pushOnAstStack ( md ) ; md . sourceEnd = this . lParenPos ; md . bodyStart = this . lParenPos + <NUM_LIT:1> ; this . listLength = <NUM_LIT:0> ; if ( this . currentElement != null ) { boolean isType ; if ( ( isType = this . currentElement instanceof RecoveredType ) || ( Util . getLineNumber ( md . returnType . sourceStart , this . scanner . lineEnds , <NUM_LIT:0> , this . scanner . linePtr ) == Util . getLineNumber ( md . sourceStart , this . scanner . lineEnds , <NUM_LIT:0> , this . scanner . linePtr ) ) ) { if ( isType ) { ( ( RecoveredType ) this . currentElement ) . pendingTypeParameters = null ; } this . lastCheckPoint = md . bodyStart ; this . currentElement = this . currentElement . add ( md , <NUM_LIT:0> ) ; this . lastIgnoredToken = - <NUM_LIT:1> ; } else { this . lastCheckPoint = md . sourceStart ; this . restartRecovery = true ; } } } protected void consumeMethodHeaderRightParen ( ) { int length = this . astLengthStack [ this . astLengthPtr -- ] ; this . astPtr -= length ; AbstractMethodDeclaration md = ( AbstractMethodDeclaration ) this . astStack [ this . astPtr ] ; md . sourceEnd = this . rParenPos ; if ( length != <NUM_LIT:0> ) { System . arraycopy ( this . astStack , this . astPtr + <NUM_LIT:1> , md . arguments = new Argument [ length ] , <NUM_LIT:0> , length ) ; } md . bodyStart = this . rParenPos + <NUM_LIT:1> ; this . listLength = <NUM_LIT:0> ; if ( this . currentElement != null ) { this . lastCheckPoint = md . bodyStart ; if ( this . currentElement . parseTree ( ) == md ) return ; if ( md . isConstructor ( ) ) { if ( ( length != <NUM_LIT:0> ) || ( this . currentToken == TokenNameLBRACE ) || ( this . currentToken == TokenNamethrows ) ) { this . currentElement = this . currentElement . add ( md , <NUM_LIT:0> ) ; this . lastIgnoredToken = - <NUM_LIT:1> ; } } } } protected void consumeMethodHeaderThrowsClause ( ) { int length = this . astLengthStack [ this . astLengthPtr -- ] ; this . astPtr -= length ; AbstractMethodDeclaration md = ( AbstractMethodDeclaration ) this . astStack [ this . astPtr ] ; System . arraycopy ( this . astStack , this . astPtr + <NUM_LIT:1> , md . thrownExceptions = new TypeReference [ length ] , <NUM_LIT:0> , length ) ; md . sourceEnd = md . thrownExceptions [ length - <NUM_LIT:1> ] . sourceEnd ; md . bodyStart = md . thrownExceptions [ length - <NUM_LIT:1> ] . sourceEnd + <NUM_LIT:1> ; this . listLength = <NUM_LIT:0> ; if ( this . currentElement != null ) { this . lastCheckPoint = md . bodyStart ; } } protected void consumeMethodInvocationName ( ) { MessageSend m = newMessageSend ( ) ; m . sourceEnd = this . rParenPos ; m . sourceStart = ( int ) ( ( m . nameSourcePosition = this . identifierPositionStack [ this . identifierPtr ] ) > > > <NUM_LIT:32> ) ; m . selector = this . identifierStack [ this . identifierPtr -- ] ; if ( this . identifierLengthStack [ this . identifierLengthPtr ] == <NUM_LIT:1> ) { m . receiver = ThisReference . implicitThis ( ) ; this . identifierLengthPtr -- ; } else { this . identifierLengthStack [ this . identifierLengthPtr ] -- ; m . receiver = getUnspecifiedReference ( ) ; m . sourceStart = m . receiver . sourceStart ; } pushOnExpressionStack ( m ) ; } protected void consumeMethodInvocationNameWithTypeArguments ( ) { MessageSend m = newMessageSendWithTypeArguments ( ) ; m . sourceEnd = this . rParenPos ; m . sourceStart = ( int ) ( ( m . nameSourcePosition = this . identifierPositionStack [ this . identifierPtr ] ) > > > <NUM_LIT:32> ) ; m . selector = this . identifierStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; int length = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; this . genericsPtr -= length ; System . arraycopy ( this . genericsStack , this . genericsPtr + <NUM_LIT:1> , m . typeArguments = new TypeReference [ length ] , <NUM_LIT:0> , length ) ; this . intPtr -- ; m . receiver = getUnspecifiedReference ( ) ; m . sourceStart = m . receiver . sourceStart ; pushOnExpressionStack ( m ) ; } protected void consumeMethodInvocationPrimary ( ) { MessageSend m = newMessageSend ( ) ; m . sourceStart = ( int ) ( ( m . nameSourcePosition = this . identifierPositionStack [ this . identifierPtr ] ) > > > <NUM_LIT:32> ) ; m . selector = this . identifierStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; m . receiver = this . expressionStack [ this . expressionPtr ] ; m . sourceStart = m . receiver . sourceStart ; m . sourceEnd = this . rParenPos ; this . expressionStack [ this . expressionPtr ] = m ; } protected void consumeMethodInvocationPrimaryWithTypeArguments ( ) { MessageSend m = newMessageSendWithTypeArguments ( ) ; m . sourceStart = ( int ) ( ( m . nameSourcePosition = this . identifierPositionStack [ this . identifierPtr ] ) > > > <NUM_LIT:32> ) ; m . selector = this . identifierStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; int length = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; this . genericsPtr -= length ; System . arraycopy ( this . genericsStack , this . genericsPtr + <NUM_LIT:1> , m . typeArguments = new TypeReference [ length ] , <NUM_LIT:0> , length ) ; this . intPtr -- ; m . receiver = this . expressionStack [ this . expressionPtr ] ; m . sourceStart = m . receiver . sourceStart ; m . sourceEnd = this . rParenPos ; this . expressionStack [ this . expressionPtr ] = m ; } protected void consumeMethodInvocationSuper ( ) { MessageSend m = newMessageSend ( ) ; m . sourceStart = this . intStack [ this . intPtr -- ] ; m . sourceEnd = this . rParenPos ; m . nameSourcePosition = this . identifierPositionStack [ this . identifierPtr ] ; m . selector = this . identifierStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; m . receiver = new SuperReference ( m . sourceStart , this . endPosition ) ; pushOnExpressionStack ( m ) ; } protected void consumeMethodInvocationSuperWithTypeArguments ( ) { MessageSend m = newMessageSendWithTypeArguments ( ) ; this . intPtr -- ; m . sourceEnd = this . rParenPos ; m . nameSourcePosition = this . identifierPositionStack [ this . identifierPtr ] ; m . selector = this . identifierStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; int length = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; this . genericsPtr -= length ; System . arraycopy ( this . genericsStack , this . genericsPtr + <NUM_LIT:1> , m . typeArguments = new TypeReference [ length ] , <NUM_LIT:0> , length ) ; m . sourceStart = this . intStack [ this . intPtr -- ] ; m . receiver = new SuperReference ( m . sourceStart , this . endPosition ) ; pushOnExpressionStack ( m ) ; } protected void consumeModifiers ( ) { int savedModifiersSourceStart = this . modifiersSourceStart ; checkComment ( ) ; pushOnIntStack ( this . modifiers ) ; if ( this . modifiersSourceStart >= savedModifiersSourceStart ) { this . modifiersSourceStart = savedModifiersSourceStart ; } pushOnIntStack ( this . modifiersSourceStart ) ; resetModifiers ( ) ; } protected void consumeModifiers2 ( ) { this . expressionLengthStack [ this . expressionLengthPtr - <NUM_LIT:1> ] += this . expressionLengthStack [ this . expressionLengthPtr -- ] ; } protected void consumeMultipleResources ( ) { concatNodeLists ( ) ; } protected void consumeNameArrayType ( ) { pushOnGenericsLengthStack ( <NUM_LIT:0> ) ; pushOnGenericsIdentifiersLengthStack ( this . identifierLengthStack [ this . identifierLengthPtr ] ) ; } protected void consumeNestedMethod ( ) { jumpOverMethodBody ( ) ; this . nestedMethod [ this . nestedType ] ++ ; pushOnIntStack ( this . scanner . currentPosition ) ; consumeOpenBlock ( ) ; } protected void consumeNestedType ( ) { int length = this . nestedMethod . length ; if ( ++ this . nestedType >= length ) { System . arraycopy ( this . nestedMethod , <NUM_LIT:0> , this . nestedMethod = new int [ length + <NUM_LIT:30> ] , <NUM_LIT:0> , length ) ; System . arraycopy ( this . variablesCounter , <NUM_LIT:0> , this . variablesCounter = new int [ length + <NUM_LIT:30> ] , <NUM_LIT:0> , length ) ; } this . nestedMethod [ this . nestedType ] = <NUM_LIT:0> ; this . variablesCounter [ this . nestedType ] = <NUM_LIT:0> ; } protected void consumeNormalAnnotation ( ) { NormalAnnotation normalAnnotation = null ; int oldIndex = this . identifierPtr ; TypeReference typeReference = getAnnotationType ( ) ; normalAnnotation = new NormalAnnotation ( typeReference , this . intStack [ this . intPtr -- ] ) ; int length ; if ( ( length = this . astLengthStack [ this . astLengthPtr -- ] ) != <NUM_LIT:0> ) { System . arraycopy ( this . astStack , ( this . astPtr -= length ) + <NUM_LIT:1> , normalAnnotation . memberValuePairs = new MemberValuePair [ length ] , <NUM_LIT:0> , length ) ; } normalAnnotation . declarationSourceEnd = this . rParenPos ; pushOnExpressionStack ( normalAnnotation ) ; if ( this . currentElement != null ) { annotationRecoveryCheckPoint ( normalAnnotation . sourceStart , normalAnnotation . declarationSourceEnd ) ; if ( this . currentElement instanceof RecoveredAnnotation ) { this . currentElement = ( ( RecoveredAnnotation ) this . currentElement ) . addAnnotation ( normalAnnotation , oldIndex ) ; } } if ( ! this . statementRecoveryActivated && this . options . sourceLevel < ClassFileConstants . JDK1_5 && this . lastErrorEndPositionBeforeRecovery < this . scanner . currentPosition ) { problemReporter ( ) . invalidUsageOfAnnotation ( normalAnnotation ) ; } this . recordStringLiterals = true ; } protected void consumeOneDimLoop ( ) { this . dimensions ++ ; } protected void consumeOnlySynchronized ( ) { pushOnIntStack ( this . synchronizedBlockSourceStart ) ; resetModifiers ( ) ; this . expressionLengthPtr -- ; } protected void consumeOnlyTypeArguments ( ) { if ( ! this . statementRecoveryActivated && this . options . sourceLevel < ClassFileConstants . JDK1_5 && this . lastErrorEndPositionBeforeRecovery < this . scanner . currentPosition ) { int length = this . genericsLengthStack [ this . genericsLengthPtr ] ; problemReporter ( ) . invalidUsageOfTypeArguments ( ( TypeReference ) this . genericsStack [ this . genericsPtr - length + <NUM_LIT:1> ] , ( TypeReference ) this . genericsStack [ this . genericsPtr ] ) ; } } protected void consumeOnlyTypeArgumentsForCastExpression ( ) { } protected void consumeOpenBlock ( ) { pushOnIntStack ( this . scanner . startPosition ) ; int stackLength = this . realBlockStack . length ; if ( ++ this . realBlockPtr >= stackLength ) { System . arraycopy ( this . realBlockStack , <NUM_LIT:0> , this . realBlockStack = new int [ stackLength + StackIncrement ] , <NUM_LIT:0> , stackLength ) ; } this . realBlockStack [ this . realBlockPtr ] = <NUM_LIT:0> ; } protected void consumePackageComment ( ) { if ( this . options . sourceLevel >= ClassFileConstants . JDK1_5 ) { checkComment ( ) ; resetModifiers ( ) ; } } protected void consumePackageDeclaration ( ) { ImportReference impt = this . compilationUnit . currentPackage ; this . compilationUnit . javadoc = this . javadoc ; this . javadoc = null ; impt . declarationEnd = this . endStatementPosition ; impt . declarationSourceEnd = flushCommentsDefinedPriorTo ( impt . declarationSourceEnd ) ; } protected void consumePackageDeclarationName ( ) { ImportReference impt ; int length ; char [ ] [ ] tokens = new char [ length = this . identifierLengthStack [ this . identifierLengthPtr -- ] ] [ ] ; this . identifierPtr -= length ; long [ ] positions = new long [ length ] ; System . arraycopy ( this . identifierStack , ++ this . identifierPtr , tokens , <NUM_LIT:0> , length ) ; System . arraycopy ( this . identifierPositionStack , this . identifierPtr -- , positions , <NUM_LIT:0> , length ) ; impt = new ImportReference ( tokens , positions , false , ClassFileConstants . AccDefault ) ; this . compilationUnit . currentPackage = impt ; if ( this . currentToken == TokenNameSEMICOLON ) { impt . declarationSourceEnd = this . scanner . currentPosition - <NUM_LIT:1> ; } else { impt . declarationSourceEnd = impt . sourceEnd ; } impt . declarationEnd = impt . declarationSourceEnd ; impt . declarationSourceStart = this . intStack [ this . intPtr -- ] ; if ( this . javadoc != null ) { impt . declarationSourceStart = this . javadoc . sourceStart ; } if ( this . currentElement != null ) { this . lastCheckPoint = impt . declarationSourceEnd + <NUM_LIT:1> ; this . restartRecovery = true ; } } protected void consumePackageDeclarationNameWithModifiers ( ) { ImportReference impt ; int length ; char [ ] [ ] tokens = new char [ length = this . identifierLengthStack [ this . identifierLengthPtr -- ] ] [ ] ; this . identifierPtr -= length ; long [ ] positions = new long [ length ] ; System . arraycopy ( this . identifierStack , ++ this . identifierPtr , tokens , <NUM_LIT:0> , length ) ; System . arraycopy ( this . identifierPositionStack , this . identifierPtr -- , positions , <NUM_LIT:0> , length ) ; int packageModifiersSourceStart = this . intStack [ this . intPtr -- ] ; int packageModifiers = this . intStack [ this . intPtr -- ] ; impt = new ImportReference ( tokens , positions , false , packageModifiers ) ; this . compilationUnit . currentPackage = impt ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != <NUM_LIT:0> ) { System . arraycopy ( this . expressionStack , ( this . expressionPtr -= length ) + <NUM_LIT:1> , impt . annotations = new Annotation [ length ] , <NUM_LIT:0> , length ) ; impt . declarationSourceStart = packageModifiersSourceStart ; this . intPtr -- ; } else { impt . declarationSourceStart = this . intStack [ this . intPtr -- ] ; if ( this . javadoc != null ) { impt . declarationSourceStart = this . javadoc . sourceStart ; } } if ( this . currentToken == TokenNameSEMICOLON ) { impt . declarationSourceEnd = this . scanner . currentPosition - <NUM_LIT:1> ; } else { impt . declarationSourceEnd = impt . sourceEnd ; } impt . declarationEnd = impt . declarationSourceEnd ; if ( this . currentElement != null ) { this . lastCheckPoint = impt . declarationSourceEnd + <NUM_LIT:1> ; this . restartRecovery = true ; } } protected void consumePostfixExpression ( ) { pushOnExpressionStack ( getUnspecifiedReferenceOptimized ( ) ) ; } protected void consumePrimaryNoNewArray ( ) { final Expression parenthesizedExpression = this . expressionStack [ this . expressionPtr ] ; updateSourcePosition ( parenthesizedExpression ) ; int numberOfParenthesis = ( parenthesizedExpression . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; parenthesizedExpression . bits &= ~ ASTNode . ParenthesizedMASK ; parenthesizedExpression . bits |= ( numberOfParenthesis + <NUM_LIT:1> ) << ASTNode . ParenthesizedSHIFT ; } protected void consumePrimaryNoNewArrayArrayType ( ) { this . intPtr -- ; pushOnGenericsIdentifiersLengthStack ( this . identifierLengthStack [ this . identifierLengthPtr ] ) ; pushOnGenericsLengthStack ( <NUM_LIT:0> ) ; pushOnExpressionStack ( new ClassLiteralAccess ( this . intStack [ this . intPtr -- ] , getTypeReference ( this . intStack [ this . intPtr -- ] ) ) ) ; } protected void consumePrimaryNoNewArrayName ( ) { this . intPtr -- ; pushOnGenericsIdentifiersLengthStack ( this . identifierLengthStack [ this . identifierLengthPtr ] ) ; pushOnGenericsLengthStack ( <NUM_LIT:0> ) ; TypeReference typeReference = getTypeReference ( <NUM_LIT:0> ) ; pushOnExpressionStack ( new ClassLiteralAccess ( this . intStack [ this . intPtr -- ] , typeReference ) ) ; } protected void consumePrimaryNoNewArrayNameSuper ( ) { pushOnGenericsIdentifiersLengthStack ( this . identifierLengthStack [ this . identifierLengthPtr ] ) ; pushOnGenericsLengthStack ( <NUM_LIT:0> ) ; TypeReference typeReference = getTypeReference ( <NUM_LIT:0> ) ; pushOnExpressionStack ( new QualifiedSuperReference ( typeReference , this . intStack [ this . intPtr -- ] , this . endPosition ) ) ; } protected void consumePrimaryNoNewArrayNameThis ( ) { pushOnGenericsIdentifiersLengthStack ( this . identifierLengthStack [ this . identifierLengthPtr ] ) ; pushOnGenericsLengthStack ( <NUM_LIT:0> ) ; TypeReference typeReference = getTypeReference ( <NUM_LIT:0> ) ; pushOnExpressionStack ( new QualifiedThisReference ( typeReference , this . intStack [ this . intPtr -- ] , this . endPosition ) ) ; } protected void consumePrimaryNoNewArrayPrimitiveArrayType ( ) { this . intPtr -- ; pushOnExpressionStack ( new ClassLiteralAccess ( this . intStack [ this . intPtr -- ] , getTypeReference ( this . intStack [ this . intPtr -- ] ) ) ) ; } protected void consumePrimaryNoNewArrayPrimitiveType ( ) { this . intPtr -- ; pushOnExpressionStack ( new ClassLiteralAccess ( this . intStack [ this . intPtr -- ] , getTypeReference ( <NUM_LIT:0> ) ) ) ; } protected void consumePrimaryNoNewArrayThis ( ) { pushOnExpressionStack ( new ThisReference ( this . intStack [ this . intPtr -- ] , this . endPosition ) ) ; } protected void consumePrimaryNoNewArrayWithName ( ) { pushOnExpressionStack ( getUnspecifiedReferenceOptimized ( ) ) ; final Expression parenthesizedExpression = this . expressionStack [ this . expressionPtr ] ; updateSourcePosition ( parenthesizedExpression ) ; int numberOfParenthesis = ( parenthesizedExpression . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; parenthesizedExpression . bits &= ~ ASTNode . ParenthesizedMASK ; parenthesizedExpression . bits |= ( numberOfParenthesis + <NUM_LIT:1> ) << ASTNode . ParenthesizedSHIFT ; } protected void consumePrimitiveArrayType ( ) { } protected void consumePrimitiveType ( ) { pushOnIntStack ( <NUM_LIT:0> ) ; } protected void consumePushLeftBrace ( ) { pushOnIntStack ( this . endPosition ) ; } protected void consumePushModifiers ( ) { pushOnIntStack ( this . modifiers ) ; pushOnIntStack ( this . modifiersSourceStart ) ; resetModifiers ( ) ; pushOnExpressionStackLengthStack ( <NUM_LIT:0> ) ; } protected void consumePushModifiersForHeader ( ) { checkComment ( ) ; pushOnIntStack ( this . modifiers ) ; pushOnIntStack ( this . modifiersSourceStart ) ; resetModifiers ( ) ; pushOnExpressionStackLengthStack ( <NUM_LIT:0> ) ; } protected void consumePushPosition ( ) { pushOnIntStack ( this . endPosition ) ; } protected void consumePushRealModifiers ( ) { checkComment ( ) ; pushOnIntStack ( this . modifiers ) ; pushOnIntStack ( this . modifiersSourceStart ) ; resetModifiers ( ) ; } protected void consumeQualifiedName ( ) { this . identifierLengthStack [ -- this . identifierLengthPtr ] ++ ; } protected void consumeRecoveryMethodHeaderName ( ) { boolean isAnnotationMethod = false ; if ( this . currentElement instanceof RecoveredType ) { isAnnotationMethod = ( ( ( RecoveredType ) this . currentElement ) . typeDeclaration . modifiers & ClassFileConstants . AccAnnotation ) != <NUM_LIT:0> ; } else { RecoveredType recoveredType = this . currentElement . enclosingType ( ) ; if ( recoveredType != null ) { isAnnotationMethod = ( recoveredType . typeDeclaration . modifiers & ClassFileConstants . AccAnnotation ) != <NUM_LIT:0> ; } } consumeMethodHeaderName ( isAnnotationMethod ) ; } protected void consumeRecoveryMethodHeaderNameWithTypeParameters ( ) { boolean isAnnotationMethod = false ; if ( this . currentElement instanceof RecoveredType ) { isAnnotationMethod = ( ( ( RecoveredType ) this . currentElement ) . typeDeclaration . modifiers & ClassFileConstants . AccAnnotation ) != <NUM_LIT:0> ; } else { RecoveredType recoveredType = this . currentElement . enclosingType ( ) ; if ( recoveredType != null ) { isAnnotationMethod = ( recoveredType . typeDeclaration . modifiers & ClassFileConstants . AccAnnotation ) != <NUM_LIT:0> ; } } consumeMethodHeaderNameWithTypeParameters ( isAnnotationMethod ) ; } protected void consumeReduceImports ( ) { int length ; if ( ( length = this . astLengthStack [ this . astLengthPtr -- ] ) != <NUM_LIT:0> ) { this . astPtr -= length ; System . arraycopy ( this . astStack , this . astPtr + <NUM_LIT:1> , this . compilationUnit . imports = new ImportReference [ length ] , <NUM_LIT:0> , length ) ; } } protected void consumeReferenceType ( ) { pushOnIntStack ( <NUM_LIT:0> ) ; } protected void consumeReferenceType1 ( ) { pushOnGenericsStack ( getTypeReference ( this . intStack [ this . intPtr -- ] ) ) ; } protected void consumeReferenceType2 ( ) { pushOnGenericsStack ( getTypeReference ( this . intStack [ this . intPtr -- ] ) ) ; } protected void consumeReferenceType3 ( ) { pushOnGenericsStack ( getTypeReference ( this . intStack [ this . intPtr -- ] ) ) ; } protected void consumeResourceAsLocalVariableDeclaration ( ) { consumeLocalVariableDeclaration ( ) ; } protected void consumeResourceSpecification ( ) { } protected void consumeResourceOptionalTrailingSemiColon ( boolean punctuated ) { LocalDeclaration localDeclaration = ( LocalDeclaration ) this . astStack [ this . astPtr ] ; if ( punctuated ) { localDeclaration . declarationSourceEnd = this . endStatementPosition ; } } protected void consumeRestoreDiet ( ) { this . dietInt -- ; } protected void consumeRightParen ( ) { pushOnIntStack ( this . rParenPos ) ; } protected void consumeRule ( int act ) { switch ( act ) { case <NUM_LIT:30> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumePrimitiveType ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeReferenceType ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeClassOrInterfaceName ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeClassOrInterface ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeGenericType ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeGenericTypeWithDiamond ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeArrayTypeWithTypeArgumentsName ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumePrimitiveArrayType ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeNameArrayType ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeGenericTypeNameArrayType ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeGenericTypeArrayType ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeQualifiedName ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeCompilationUnit ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeInternalCompilationUnit ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeInternalCompilationUnit ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeInternalCompilationUnitWithTypes ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeInternalCompilationUnitWithTypes ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeInternalCompilationUnit ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeInternalCompilationUnitWithTypes ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeInternalCompilationUnitWithTypes ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEmptyInternalCompilationUnit ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeReduceImports ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEnterCompilationUnit ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeCatchHeader ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeImportDeclarations ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeTypeDeclarations ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumePackageDeclaration ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumePackageDeclarationNameWithModifiers ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumePackageDeclarationName ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumePackageComment ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeImportDeclaration ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeSingleTypeImportDeclarationName ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeImportDeclaration ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeTypeImportOnDemandDeclarationName ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEmptyTypeDeclaration ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeModifiers2 ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeAnnotationAsModifier ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeClassDeclaration ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeClassHeader ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeTypeHeaderNameWithTypeParameters ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeClassHeaderName1 ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeClassHeaderExtends ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeClassHeaderImplements ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeInterfaceTypeList ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeInterfaceType ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeClassBodyDeclarations ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeClassBodyDeclaration ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeDiet ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeClassBodyDeclaration ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeCreateInitializer ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEmptyTypeDeclaration ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeFieldDeclaration ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeVariableDeclarators ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEnterVariable ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeExitVariableWithInitialization ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeExitVariableWithoutInitialization ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeForceNoDiet ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeRestoreDiet ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeMethodDeclaration ( true ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeMethodDeclaration ( false ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeMethodHeader ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeMethodHeaderNameWithTypeParameters ( false ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeMethodHeaderName ( false ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeMethodHeaderRightParen ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeMethodHeaderExtendedDims ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeMethodHeaderThrowsClause ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeConstructorHeader ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeConstructorHeaderNameWithTypeParameters ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeConstructorHeaderName ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeFormalParameterList ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeFormalParameter ( false ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeFormalParameter ( true ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeCatchFormalParameter ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeCatchType ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeUnionTypeAsClassType ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeUnionType ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeClassTypeList ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeClassTypeElt ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeMethodBody ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeNestedMethod ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeStaticInitializer ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeStaticOnly ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeConstructorDeclaration ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeInvalidConstructorDeclaration ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeExplicitConstructorInvocation ( <NUM_LIT:0> , THIS_CALL ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeExplicitConstructorInvocationWithTypeArguments ( <NUM_LIT:0> , THIS_CALL ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeExplicitConstructorInvocation ( <NUM_LIT:0> , SUPER_CALL ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeExplicitConstructorInvocationWithTypeArguments ( <NUM_LIT:0> , SUPER_CALL ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeExplicitConstructorInvocation ( <NUM_LIT:1> , SUPER_CALL ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeExplicitConstructorInvocationWithTypeArguments ( <NUM_LIT:1> , SUPER_CALL ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeExplicitConstructorInvocation ( <NUM_LIT:2> , SUPER_CALL ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeExplicitConstructorInvocationWithTypeArguments ( <NUM_LIT:2> , SUPER_CALL ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeExplicitConstructorInvocation ( <NUM_LIT:1> , THIS_CALL ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeExplicitConstructorInvocationWithTypeArguments ( <NUM_LIT:1> , THIS_CALL ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeExplicitConstructorInvocation ( <NUM_LIT:2> , THIS_CALL ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeExplicitConstructorInvocationWithTypeArguments ( <NUM_LIT:2> , THIS_CALL ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeInterfaceDeclaration ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeInterfaceHeader ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeTypeHeaderNameWithTypeParameters ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeInterfaceHeaderName1 ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeInterfaceHeaderExtends ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeInterfaceMemberDeclarations ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEmptyTypeDeclaration ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeInvalidMethodDeclaration ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeInvalidConstructorDeclaration ( true ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeInvalidConstructorDeclaration ( false ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumePushLeftBrace ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEmptyArrayInitializer ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeArrayInitializer ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeArrayInitializer ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeVariableInitializers ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBlock ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeOpenBlock ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBlockStatements ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeInvalidInterfaceDeclaration ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeInvalidAnnotationTypeDeclaration ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeInvalidEnumDeclaration ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeLocalVariableDeclarationStatement ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeLocalVariableDeclaration ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeLocalVariableDeclaration ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumePushModifiers ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumePushModifiersForHeader ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumePushRealModifiers ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEmptyStatement ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeStatementLabel ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeStatementLabel ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeLabel ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeExpressionStatement ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeStatementIfNoElse ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeStatementIfWithElse ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeStatementIfWithElse ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeStatementSwitch ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEmptySwitchBlock ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeSwitchBlock ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeSwitchBlockStatements ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeSwitchBlockStatement ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeSwitchLabels ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeCaseLabel ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeDefaultLabel ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeStatementWhile ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeStatementWhile ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeStatementDo ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeStatementFor ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeStatementFor ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeForInit ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeStatementExpressionList ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeSimpleAssertStatement ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeAssertStatement ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeStatementBreak ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeStatementBreakWithLabel ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeStatementContinue ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeStatementContinueWithLabel ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeStatementReturn ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeStatementThrow ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeStatementSynchronized ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeOnlySynchronized ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeStatementTry ( false , false ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeStatementTry ( true , false ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeStatementTry ( false , true ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeStatementTry ( true , true ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeResourceSpecification ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeResourceOptionalTrailingSemiColon ( false ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeResourceOptionalTrailingSemiColon ( true ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeSingleResource ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeMultipleResources ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeResourceOptionalTrailingSemiColon ( true ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeResourceAsLocalVariableDeclaration ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeResourceAsLocalVariableDeclaration ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeExitTryBlock ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeCatches ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeStatementCatch ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeLeftParen ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeRightParen ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumePrimaryNoNewArrayThis ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumePrimaryNoNewArray ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumePrimaryNoNewArrayWithName ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumePrimaryNoNewArrayNameThis ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumePrimaryNoNewArrayNameSuper ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumePrimaryNoNewArrayName ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumePrimaryNoNewArrayArrayType ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumePrimaryNoNewArrayPrimitiveArrayType ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumePrimaryNoNewArrayPrimitiveType ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeAllocationHeader ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeClassInstanceCreationExpressionWithTypeArguments ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeClassInstanceCreationExpression ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeClassInstanceCreationExpressionQualifiedWithTypeArguments ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeClassInstanceCreationExpressionQualified ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeClassInstanceCreationExpressionQualified ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeClassInstanceCreationExpressionQualifiedWithTypeArguments ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEnterInstanceCreationArgumentList ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeClassInstanceCreationExpressionName ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeClassBodyopt ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEnterAnonymousClassBody ( false ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeClassBodyopt ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEnterAnonymousClassBody ( true ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeArgumentList ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeArrayCreationHeader ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeArrayCreationHeader ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeArrayCreationExpressionWithoutInitializer ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeArrayCreationExpressionWithInitializer ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeArrayCreationExpressionWithoutInitializer ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeArrayCreationExpressionWithInitializer ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeDimWithOrWithOutExprs ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeDimWithOrWithOutExpr ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeDims ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeOneDimLoop ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeFieldAccess ( false ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeFieldAccess ( true ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeMethodInvocationName ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeMethodInvocationNameWithTypeArguments ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeMethodInvocationPrimaryWithTypeArguments ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeMethodInvocationPrimary ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeMethodInvocationSuperWithTypeArguments ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeMethodInvocationSuper ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeArrayAccess ( true ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeArrayAccess ( false ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeArrayAccess ( false ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumePostfixExpression ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeUnaryExpression ( OperatorIds . PLUS , true ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeUnaryExpression ( OperatorIds . MINUS , true ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumePushPosition ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeUnaryExpression ( OperatorIds . PLUS ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeUnaryExpression ( OperatorIds . MINUS ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeUnaryExpression ( OperatorIds . PLUS , false ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeUnaryExpression ( OperatorIds . MINUS , false ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeUnaryExpression ( OperatorIds . TWIDDLE ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeUnaryExpression ( OperatorIds . NOT ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeCastExpressionWithPrimitiveType ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeCastExpressionWithGenericsArray ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeCastExpressionWithQualifiedGenericsArray ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeCastExpressionLL1 ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeCastExpressionWithNameArray ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeOnlyTypeArgumentsForCastExpression ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeInsideCastExpression ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeInsideCastExpressionLL1 ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeInsideCastExpressionWithQualifiedGenerics ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpression ( OperatorIds . MULTIPLY ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpression ( OperatorIds . DIVIDE ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpression ( OperatorIds . REMAINDER ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpression ( OperatorIds . PLUS ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpression ( OperatorIds . MINUS ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpression ( OperatorIds . LEFT_SHIFT ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpression ( OperatorIds . RIGHT_SHIFT ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpression ( OperatorIds . UNSIGNED_RIGHT_SHIFT ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpression ( OperatorIds . LESS ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpression ( OperatorIds . GREATER ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpression ( OperatorIds . LESS_EQUAL ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpression ( OperatorIds . GREATER_EQUAL ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeInstanceOfExpression ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEqualityExpression ( OperatorIds . EQUAL_EQUAL ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEqualityExpression ( OperatorIds . NOT_EQUAL ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpression ( OperatorIds . AND ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpression ( OperatorIds . XOR ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpression ( OperatorIds . OR ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpression ( OperatorIds . AND_AND ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpression ( OperatorIds . OR_OR ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeConditionalExpression ( OperatorIds . QUESTIONCOLON ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeAssignment ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } ignoreExpressionAssignment ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeAssignmentOperator ( EQUAL ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeAssignmentOperator ( MULTIPLY ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeAssignmentOperator ( DIVIDE ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeAssignmentOperator ( REMAINDER ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeAssignmentOperator ( PLUS ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeAssignmentOperator ( MINUS ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeAssignmentOperator ( LEFT_SHIFT ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeAssignmentOperator ( RIGHT_SHIFT ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeAssignmentOperator ( UNSIGNED_RIGHT_SHIFT ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeAssignmentOperator ( AND ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeAssignmentOperator ( XOR ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeAssignmentOperator ( OR ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEmptyExpression ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEmptyClassBodyDeclarationsopt ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeClassBodyDeclarationsopt ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeDefaultModifiers ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeModifiers ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEmptyBlockStatementsopt ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEmptyDimsopt ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEmptyArgumentListopt ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeFormalParameterListopt ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEmptyInterfaceMemberDeclarationsopt ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeInterfaceMemberDeclarationsopt ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeNestedType ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEmptyForInitopt ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEmptyForUpdateopt ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEmptyCatchesopt ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEnumDeclaration ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEnumHeader ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEnumHeaderName ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEnumHeaderNameWithTypeParameters ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEnumBodyNoConstants ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEnumBodyNoConstants ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEnumBodyWithConstants ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEnumBodyWithConstants ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEnumConstants ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEnumConstantHeaderName ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEnumConstantHeader ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEnumConstantWithClassBody ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEnumConstantNoClassBody ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeArguments ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEmptyArguments ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEnumDeclarations ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEmptyEnumDeclarations ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEnhancedForStatement ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEnhancedForStatement ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEnhancedForStatementHeaderInit ( false ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEnhancedForStatementHeaderInit ( true ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEnhancedForStatementHeader ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeImportDeclaration ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeSingleStaticImportDeclarationName ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeImportDeclaration ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeStaticImportOnDemandDeclarationName ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeTypeArguments ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeOnlyTypeArguments ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeTypeArgumentList1 ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeTypeArgumentList ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeTypeArgument ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeReferenceType1 ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeTypeArgumentReferenceType1 ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeTypeArgumentList2 ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeReferenceType2 ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeTypeArgumentReferenceType2 ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeTypeArgumentList3 ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeReferenceType3 ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeWildcard ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeWildcardWithBounds ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeWildcardBoundsExtends ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeWildcardBoundsSuper ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeWildcard1 ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeWildcard1WithBounds ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeWildcardBounds1Extends ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeWildcardBounds1Super ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeWildcard2 ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeWildcard2WithBounds ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeWildcardBounds2Extends ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeWildcardBounds2Super ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeWildcard3 ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeWildcard3WithBounds ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeWildcardBounds3Extends ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeWildcardBounds3Super ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeTypeParameterHeader ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeTypeParameters ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeTypeParameterList ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeTypeParameterWithExtends ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeTypeParameterWithExtendsAndBounds ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeAdditionalBoundList ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeAdditionalBound ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeTypeParameterList1 ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeTypeParameter1 ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeTypeParameter1WithExtends ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeTypeParameter1WithExtendsAndBounds ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeAdditionalBoundList1 ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeAdditionalBound1 ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeUnaryExpression ( OperatorIds . PLUS ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeUnaryExpression ( OperatorIds . MINUS ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeUnaryExpression ( OperatorIds . TWIDDLE ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeUnaryExpression ( OperatorIds . NOT ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpression ( OperatorIds . MULTIPLY ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpressionWithName ( OperatorIds . MULTIPLY ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpression ( OperatorIds . DIVIDE ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpressionWithName ( OperatorIds . DIVIDE ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpression ( OperatorIds . REMAINDER ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpressionWithName ( OperatorIds . REMAINDER ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpression ( OperatorIds . PLUS ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpressionWithName ( OperatorIds . PLUS ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpression ( OperatorIds . MINUS ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpressionWithName ( OperatorIds . MINUS ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpression ( OperatorIds . LEFT_SHIFT ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpressionWithName ( OperatorIds . LEFT_SHIFT ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpression ( OperatorIds . RIGHT_SHIFT ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpressionWithName ( OperatorIds . RIGHT_SHIFT ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpression ( OperatorIds . UNSIGNED_RIGHT_SHIFT ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpressionWithName ( OperatorIds . UNSIGNED_RIGHT_SHIFT ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpression ( OperatorIds . LESS ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpressionWithName ( OperatorIds . LESS ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpression ( OperatorIds . GREATER ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpressionWithName ( OperatorIds . GREATER ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpression ( OperatorIds . LESS_EQUAL ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpressionWithName ( OperatorIds . LESS_EQUAL ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpression ( OperatorIds . GREATER_EQUAL ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpressionWithName ( OperatorIds . GREATER_EQUAL ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeInstanceOfExpressionWithName ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeInstanceOfExpression ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEqualityExpression ( OperatorIds . EQUAL_EQUAL ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEqualityExpressionWithName ( OperatorIds . EQUAL_EQUAL ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEqualityExpression ( OperatorIds . NOT_EQUAL ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEqualityExpressionWithName ( OperatorIds . NOT_EQUAL ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpression ( OperatorIds . AND ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpressionWithName ( OperatorIds . AND ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpression ( OperatorIds . XOR ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpressionWithName ( OperatorIds . XOR ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpression ( OperatorIds . OR ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpressionWithName ( OperatorIds . OR ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpression ( OperatorIds . AND_AND ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpressionWithName ( OperatorIds . AND_AND ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpression ( OperatorIds . OR_OR ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeBinaryExpressionWithName ( OperatorIds . OR_OR ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeConditionalExpression ( OperatorIds . QUESTIONCOLON ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeConditionalExpressionWithName ( OperatorIds . QUESTIONCOLON ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeAnnotationTypeDeclarationHeaderName ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeAnnotationTypeDeclarationHeaderName ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeAnnotationTypeDeclarationHeader ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeAnnotationTypeDeclaration ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEmptyAnnotationTypeMemberDeclarationsopt ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeAnnotationTypeMemberDeclarationsopt ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeAnnotationTypeMemberDeclarations ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeMethodHeaderNameWithTypeParameters ( true ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeMethodHeaderName ( true ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEmptyMethodHeaderDefaultValue ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeMethodHeaderDefaultValue ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeMethodHeader ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeAnnotationTypeMemberDeclaration ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeAnnotationName ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeNormalAnnotation ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEmptyMemberValuePairsopt ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeMemberValuePairs ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeMemberValuePair ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEnterMemberValue ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeExitMemberValue ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeMemberValueAsName ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeMemberValueArrayInitializer ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeMemberValueArrayInitializer ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEmptyMemberValueArrayInitializer ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEmptyMemberValueArrayInitializer ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeEnterMemberValueArrayInitializer ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeMemberValues ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeMarkerAnnotation ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeSingleMemberAnnotationMemberValue ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeSingleMemberAnnotation ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeRecoveryMethodHeaderNameWithTypeParameters ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeRecoveryMethodHeaderName ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeMethodHeader ( ) ; break ; case <NUM_LIT> : if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } consumeMethodHeader ( ) ; break ; } } protected void consumeEnterInstanceCreationArgumentList ( ) { this . shouldDeferRecovery = true ; } protected void consumeSimpleAssertStatement ( ) { this . expressionLengthPtr -- ; pushOnAstStack ( new AssertStatement ( this . expressionStack [ this . expressionPtr -- ] , this . intStack [ this . intPtr -- ] ) ) ; } protected void consumeSingleMemberAnnotation ( ) { SingleMemberAnnotation singleMemberAnnotation = null ; int oldIndex = this . identifierPtr ; TypeReference typeReference = getAnnotationType ( ) ; singleMemberAnnotation = new SingleMemberAnnotation ( typeReference , this . intStack [ this . intPtr -- ] ) ; singleMemberAnnotation . memberValue = this . expressionStack [ this . expressionPtr -- ] ; this . expressionLengthPtr -- ; singleMemberAnnotation . declarationSourceEnd = this . rParenPos ; pushOnExpressionStack ( singleMemberAnnotation ) ; if ( this . currentElement != null ) { annotationRecoveryCheckPoint ( singleMemberAnnotation . sourceStart , singleMemberAnnotation . declarationSourceEnd ) ; if ( this . currentElement instanceof RecoveredAnnotation ) { this . currentElement = ( ( RecoveredAnnotation ) this . currentElement ) . addAnnotation ( singleMemberAnnotation , oldIndex ) ; } } if ( ! this . statementRecoveryActivated && this . options . sourceLevel < ClassFileConstants . JDK1_5 && this . lastErrorEndPositionBeforeRecovery < this . scanner . currentPosition ) { problemReporter ( ) . invalidUsageOfAnnotation ( singleMemberAnnotation ) ; } this . recordStringLiterals = true ; } protected void consumeSingleMemberAnnotationMemberValue ( ) { if ( this . currentElement != null && this . currentElement instanceof RecoveredAnnotation ) { RecoveredAnnotation recoveredAnnotation = ( RecoveredAnnotation ) this . currentElement ; recoveredAnnotation . setKind ( RecoveredAnnotation . SINGLE_MEMBER ) ; } } protected void consumeSingleResource ( ) { } protected void consumeSingleStaticImportDeclarationName ( ) { ImportReference impt ; int length ; char [ ] [ ] tokens = new char [ length = this . identifierLengthStack [ this . identifierLengthPtr -- ] ] [ ] ; this . identifierPtr -= length ; long [ ] positions = new long [ length ] ; System . arraycopy ( this . identifierStack , this . identifierPtr + <NUM_LIT:1> , tokens , <NUM_LIT:0> , length ) ; System . arraycopy ( this . identifierPositionStack , this . identifierPtr + <NUM_LIT:1> , positions , <NUM_LIT:0> , length ) ; pushOnAstStack ( impt = new ImportReference ( tokens , positions , false , ClassFileConstants . AccStatic ) ) ; this . modifiers = ClassFileConstants . AccDefault ; this . modifiersSourceStart = - <NUM_LIT:1> ; if ( this . currentToken == TokenNameSEMICOLON ) { impt . declarationSourceEnd = this . scanner . currentPosition - <NUM_LIT:1> ; } else { impt . declarationSourceEnd = impt . sourceEnd ; } impt . declarationEnd = impt . declarationSourceEnd ; impt . declarationSourceStart = this . intStack [ this . intPtr -- ] ; if ( ! this . statementRecoveryActivated && this . options . sourceLevel < ClassFileConstants . JDK1_5 && this . lastErrorEndPositionBeforeRecovery < this . scanner . currentPosition ) { impt . modifiers = ClassFileConstants . AccDefault ; problemReporter ( ) . invalidUsageOfStaticImports ( impt ) ; } if ( this . currentElement != null ) { this . lastCheckPoint = impt . declarationSourceEnd + <NUM_LIT:1> ; this . currentElement = this . currentElement . add ( impt , <NUM_LIT:0> ) ; this . lastIgnoredToken = - <NUM_LIT:1> ; this . restartRecovery = true ; } } protected void consumeSingleTypeImportDeclarationName ( ) { ImportReference impt ; int length ; char [ ] [ ] tokens = new char [ length = this . identifierLengthStack [ this . identifierLengthPtr -- ] ] [ ] ; this . identifierPtr -= length ; long [ ] positions = new long [ length ] ; System . arraycopy ( this . identifierStack , this . identifierPtr + <NUM_LIT:1> , tokens , <NUM_LIT:0> , length ) ; System . arraycopy ( this . identifierPositionStack , this . identifierPtr + <NUM_LIT:1> , positions , <NUM_LIT:0> , length ) ; pushOnAstStack ( impt = new ImportReference ( tokens , positions , false , ClassFileConstants . AccDefault ) ) ; if ( this . currentToken == TokenNameSEMICOLON ) { impt . declarationSourceEnd = this . scanner . currentPosition - <NUM_LIT:1> ; } else { impt . declarationSourceEnd = impt . sourceEnd ; } impt . declarationEnd = impt . declarationSourceEnd ; impt . declarationSourceStart = this . intStack [ this . intPtr -- ] ; if ( this . currentElement != null ) { this . lastCheckPoint = impt . declarationSourceEnd + <NUM_LIT:1> ; this . currentElement = this . currentElement . add ( impt , <NUM_LIT:0> ) ; this . lastIgnoredToken = - <NUM_LIT:1> ; this . restartRecovery = true ; } } protected void consumeStatementBreak ( ) { pushOnAstStack ( new BreakStatement ( null , this . intStack [ this . intPtr -- ] , this . endStatementPosition ) ) ; if ( this . pendingRecoveredType != null ) { if ( this . pendingRecoveredType . allocation == null && this . endPosition <= this . pendingRecoveredType . declarationSourceEnd ) { this . astStack [ this . astPtr ] = this . pendingRecoveredType ; this . pendingRecoveredType = null ; return ; } this . pendingRecoveredType = null ; } } protected void consumeStatementBreakWithLabel ( ) { pushOnAstStack ( new BreakStatement ( this . identifierStack [ this . identifierPtr -- ] , this . intStack [ this . intPtr -- ] , this . endStatementPosition ) ) ; this . identifierLengthPtr -- ; } protected void consumeStatementCatch ( ) { this . astLengthPtr -- ; this . listLength = <NUM_LIT:0> ; } protected void consumeStatementContinue ( ) { pushOnAstStack ( new ContinueStatement ( null , this . intStack [ this . intPtr -- ] , this . endStatementPosition ) ) ; } protected void consumeStatementContinueWithLabel ( ) { pushOnAstStack ( new ContinueStatement ( this . identifierStack [ this . identifierPtr -- ] , this . intStack [ this . intPtr -- ] , this . endStatementPosition ) ) ; this . identifierLengthPtr -- ; } protected void consumeStatementDo ( ) { this . intPtr -- ; Statement statement = ( Statement ) this . astStack [ this . astPtr ] ; this . expressionLengthPtr -- ; this . astStack [ this . astPtr ] = new DoStatement ( this . expressionStack [ this . expressionPtr -- ] , statement , this . intStack [ this . intPtr -- ] , this . endStatementPosition ) ; } protected void consumeStatementExpressionList ( ) { concatExpressionLists ( ) ; } protected void consumeStatementFor ( ) { int length ; Expression cond = null ; Statement [ ] inits , updates ; boolean scope = true ; this . astLengthPtr -- ; Statement statement = ( Statement ) this . astStack [ this . astPtr -- ] ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) == <NUM_LIT:0> ) { updates = null ; } else { this . expressionPtr -= length ; System . arraycopy ( this . expressionStack , this . expressionPtr + <NUM_LIT:1> , updates = new Statement [ length ] , <NUM_LIT:0> , length ) ; } if ( this . expressionLengthStack [ this . expressionLengthPtr -- ] != <NUM_LIT:0> ) cond = this . expressionStack [ this . expressionPtr -- ] ; if ( ( length = this . astLengthStack [ this . astLengthPtr -- ] ) == <NUM_LIT:0> ) { inits = null ; scope = false ; } else { if ( length == - <NUM_LIT:1> ) { scope = false ; length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ; this . expressionPtr -= length ; System . arraycopy ( this . expressionStack , this . expressionPtr + <NUM_LIT:1> , inits = new Statement [ length ] , <NUM_LIT:0> , length ) ; } else { this . astPtr -= length ; System . arraycopy ( this . astStack , this . astPtr + <NUM_LIT:1> , inits = new Statement [ length ] , <NUM_LIT:0> , length ) ; } } pushOnAstStack ( new ForStatement ( inits , cond , updates , statement , scope , this . intStack [ this . intPtr -- ] , this . endStatementPosition ) ) ; } protected void consumeStatementIfNoElse ( ) { this . expressionLengthPtr -- ; Statement thenStatement = ( Statement ) this . astStack [ this . astPtr ] ; this . astStack [ this . astPtr ] = new IfStatement ( this . expressionStack [ this . expressionPtr -- ] , thenStatement , this . intStack [ this . intPtr -- ] , this . endStatementPosition ) ; } protected void consumeStatementIfWithElse ( ) { this . expressionLengthPtr -- ; this . astLengthPtr -- ; this . astStack [ -- this . astPtr ] = new IfStatement ( this . expressionStack [ this . expressionPtr -- ] , ( Statement ) this . astStack [ this . astPtr ] , ( Statement ) this . astStack [ this . astPtr + <NUM_LIT:1> ] , this . intStack [ this . intPtr -- ] , this . endStatementPosition ) ; } protected void consumeStatementLabel ( ) { Statement statement = ( Statement ) this . astStack [ this . astPtr ] ; this . astStack [ this . astPtr ] = new LabeledStatement ( this . identifierStack [ this . identifierPtr ] , statement , this . identifierPositionStack [ this . identifierPtr -- ] , this . endStatementPosition ) ; this . identifierLengthPtr -- ; } protected void consumeStatementReturn ( ) { if ( this . expressionLengthStack [ this . expressionLengthPtr -- ] != <NUM_LIT:0> ) { pushOnAstStack ( new ReturnStatement ( this . expressionStack [ this . expressionPtr -- ] , this . intStack [ this . intPtr -- ] , this . endStatementPosition ) ) ; } else { pushOnAstStack ( new ReturnStatement ( null , this . intStack [ this . intPtr -- ] , this . endStatementPosition ) ) ; } } protected void consumeStatementSwitch ( ) { int length ; SwitchStatement switchStatement = new SwitchStatement ( ) ; this . expressionLengthPtr -- ; switchStatement . expression = this . expressionStack [ this . expressionPtr -- ] ; if ( ( length = this . astLengthStack [ this . astLengthPtr -- ] ) != <NUM_LIT:0> ) { this . astPtr -= length ; System . arraycopy ( this . astStack , this . astPtr + <NUM_LIT:1> , switchStatement . statements = new Statement [ length ] , <NUM_LIT:0> , length ) ; } switchStatement . explicitDeclarations = this . realBlockStack [ this . realBlockPtr -- ] ; pushOnAstStack ( switchStatement ) ; switchStatement . blockStart = this . intStack [ this . intPtr -- ] ; switchStatement . sourceStart = this . intStack [ this . intPtr -- ] ; switchStatement . sourceEnd = this . endStatementPosition ; if ( length == <NUM_LIT:0> && ! containsComment ( switchStatement . blockStart , switchStatement . sourceEnd ) ) { switchStatement . bits |= ASTNode . UndocumentedEmptyBlock ; } } protected void consumeStatementSynchronized ( ) { if ( this . astLengthStack [ this . astLengthPtr ] == <NUM_LIT:0> ) { this . astLengthStack [ this . astLengthPtr ] = <NUM_LIT:1> ; this . expressionLengthPtr -- ; this . astStack [ ++ this . astPtr ] = new SynchronizedStatement ( this . expressionStack [ this . expressionPtr -- ] , null , this . intStack [ this . intPtr -- ] , this . endStatementPosition ) ; } else { this . expressionLengthPtr -- ; this . astStack [ this . astPtr ] = new SynchronizedStatement ( this . expressionStack [ this . expressionPtr -- ] , ( Block ) this . astStack [ this . astPtr ] , this . intStack [ this . intPtr -- ] , this . endStatementPosition ) ; } resetModifiers ( ) ; } protected void consumeStatementThrow ( ) { this . expressionLengthPtr -- ; pushOnAstStack ( new ThrowStatement ( this . expressionStack [ this . expressionPtr -- ] , this . intStack [ this . intPtr -- ] , this . endStatementPosition ) ) ; } protected void consumeStatementTry ( boolean withFinally , boolean hasResources ) { int length ; TryStatement tryStmt = new TryStatement ( ) ; if ( withFinally ) { this . astLengthPtr -- ; tryStmt . finallyBlock = ( Block ) this . astStack [ this . astPtr -- ] ; } if ( ( length = this . astLengthStack [ this . astLengthPtr -- ] ) != <NUM_LIT:0> ) { if ( length == <NUM_LIT:1> ) { tryStmt . catchBlocks = new Block [ ] { ( Block ) this . astStack [ this . astPtr -- ] } ; tryStmt . catchArguments = new Argument [ ] { ( Argument ) this . astStack [ this . astPtr -- ] } ; } else { Block [ ] bks = ( tryStmt . catchBlocks = new Block [ length ] ) ; Argument [ ] args = ( tryStmt . catchArguments = new Argument [ length ] ) ; while ( length -- > <NUM_LIT:0> ) { bks [ length ] = ( Block ) this . astStack [ this . astPtr -- ] ; args [ length ] = ( Argument ) this . astStack [ this . astPtr -- ] ; } } } this . astLengthPtr -- ; tryStmt . tryBlock = ( Block ) this . astStack [ this . astPtr -- ] ; if ( hasResources ) { length = this . astLengthStack [ this . astLengthPtr -- ] ; LocalDeclaration [ ] resources = new LocalDeclaration [ length ] ; System . arraycopy ( this . astStack , ( this . astPtr -= length ) + <NUM_LIT:1> , resources , <NUM_LIT:0> , length ) ; tryStmt . resources = resources ; if ( this . options . sourceLevel < ClassFileConstants . JDK1_7 ) { problemReporter ( ) . autoManagedResourcesNotBelow17 ( resources ) ; } } tryStmt . sourceEnd = this . endStatementPosition ; tryStmt . sourceStart = this . intStack [ this . intPtr -- ] ; pushOnAstStack ( tryStmt ) ; } protected void consumeStatementWhile ( ) { this . expressionLengthPtr -- ; Statement statement = ( Statement ) this . astStack [ this . astPtr ] ; this . astStack [ this . astPtr ] = new WhileStatement ( this . expressionStack [ this . expressionPtr -- ] , statement , this . intStack [ this . intPtr -- ] , this . endStatementPosition ) ; } protected void consumeStaticImportOnDemandDeclarationName ( ) { ImportReference impt ; int length ; char [ ] [ ] tokens = new char [ length = this . identifierLengthStack [ this . identifierLengthPtr -- ] ] [ ] ; this . identifierPtr -= length ; long [ ] positions = new long [ length ] ; System . arraycopy ( this . identifierStack , this . identifierPtr + <NUM_LIT:1> , tokens , <NUM_LIT:0> , length ) ; System . arraycopy ( this . identifierPositionStack , this . identifierPtr + <NUM_LIT:1> , positions , <NUM_LIT:0> , length ) ; pushOnAstStack ( impt = new ImportReference ( tokens , positions , true , ClassFileConstants . AccStatic ) ) ; impt . trailingStarPosition = this . intStack [ this . intPtr -- ] ; this . modifiers = ClassFileConstants . AccDefault ; this . modifiersSourceStart = - <NUM_LIT:1> ; if ( this . currentToken == TokenNameSEMICOLON ) { impt . declarationSourceEnd = this . scanner . currentPosition - <NUM_LIT:1> ; } else { impt . declarationSourceEnd = impt . sourceEnd ; } impt . declarationEnd = impt . declarationSourceEnd ; impt . declarationSourceStart = this . intStack [ this . intPtr -- ] ; if ( ! this . statementRecoveryActivated && this . options . sourceLevel < ClassFileConstants . JDK1_5 && this . lastErrorEndPositionBeforeRecovery < this . scanner . currentPosition ) { impt . modifiers = ClassFileConstants . AccDefault ; problemReporter ( ) . invalidUsageOfStaticImports ( impt ) ; } if ( this . currentElement != null ) { this . lastCheckPoint = impt . declarationSourceEnd + <NUM_LIT:1> ; this . currentElement = this . currentElement . add ( impt , <NUM_LIT:0> ) ; this . lastIgnoredToken = - <NUM_LIT:1> ; this . restartRecovery = true ; } } protected void consumeStaticInitializer ( ) { Block block = ( Block ) this . astStack [ this . astPtr ] ; if ( this . diet ) block . bits &= ~ ASTNode . UndocumentedEmptyBlock ; Initializer initializer = new Initializer ( block , ClassFileConstants . AccStatic ) ; this . astStack [ this . astPtr ] = initializer ; initializer . sourceEnd = this . endStatementPosition ; initializer . declarationSourceEnd = flushCommentsDefinedPriorTo ( this . endStatementPosition ) ; this . nestedMethod [ this . nestedType ] -- ; initializer . declarationSourceStart = this . intStack [ this . intPtr -- ] ; initializer . bodyStart = this . intStack [ this . intPtr -- ] ; initializer . bodyEnd = this . endPosition ; initializer . javadoc = this . javadoc ; this . javadoc = null ; if ( this . currentElement != null ) { this . lastCheckPoint = initializer . declarationSourceEnd ; this . currentElement = this . currentElement . add ( initializer , <NUM_LIT:0> ) ; this . lastIgnoredToken = - <NUM_LIT:1> ; } } protected void consumeStaticOnly ( ) { int savedModifiersSourceStart = this . modifiersSourceStart ; checkComment ( ) ; if ( this . modifiersSourceStart >= savedModifiersSourceStart ) { this . modifiersSourceStart = savedModifiersSourceStart ; } pushOnIntStack ( this . scanner . currentPosition ) ; pushOnIntStack ( this . modifiersSourceStart >= <NUM_LIT:0> ? this . modifiersSourceStart : this . scanner . startPosition ) ; jumpOverMethodBody ( ) ; this . nestedMethod [ this . nestedType ] ++ ; resetModifiers ( ) ; this . expressionLengthPtr -- ; if ( this . currentElement != null ) { this . recoveredStaticInitializerStart = this . intStack [ this . intPtr ] ; } } protected void consumeSwitchBlock ( ) { concatNodeLists ( ) ; } protected void consumeSwitchBlockStatement ( ) { concatNodeLists ( ) ; } protected void consumeSwitchBlockStatements ( ) { concatNodeLists ( ) ; } protected void consumeSwitchLabels ( ) { optimizedConcatNodeLists ( ) ; } protected void consumeToken ( int type ) { switch ( type ) { case TokenNameIdentifier : pushIdentifier ( ) ; if ( this . scanner . useAssertAsAnIndentifier && this . lastErrorEndPositionBeforeRecovery < this . scanner . currentPosition ) { long positions = this . identifierPositionStack [ this . identifierPtr ] ; if ( ! this . statementRecoveryActivated ) problemReporter ( ) . useAssertAsAnIdentifier ( ( int ) ( positions > > > <NUM_LIT:32> ) , ( int ) positions ) ; } if ( this . scanner . useEnumAsAnIndentifier && this . lastErrorEndPositionBeforeRecovery < this . scanner . currentPosition ) { long positions = this . identifierPositionStack [ this . identifierPtr ] ; if ( ! this . statementRecoveryActivated ) problemReporter ( ) . useEnumAsAnIdentifier ( ( int ) ( positions > > > <NUM_LIT:32> ) , ( int ) positions ) ; } break ; case TokenNameinterface : pushOnIntStack ( this . scanner . currentPosition - <NUM_LIT:1> ) ; pushOnIntStack ( this . scanner . startPosition ) ; break ; case TokenNameabstract : checkAndSetModifiers ( ClassFileConstants . AccAbstract ) ; pushOnExpressionStackLengthStack ( <NUM_LIT:0> ) ; break ; case TokenNamestrictfp : checkAndSetModifiers ( ClassFileConstants . AccStrictfp ) ; pushOnExpressionStackLengthStack ( <NUM_LIT:0> ) ; break ; case TokenNamefinal : checkAndSetModifiers ( ClassFileConstants . AccFinal ) ; pushOnExpressionStackLengthStack ( <NUM_LIT:0> ) ; break ; case TokenNamenative : checkAndSetModifiers ( ClassFileConstants . AccNative ) ; pushOnExpressionStackLengthStack ( <NUM_LIT:0> ) ; break ; case TokenNameprivate : checkAndSetModifiers ( ClassFileConstants . AccPrivate ) ; pushOnExpressionStackLengthStack ( <NUM_LIT:0> ) ; break ; case TokenNameprotected : checkAndSetModifiers ( ClassFileConstants . AccProtected ) ; pushOnExpressionStackLengthStack ( <NUM_LIT:0> ) ; break ; case TokenNamepublic : checkAndSetModifiers ( ClassFileConstants . AccPublic ) ; pushOnExpressionStackLengthStack ( <NUM_LIT:0> ) ; break ; case TokenNametransient : checkAndSetModifiers ( ClassFileConstants . AccTransient ) ; pushOnExpressionStackLengthStack ( <NUM_LIT:0> ) ; break ; case TokenNamevolatile : checkAndSetModifiers ( ClassFileConstants . AccVolatile ) ; pushOnExpressionStackLengthStack ( <NUM_LIT:0> ) ; break ; case TokenNamestatic : checkAndSetModifiers ( ClassFileConstants . AccStatic ) ; pushOnExpressionStackLengthStack ( <NUM_LIT:0> ) ; break ; case TokenNamesynchronized : this . synchronizedBlockSourceStart = this . scanner . startPosition ; checkAndSetModifiers ( ClassFileConstants . AccSynchronized ) ; pushOnExpressionStackLengthStack ( <NUM_LIT:0> ) ; break ; case TokenNamevoid : pushIdentifier ( - T_void ) ; pushOnIntStack ( this . scanner . currentPosition - <NUM_LIT:1> ) ; pushOnIntStack ( this . scanner . startPosition ) ; break ; case TokenNameboolean : pushIdentifier ( - T_boolean ) ; pushOnIntStack ( this . scanner . currentPosition - <NUM_LIT:1> ) ; pushOnIntStack ( this . scanner . startPosition ) ; break ; case TokenNamebyte : pushIdentifier ( - T_byte ) ; pushOnIntStack ( this . scanner . currentPosition - <NUM_LIT:1> ) ; pushOnIntStack ( this . scanner . startPosition ) ; break ; case TokenNamechar : pushIdentifier ( - T_char ) ; pushOnIntStack ( this . scanner . currentPosition - <NUM_LIT:1> ) ; pushOnIntStack ( this . scanner . startPosition ) ; break ; case TokenNamedouble : pushIdentifier ( - T_double ) ; pushOnIntStack ( this . scanner . currentPosition - <NUM_LIT:1> ) ; pushOnIntStack ( this . scanner . startPosition ) ; break ; case TokenNamefloat : pushIdentifier ( - T_float ) ; pushOnIntStack ( this . scanner . currentPosition - <NUM_LIT:1> ) ; pushOnIntStack ( this . scanner . startPosition ) ; break ; case TokenNameint : pushIdentifier ( - T_int ) ; pushOnIntStack ( this . scanner . currentPosition - <NUM_LIT:1> ) ; pushOnIntStack ( this . scanner . startPosition ) ; break ; case TokenNamelong : pushIdentifier ( - T_long ) ; pushOnIntStack ( this . scanner . currentPosition - <NUM_LIT:1> ) ; pushOnIntStack ( this . scanner . startPosition ) ; break ; case TokenNameshort : pushIdentifier ( - T_short ) ; pushOnIntStack ( this . scanner . currentPosition - <NUM_LIT:1> ) ; pushOnIntStack ( this . scanner . startPosition ) ; break ; case TokenNameIntegerLiteral : pushOnExpressionStack ( IntLiteral . buildIntLiteral ( this . scanner . getCurrentTokenSource ( ) , this . scanner . startPosition , this . scanner . currentPosition - <NUM_LIT:1> ) ) ; break ; case TokenNameLongLiteral : pushOnExpressionStack ( LongLiteral . buildLongLiteral ( this . scanner . getCurrentTokenSource ( ) , this . scanner . startPosition , this . scanner . currentPosition - <NUM_LIT:1> ) ) ; break ; case TokenNameFloatingPointLiteral : pushOnExpressionStack ( new FloatLiteral ( this . scanner . getCurrentTokenSource ( ) , this . scanner . startPosition , this . scanner . currentPosition - <NUM_LIT:1> ) ) ; break ; case TokenNameDoubleLiteral : pushOnExpressionStack ( new DoubleLiteral ( this . scanner . getCurrentTokenSource ( ) , this . scanner . startPosition , this . scanner . currentPosition - <NUM_LIT:1> ) ) ; break ; case TokenNameCharacterLiteral : pushOnExpressionStack ( new CharLiteral ( this . scanner . getCurrentTokenSource ( ) , this . scanner . startPosition , this . scanner . currentPosition - <NUM_LIT:1> ) ) ; break ; case TokenNameStringLiteral : StringLiteral stringLiteral ; if ( this . recordStringLiterals && this . checkExternalizeStrings && this . lastPosistion < this . scanner . currentPosition && ! this . statementRecoveryActivated ) { stringLiteral = createStringLiteral ( this . scanner . getCurrentTokenSourceString ( ) , this . scanner . startPosition , this . scanner . currentPosition - <NUM_LIT:1> , Util . getLineNumber ( this . scanner . startPosition , this . scanner . lineEnds , <NUM_LIT:0> , this . scanner . linePtr ) ) ; this . compilationUnit . recordStringLiteral ( stringLiteral , this . currentElement != null ) ; } else { stringLiteral = createStringLiteral ( this . scanner . getCurrentTokenSourceString ( ) , this . scanner . startPosition , this . scanner . currentPosition - <NUM_LIT:1> , <NUM_LIT:0> ) ; } pushOnExpressionStack ( stringLiteral ) ; break ; case TokenNamefalse : pushOnExpressionStack ( new FalseLiteral ( this . scanner . startPosition , this . scanner . currentPosition - <NUM_LIT:1> ) ) ; break ; case TokenNametrue : pushOnExpressionStack ( new TrueLiteral ( this . scanner . startPosition , this . scanner . currentPosition - <NUM_LIT:1> ) ) ; break ; case TokenNamenull : pushOnExpressionStack ( new NullLiteral ( this . scanner . startPosition , this . scanner . currentPosition - <NUM_LIT:1> ) ) ; break ; case TokenNamesuper : case TokenNamethis : this . endPosition = this . scanner . currentPosition - <NUM_LIT:1> ; pushOnIntStack ( this . scanner . startPosition ) ; break ; case TokenNameassert : case TokenNameimport : case TokenNamepackage : case TokenNamethrow : case TokenNamedo : case TokenNameif : case TokenNamefor : case TokenNameswitch : case TokenNametry : case TokenNamewhile : case TokenNamebreak : case TokenNamecontinue : case TokenNamereturn : case TokenNamecase : pushOnIntStack ( this . scanner . startPosition ) ; break ; case TokenNamenew : resetModifiers ( ) ; pushOnIntStack ( this . scanner . startPosition ) ; break ; case TokenNameclass : pushOnIntStack ( this . scanner . currentPosition - <NUM_LIT:1> ) ; pushOnIntStack ( this . scanner . startPosition ) ; break ; case TokenNameenum : pushOnIntStack ( this . scanner . currentPosition - <NUM_LIT:1> ) ; pushOnIntStack ( this . scanner . startPosition ) ; break ; case TokenNamedefault : pushOnIntStack ( this . scanner . startPosition ) ; pushOnIntStack ( this . scanner . currentPosition - <NUM_LIT:1> ) ; break ; case TokenNameRBRACKET : this . endPosition = this . scanner . startPosition ; this . endStatementPosition = this . scanner . currentPosition - <NUM_LIT:1> ; break ; case TokenNameLBRACE : this . endStatementPosition = this . scanner . currentPosition - <NUM_LIT:1> ; case TokenNamePLUS : case TokenNameMINUS : case TokenNameNOT : case TokenNameTWIDDLE : this . endPosition = this . scanner . startPosition ; break ; case TokenNamePLUS_PLUS : case TokenNameMINUS_MINUS : this . endPosition = this . scanner . startPosition ; this . endStatementPosition = this . scanner . currentPosition - <NUM_LIT:1> ; break ; case TokenNameRBRACE : case TokenNameSEMICOLON : this . endStatementPosition = this . scanner . currentPosition - <NUM_LIT:1> ; this . endPosition = this . scanner . startPosition - <NUM_LIT:1> ; break ; case TokenNameRPAREN : this . rParenPos = this . scanner . currentPosition - <NUM_LIT:1> ; break ; case TokenNameLPAREN : this . lParenPos = this . scanner . startPosition ; break ; case TokenNameAT : pushOnIntStack ( this . scanner . startPosition ) ; break ; case TokenNameQUESTION : pushOnIntStack ( this . scanner . startPosition ) ; pushOnIntStack ( this . scanner . currentPosition - <NUM_LIT:1> ) ; break ; case TokenNameLESS : pushOnIntStack ( this . scanner . startPosition ) ; break ; case TokenNameELLIPSIS : pushOnIntStack ( this . scanner . currentPosition - <NUM_LIT:1> ) ; break ; case TokenNameEQUAL : if ( this . currentElement != null && this . currentElement instanceof RecoveredAnnotation ) { RecoveredAnnotation recoveredAnnotation = ( RecoveredAnnotation ) this . currentElement ; if ( recoveredAnnotation . memberValuPairEqualEnd == - <NUM_LIT:1> ) { recoveredAnnotation . memberValuPairEqualEnd = this . scanner . currentPosition - <NUM_LIT:1> ; } } break ; case TokenNameMULTIPLY : pushOnIntStack ( this . scanner . currentPosition - <NUM_LIT:1> ) ; break ; } } protected void consumeTypeArgument ( ) { pushOnGenericsStack ( getTypeReference ( this . intStack [ this . intPtr -- ] ) ) ; } protected void consumeTypeArgumentList ( ) { concatGenericsLists ( ) ; } protected void consumeTypeArgumentList1 ( ) { concatGenericsLists ( ) ; } protected void consumeTypeArgumentList2 ( ) { concatGenericsLists ( ) ; } protected void consumeTypeArgumentList3 ( ) { concatGenericsLists ( ) ; } protected void consumeTypeArgumentReferenceType1 ( ) { concatGenericsLists ( ) ; pushOnGenericsStack ( getTypeReference ( <NUM_LIT:0> ) ) ; this . intPtr -- ; } protected void consumeTypeArgumentReferenceType2 ( ) { concatGenericsLists ( ) ; pushOnGenericsStack ( getTypeReference ( <NUM_LIT:0> ) ) ; this . intPtr -- ; } protected void consumeTypeArguments ( ) { concatGenericsLists ( ) ; this . intPtr -- ; if ( ! this . statementRecoveryActivated && this . options . sourceLevel < ClassFileConstants . JDK1_5 && this . lastErrorEndPositionBeforeRecovery < this . scanner . currentPosition ) { int length = this . genericsLengthStack [ this . genericsLengthPtr ] ; problemReporter ( ) . invalidUsageOfTypeArguments ( ( TypeReference ) this . genericsStack [ this . genericsPtr - length + <NUM_LIT:1> ] , ( TypeReference ) this . genericsStack [ this . genericsPtr ] ) ; } } protected void consumeTypeDeclarations ( ) { concatNodeLists ( ) ; } protected void consumeTypeHeaderNameWithTypeParameters ( ) { TypeDeclaration typeDecl = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; int length = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; this . genericsPtr -= length ; System . arraycopy ( this . genericsStack , this . genericsPtr + <NUM_LIT:1> , typeDecl . typeParameters = new TypeParameter [ length ] , <NUM_LIT:0> , length ) ; typeDecl . bodyStart = typeDecl . typeParameters [ length - <NUM_LIT:1> ] . declarationSourceEnd + <NUM_LIT:1> ; this . listTypeParameterLength = <NUM_LIT:0> ; if ( this . currentElement != null ) { if ( this . currentElement instanceof RecoveredType ) { RecoveredType recoveredType = ( RecoveredType ) this . currentElement ; recoveredType . pendingTypeParameters = null ; this . lastCheckPoint = typeDecl . bodyStart ; } else { this . lastCheckPoint = typeDecl . bodyStart ; this . currentElement = this . currentElement . add ( typeDecl , <NUM_LIT:0> ) ; this . lastIgnoredToken = - <NUM_LIT:1> ; } } } protected void consumeTypeImportOnDemandDeclarationName ( ) { ImportReference impt ; int length ; char [ ] [ ] tokens = new char [ length = this . identifierLengthStack [ this . identifierLengthPtr -- ] ] [ ] ; this . identifierPtr -= length ; long [ ] positions = new long [ length ] ; System . arraycopy ( this . identifierStack , this . identifierPtr + <NUM_LIT:1> , tokens , <NUM_LIT:0> , length ) ; System . arraycopy ( this . identifierPositionStack , this . identifierPtr + <NUM_LIT:1> , positions , <NUM_LIT:0> , length ) ; pushOnAstStack ( impt = new ImportReference ( tokens , positions , true , ClassFileConstants . AccDefault ) ) ; impt . trailingStarPosition = this . intStack [ this . intPtr -- ] ; if ( this . currentToken == TokenNameSEMICOLON ) { impt . declarationSourceEnd = this . scanner . currentPosition - <NUM_LIT:1> ; } else { impt . declarationSourceEnd = impt . sourceEnd ; } impt . declarationEnd = impt . declarationSourceEnd ; impt . declarationSourceStart = this . intStack [ this . intPtr -- ] ; if ( this . currentElement != null ) { this . lastCheckPoint = impt . declarationSourceEnd + <NUM_LIT:1> ; this . currentElement = this . currentElement . add ( impt , <NUM_LIT:0> ) ; this . lastIgnoredToken = - <NUM_LIT:1> ; this . restartRecovery = true ; } } protected void consumeTypeParameter1 ( ) { } protected void consumeTypeParameter1WithExtends ( ) { TypeReference superType = ( TypeReference ) this . genericsStack [ this . genericsPtr -- ] ; this . genericsLengthPtr -- ; TypeParameter typeParameter = ( TypeParameter ) this . genericsStack [ this . genericsPtr ] ; typeParameter . declarationSourceEnd = superType . sourceEnd ; typeParameter . type = superType ; superType . bits |= ASTNode . IsSuperType ; this . genericsStack [ this . genericsPtr ] = typeParameter ; } protected void consumeTypeParameter1WithExtendsAndBounds ( ) { int additionalBoundsLength = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; TypeReference [ ] bounds = new TypeReference [ additionalBoundsLength ] ; this . genericsPtr -= additionalBoundsLength ; System . arraycopy ( this . genericsStack , this . genericsPtr + <NUM_LIT:1> , bounds , <NUM_LIT:0> , additionalBoundsLength ) ; TypeReference superType = getTypeReference ( this . intStack [ this . intPtr -- ] ) ; TypeParameter typeParameter = ( TypeParameter ) this . genericsStack [ this . genericsPtr ] ; typeParameter . declarationSourceEnd = bounds [ additionalBoundsLength - <NUM_LIT:1> ] . sourceEnd ; typeParameter . type = superType ; superType . bits |= ASTNode . IsSuperType ; typeParameter . bounds = bounds ; for ( int i = <NUM_LIT:0> , max = bounds . length ; i < max ; i ++ ) { bounds [ i ] . bits |= ASTNode . IsSuperType ; } } protected void consumeTypeParameterHeader ( ) { TypeParameter typeParameter = new TypeParameter ( ) ; long pos = this . identifierPositionStack [ this . identifierPtr ] ; final int end = ( int ) pos ; typeParameter . declarationSourceEnd = end ; typeParameter . sourceEnd = end ; final int start = ( int ) ( pos > > > <NUM_LIT:32> ) ; typeParameter . declarationSourceStart = start ; typeParameter . sourceStart = start ; typeParameter . name = this . identifierStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; pushOnGenericsStack ( typeParameter ) ; this . listTypeParameterLength ++ ; } protected void consumeTypeParameterList ( ) { concatGenericsLists ( ) ; } protected void consumeTypeParameterList1 ( ) { concatGenericsLists ( ) ; } protected void consumeTypeParameters ( ) { int startPos = this . intStack [ this . intPtr -- ] ; if ( this . currentElement != null ) { if ( this . currentElement instanceof RecoveredType ) { RecoveredType recoveredType = ( RecoveredType ) this . currentElement ; int length = this . genericsLengthStack [ this . genericsLengthPtr ] ; TypeParameter [ ] typeParameters = new TypeParameter [ length ] ; System . arraycopy ( this . genericsStack , this . genericsPtr - length + <NUM_LIT:1> , typeParameters , <NUM_LIT:0> , length ) ; recoveredType . add ( typeParameters , startPos ) ; } } if ( ! this . statementRecoveryActivated && this . options . sourceLevel < ClassFileConstants . JDK1_5 && this . lastErrorEndPositionBeforeRecovery < this . scanner . currentPosition ) { int length = this . genericsLengthStack [ this . genericsLengthPtr ] ; problemReporter ( ) . invalidUsageOfTypeParameters ( ( TypeParameter ) this . genericsStack [ this . genericsPtr - length + <NUM_LIT:1> ] , ( TypeParameter ) this . genericsStack [ this . genericsPtr ] ) ; } } protected void consumeTypeParameterWithExtends ( ) { TypeReference superType = getTypeReference ( this . intStack [ this . intPtr -- ] ) ; TypeParameter typeParameter = ( TypeParameter ) this . genericsStack [ this . genericsPtr ] ; typeParameter . declarationSourceEnd = superType . sourceEnd ; typeParameter . type = superType ; superType . bits |= ASTNode . IsSuperType ; } protected void consumeTypeParameterWithExtendsAndBounds ( ) { int additionalBoundsLength = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; TypeReference [ ] bounds = new TypeReference [ additionalBoundsLength ] ; this . genericsPtr -= additionalBoundsLength ; System . arraycopy ( this . genericsStack , this . genericsPtr + <NUM_LIT:1> , bounds , <NUM_LIT:0> , additionalBoundsLength ) ; TypeReference superType = getTypeReference ( this . intStack [ this . intPtr -- ] ) ; TypeParameter typeParameter = ( TypeParameter ) this . genericsStack [ this . genericsPtr ] ; typeParameter . type = superType ; superType . bits |= ASTNode . IsSuperType ; typeParameter . bounds = bounds ; typeParameter . declarationSourceEnd = bounds [ additionalBoundsLength - <NUM_LIT:1> ] . sourceEnd ; for ( int i = <NUM_LIT:0> , max = bounds . length ; i < max ; i ++ ) { bounds [ i ] . bits |= ASTNode . IsSuperType ; } } protected void consumeUnaryExpression ( int op ) { Expression r , exp = this . expressionStack [ this . expressionPtr ] ; if ( op == MINUS ) { if ( exp instanceof IntLiteral ) { IntLiteral intLiteral = ( IntLiteral ) exp ; IntLiteral convertToMinValue = intLiteral . convertToMinValue ( ) ; if ( convertToMinValue == intLiteral ) { r = new UnaryExpression ( exp , op ) ; } else { r = convertToMinValue ; } } else if ( exp instanceof LongLiteral ) { LongLiteral longLiteral = ( LongLiteral ) exp ; LongLiteral convertToMinValue = longLiteral . convertToMinValue ( ) ; if ( convertToMinValue == longLiteral ) { r = new UnaryExpression ( exp , op ) ; } else { r = convertToMinValue ; } } else { r = new UnaryExpression ( exp , op ) ; } } else { r = new UnaryExpression ( exp , op ) ; } r . sourceStart = this . intStack [ this . intPtr -- ] ; r . sourceEnd = exp . sourceEnd ; this . expressionStack [ this . expressionPtr ] = r ; } protected void consumeUnaryExpression ( int op , boolean post ) { Expression leftHandSide = this . expressionStack [ this . expressionPtr ] ; if ( leftHandSide instanceof Reference ) { if ( post ) { this . expressionStack [ this . expressionPtr ] = new PostfixExpression ( leftHandSide , IntLiteral . One , op , this . endStatementPosition ) ; } else { this . expressionStack [ this . expressionPtr ] = new PrefixExpression ( leftHandSide , IntLiteral . One , op , this . intStack [ this . intPtr -- ] ) ; } } else { if ( ! post ) { this . intPtr -- ; } if ( ! this . statementRecoveryActivated ) problemReporter ( ) . invalidUnaryExpression ( leftHandSide ) ; } } protected void consumeVariableDeclarators ( ) { optimizedConcatNodeLists ( ) ; } protected void consumeVariableInitializers ( ) { concatExpressionLists ( ) ; } protected void consumeWildcard ( ) { final Wildcard wildcard = new Wildcard ( Wildcard . UNBOUND ) ; wildcard . sourceEnd = this . intStack [ this . intPtr -- ] ; wildcard . sourceStart = this . intStack [ this . intPtr -- ] ; pushOnGenericsStack ( wildcard ) ; } protected void consumeWildcard1 ( ) { final Wildcard wildcard = new Wildcard ( Wildcard . UNBOUND ) ; wildcard . sourceEnd = this . intStack [ this . intPtr -- ] ; wildcard . sourceStart = this . intStack [ this . intPtr -- ] ; pushOnGenericsStack ( wildcard ) ; } protected void consumeWildcard1WithBounds ( ) { } protected void consumeWildcard2 ( ) { final Wildcard wildcard = new Wildcard ( Wildcard . UNBOUND ) ; wildcard . sourceEnd = this . intStack [ this . intPtr -- ] ; wildcard . sourceStart = this . intStack [ this . intPtr -- ] ; pushOnGenericsStack ( wildcard ) ; } protected void consumeWildcard2WithBounds ( ) { } protected void consumeWildcard3 ( ) { final Wildcard wildcard = new Wildcard ( Wildcard . UNBOUND ) ; wildcard . sourceEnd = this . intStack [ this . intPtr -- ] ; wildcard . sourceStart = this . intStack [ this . intPtr -- ] ; pushOnGenericsStack ( wildcard ) ; } protected void consumeWildcard3WithBounds ( ) { } protected void consumeWildcardBounds1Extends ( ) { Wildcard wildcard = new Wildcard ( Wildcard . EXTENDS ) ; wildcard . bound = ( TypeReference ) this . genericsStack [ this . genericsPtr ] ; wildcard . sourceEnd = wildcard . bound . sourceEnd ; this . intPtr -- ; wildcard . sourceStart = this . intStack [ this . intPtr -- ] ; this . genericsStack [ this . genericsPtr ] = wildcard ; } protected void consumeWildcardBounds1Super ( ) { Wildcard wildcard = new Wildcard ( Wildcard . SUPER ) ; wildcard . bound = ( TypeReference ) this . genericsStack [ this . genericsPtr ] ; this . intPtr -- ; wildcard . sourceEnd = wildcard . bound . sourceEnd ; this . intPtr -- ; wildcard . sourceStart = this . intStack [ this . intPtr -- ] ; this . genericsStack [ this . genericsPtr ] = wildcard ; } protected void consumeWildcardBounds2Extends ( ) { Wildcard wildcard = new Wildcard ( Wildcard . EXTENDS ) ; wildcard . bound = ( TypeReference ) this . genericsStack [ this . genericsPtr ] ; wildcard . sourceEnd = wildcard . bound . sourceEnd ; this . intPtr -- ; wildcard . sourceStart = this . intStack [ this . intPtr -- ] ; this . genericsStack [ this . genericsPtr ] = wildcard ; } protected void consumeWildcardBounds2Super ( ) { Wildcard wildcard = new Wildcard ( Wildcard . SUPER ) ; wildcard . bound = ( TypeReference ) this . genericsStack [ this . genericsPtr ] ; this . intPtr -- ; wildcard . sourceEnd = wildcard . bound . sourceEnd ; this . intPtr -- ; wildcard . sourceStart = this . intStack [ this . intPtr -- ] ; this . genericsStack [ this . genericsPtr ] = wildcard ; } protected void consumeWildcardBounds3Extends ( ) { Wildcard wildcard = new Wildcard ( Wildcard . EXTENDS ) ; wildcard . bound = ( TypeReference ) this . genericsStack [ this . genericsPtr ] ; wildcard . sourceEnd = wildcard . bound . sourceEnd ; this . intPtr -- ; wildcard . sourceStart = this . intStack [ this . intPtr -- ] ; this . genericsStack [ this . genericsPtr ] = wildcard ; } protected void consumeWildcardBounds3Super ( ) { Wildcard wildcard = new Wildcard ( Wildcard . SUPER ) ; wildcard . bound = ( TypeReference ) this . genericsStack [ this . genericsPtr ] ; this . intPtr -- ; wildcard . sourceEnd = wildcard . bound . sourceEnd ; this . intPtr -- ; wildcard . sourceStart = this . intStack [ this . intPtr -- ] ; this . genericsStack [ this . genericsPtr ] = wildcard ; } protected void consumeWildcardBoundsExtends ( ) { Wildcard wildcard = new Wildcard ( Wildcard . EXTENDS ) ; wildcard . bound = getTypeReference ( this . intStack [ this . intPtr -- ] ) ; wildcard . sourceEnd = wildcard . bound . sourceEnd ; this . intPtr -- ; wildcard . sourceStart = this . intStack [ this . intPtr -- ] ; pushOnGenericsStack ( wildcard ) ; } protected void consumeWildcardBoundsSuper ( ) { Wildcard wildcard = new Wildcard ( Wildcard . SUPER ) ; wildcard . bound = getTypeReference ( this . intStack [ this . intPtr -- ] ) ; this . intPtr -- ; wildcard . sourceEnd = wildcard . bound . sourceEnd ; this . intPtr -- ; wildcard . sourceStart = this . intStack [ this . intPtr -- ] ; pushOnGenericsStack ( wildcard ) ; } protected void consumeWildcardWithBounds ( ) { } public boolean containsComment ( int sourceStart , int sourceEnd ) { int iComment = this . scanner . commentPtr ; for ( ; iComment >= <NUM_LIT:0> ; iComment -- ) { int commentStart = this . scanner . commentStarts [ iComment ] ; if ( commentStart < <NUM_LIT:0> ) commentStart = - commentStart ; if ( commentStart < sourceStart ) continue ; if ( commentStart > sourceEnd ) continue ; return true ; } return false ; } public MethodDeclaration convertToMethodDeclaration ( ConstructorDeclaration c , CompilationResult compilationResult ) { MethodDeclaration m = new MethodDeclaration ( compilationResult ) ; m . typeParameters = c . typeParameters ; m . sourceStart = c . sourceStart ; m . sourceEnd = c . sourceEnd ; m . bodyStart = c . bodyStart ; m . bodyEnd = c . bodyEnd ; m . declarationSourceEnd = c . declarationSourceEnd ; m . declarationSourceStart = c . declarationSourceStart ; m . selector = c . selector ; m . statements = c . statements ; m . modifiers = c . modifiers ; m . annotations = c . annotations ; m . arguments = c . arguments ; m . thrownExceptions = c . thrownExceptions ; m . explicitDeclarations = c . explicitDeclarations ; m . returnType = null ; m . javadoc = c . javadoc ; return m ; } protected TypeReference copyDims ( TypeReference typeRef , int dim ) { return typeRef . copyDims ( dim ) ; } protected FieldDeclaration createFieldDeclaration ( char [ ] fieldDeclarationName , int sourceStart , int sourceEnd ) { return new FieldDeclaration ( fieldDeclarationName , sourceStart , sourceEnd ) ; } protected JavadocParser createJavadocParser ( ) { return new JavadocParser ( this ) ; } protected LocalDeclaration createLocalDeclaration ( char [ ] localDeclarationName , int sourceStart , int sourceEnd ) { return new LocalDeclaration ( localDeclarationName , sourceStart , sourceEnd ) ; } protected StringLiteral createStringLiteral ( char [ ] token , int start , int end , int lineNumber ) { return new StringLiteral ( token , start , end , lineNumber ) ; } protected RecoveredType currentRecoveryType ( ) { if ( this . currentElement != null ) { if ( this . currentElement instanceof RecoveredType ) { return ( RecoveredType ) this . currentElement ; } else { return this . currentElement . enclosingType ( ) ; } } return null ; } public CompilationUnitDeclaration dietParse ( ICompilationUnit sourceUnit , CompilationResult compilationResult ) { CompilationUnitDeclaration parsedUnit ; boolean old = this . diet ; try { this . diet = true ; parsedUnit = parse ( sourceUnit , compilationResult ) ; } finally { this . diet = old ; } return parsedUnit ; } protected void dispatchDeclarationInto ( int length ) { if ( length == <NUM_LIT:0> ) return ; int [ ] flag = new int [ length + <NUM_LIT:1> ] ; int size1 = <NUM_LIT:0> , size2 = <NUM_LIT:0> , size3 = <NUM_LIT:0> ; boolean hasAbstractMethods = false ; for ( int i = length - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) { ASTNode astNode = this . astStack [ this . astPtr -- ] ; if ( astNode instanceof AbstractMethodDeclaration ) { flag [ i ] = <NUM_LIT:2> ; size2 ++ ; if ( ( ( AbstractMethodDeclaration ) astNode ) . isAbstract ( ) ) { hasAbstractMethods = true ; } } else if ( astNode instanceof TypeDeclaration ) { flag [ i ] = <NUM_LIT:3> ; size3 ++ ; } else { flag [ i ] = <NUM_LIT:1> ; size1 ++ ; } } TypeDeclaration typeDecl = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; if ( size1 != <NUM_LIT:0> ) { typeDecl . fields = new FieldDeclaration [ size1 ] ; } if ( size2 != <NUM_LIT:0> ) { typeDecl . methods = new AbstractMethodDeclaration [ size2 ] ; if ( hasAbstractMethods ) typeDecl . bits |= ASTNode . HasAbstractMethods ; } if ( size3 != <NUM_LIT:0> ) { typeDecl . memberTypes = new TypeDeclaration [ size3 ] ; } size1 = size2 = size3 = <NUM_LIT:0> ; int flagI = flag [ <NUM_LIT:0> ] , start = <NUM_LIT:0> ; int length2 ; for ( int end = <NUM_LIT:0> ; end <= length ; end ++ ) { if ( flagI != flag [ end ] ) { switch ( flagI ) { case <NUM_LIT:1> : size1 += ( length2 = end - start ) ; System . arraycopy ( this . astStack , this . astPtr + start + <NUM_LIT:1> , typeDecl . fields , size1 - length2 , length2 ) ; break ; case <NUM_LIT:2> : size2 += ( length2 = end - start ) ; System . arraycopy ( this . astStack , this . astPtr + start + <NUM_LIT:1> , typeDecl . methods , size2 - length2 , length2 ) ; break ; case <NUM_LIT:3> : size3 += ( length2 = end - start ) ; System . arraycopy ( this . astStack , this . astPtr + start + <NUM_LIT:1> , typeDecl . memberTypes , size3 - length2 , length2 ) ; break ; } flagI = flag [ start = end ] ; } } if ( typeDecl . memberTypes != null ) { for ( int i = typeDecl . memberTypes . length - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) { typeDecl . memberTypes [ i ] . enclosingType = typeDecl ; } } } protected void dispatchDeclarationIntoEnumDeclaration ( int length ) { if ( length == <NUM_LIT:0> ) return ; int [ ] flag = new int [ length + <NUM_LIT:1> ] ; int size1 = <NUM_LIT:0> , size2 = <NUM_LIT:0> , size3 = <NUM_LIT:0> ; TypeDeclaration enumDeclaration = ( TypeDeclaration ) this . astStack [ this . astPtr - length ] ; boolean hasAbstractMethods = false ; int enumConstantsCounter = <NUM_LIT:0> ; for ( int i = length - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) { ASTNode astNode = this . astStack [ this . astPtr -- ] ; if ( astNode instanceof AbstractMethodDeclaration ) { flag [ i ] = <NUM_LIT:2> ; size2 ++ ; if ( ( ( AbstractMethodDeclaration ) astNode ) . isAbstract ( ) ) { hasAbstractMethods = true ; } } else if ( astNode instanceof TypeDeclaration ) { flag [ i ] = <NUM_LIT:3> ; size3 ++ ; } else if ( astNode instanceof FieldDeclaration ) { flag [ i ] = <NUM_LIT:1> ; size1 ++ ; if ( ( ( FieldDeclaration ) astNode ) . getKind ( ) == AbstractVariableDeclaration . ENUM_CONSTANT ) { enumConstantsCounter ++ ; } } } if ( size1 != <NUM_LIT:0> ) { enumDeclaration . fields = new FieldDeclaration [ size1 ] ; } if ( size2 != <NUM_LIT:0> ) { enumDeclaration . methods = new AbstractMethodDeclaration [ size2 ] ; if ( hasAbstractMethods ) enumDeclaration . bits |= ASTNode . HasAbstractMethods ; } if ( size3 != <NUM_LIT:0> ) { enumDeclaration . memberTypes = new TypeDeclaration [ size3 ] ; } size1 = size2 = size3 = <NUM_LIT:0> ; int flagI = flag [ <NUM_LIT:0> ] , start = <NUM_LIT:0> ; int length2 ; for ( int end = <NUM_LIT:0> ; end <= length ; end ++ ) { if ( flagI != flag [ end ] ) { switch ( flagI ) { case <NUM_LIT:1> : size1 += ( length2 = end - start ) ; System . arraycopy ( this . astStack , this . astPtr + start + <NUM_LIT:1> , enumDeclaration . fields , size1 - length2 , length2 ) ; break ; case <NUM_LIT:2> : size2 += ( length2 = end - start ) ; System . arraycopy ( this . astStack , this . astPtr + start + <NUM_LIT:1> , enumDeclaration . methods , size2 - length2 , length2 ) ; break ; case <NUM_LIT:3> : size3 += ( length2 = end - start ) ; System . arraycopy ( this . astStack , this . astPtr + start + <NUM_LIT:1> , enumDeclaration . memberTypes , size3 - length2 , length2 ) ; break ; } flagI = flag [ start = end ] ; } } if ( enumDeclaration . memberTypes != null ) { for ( int i = enumDeclaration . memberTypes . length - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) { enumDeclaration . memberTypes [ i ] . enclosingType = enumDeclaration ; } } enumDeclaration . enumConstantsCounter = enumConstantsCounter ; } protected CompilationUnitDeclaration endParse ( int act ) { this . lastAct = act ; if ( this . statementRecoveryActivated ) { RecoveredElement recoveredElement = buildInitialRecoveryState ( ) ; if ( recoveredElement != null ) { recoveredElement . topElement ( ) . updateParseTree ( ) ; } if ( this . hasError ) resetStacks ( ) ; } else if ( this . currentElement != null ) { if ( VERBOSE_RECOVERY ) { System . out . print ( Messages . parser_syntaxRecovery ) ; System . out . println ( "<STR_LIT>" ) ; System . out . println ( this . compilationUnit ) ; System . out . println ( "<STR_LIT>" ) ; } this . currentElement . topElement ( ) . updateParseTree ( ) ; } else { if ( this . diet & VERBOSE_RECOVERY ) { System . out . print ( Messages . parser_regularParse ) ; System . out . println ( "<STR_LIT>" ) ; System . out . println ( this . compilationUnit ) ; System . out . println ( "<STR_LIT>" ) ; } } persistLineSeparatorPositions ( ) ; for ( int i = <NUM_LIT:0> ; i < this . scanner . foundTaskCount ; i ++ ) { if ( ! this . statementRecoveryActivated ) problemReporter ( ) . task ( new String ( this . scanner . foundTaskTags [ i ] ) , new String ( this . scanner . foundTaskMessages [ i ] ) , this . scanner . foundTaskPriorities [ i ] == null ? null : new String ( this . scanner . foundTaskPriorities [ i ] ) , this . scanner . foundTaskPositions [ i ] [ <NUM_LIT:0> ] , this . scanner . foundTaskPositions [ i ] [ <NUM_LIT:1> ] ) ; } return this . compilationUnit ; } public int flushCommentsDefinedPriorTo ( int position ) { int lastCommentIndex = this . scanner . commentPtr ; if ( lastCommentIndex < <NUM_LIT:0> ) return position ; int index = lastCommentIndex ; int validCount = <NUM_LIT:0> ; while ( index >= <NUM_LIT:0> ) { int commentEnd = this . scanner . commentStops [ index ] ; if ( commentEnd < <NUM_LIT:0> ) commentEnd = - commentEnd ; if ( commentEnd <= position ) { break ; } index -- ; validCount ++ ; } if ( validCount > <NUM_LIT:0> ) { int immediateCommentEnd = - this . scanner . commentStops [ index + <NUM_LIT:1> ] ; if ( immediateCommentEnd > <NUM_LIT:0> ) { immediateCommentEnd -- ; if ( Util . getLineNumber ( position , this . scanner . lineEnds , <NUM_LIT:0> , this . scanner . linePtr ) == Util . getLineNumber ( immediateCommentEnd , this . scanner . lineEnds , <NUM_LIT:0> , this . scanner . linePtr ) ) { position = immediateCommentEnd ; validCount -- ; index ++ ; } } } if ( index < <NUM_LIT:0> ) return position ; switch ( validCount ) { case <NUM_LIT:0> : break ; case <NUM_LIT:2> : this . scanner . commentStarts [ <NUM_LIT:0> ] = this . scanner . commentStarts [ index + <NUM_LIT:1> ] ; this . scanner . commentStops [ <NUM_LIT:0> ] = this . scanner . commentStops [ index + <NUM_LIT:1> ] ; this . scanner . commentTagStarts [ <NUM_LIT:0> ] = this . scanner . commentTagStarts [ index + <NUM_LIT:1> ] ; this . scanner . commentStarts [ <NUM_LIT:1> ] = this . scanner . commentStarts [ index + <NUM_LIT:2> ] ; this . scanner . commentStops [ <NUM_LIT:1> ] = this . scanner . commentStops [ index + <NUM_LIT:2> ] ; this . scanner . commentTagStarts [ <NUM_LIT:1> ] = this . scanner . commentTagStarts [ index + <NUM_LIT:2> ] ; break ; case <NUM_LIT:1> : this . scanner . commentStarts [ <NUM_LIT:0> ] = this . scanner . commentStarts [ index + <NUM_LIT:1> ] ; this . scanner . commentStops [ <NUM_LIT:0> ] = this . scanner . commentStops [ index + <NUM_LIT:1> ] ; this . scanner . commentTagStarts [ <NUM_LIT:0> ] = this . scanner . commentTagStarts [ index + <NUM_LIT:1> ] ; break ; default : System . arraycopy ( this . scanner . commentStarts , index + <NUM_LIT:1> , this . scanner . commentStarts , <NUM_LIT:0> , validCount ) ; System . arraycopy ( this . scanner . commentStops , index + <NUM_LIT:1> , this . scanner . commentStops , <NUM_LIT:0> , validCount ) ; System . arraycopy ( this . scanner . commentTagStarts , index + <NUM_LIT:1> , this . scanner . commentTagStarts , <NUM_LIT:0> , validCount ) ; } this . scanner . commentPtr = validCount - <NUM_LIT:1> ; return position ; } protected TypeReference getAnnotationType ( ) { int length = this . identifierLengthStack [ this . identifierLengthPtr -- ] ; if ( length == <NUM_LIT:1> ) { return new SingleTypeReference ( this . identifierStack [ this . identifierPtr ] , this . identifierPositionStack [ this . identifierPtr -- ] ) ; } else { char [ ] [ ] tokens = new char [ length ] [ ] ; this . identifierPtr -= length ; long [ ] positions = new long [ length ] ; System . arraycopy ( this . identifierStack , this . identifierPtr + <NUM_LIT:1> , tokens , <NUM_LIT:0> , length ) ; System . arraycopy ( this . identifierPositionStack , this . identifierPtr + <NUM_LIT:1> , positions , <NUM_LIT:0> , length ) ; return new QualifiedTypeReference ( tokens , positions ) ; } } public int getFirstToken ( ) { return this . firstToken ; } public int [ ] getJavaDocPositions ( ) { int javadocCount = <NUM_LIT:0> ; int max = this . scanner . commentPtr ; for ( int i = <NUM_LIT:0> ; i <= max ; i ++ ) { if ( this . scanner . commentStarts [ i ] >= <NUM_LIT:0> && this . scanner . commentStops [ i ] > <NUM_LIT:0> ) { javadocCount ++ ; } } if ( javadocCount == <NUM_LIT:0> ) return null ; int [ ] positions = new int [ <NUM_LIT:2> * javadocCount ] ; int index = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i <= max ; i ++ ) { int commentStart = this . scanner . commentStarts [ i ] ; if ( commentStart >= <NUM_LIT:0> ) { int commentStop = this . scanner . commentStops [ i ] ; if ( commentStop > <NUM_LIT:0> ) { positions [ index ++ ] = commentStart ; positions [ index ++ ] = commentStop - <NUM_LIT:1> ; } } } return positions ; } public void getMethodBodies ( CompilationUnitDeclaration unit ) { if ( unit == null ) return ; if ( unit . ignoreMethodBodies ) { unit . ignoreFurtherInvestigation = true ; return ; } if ( ( unit . bits & ASTNode . HasAllMethodBodies ) != <NUM_LIT:0> ) return ; int [ ] oldLineEnds = this . scanner . lineEnds ; int oldLinePtr = this . scanner . linePtr ; CompilationResult compilationResult = unit . compilationResult ; char [ ] contents = this . readManager != null ? this . readManager . getContents ( compilationResult . compilationUnit ) : compilationResult . compilationUnit . getContents ( ) ; this . scanner . setSource ( contents , compilationResult ) ; if ( this . javadocParser != null && this . javadocParser . checkDocComment ) { this . javadocParser . scanner . setSource ( contents ) ; } if ( unit . types != null ) { for ( int i = <NUM_LIT:0> , length = unit . types . length ; i < length ; i ++ ) unit . types [ i ] . parseMethods ( this , unit ) ; } unit . bits |= ASTNode . HasAllMethodBodies ; this . scanner . lineEnds = oldLineEnds ; this . scanner . linePtr = oldLinePtr ; } protected char getNextCharacter ( char [ ] comment , int [ ] index ) { char nextCharacter = comment [ index [ <NUM_LIT:0> ] ++ ] ; switch ( nextCharacter ) { case '<STR_LIT:\\>' : int c1 , c2 , c3 , c4 ; index [ <NUM_LIT:0> ] ++ ; while ( comment [ index [ <NUM_LIT:0> ] ] == '<CHAR_LIT>' ) index [ <NUM_LIT:0> ] ++ ; if ( ! ( ( ( c1 = ScannerHelper . getHexadecimalValue ( comment [ index [ <NUM_LIT:0> ] ++ ] ) ) > <NUM_LIT:15> || c1 < <NUM_LIT:0> ) || ( ( c2 = ScannerHelper . getHexadecimalValue ( comment [ index [ <NUM_LIT:0> ] ++ ] ) ) > <NUM_LIT:15> || c2 < <NUM_LIT:0> ) || ( ( c3 = ScannerHelper . getHexadecimalValue ( comment [ index [ <NUM_LIT:0> ] ++ ] ) ) > <NUM_LIT:15> || c3 < <NUM_LIT:0> ) || ( ( c4 = ScannerHelper . getHexadecimalValue ( comment [ index [ <NUM_LIT:0> ] ++ ] ) ) > <NUM_LIT:15> || c4 < <NUM_LIT:0> ) ) ) { nextCharacter = ( char ) ( ( ( c1 * <NUM_LIT:16> + c2 ) * <NUM_LIT:16> + c3 ) * <NUM_LIT:16> + c4 ) ; } break ; } return nextCharacter ; } protected Expression getTypeReference ( Expression exp ) { exp . bits &= ~ ASTNode . RestrictiveFlagMASK ; exp . bits |= Binding . TYPE ; return exp ; } protected TypeReference getTypeReference ( int dim ) { TypeReference ref ; int length = this . identifierLengthStack [ this . identifierLengthPtr -- ] ; if ( length < <NUM_LIT:0> ) { ref = TypeReference . baseTypeReference ( - length , dim ) ; ref . sourceStart = this . intStack [ this . intPtr -- ] ; if ( dim == <NUM_LIT:0> ) { ref . sourceEnd = this . intStack [ this . intPtr -- ] ; } else { this . intPtr -- ; ref . sourceEnd = this . endPosition ; } } else { int numberOfIdentifiers = this . genericsIdentifiersLengthStack [ this . genericsIdentifiersLengthPtr -- ] ; if ( length != numberOfIdentifiers || this . genericsLengthStack [ this . genericsLengthPtr ] != <NUM_LIT:0> ) { ref = getTypeReferenceForGenericType ( dim , length , numberOfIdentifiers ) ; } else if ( length == <NUM_LIT:1> ) { this . genericsLengthPtr -- ; if ( dim == <NUM_LIT:0> ) { ref = new SingleTypeReference ( this . identifierStack [ this . identifierPtr ] , this . identifierPositionStack [ this . identifierPtr -- ] ) ; } else { ref = new ArrayTypeReference ( this . identifierStack [ this . identifierPtr ] , dim , this . identifierPositionStack [ this . identifierPtr -- ] ) ; ref . sourceEnd = this . endPosition ; } } else { this . genericsLengthPtr -- ; char [ ] [ ] tokens = new char [ length ] [ ] ; this . identifierPtr -= length ; long [ ] positions = new long [ length ] ; System . arraycopy ( this . identifierStack , this . identifierPtr + <NUM_LIT:1> , tokens , <NUM_LIT:0> , length ) ; System . arraycopy ( this . identifierPositionStack , this . identifierPtr + <NUM_LIT:1> , positions , <NUM_LIT:0> , length ) ; if ( dim == <NUM_LIT:0> ) { ref = new QualifiedTypeReference ( tokens , positions ) ; } else { ref = new ArrayQualifiedTypeReference ( tokens , dim , positions ) ; ref . sourceEnd = this . endPosition ; } } } return ref ; } protected TypeReference getTypeReferenceForGenericType ( int dim , int identifierLength , int numberOfIdentifiers ) { if ( identifierLength == <NUM_LIT:1> && numberOfIdentifiers == <NUM_LIT:1> ) { int currentTypeArgumentsLength = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; TypeReference [ ] typeArguments = null ; if ( currentTypeArgumentsLength < <NUM_LIT:0> ) { typeArguments = TypeReference . NO_TYPE_ARGUMENTS ; } else { typeArguments = new TypeReference [ currentTypeArgumentsLength ] ; this . genericsPtr -= currentTypeArgumentsLength ; System . arraycopy ( this . genericsStack , this . genericsPtr + <NUM_LIT:1> , typeArguments , <NUM_LIT:0> , currentTypeArgumentsLength ) ; } ParameterizedSingleTypeReference parameterizedSingleTypeReference = new ParameterizedSingleTypeReference ( this . identifierStack [ this . identifierPtr ] , typeArguments , dim , this . identifierPositionStack [ this . identifierPtr -- ] ) ; if ( dim != <NUM_LIT:0> ) { parameterizedSingleTypeReference . sourceEnd = this . endStatementPosition ; } return parameterizedSingleTypeReference ; } else { TypeReference [ ] [ ] typeArguments = new TypeReference [ numberOfIdentifiers ] [ ] ; char [ ] [ ] tokens = new char [ numberOfIdentifiers ] [ ] ; long [ ] positions = new long [ numberOfIdentifiers ] ; int index = numberOfIdentifiers ; int currentIdentifiersLength = identifierLength ; while ( index > <NUM_LIT:0> ) { int currentTypeArgumentsLength = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; if ( currentTypeArgumentsLength > <NUM_LIT:0> ) { this . genericsPtr -= currentTypeArgumentsLength ; System . arraycopy ( this . genericsStack , this . genericsPtr + <NUM_LIT:1> , typeArguments [ index - <NUM_LIT:1> ] = new TypeReference [ currentTypeArgumentsLength ] , <NUM_LIT:0> , currentTypeArgumentsLength ) ; } else if ( currentTypeArgumentsLength < <NUM_LIT:0> ) { typeArguments [ index - <NUM_LIT:1> ] = TypeReference . NO_TYPE_ARGUMENTS ; } switch ( currentIdentifiersLength ) { case <NUM_LIT:1> : tokens [ index - <NUM_LIT:1> ] = this . identifierStack [ this . identifierPtr ] ; positions [ index - <NUM_LIT:1> ] = this . identifierPositionStack [ this . identifierPtr -- ] ; break ; default : this . identifierPtr -= currentIdentifiersLength ; System . arraycopy ( this . identifierStack , this . identifierPtr + <NUM_LIT:1> , tokens , index - currentIdentifiersLength , currentIdentifiersLength ) ; System . arraycopy ( this . identifierPositionStack , this . identifierPtr + <NUM_LIT:1> , positions , index - currentIdentifiersLength , currentIdentifiersLength ) ; } index -= currentIdentifiersLength ; if ( index > <NUM_LIT:0> ) { currentIdentifiersLength = this . identifierLengthStack [ this . identifierLengthPtr -- ] ; } } ParameterizedQualifiedTypeReference parameterizedQualifiedTypeReference = new ParameterizedQualifiedTypeReference ( tokens , typeArguments , dim , positions ) ; if ( dim != <NUM_LIT:0> ) { parameterizedQualifiedTypeReference . sourceEnd = this . endStatementPosition ; } return parameterizedQualifiedTypeReference ; } } protected NameReference getUnspecifiedReference ( ) { int length ; NameReference ref ; if ( ( length = this . identifierLengthStack [ this . identifierLengthPtr -- ] ) == <NUM_LIT:1> ) ref = new SingleNameReference ( this . identifierStack [ this . identifierPtr ] , this . identifierPositionStack [ this . identifierPtr -- ] ) ; else { char [ ] [ ] tokens = new char [ length ] [ ] ; this . identifierPtr -= length ; System . arraycopy ( this . identifierStack , this . identifierPtr + <NUM_LIT:1> , tokens , <NUM_LIT:0> , length ) ; long [ ] positions = new long [ length ] ; System . arraycopy ( this . identifierPositionStack , this . identifierPtr + <NUM_LIT:1> , positions , <NUM_LIT:0> , length ) ; ref = new QualifiedNameReference ( tokens , positions , ( int ) ( this . identifierPositionStack [ this . identifierPtr + <NUM_LIT:1> ] > > <NUM_LIT:32> ) , ( int ) this . identifierPositionStack [ this . identifierPtr + length ] ) ; } return ref ; } protected NameReference getUnspecifiedReferenceOptimized ( ) { int length ; NameReference ref ; if ( ( length = this . identifierLengthStack [ this . identifierLengthPtr -- ] ) == <NUM_LIT:1> ) { ref = new SingleNameReference ( this . identifierStack [ this . identifierPtr ] , this . identifierPositionStack [ this . identifierPtr -- ] ) ; ref . bits &= ~ ASTNode . RestrictiveFlagMASK ; ref . bits |= Binding . LOCAL | Binding . FIELD ; return ref ; } char [ ] [ ] tokens = new char [ length ] [ ] ; this . identifierPtr -= length ; System . arraycopy ( this . identifierStack , this . identifierPtr + <NUM_LIT:1> , tokens , <NUM_LIT:0> , length ) ; long [ ] positions = new long [ length ] ; System . arraycopy ( this . identifierPositionStack , this . identifierPtr + <NUM_LIT:1> , positions , <NUM_LIT:0> , length ) ; ref = new QualifiedNameReference ( tokens , positions , ( int ) ( this . identifierPositionStack [ this . identifierPtr + <NUM_LIT:1> ] > > <NUM_LIT:32> ) , ( int ) this . identifierPositionStack [ this . identifierPtr + length ] ) ; ref . bits &= ~ ASTNode . RestrictiveFlagMASK ; ref . bits |= Binding . LOCAL | Binding . FIELD ; return ref ; } public void goForBlockStatementsopt ( ) { this . firstToken = TokenNameTWIDDLE ; this . scanner . recordLineSeparator = false ; } public void goForBlockStatementsOrCatchHeader ( ) { this . firstToken = TokenNameMULTIPLY ; this . scanner . recordLineSeparator = false ; } public void goForClassBodyDeclarations ( ) { this . firstToken = TokenNameAND ; this . scanner . recordLineSeparator = true ; } public void goForCompilationUnit ( ) { this . firstToken = TokenNamePLUS_PLUS ; this . scanner . foundTaskCount = <NUM_LIT:0> ; this . scanner . recordLineSeparator = true ; } public void goForExpression ( ) { this . firstToken = TokenNameREMAINDER ; this . scanner . recordLineSeparator = true ; } public void goForFieldDeclaration ( ) { this . firstToken = TokenNameAND_AND ; this . scanner . recordLineSeparator = true ; } public void goForGenericMethodDeclaration ( ) { this . firstToken = TokenNameDIVIDE ; this . scanner . recordLineSeparator = true ; } public void goForHeaders ( ) { RecoveredType currentType = currentRecoveryType ( ) ; if ( currentType != null && currentType . insideEnumConstantPart ) { this . firstToken = TokenNameNOT ; } else { this . firstToken = TokenNameUNSIGNED_RIGHT_SHIFT ; } this . scanner . recordLineSeparator = true ; } public void goForImportDeclaration ( ) { this . firstToken = TokenNameOR_OR ; this . scanner . recordLineSeparator = true ; } public void goForInitializer ( ) { this . firstToken = TokenNameRIGHT_SHIFT ; this . scanner . recordLineSeparator = false ; } public void goForMemberValue ( ) { this . firstToken = TokenNameOR_OR ; this . scanner . recordLineSeparator = true ; } public void goForMethodBody ( ) { this . firstToken = TokenNameMINUS_MINUS ; this . scanner . recordLineSeparator = false ; } public void goForPackageDeclaration ( ) { this . firstToken = TokenNameQUESTION ; this . scanner . recordLineSeparator = true ; } public void goForTypeDeclaration ( ) { this . firstToken = TokenNamePLUS ; this . scanner . recordLineSeparator = true ; } public boolean hasLeadingTagComment ( char [ ] commentPrefixTag , int rangeEnd ) { int iComment = this . scanner . commentPtr ; if ( iComment < <NUM_LIT:0> ) return false ; int iStatement = this . astLengthPtr ; if ( iStatement < <NUM_LIT:0> || this . astLengthStack [ iStatement ] <= <NUM_LIT:1> ) return false ; ASTNode lastNode = this . astStack [ this . astPtr ] ; int rangeStart = lastNode . sourceEnd ; previousComment : for ( ; iComment >= <NUM_LIT:0> ; iComment -- ) { int commentStart = this . scanner . commentStarts [ iComment ] ; if ( commentStart < <NUM_LIT:0> ) commentStart = - commentStart ; if ( commentStart < rangeStart ) return false ; if ( commentStart > rangeEnd ) continue previousComment ; char [ ] source = this . scanner . source ; int charPos = commentStart + <NUM_LIT:2> ; for ( ; charPos < rangeEnd ; charPos ++ ) { char c = source [ charPos ] ; if ( c >= ScannerHelper . MAX_OBVIOUS || ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] & ScannerHelper . C_JLS_SPACE ) == <NUM_LIT:0> ) { break ; } } for ( int iTag = <NUM_LIT:0> , length = commentPrefixTag . length ; iTag < length ; iTag ++ , charPos ++ ) { if ( charPos >= rangeEnd || source [ charPos ] != commentPrefixTag [ iTag ] ) { if ( iTag == <NUM_LIT:0> ) { return false ; } else { continue previousComment ; } } } return true ; } return false ; } protected void ignoreExpressionAssignment ( ) { this . intPtr -- ; ArrayInitializer arrayInitializer = ( ArrayInitializer ) this . expressionStack [ this . expressionPtr -- ] ; this . expressionLengthPtr -- ; if ( ! this . statementRecoveryActivated ) problemReporter ( ) . arrayConstantsOnlyInArrayInitializers ( arrayInitializer . sourceStart , arrayInitializer . sourceEnd ) ; } public void initialize ( ) { this . initialize ( false ) ; } public void initialize ( boolean initializeNLS ) { this . astPtr = - <NUM_LIT:1> ; this . astLengthPtr = - <NUM_LIT:1> ; this . expressionPtr = - <NUM_LIT:1> ; this . expressionLengthPtr = - <NUM_LIT:1> ; this . identifierPtr = - <NUM_LIT:1> ; this . identifierLengthPtr = - <NUM_LIT:1> ; this . intPtr = - <NUM_LIT:1> ; this . nestedMethod [ this . nestedType = <NUM_LIT:0> ] = <NUM_LIT:0> ; this . variablesCounter [ this . nestedType ] = <NUM_LIT:0> ; this . dimensions = <NUM_LIT:0> ; this . realBlockPtr = - <NUM_LIT:1> ; this . compilationUnit = null ; this . referenceContext = null ; this . endStatementPosition = <NUM_LIT:0> ; int astLength = this . astStack . length ; if ( this . noAstNodes . length < astLength ) { this . noAstNodes = new ASTNode [ astLength ] ; } System . arraycopy ( this . noAstNodes , <NUM_LIT:0> , this . astStack , <NUM_LIT:0> , astLength ) ; int expressionLength = this . expressionStack . length ; if ( this . noExpressions . length < expressionLength ) { this . noExpressions = new Expression [ expressionLength ] ; } System . arraycopy ( this . noExpressions , <NUM_LIT:0> , this . expressionStack , <NUM_LIT:0> , expressionLength ) ; this . scanner . commentPtr = - <NUM_LIT:1> ; this . scanner . foundTaskCount = <NUM_LIT:0> ; this . scanner . eofPosition = Integer . MAX_VALUE ; this . recordStringLiterals = true ; final boolean checkNLS = this . options . getSeverity ( CompilerOptions . NonExternalizedString ) != ProblemSeverities . Ignore ; this . checkExternalizeStrings = checkNLS ; this . scanner . checkNonExternalizedStringLiterals = initializeNLS && checkNLS ; this . scanner . lastPosition = - <NUM_LIT:1> ; resetModifiers ( ) ; this . lastCheckPoint = - <NUM_LIT:1> ; this . currentElement = null ; this . restartRecovery = false ; this . hasReportedError = false ; this . recoveredStaticInitializerStart = <NUM_LIT:0> ; this . lastIgnoredToken = - <NUM_LIT:1> ; this . lastErrorEndPosition = - <NUM_LIT:1> ; this . lastErrorEndPositionBeforeRecovery = - <NUM_LIT:1> ; this . lastJavadocEnd = - <NUM_LIT:1> ; this . listLength = <NUM_LIT:0> ; this . listTypeParameterLength = <NUM_LIT:0> ; this . lastPosistion = - <NUM_LIT:1> ; this . rBraceStart = <NUM_LIT:0> ; this . rBraceEnd = <NUM_LIT:0> ; this . rBraceSuccessorStart = <NUM_LIT:0> ; this . genericsIdentifiersLengthPtr = - <NUM_LIT:1> ; this . genericsLengthPtr = - <NUM_LIT:1> ; this . genericsPtr = - <NUM_LIT:1> ; } public void initializeScanner ( ) { this . scanner = new Scanner ( false , false , false , this . options . sourceLevel , this . options . complianceLevel , this . options . taskTags , this . options . taskPriorities , this . options . isTaskCaseSensitive ) ; this . options . taskPriorities = scanner . taskPriorities ; } public void jumpOverMethodBody ( ) { if ( this . diet && ( this . dietInt == <NUM_LIT:0> ) ) this . scanner . diet = true ; } private void jumpOverType ( ) { if ( this . recoveredTypes != null && this . nextTypeStart > - <NUM_LIT:1> && this . nextTypeStart < this . scanner . currentPosition ) { if ( DEBUG_AUTOMATON ) { System . out . println ( "<STR_LIT>" ) ; } TypeDeclaration typeDeclaration = this . recoveredTypes [ this . recoveredTypePtr ] ; boolean isAnonymous = typeDeclaration . allocation != null ; this . scanner . startPosition = typeDeclaration . declarationSourceEnd + <NUM_LIT:1> ; this . scanner . currentPosition = typeDeclaration . declarationSourceEnd + <NUM_LIT:1> ; this . scanner . diet = false ; if ( ! isAnonymous ) { ( ( RecoveryScanner ) this . scanner ) . setPendingTokens ( new int [ ] { TokenNameSEMICOLON , TokenNamebreak } ) ; } else { ( ( RecoveryScanner ) this . scanner ) . setPendingTokens ( new int [ ] { TokenNameIdentifier , TokenNameEQUAL , TokenNameIdentifier } ) ; } this . pendingRecoveredType = typeDeclaration ; try { this . currentToken = this . scanner . getNextToken ( ) ; } catch ( InvalidInputException e ) { } if ( ++ this . recoveredTypePtr < this . recoveredTypes . length ) { TypeDeclaration nextTypeDeclaration = this . recoveredTypes [ this . recoveredTypePtr ] ; this . nextTypeStart = nextTypeDeclaration . allocation == null ? nextTypeDeclaration . declarationSourceStart : nextTypeDeclaration . allocation . sourceStart ; } else { this . nextTypeStart = Integer . MAX_VALUE ; } } } protected void markEnclosingMemberWithLocalType ( ) { if ( this . currentElement != null ) return ; for ( int i = this . astPtr ; i >= <NUM_LIT:0> ; i -- ) { ASTNode node = this . astStack [ i ] ; if ( node instanceof AbstractMethodDeclaration || node instanceof FieldDeclaration || ( node instanceof TypeDeclaration && ( ( TypeDeclaration ) node ) . declarationSourceEnd == <NUM_LIT:0> ) ) { node . bits |= ASTNode . HasLocalType ; return ; } } if ( this . referenceContext instanceof AbstractMethodDeclaration || this . referenceContext instanceof TypeDeclaration ) { ( ( ASTNode ) this . referenceContext ) . bits |= ASTNode . HasLocalType ; } } protected boolean moveRecoveryCheckpoint ( ) { int pos = this . lastCheckPoint ; this . scanner . startPosition = pos ; this . scanner . currentPosition = pos ; this . scanner . diet = false ; if ( this . restartRecovery ) { this . lastIgnoredToken = - <NUM_LIT:1> ; this . scanner . insideRecovery = true ; return true ; } this . lastIgnoredToken = this . nextIgnoredToken ; this . nextIgnoredToken = - <NUM_LIT:1> ; do { try { this . nextIgnoredToken = this . scanner . getNextToken ( ) ; if ( this . scanner . currentPosition == this . scanner . startPosition ) { this . scanner . currentPosition ++ ; this . nextIgnoredToken = - <NUM_LIT:1> ; } } catch ( InvalidInputException e ) { pos = this . scanner . currentPosition ; } } while ( this . nextIgnoredToken < <NUM_LIT:0> ) ; if ( this . nextIgnoredToken == TokenNameEOF ) { if ( this . currentToken == TokenNameEOF ) { return false ; } } this . lastCheckPoint = this . scanner . currentPosition ; this . scanner . startPosition = pos ; this . scanner . currentPosition = pos ; this . scanner . commentPtr = - <NUM_LIT:1> ; this . scanner . foundTaskCount = <NUM_LIT:0> ; return true ; } protected MessageSend newMessageSend ( ) { MessageSend m = new MessageSend ( ) ; int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != <NUM_LIT:0> ) { this . expressionPtr -= length ; System . arraycopy ( this . expressionStack , this . expressionPtr + <NUM_LIT:1> , m . arguments = new Expression [ length ] , <NUM_LIT:0> , length ) ; } return m ; } protected MessageSend newMessageSendWithTypeArguments ( ) { MessageSend m = new MessageSend ( ) ; int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != <NUM_LIT:0> ) { this . expressionPtr -= length ; System . arraycopy ( this . expressionStack , this . expressionPtr + <NUM_LIT:1> , m . arguments = new Expression [ length ] , <NUM_LIT:0> , length ) ; } return m ; } protected void optimizedConcatNodeLists ( ) { this . astLengthStack [ -- this . astLengthPtr ] ++ ; } protected void parse ( ) { if ( DEBUG ) System . out . println ( "<STR_LIT>" ) ; if ( DEBUG_AUTOMATON ) { System . out . println ( "<STR_LIT>" ) ; } boolean isDietParse = this . diet ; int oldFirstToken = getFirstToken ( ) ; this . hasError = false ; this . hasReportedError = false ; int act = START_STATE ; this . stateStackTop = - <NUM_LIT:1> ; this . currentToken = getFirstToken ( ) ; ProcessTerminals : for ( ; ; ) { int stackLength = this . stack . length ; if ( ++ this . stateStackTop >= stackLength ) { System . arraycopy ( this . stack , <NUM_LIT:0> , this . stack = new int [ stackLength + StackIncrement ] , <NUM_LIT:0> , stackLength ) ; } this . stack [ this . stateStackTop ] = act ; act = tAction ( act , this . currentToken ) ; if ( act == ERROR_ACTION || ( this . restartRecovery && ! this . shouldDeferRecovery ) ) { this . shouldDeferRecovery = false ; if ( DEBUG_AUTOMATON ) { if ( this . restartRecovery ) { System . out . println ( "<STR_LIT>" ) ; } else { System . out . println ( "<STR_LIT>" ) ; } } int errorPos = this . scanner . currentPosition - <NUM_LIT:1> ; if ( ! this . hasReportedError ) { this . hasError = true ; } int previousToken = this . currentToken ; if ( resumeOnSyntaxError ( ) ) { if ( act == ERROR_ACTION && previousToken != <NUM_LIT:0> ) this . lastErrorEndPosition = errorPos ; act = START_STATE ; this . stateStackTop = - <NUM_LIT:1> ; this . currentToken = getFirstToken ( ) ; continue ProcessTerminals ; } act = ERROR_ACTION ; break ProcessTerminals ; } if ( act <= NUM_RULES ) { this . stateStackTop -- ; if ( DEBUG_AUTOMATON ) { System . out . print ( "<STR_LIT>" ) ; } } else if ( act > ERROR_ACTION ) { consumeToken ( this . currentToken ) ; if ( this . currentElement != null ) { boolean oldValue = this . recordStringLiterals ; this . recordStringLiterals = false ; recoveryTokenCheck ( ) ; this . recordStringLiterals = oldValue ; } try { this . currentToken = this . scanner . getNextToken ( ) ; } catch ( InvalidInputException e ) { if ( ! this . hasReportedError ) { problemReporter ( ) . scannerError ( this , e . getMessage ( ) ) ; this . hasReportedError = true ; } this . lastCheckPoint = this . scanner . currentPosition ; this . currentToken = <NUM_LIT:0> ; this . restartRecovery = true ; } if ( this . statementRecoveryActivated ) { jumpOverType ( ) ; } act -= ERROR_ACTION ; if ( DEBUG_AUTOMATON ) { System . out . print ( "<STR_LIT>" + name [ terminal_index [ this . currentToken ] ] + "<STR_LIT>" ) ; } } else { if ( act < ACCEPT_ACTION ) { consumeToken ( this . currentToken ) ; if ( this . currentElement != null ) { boolean oldValue = this . recordStringLiterals ; this . recordStringLiterals = false ; recoveryTokenCheck ( ) ; this . recordStringLiterals = oldValue ; } try { this . currentToken = this . scanner . getNextToken ( ) ; } catch ( InvalidInputException e ) { if ( ! this . hasReportedError ) { problemReporter ( ) . scannerError ( this , e . getMessage ( ) ) ; this . hasReportedError = true ; } this . lastCheckPoint = this . scanner . currentPosition ; this . currentToken = <NUM_LIT:0> ; this . restartRecovery = true ; } if ( this . statementRecoveryActivated ) { jumpOverType ( ) ; } if ( DEBUG_AUTOMATON ) { System . out . println ( "<STR_LIT>" + name [ terminal_index [ this . currentToken ] ] + "<STR_LIT:)>" ) ; } continue ProcessTerminals ; } break ProcessTerminals ; } do { if ( DEBUG_AUTOMATON ) { System . out . println ( name [ non_terminal_index [ lhs [ act ] ] ] ) ; } consumeRule ( act ) ; this . stateStackTop -= ( rhs [ act ] - <NUM_LIT:1> ) ; act = ntAction ( this . stack [ this . stateStackTop ] , lhs [ act ] ) ; if ( DEBUG_AUTOMATON ) { if ( act <= NUM_RULES ) { System . out . print ( "<STR_LIT>" ) ; } } } while ( act <= NUM_RULES ) ; if ( DEBUG_AUTOMATON ) { System . out . println ( "<STR_LIT>" ) ; } } if ( DEBUG_AUTOMATON ) { System . out . println ( "<STR_LIT>" ) ; } endParse ( act ) ; final NLSTag [ ] tags = this . scanner . getNLSTags ( ) ; if ( tags != null ) { this . compilationUnit . nlsTags = tags ; } this . scanner . checkNonExternalizedStringLiterals = false ; if ( this . reportSyntaxErrorIsRequired && this . hasError && ! this . statementRecoveryActivated ) { if ( ! this . options . performStatementsRecovery ) { reportSyntaxErrors ( isDietParse , oldFirstToken ) ; } else { RecoveryScannerData data = this . referenceContext . compilationResult ( ) . recoveryScannerData ; if ( this . recoveryScanner == null ) { this . recoveryScanner = new RecoveryScanner ( this . scanner , data ) ; } else { this . recoveryScanner . setData ( data ) ; } this . recoveryScanner . setSource ( this . scanner . source ) ; this . recoveryScanner . lineEnds = this . scanner . lineEnds ; this . recoveryScanner . linePtr = this . scanner . linePtr ; reportSyntaxErrors ( isDietParse , oldFirstToken ) ; if ( data == null ) { this . referenceContext . compilationResult ( ) . recoveryScannerData = this . recoveryScanner . getData ( ) ; } if ( this . methodRecoveryActivated && this . options . performStatementsRecovery ) { this . methodRecoveryActivated = false ; recoverStatements ( ) ; this . methodRecoveryActivated = true ; this . lastAct = ERROR_ACTION ; } } } if ( DEBUG ) System . out . println ( "<STR_LIT>" ) ; } public void parse ( ConstructorDeclaration cd , CompilationUnitDeclaration unit , boolean recordLineSeparator ) { boolean oldMethodRecoveryActivated = this . methodRecoveryActivated ; if ( this . options . performMethodsFullRecovery ) { this . methodRecoveryActivated = true ; this . ignoreNextOpeningBrace = true ; } initialize ( ) ; goForBlockStatementsopt ( ) ; if ( recordLineSeparator ) { this . scanner . recordLineSeparator = true ; } this . nestedMethod [ this . nestedType ] ++ ; pushOnRealBlockStack ( <NUM_LIT:0> ) ; this . referenceContext = cd ; this . compilationUnit = unit ; this . scanner . resetTo ( cd . bodyStart , cd . bodyEnd ) ; try { parse ( ) ; } catch ( AbortCompilation ex ) { this . lastAct = ERROR_ACTION ; } finally { this . nestedMethod [ this . nestedType ] -- ; if ( this . options . performStatementsRecovery ) { this . methodRecoveryActivated = oldMethodRecoveryActivated ; } } checkNonNLSAfterBodyEnd ( cd . declarationSourceEnd ) ; if ( this . lastAct == ERROR_ACTION ) { cd . bits |= ASTNode . HasSyntaxErrors ; initialize ( ) ; return ; } cd . explicitDeclarations = this . realBlockStack [ this . realBlockPtr -- ] ; int length ; if ( this . astLengthPtr > - <NUM_LIT:1> && ( length = this . astLengthStack [ this . astLengthPtr -- ] ) != <NUM_LIT:0> ) { this . astPtr -= length ; if ( ! this . options . ignoreMethodBodies ) { if ( this . astStack [ this . astPtr + <NUM_LIT:1> ] instanceof ExplicitConstructorCall ) { System . arraycopy ( this . astStack , this . astPtr + <NUM_LIT:2> , cd . statements = new Statement [ length - <NUM_LIT:1> ] , <NUM_LIT:0> , length - <NUM_LIT:1> ) ; cd . constructorCall = ( ExplicitConstructorCall ) this . astStack [ this . astPtr + <NUM_LIT:1> ] ; } else { System . arraycopy ( this . astStack , this . astPtr + <NUM_LIT:1> , cd . statements = new Statement [ length ] , <NUM_LIT:0> , length ) ; cd . constructorCall = SuperReference . implicitSuperConstructorCall ( ) ; } } } else { if ( ! this . options . ignoreMethodBodies ) { cd . constructorCall = SuperReference . implicitSuperConstructorCall ( ) ; } if ( ! containsComment ( cd . bodyStart , cd . bodyEnd ) ) { cd . bits |= ASTNode . UndocumentedEmptyBlock ; } } ExplicitConstructorCall explicitConstructorCall = cd . constructorCall ; if ( explicitConstructorCall != null && explicitConstructorCall . sourceEnd == <NUM_LIT:0> ) { explicitConstructorCall . sourceEnd = cd . sourceEnd ; explicitConstructorCall . sourceStart = cd . sourceStart ; } } public void parse ( FieldDeclaration field , TypeDeclaration type , CompilationUnitDeclaration unit , char [ ] initializationSource ) { initialize ( ) ; goForExpression ( ) ; this . nestedMethod [ this . nestedType ] ++ ; this . referenceContext = type ; this . compilationUnit = unit ; this . scanner . setSource ( initializationSource ) ; this . scanner . resetTo ( <NUM_LIT:0> , initializationSource . length - <NUM_LIT:1> ) ; try { parse ( ) ; } catch ( AbortCompilation ex ) { this . lastAct = ERROR_ACTION ; } finally { this . nestedMethod [ this . nestedType ] -- ; } if ( this . lastAct == ERROR_ACTION ) { field . bits |= ASTNode . HasSyntaxErrors ; return ; } field . initialization = this . expressionStack [ this . expressionPtr ] ; if ( ( type . bits & ASTNode . HasLocalType ) != <NUM_LIT:0> ) { field . bits |= ASTNode . HasLocalType ; } } public CompilationUnitDeclaration parse ( ICompilationUnit sourceUnit , CompilationResult compilationResult ) { return parse ( sourceUnit , compilationResult , - <NUM_LIT:1> , - <NUM_LIT:1> ) ; } public CompilationUnitDeclaration parse ( ICompilationUnit sourceUnit , CompilationResult compilationResult , int start , int end ) { CompilationUnitDeclaration unit ; try { initialize ( true ) ; goForCompilationUnit ( ) ; this . referenceContext = this . compilationUnit = new CompilationUnitDeclaration ( this . problemReporter , compilationResult , <NUM_LIT:0> ) ; char [ ] contents ; try { contents = this . readManager != null ? this . readManager . getContents ( sourceUnit ) : sourceUnit . getContents ( ) ; } catch ( AbortCompilationUnit abortException ) { problemReporter ( ) . cannotReadSource ( this . compilationUnit , abortException , this . options . verbose ) ; contents = CharOperation . NO_CHAR ; } this . scanner . setSource ( contents ) ; this . compilationUnit . sourceEnd = this . scanner . source . length - <NUM_LIT:1> ; if ( end != - <NUM_LIT:1> ) this . scanner . resetTo ( start , end ) ; if ( this . javadocParser != null && this . javadocParser . checkDocComment ) { this . javadocParser . scanner . setSource ( contents ) ; if ( end != - <NUM_LIT:1> ) { this . javadocParser . scanner . resetTo ( start , end ) ; } } parse ( ) ; } finally { unit = this . compilationUnit ; this . compilationUnit = null ; if ( ! this . diet ) unit . bits |= ASTNode . HasAllMethodBodies ; } return unit ; } public void parse ( Initializer initializer , TypeDeclaration type , CompilationUnitDeclaration unit ) { boolean oldMethodRecoveryActivated = this . methodRecoveryActivated ; if ( this . options . performMethodsFullRecovery ) { this . methodRecoveryActivated = true ; } initialize ( ) ; goForBlockStatementsopt ( ) ; this . nestedMethod [ this . nestedType ] ++ ; pushOnRealBlockStack ( <NUM_LIT:0> ) ; this . referenceContext = type ; this . compilationUnit = unit ; this . scanner . resetTo ( initializer . bodyStart , initializer . bodyEnd ) ; try { parse ( ) ; } catch ( AbortCompilation ex ) { this . lastAct = ERROR_ACTION ; } finally { this . nestedMethod [ this . nestedType ] -- ; if ( this . options . performStatementsRecovery ) { this . methodRecoveryActivated = oldMethodRecoveryActivated ; } } checkNonNLSAfterBodyEnd ( initializer . declarationSourceEnd ) ; if ( this . lastAct == ERROR_ACTION ) { initializer . bits |= ASTNode . HasSyntaxErrors ; return ; } initializer . block . explicitDeclarations = this . realBlockStack [ this . realBlockPtr -- ] ; int length ; if ( this . astLengthPtr > - <NUM_LIT:1> && ( length = this . astLengthStack [ this . astLengthPtr -- ] ) > <NUM_LIT:0> ) { System . arraycopy ( this . astStack , ( this . astPtr -= length ) + <NUM_LIT:1> , initializer . block . statements = new Statement [ length ] , <NUM_LIT:0> , length ) ; } else { if ( ! containsComment ( initializer . block . sourceStart , initializer . block . sourceEnd ) ) { initializer . block . bits |= ASTNode . UndocumentedEmptyBlock ; } } if ( ( type . bits & ASTNode . HasLocalType ) != <NUM_LIT:0> ) { initializer . bits |= ASTNode . HasLocalType ; } } public void parse ( MethodDeclaration md , CompilationUnitDeclaration unit ) { if ( md . isAbstract ( ) ) return ; if ( md . isNative ( ) ) return ; if ( ( md . modifiers & ExtraCompilerModifiers . AccSemicolonBody ) != <NUM_LIT:0> ) return ; boolean oldMethodRecoveryActivated = this . methodRecoveryActivated ; if ( this . options . performMethodsFullRecovery ) { this . ignoreNextOpeningBrace = true ; this . methodRecoveryActivated = true ; this . rParenPos = md . sourceEnd ; } initialize ( ) ; goForBlockStatementsopt ( ) ; this . nestedMethod [ this . nestedType ] ++ ; pushOnRealBlockStack ( <NUM_LIT:0> ) ; this . referenceContext = md ; this . compilationUnit = unit ; this . scanner . resetTo ( md . bodyStart , md . bodyEnd ) ; try { parse ( ) ; } catch ( AbortCompilation ex ) { this . lastAct = ERROR_ACTION ; } finally { this . nestedMethod [ this . nestedType ] -- ; if ( this . options . performStatementsRecovery ) { this . methodRecoveryActivated = oldMethodRecoveryActivated ; } } checkNonNLSAfterBodyEnd ( md . declarationSourceEnd ) ; if ( this . lastAct == ERROR_ACTION ) { md . bits |= ASTNode . HasSyntaxErrors ; return ; } md . explicitDeclarations = this . realBlockStack [ this . realBlockPtr -- ] ; int length ; if ( this . astLengthPtr > - <NUM_LIT:1> && ( length = this . astLengthStack [ this . astLengthPtr -- ] ) != <NUM_LIT:0> ) { if ( this . options . ignoreMethodBodies ) { this . astPtr -= length ; } else { System . arraycopy ( this . astStack , ( this . astPtr -= length ) + <NUM_LIT:1> , md . statements = new Statement [ length ] , <NUM_LIT:0> , length ) ; } } else { if ( ! containsComment ( md . bodyStart , md . bodyEnd ) ) { md . bits |= ASTNode . UndocumentedEmptyBlock ; } } } public ASTNode [ ] parseClassBodyDeclarations ( char [ ] source , int offset , int length , CompilationUnitDeclaration unit ) { boolean oldDiet = this . diet ; initialize ( ) ; goForClassBodyDeclarations ( ) ; this . scanner . setSource ( source ) ; this . scanner . resetTo ( offset , offset + length - <NUM_LIT:1> ) ; if ( this . javadocParser != null && this . javadocParser . checkDocComment ) { this . javadocParser . scanner . setSource ( source ) ; this . javadocParser . scanner . resetTo ( offset , offset + length - <NUM_LIT:1> ) ; } this . nestedType = <NUM_LIT:1> ; TypeDeclaration referenceContextTypeDeclaration = new TypeDeclaration ( unit . compilationResult ) ; referenceContextTypeDeclaration . name = Util . EMPTY_STRING . toCharArray ( ) ; referenceContextTypeDeclaration . fields = new FieldDeclaration [ <NUM_LIT:0> ] ; this . compilationUnit = unit ; unit . types = new TypeDeclaration [ <NUM_LIT:1> ] ; unit . types [ <NUM_LIT:0> ] = referenceContextTypeDeclaration ; this . referenceContext = unit ; try { this . diet = true ; parse ( ) ; } catch ( AbortCompilation ex ) { this . lastAct = ERROR_ACTION ; } finally { this . diet = oldDiet ; } ASTNode [ ] result = null ; if ( this . lastAct == ERROR_ACTION ) { if ( ! this . options . performMethodsFullRecovery && ! this . options . performStatementsRecovery ) { return null ; } final List bodyDeclarations = new ArrayList ( ) ; ASTVisitor visitor = new ASTVisitor ( ) { public boolean visit ( MethodDeclaration methodDeclaration , ClassScope scope ) { if ( ! methodDeclaration . isDefaultConstructor ( ) ) { bodyDeclarations . add ( methodDeclaration ) ; } return false ; } public boolean visit ( FieldDeclaration fieldDeclaration , MethodScope scope ) { bodyDeclarations . add ( fieldDeclaration ) ; return false ; } public boolean visit ( TypeDeclaration memberTypeDeclaration , ClassScope scope ) { bodyDeclarations . add ( memberTypeDeclaration ) ; return false ; } } ; unit . ignoreFurtherInvestigation = false ; unit . traverse ( visitor , unit . scope ) ; unit . ignoreFurtherInvestigation = true ; result = ( ASTNode [ ] ) bodyDeclarations . toArray ( new ASTNode [ bodyDeclarations . size ( ) ] ) ; } else { int astLength ; if ( this . astLengthPtr > - <NUM_LIT:1> && ( astLength = this . astLengthStack [ this . astLengthPtr -- ] ) != <NUM_LIT:0> ) { result = new ASTNode [ astLength ] ; this . astPtr -= astLength ; System . arraycopy ( this . astStack , this . astPtr + <NUM_LIT:1> , result , <NUM_LIT:0> , astLength ) ; } else { result = new ASTNode [ <NUM_LIT:0> ] ; } } boolean containsInitializers = false ; TypeDeclaration typeDeclaration = null ; for ( int i = <NUM_LIT:0> , max = result . length ; i < max ; i ++ ) { ASTNode node = result [ i ] ; if ( node instanceof TypeDeclaration ) { ( ( TypeDeclaration ) node ) . parseMethods ( this , unit ) ; } else if ( node instanceof AbstractMethodDeclaration ) { ( ( AbstractMethodDeclaration ) node ) . parseStatements ( this , unit ) ; } else if ( node instanceof FieldDeclaration ) { FieldDeclaration fieldDeclaration = ( FieldDeclaration ) node ; switch ( fieldDeclaration . getKind ( ) ) { case AbstractVariableDeclaration . INITIALIZER : containsInitializers = true ; if ( typeDeclaration == null ) { typeDeclaration = referenceContextTypeDeclaration ; } if ( typeDeclaration . fields == null ) { typeDeclaration . fields = new FieldDeclaration [ <NUM_LIT:1> ] ; typeDeclaration . fields [ <NUM_LIT:0> ] = fieldDeclaration ; } else { int length2 = typeDeclaration . fields . length ; FieldDeclaration [ ] temp = new FieldDeclaration [ length2 + <NUM_LIT:1> ] ; System . arraycopy ( typeDeclaration . fields , <NUM_LIT:0> , temp , <NUM_LIT:0> , length2 ) ; temp [ length2 ] = fieldDeclaration ; typeDeclaration . fields = temp ; } break ; } } if ( ( ( node . bits & ASTNode . HasSyntaxErrors ) != <NUM_LIT:0> ) && ( ! this . options . performMethodsFullRecovery && ! this . options . performStatementsRecovery ) ) { return null ; } } if ( containsInitializers ) { FieldDeclaration [ ] fieldDeclarations = typeDeclaration . fields ; for ( int i = <NUM_LIT:0> , max = fieldDeclarations . length ; i < max ; i ++ ) { Initializer initializer = ( Initializer ) fieldDeclarations [ i ] ; initializer . parseStatements ( this , typeDeclaration , unit ) ; if ( ( ( initializer . bits & ASTNode . HasSyntaxErrors ) != <NUM_LIT:0> ) && ( ! this . options . performMethodsFullRecovery && ! this . options . performStatementsRecovery ) ) { return null ; } } } return result ; } public Expression parseExpression ( char [ ] source , int offset , int length , CompilationUnitDeclaration unit ) { initialize ( ) ; goForExpression ( ) ; this . nestedMethod [ this . nestedType ] ++ ; this . referenceContext = unit ; this . compilationUnit = unit ; this . scanner . setSource ( source ) ; this . scanner . resetTo ( offset , offset + length - <NUM_LIT:1> ) ; try { parse ( ) ; } catch ( AbortCompilation ex ) { this . lastAct = ERROR_ACTION ; } finally { this . nestedMethod [ this . nestedType ] -- ; } if ( this . lastAct == ERROR_ACTION ) { return null ; } return this . expressionStack [ this . expressionPtr ] ; } public Expression parseMemberValue ( char [ ] source , int offset , int length , CompilationUnitDeclaration unit ) { initialize ( ) ; goForMemberValue ( ) ; this . nestedMethod [ this . nestedType ] ++ ; this . referenceContext = unit ; this . compilationUnit = unit ; this . scanner . setSource ( source ) ; this . scanner . resetTo ( offset , offset + length - <NUM_LIT:1> ) ; try { parse ( ) ; } catch ( AbortCompilation ex ) { this . lastAct = ERROR_ACTION ; } finally { this . nestedMethod [ this . nestedType ] -- ; } if ( this . lastAct == ERROR_ACTION ) { return null ; } return this . expressionStack [ this . expressionPtr ] ; } public void parseStatements ( ReferenceContext rc , int start , int end , TypeDeclaration [ ] types , CompilationUnitDeclaration unit ) { boolean oldStatementRecoveryEnabled = this . statementRecoveryActivated ; this . statementRecoveryActivated = true ; initialize ( ) ; goForBlockStatementsopt ( ) ; this . nestedMethod [ this . nestedType ] ++ ; pushOnRealBlockStack ( <NUM_LIT:0> ) ; pushOnAstLengthStack ( <NUM_LIT:0> ) ; this . referenceContext = rc ; this . compilationUnit = unit ; this . pendingRecoveredType = null ; if ( types != null && types . length > <NUM_LIT:0> ) { this . recoveredTypes = types ; this . recoveredTypePtr = <NUM_LIT:0> ; this . nextTypeStart = this . recoveredTypes [ <NUM_LIT:0> ] . allocation == null ? this . recoveredTypes [ <NUM_LIT:0> ] . declarationSourceStart : this . recoveredTypes [ <NUM_LIT:0> ] . allocation . sourceStart ; } else { this . recoveredTypes = null ; this . recoveredTypePtr = - <NUM_LIT:1> ; this . nextTypeStart = - <NUM_LIT:1> ; } this . scanner . resetTo ( start , end ) ; this . lastCheckPoint = this . scanner . initialPosition ; this . stateStackTop = - <NUM_LIT:1> ; try { parse ( ) ; } catch ( AbortCompilation ex ) { this . lastAct = ERROR_ACTION ; } finally { this . nestedMethod [ this . nestedType ] -- ; this . recoveredTypes = null ; this . statementRecoveryActivated = oldStatementRecoveryEnabled ; } checkNonNLSAfterBodyEnd ( end ) ; } public void persistLineSeparatorPositions ( ) { if ( this . scanner . recordLineSeparator ) { this . compilationUnit . compilationResult . lineSeparatorPositions = this . scanner . getLineEnds ( ) ; } } protected void prepareForBlockStatements ( ) { this . nestedMethod [ this . nestedType = <NUM_LIT:0> ] = <NUM_LIT:1> ; this . variablesCounter [ this . nestedType ] = <NUM_LIT:0> ; this . realBlockStack [ this . realBlockPtr = <NUM_LIT:1> ] = <NUM_LIT:0> ; } public ProblemReporter problemReporter ( ) { if ( this . scanner . recordLineSeparator ) { this . compilationUnit . compilationResult . lineSeparatorPositions = this . scanner . getLineEnds ( ) ; } this . problemReporter . referenceContext = this . referenceContext ; return this . problemReporter ; } protected void pushIdentifier ( ) { int stackLength = this . identifierStack . length ; if ( ++ this . identifierPtr >= stackLength ) { System . arraycopy ( this . identifierStack , <NUM_LIT:0> , this . identifierStack = new char [ stackLength + <NUM_LIT:20> ] [ ] , <NUM_LIT:0> , stackLength ) ; System . arraycopy ( this . identifierPositionStack , <NUM_LIT:0> , this . identifierPositionStack = new long [ stackLength + <NUM_LIT:20> ] , <NUM_LIT:0> , stackLength ) ; } this . identifierStack [ this . identifierPtr ] = this . scanner . getCurrentIdentifierSource ( ) ; this . identifierPositionStack [ this . identifierPtr ] = ( ( ( long ) this . scanner . startPosition ) << <NUM_LIT:32> ) + ( this . scanner . currentPosition - <NUM_LIT:1> ) ; stackLength = this . identifierLengthStack . length ; if ( ++ this . identifierLengthPtr >= stackLength ) { System . arraycopy ( this . identifierLengthStack , <NUM_LIT:0> , this . identifierLengthStack = new int [ stackLength + <NUM_LIT:10> ] , <NUM_LIT:0> , stackLength ) ; } this . identifierLengthStack [ this . identifierLengthPtr ] = <NUM_LIT:1> ; } protected void pushIdentifier ( int flag ) { int stackLength = this . identifierLengthStack . length ; if ( ++ this . identifierLengthPtr >= stackLength ) { System . arraycopy ( this . identifierLengthStack , <NUM_LIT:0> , this . identifierLengthStack = new int [ stackLength + <NUM_LIT:10> ] , <NUM_LIT:0> , stackLength ) ; } this . identifierLengthStack [ this . identifierLengthPtr ] = flag ; } protected void pushOnAstLengthStack ( int pos ) { int stackLength = this . astLengthStack . length ; if ( ++ this . astLengthPtr >= stackLength ) { System . arraycopy ( this . astLengthStack , <NUM_LIT:0> , this . astLengthStack = new int [ stackLength + StackIncrement ] , <NUM_LIT:0> , stackLength ) ; } this . astLengthStack [ this . astLengthPtr ] = pos ; } protected void pushOnAstStack ( ASTNode node ) { int stackLength = this . astStack . length ; if ( ++ this . astPtr >= stackLength ) { System . arraycopy ( this . astStack , <NUM_LIT:0> , this . astStack = new ASTNode [ stackLength + AstStackIncrement ] , <NUM_LIT:0> , stackLength ) ; this . astPtr = stackLength ; } this . astStack [ this . astPtr ] = node ; stackLength = this . astLengthStack . length ; if ( ++ this . astLengthPtr >= stackLength ) { System . arraycopy ( this . astLengthStack , <NUM_LIT:0> , this . astLengthStack = new int [ stackLength + AstStackIncrement ] , <NUM_LIT:0> , stackLength ) ; } this . astLengthStack [ this . astLengthPtr ] = <NUM_LIT:1> ; } protected void pushOnExpressionStack ( Expression expr ) { int stackLength = this . expressionStack . length ; if ( ++ this . expressionPtr >= stackLength ) { System . arraycopy ( this . expressionStack , <NUM_LIT:0> , this . expressionStack = new Expression [ stackLength + ExpressionStackIncrement ] , <NUM_LIT:0> , stackLength ) ; } this . expressionStack [ this . expressionPtr ] = expr ; stackLength = this . expressionLengthStack . length ; if ( ++ this . expressionLengthPtr >= stackLength ) { System . arraycopy ( this . expressionLengthStack , <NUM_LIT:0> , this . expressionLengthStack = new int [ stackLength + ExpressionStackIncrement ] , <NUM_LIT:0> , stackLength ) ; } this . expressionLengthStack [ this . expressionLengthPtr ] = <NUM_LIT:1> ; } protected void pushOnExpressionStackLengthStack ( int pos ) { int stackLength = this . expressionLengthStack . length ; if ( ++ this . expressionLengthPtr >= stackLength ) { System . arraycopy ( this . expressionLengthStack , <NUM_LIT:0> , this . expressionLengthStack = new int [ stackLength + StackIncrement ] , <NUM_LIT:0> , stackLength ) ; } this . expressionLengthStack [ this . expressionLengthPtr ] = pos ; } protected void pushOnGenericsIdentifiersLengthStack ( int pos ) { int stackLength = this . genericsIdentifiersLengthStack . length ; if ( ++ this . genericsIdentifiersLengthPtr >= stackLength ) { System . arraycopy ( this . genericsIdentifiersLengthStack , <NUM_LIT:0> , this . genericsIdentifiersLengthStack = new int [ stackLength + GenericsStackIncrement ] , <NUM_LIT:0> , stackLength ) ; } this . genericsIdentifiersLengthStack [ this . genericsIdentifiersLengthPtr ] = pos ; } protected void pushOnGenericsLengthStack ( int pos ) { int stackLength = this . genericsLengthStack . length ; if ( ++ this . genericsLengthPtr >= stackLength ) { System . arraycopy ( this . genericsLengthStack , <NUM_LIT:0> , this . genericsLengthStack = new int [ stackLength + GenericsStackIncrement ] , <NUM_LIT:0> , stackLength ) ; } this . genericsLengthStack [ this . genericsLengthPtr ] = pos ; } protected void pushOnGenericsStack ( ASTNode node ) { int stackLength = this . genericsStack . length ; if ( ++ this . genericsPtr >= stackLength ) { System . arraycopy ( this . genericsStack , <NUM_LIT:0> , this . genericsStack = new ASTNode [ stackLength + GenericsStackIncrement ] , <NUM_LIT:0> , stackLength ) ; } this . genericsStack [ this . genericsPtr ] = node ; stackLength = this . genericsLengthStack . length ; if ( ++ this . genericsLengthPtr >= stackLength ) { System . arraycopy ( this . genericsLengthStack , <NUM_LIT:0> , this . genericsLengthStack = new int [ stackLength + GenericsStackIncrement ] , <NUM_LIT:0> , stackLength ) ; } this . genericsLengthStack [ this . genericsLengthPtr ] = <NUM_LIT:1> ; } protected void pushOnIntStack ( int pos ) { int stackLength = this . intStack . length ; if ( ++ this . intPtr >= stackLength ) { System . arraycopy ( this . intStack , <NUM_LIT:0> , this . intStack = new int [ stackLength + StackIncrement ] , <NUM_LIT:0> , stackLength ) ; } this . intStack [ this . intPtr ] = pos ; } protected void pushOnRealBlockStack ( int i ) { int stackLength = this . realBlockStack . length ; if ( ++ this . realBlockPtr >= stackLength ) { System . arraycopy ( this . realBlockStack , <NUM_LIT:0> , this . realBlockStack = new int [ stackLength + StackIncrement ] , <NUM_LIT:0> , stackLength ) ; } this . realBlockStack [ this . realBlockPtr ] = i ; } protected void recoverStatements ( ) { class MethodVisitor extends ASTVisitor { public ASTVisitor typeVisitor ; TypeDeclaration enclosingType ; TypeDeclaration [ ] types = new TypeDeclaration [ <NUM_LIT:0> ] ; int typePtr = - <NUM_LIT:1> ; public void endVisit ( ConstructorDeclaration constructorDeclaration , ClassScope scope ) { endVisitMethod ( constructorDeclaration , scope ) ; } public void endVisit ( Initializer initializer , MethodScope scope ) { if ( initializer . block == null ) return ; TypeDeclaration [ ] foundTypes = null ; int length = <NUM_LIT:0> ; if ( this . typePtr > - <NUM_LIT:1> ) { length = this . typePtr + <NUM_LIT:1> ; foundTypes = new TypeDeclaration [ length ] ; System . arraycopy ( this . types , <NUM_LIT:0> , foundTypes , <NUM_LIT:0> , length ) ; } ReferenceContext oldContext = Parser . this . referenceContext ; Parser . this . recoveryScanner . resetTo ( initializer . bodyStart , initializer . bodyEnd ) ; Scanner oldScanner = Parser . this . scanner ; Parser . this . scanner = Parser . this . recoveryScanner ; parseStatements ( this . enclosingType , initializer . bodyStart , initializer . bodyEnd , foundTypes , Parser . this . compilationUnit ) ; Parser . this . scanner = oldScanner ; Parser . this . referenceContext = oldContext ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { foundTypes [ i ] . traverse ( this . typeVisitor , scope ) ; } } public void endVisit ( MethodDeclaration methodDeclaration , ClassScope scope ) { endVisitMethod ( methodDeclaration , scope ) ; } private void endVisitMethod ( AbstractMethodDeclaration methodDeclaration , ClassScope scope ) { TypeDeclaration [ ] foundTypes = null ; int length = <NUM_LIT:0> ; if ( this . typePtr > - <NUM_LIT:1> ) { length = this . typePtr + <NUM_LIT:1> ; foundTypes = new TypeDeclaration [ length ] ; System . arraycopy ( this . types , <NUM_LIT:0> , foundTypes , <NUM_LIT:0> , length ) ; } ReferenceContext oldContext = Parser . this . referenceContext ; Parser . this . recoveryScanner . resetTo ( methodDeclaration . bodyStart , methodDeclaration . bodyEnd ) ; Scanner oldScanner = Parser . this . scanner ; Parser . this . scanner = Parser . this . recoveryScanner ; parseStatements ( methodDeclaration , methodDeclaration . bodyStart , methodDeclaration . bodyEnd , foundTypes , Parser . this . compilationUnit ) ; Parser . this . scanner = oldScanner ; Parser . this . referenceContext = oldContext ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { foundTypes [ i ] . traverse ( this . typeVisitor , scope ) ; } } public boolean visit ( ConstructorDeclaration constructorDeclaration , ClassScope scope ) { this . typePtr = - <NUM_LIT:1> ; return true ; } public boolean visit ( Initializer initializer , MethodScope scope ) { this . typePtr = - <NUM_LIT:1> ; if ( initializer . block == null ) return false ; return true ; } public boolean visit ( MethodDeclaration methodDeclaration , ClassScope scope ) { this . typePtr = - <NUM_LIT:1> ; return true ; } private boolean visit ( TypeDeclaration typeDeclaration ) { if ( this . types . length <= ++ this . typePtr ) { int length = this . typePtr ; System . arraycopy ( this . types , <NUM_LIT:0> , this . types = new TypeDeclaration [ length * <NUM_LIT:2> + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; } this . types [ this . typePtr ] = typeDeclaration ; return false ; } public boolean visit ( TypeDeclaration typeDeclaration , BlockScope scope ) { return this . visit ( typeDeclaration ) ; } public boolean visit ( TypeDeclaration typeDeclaration , ClassScope scope ) { return this . visit ( typeDeclaration ) ; } } class TypeVisitor extends ASTVisitor { public MethodVisitor methodVisitor ; TypeDeclaration [ ] types = new TypeDeclaration [ <NUM_LIT:0> ] ; int typePtr = - <NUM_LIT:1> ; public void endVisit ( TypeDeclaration typeDeclaration , BlockScope scope ) { endVisitType ( ) ; } public void endVisit ( TypeDeclaration typeDeclaration , ClassScope scope ) { endVisitType ( ) ; } private void endVisitType ( ) { this . typePtr -- ; } public boolean visit ( ConstructorDeclaration constructorDeclaration , ClassScope scope ) { if ( constructorDeclaration . isDefaultConstructor ( ) ) return false ; constructorDeclaration . traverse ( this . methodVisitor , scope ) ; return false ; } public boolean visit ( Initializer initializer , MethodScope scope ) { if ( initializer . block == null ) return false ; this . methodVisitor . enclosingType = this . types [ this . typePtr ] ; initializer . traverse ( this . methodVisitor , scope ) ; return false ; } public boolean visit ( MethodDeclaration methodDeclaration , ClassScope scope ) { methodDeclaration . traverse ( this . methodVisitor , scope ) ; return false ; } private boolean visit ( TypeDeclaration typeDeclaration ) { if ( this . types . length <= ++ this . typePtr ) { int length = this . typePtr ; System . arraycopy ( this . types , <NUM_LIT:0> , this . types = new TypeDeclaration [ length * <NUM_LIT:2> + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; } this . types [ this . typePtr ] = typeDeclaration ; return true ; } public boolean visit ( TypeDeclaration typeDeclaration , BlockScope scope ) { return this . visit ( typeDeclaration ) ; } public boolean visit ( TypeDeclaration typeDeclaration , ClassScope scope ) { return this . visit ( typeDeclaration ) ; } } MethodVisitor methodVisitor = new MethodVisitor ( ) ; TypeVisitor typeVisitor = new TypeVisitor ( ) ; methodVisitor . typeVisitor = typeVisitor ; typeVisitor . methodVisitor = methodVisitor ; if ( this . referenceContext instanceof AbstractMethodDeclaration ) { ( ( AbstractMethodDeclaration ) this . referenceContext ) . traverse ( methodVisitor , ( ClassScope ) null ) ; } else if ( this . referenceContext instanceof TypeDeclaration ) { TypeDeclaration typeContext = ( TypeDeclaration ) this . referenceContext ; int length = typeContext . fields . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { final FieldDeclaration fieldDeclaration = typeContext . fields [ i ] ; switch ( fieldDeclaration . getKind ( ) ) { case AbstractVariableDeclaration . INITIALIZER : Initializer initializer = ( Initializer ) fieldDeclaration ; if ( initializer . block == null ) break ; methodVisitor . enclosingType = typeContext ; initializer . traverse ( methodVisitor , ( MethodScope ) null ) ; break ; } } } } public void recoveryExitFromVariable ( ) { if ( this . currentElement != null && this . currentElement . parent != null ) { if ( this . currentElement instanceof RecoveredLocalVariable ) { int end = ( ( RecoveredLocalVariable ) this . currentElement ) . localDeclaration . sourceEnd ; this . currentElement . updateSourceEndIfNecessary ( end ) ; this . currentElement = this . currentElement . parent ; } else if ( this . currentElement instanceof RecoveredField && ! ( this . currentElement instanceof RecoveredInitializer ) ) { if ( this . currentElement . bracketBalance <= <NUM_LIT:0> ) { int end = ( ( RecoveredField ) this . currentElement ) . fieldDeclaration . sourceEnd ; this . currentElement . updateSourceEndIfNecessary ( end ) ; this . currentElement = this . currentElement . parent ; } } } } public void recoveryTokenCheck ( ) { switch ( this . currentToken ) { case TokenNameStringLiteral : if ( this . recordStringLiterals && this . checkExternalizeStrings && this . lastPosistion < this . scanner . currentPosition && ! this . statementRecoveryActivated ) { StringLiteral stringLiteral = createStringLiteral ( this . scanner . getCurrentTokenSourceString ( ) , this . scanner . startPosition , this . scanner . currentPosition - <NUM_LIT:1> , Util . getLineNumber ( this . scanner . startPosition , this . scanner . lineEnds , <NUM_LIT:0> , this . scanner . linePtr ) ) ; this . compilationUnit . recordStringLiteral ( stringLiteral , this . currentElement != null ) ; } break ; case TokenNameLBRACE : RecoveredElement newElement = null ; if ( ! this . ignoreNextOpeningBrace ) { newElement = this . currentElement . updateOnOpeningBrace ( this . scanner . startPosition - <NUM_LIT:1> , this . scanner . currentPosition - <NUM_LIT:1> ) ; } this . lastCheckPoint = this . scanner . currentPosition ; if ( newElement != null ) { this . restartRecovery = true ; this . currentElement = newElement ; } break ; case TokenNameRBRACE : this . rBraceStart = this . scanner . startPosition - <NUM_LIT:1> ; this . rBraceEnd = this . scanner . currentPosition - <NUM_LIT:1> ; this . endPosition = flushCommentsDefinedPriorTo ( this . rBraceEnd ) ; newElement = this . currentElement . updateOnClosingBrace ( this . scanner . startPosition , this . rBraceEnd ) ; this . lastCheckPoint = this . scanner . currentPosition ; if ( newElement != this . currentElement ) { this . currentElement = newElement ; } break ; case TokenNameSEMICOLON : this . endStatementPosition = this . scanner . currentPosition - <NUM_LIT:1> ; this . endPosition = this . scanner . startPosition - <NUM_LIT:1> ; RecoveredType currentType = currentRecoveryType ( ) ; if ( currentType != null ) { currentType . insideEnumConstantPart = false ; } default : { if ( this . rBraceEnd > this . rBraceSuccessorStart && this . scanner . currentPosition != this . scanner . startPosition ) { this . rBraceSuccessorStart = this . scanner . startPosition ; } break ; } } this . ignoreNextOpeningBrace = false ; } protected void reportSyntaxErrors ( boolean isDietParse , int oldFirstToken ) { if ( this . referenceContext instanceof MethodDeclaration ) { MethodDeclaration methodDeclaration = ( MethodDeclaration ) this . referenceContext ; if ( ( methodDeclaration . bits & ASTNode . ErrorInSignature ) != <NUM_LIT:0> ) { return ; } } this . compilationUnit . compilationResult . lineSeparatorPositions = this . scanner . getLineEnds ( ) ; this . scanner . recordLineSeparator = false ; int start = this . scanner . initialPosition ; int end = this . scanner . eofPosition == Integer . MAX_VALUE ? this . scanner . eofPosition : this . scanner . eofPosition - <NUM_LIT:1> ; if ( isDietParse ) { TypeDeclaration [ ] types = this . compilationUnit . types ; int [ ] [ ] intervalToSkip = org . eclipse . jdt . internal . compiler . parser . diagnose . RangeUtil . computeDietRange ( types ) ; DiagnoseParser diagnoseParser = new DiagnoseParser ( this , oldFirstToken , start , end , intervalToSkip [ <NUM_LIT:0> ] , intervalToSkip [ <NUM_LIT:1> ] , intervalToSkip [ <NUM_LIT:2> ] , this . options ) ; diagnoseParser . diagnoseParse ( false ) ; reportSyntaxErrorsForSkippedMethod ( types ) ; this . scanner . resetTo ( start , end ) ; } else { DiagnoseParser diagnoseParser = new DiagnoseParser ( this , oldFirstToken , start , end , this . options ) ; diagnoseParser . diagnoseParse ( this . options . performStatementsRecovery ) ; } } private void reportSyntaxErrorsForSkippedMethod ( TypeDeclaration [ ] types ) { if ( types != null ) { for ( int i = <NUM_LIT:0> ; i < types . length ; i ++ ) { TypeDeclaration [ ] memberTypes = types [ i ] . memberTypes ; if ( memberTypes != null ) { reportSyntaxErrorsForSkippedMethod ( memberTypes ) ; } AbstractMethodDeclaration [ ] methods = types [ i ] . methods ; if ( methods != null ) { for ( int j = <NUM_LIT:0> ; j < methods . length ; j ++ ) { AbstractMethodDeclaration method = methods [ j ] ; if ( ( method . bits & ASTNode . ErrorInSignature ) != <NUM_LIT:0> ) { if ( method . isAnnotationMethod ( ) ) { DiagnoseParser diagnoseParser = new DiagnoseParser ( this , TokenNameQUESTION , method . declarationSourceStart , method . declarationSourceEnd , this . options ) ; diagnoseParser . diagnoseParse ( this . options . performStatementsRecovery ) ; } else { DiagnoseParser diagnoseParser = new DiagnoseParser ( this , TokenNameDIVIDE , method . declarationSourceStart , method . declarationSourceEnd , this . options ) ; diagnoseParser . diagnoseParse ( this . options . performStatementsRecovery ) ; } } } } FieldDeclaration [ ] fields = types [ i ] . fields ; if ( fields != null ) { int length = fields . length ; for ( int j = <NUM_LIT:0> ; j < length ; j ++ ) { if ( fields [ j ] instanceof Initializer ) { Initializer initializer = ( Initializer ) fields [ j ] ; if ( ( initializer . bits & ASTNode . ErrorInSignature ) != <NUM_LIT:0> ) { DiagnoseParser diagnoseParser = new DiagnoseParser ( this , TokenNameRIGHT_SHIFT , initializer . declarationSourceStart , initializer . declarationSourceEnd , this . options ) ; diagnoseParser . diagnoseParse ( this . options . performStatementsRecovery ) ; } } } } } } } protected void resetModifiers ( ) { this . modifiers = ClassFileConstants . AccDefault ; this . modifiersSourceStart = - <NUM_LIT:1> ; this . scanner . commentPtr = - <NUM_LIT:1> ; } protected void resetStacks ( ) { this . astPtr = - <NUM_LIT:1> ; this . astLengthPtr = - <NUM_LIT:1> ; this . expressionPtr = - <NUM_LIT:1> ; this . expressionLengthPtr = - <NUM_LIT:1> ; this . identifierPtr = - <NUM_LIT:1> ; this . identifierLengthPtr = - <NUM_LIT:1> ; this . intPtr = - <NUM_LIT:1> ; this . nestedMethod [ this . nestedType = <NUM_LIT:0> ] = <NUM_LIT:0> ; this . variablesCounter [ this . nestedType ] = <NUM_LIT:0> ; this . dimensions = <NUM_LIT:0> ; this . realBlockStack [ this . realBlockPtr = <NUM_LIT:0> ] = <NUM_LIT:0> ; this . recoveredStaticInitializerStart = <NUM_LIT:0> ; this . listLength = <NUM_LIT:0> ; this . listTypeParameterLength = <NUM_LIT:0> ; this . genericsIdentifiersLengthPtr = - <NUM_LIT:1> ; this . genericsLengthPtr = - <NUM_LIT:1> ; this . genericsPtr = - <NUM_LIT:1> ; } protected boolean resumeAfterRecovery ( ) { if ( ! this . methodRecoveryActivated && ! this . statementRecoveryActivated ) { resetStacks ( ) ; resetModifiers ( ) ; if ( ! moveRecoveryCheckpoint ( ) ) { return false ; } if ( this . referenceContext instanceof CompilationUnitDeclaration ) { goForHeaders ( ) ; this . diet = true ; return true ; } return false ; } else if ( ! this . statementRecoveryActivated ) { resetStacks ( ) ; resetModifiers ( ) ; if ( ! moveRecoveryCheckpoint ( ) ) { return false ; } goForHeaders ( ) ; return true ; } else { return false ; } } protected boolean resumeOnSyntaxError ( ) { if ( this . currentElement == null ) { this . javadoc = null ; if ( this . statementRecoveryActivated ) return false ; this . currentElement = buildInitialRecoveryState ( ) ; } if ( this . currentElement == null ) return false ; if ( this . restartRecovery ) { this . restartRecovery = false ; } updateRecoveryState ( ) ; if ( getFirstToken ( ) == TokenNameAND ) { if ( this . referenceContext instanceof CompilationUnitDeclaration ) { TypeDeclaration typeDeclaration = new TypeDeclaration ( this . referenceContext . compilationResult ( ) ) ; typeDeclaration . name = Util . EMPTY_STRING . toCharArray ( ) ; this . currentElement = this . currentElement . add ( typeDeclaration , <NUM_LIT:0> ) ; } } if ( this . lastPosistion < this . scanner . currentPosition ) { this . lastPosistion = this . scanner . currentPosition ; this . scanner . lastPosition = this . scanner . currentPosition ; } return resumeAfterRecovery ( ) ; } public void setMethodsFullRecovery ( boolean enabled ) { this . options . performMethodsFullRecovery = enabled ; } public void setStatementsRecovery ( boolean enabled ) { if ( enabled ) this . options . performMethodsFullRecovery = true ; this . options . performStatementsRecovery = enabled ; } public String toString ( ) { String s = "<STR_LIT>" + String . valueOf ( this . lastCheckPoint ) + "<STR_LIT:n>" ; s = s + "<STR_LIT>" + ( this . identifierPtr + <NUM_LIT:1> ) + "<STR_LIT>" ; for ( int i = <NUM_LIT:0> ; i <= this . identifierPtr ; i ++ ) { s = s + "<STR_LIT:\">" + String . valueOf ( this . identifierStack [ i ] ) + "<STR_LIT>" ; } s = s + "<STR_LIT>" ; s = s + "<STR_LIT>" + ( this . identifierLengthPtr + <NUM_LIT:1> ) + "<STR_LIT>" ; for ( int i = <NUM_LIT:0> ; i <= this . identifierLengthPtr ; i ++ ) { s = s + this . identifierLengthStack [ i ] + "<STR_LIT:U+002C>" ; } s = s + "<STR_LIT>" ; s = s + "<STR_LIT>" + ( this . astLengthPtr + <NUM_LIT:1> ) + "<STR_LIT>" ; for ( int i = <NUM_LIT:0> ; i <= this . astLengthPtr ; i ++ ) { s = s + this . astLengthStack [ i ] + "<STR_LIT:U+002C>" ; } s = s + "<STR_LIT>" ; s = s + "<STR_LIT>" + String . valueOf ( this . astPtr ) + "<STR_LIT:n>" ; s = s + "<STR_LIT>" + ( this . intPtr + <NUM_LIT:1> ) + "<STR_LIT>" ; for ( int i = <NUM_LIT:0> ; i <= this . intPtr ; i ++ ) { s = s + this . intStack [ i ] + "<STR_LIT:U+002C>" ; } s = s + "<STR_LIT>" ; s = s + "<STR_LIT>" + ( this . expressionLengthPtr + <NUM_LIT:1> ) + "<STR_LIT>" ; for ( int i = <NUM_LIT:0> ; i <= this . expressionLengthPtr ; i ++ ) { s = s + this . expressionLengthStack [ i ] + "<STR_LIT:U+002C>" ; } s = s + "<STR_LIT>" ; s = s + "<STR_LIT>" + String . valueOf ( this . expressionPtr ) + "<STR_LIT:n>" ; s = s + "<STR_LIT>" + ( this . genericsIdentifiersLengthPtr + <NUM_LIT:1> ) + "<STR_LIT>" ; for ( int i = <NUM_LIT:0> ; i <= this . genericsIdentifiersLengthPtr ; i ++ ) { s = s + this . genericsIdentifiersLengthStack [ i ] + "<STR_LIT:U+002C>" ; } s = s + "<STR_LIT>" ; s = s + "<STR_LIT>" + ( this . genericsLengthPtr + <NUM_LIT:1> ) + "<STR_LIT>" ; for ( int i = <NUM_LIT:0> ; i <= this . genericsLengthPtr ; i ++ ) { s = s + this . genericsLengthStack [ i ] + "<STR_LIT:U+002C>" ; } s = s + "<STR_LIT>" ; s = s + "<STR_LIT>" + String . valueOf ( this . genericsPtr ) + "<STR_LIT:n>" ; s = s + "<STR_LIT>" + this . scanner . toString ( ) ; return s ; } protected void updateRecoveryState ( ) { this . currentElement . updateFromParserState ( ) ; recoveryTokenCheck ( ) ; } protected void updateSourceDeclarationParts ( int variableDeclaratorsCounter ) { FieldDeclaration field ; int endTypeDeclarationPosition = - <NUM_LIT:1> + this . astStack [ this . astPtr - variableDeclaratorsCounter + <NUM_LIT:1> ] . sourceStart ; for ( int i = <NUM_LIT:0> ; i < variableDeclaratorsCounter - <NUM_LIT:1> ; i ++ ) { field = ( FieldDeclaration ) this . astStack [ this . astPtr - i - <NUM_LIT:1> ] ; field . endPart1Position = endTypeDeclarationPosition ; field . endPart2Position = - <NUM_LIT:1> + this . astStack [ this . astPtr - i ] . sourceStart ; } ( field = ( FieldDeclaration ) this . astStack [ this . astPtr ] ) . endPart1Position = endTypeDeclarationPosition ; field . endPart2Position = field . declarationSourceEnd ; } protected void updateSourcePosition ( Expression exp ) { exp . sourceEnd = this . intStack [ this . intPtr -- ] ; exp . sourceStart = this . intStack [ this . intPtr -- ] ; } public void reset ( ) { } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . parser ; import java . util . Set ; import org . eclipse . jdt . core . compiler . * ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . Block ; import org . eclipse . jdt . internal . compiler . ast . FieldDeclaration ; import org . eclipse . jdt . internal . compiler . ast . Initializer ; import org . eclipse . jdt . internal . compiler . ast . LocalDeclaration ; import org . eclipse . jdt . internal . compiler . ast . Statement ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; public class RecoveredInitializer extends RecoveredField implements TerminalTokens { public RecoveredType [ ] localTypes ; public int localTypeCount ; public RecoveredBlock initializerBody ; int pendingModifiers ; int pendingModifersSourceStart = - <NUM_LIT:1> ; RecoveredAnnotation [ ] pendingAnnotations ; int pendingAnnotationCount ; public RecoveredInitializer ( FieldDeclaration fieldDeclaration , RecoveredElement parent , int bracketBalance ) { this ( fieldDeclaration , parent , bracketBalance , null ) ; } public RecoveredInitializer ( FieldDeclaration fieldDeclaration , RecoveredElement parent , int bracketBalance , Parser parser ) { super ( fieldDeclaration , parent , bracketBalance , parser ) ; this . foundOpeningBrace = true ; } public RecoveredElement add ( Block nestedBlockDeclaration , int bracketBalanceValue ) { if ( this . fieldDeclaration . declarationSourceEnd > <NUM_LIT:0> && nestedBlockDeclaration . sourceStart > this . fieldDeclaration . declarationSourceEnd ) { resetPendingModifiers ( ) ; if ( this . parent == null ) return this ; return this . parent . add ( nestedBlockDeclaration , bracketBalanceValue ) ; } if ( ! this . foundOpeningBrace ) { this . foundOpeningBrace = true ; this . bracketBalance ++ ; } this . initializerBody = new RecoveredBlock ( nestedBlockDeclaration , this , bracketBalanceValue ) ; if ( nestedBlockDeclaration . sourceEnd == <NUM_LIT:0> ) return this . initializerBody ; return this ; } public RecoveredElement add ( FieldDeclaration newFieldDeclaration , int bracketBalanceValue ) { resetPendingModifiers ( ) ; char [ ] [ ] fieldTypeName ; if ( ( newFieldDeclaration . modifiers & ~ ClassFileConstants . AccFinal ) != <NUM_LIT:0> || ( newFieldDeclaration . type == null ) || ( ( fieldTypeName = newFieldDeclaration . type . getTypeName ( ) ) . length == <NUM_LIT:1> && CharOperation . equals ( fieldTypeName [ <NUM_LIT:0> ] , TypeBinding . VOID . sourceName ( ) ) ) ) { if ( this . parent == null ) return this ; this . updateSourceEndIfNecessary ( previousAvailableLineEnd ( newFieldDeclaration . declarationSourceStart - <NUM_LIT:1> ) ) ; return this . parent . add ( newFieldDeclaration , bracketBalanceValue ) ; } if ( this . fieldDeclaration . declarationSourceEnd > <NUM_LIT:0> && newFieldDeclaration . declarationSourceStart > this . fieldDeclaration . declarationSourceEnd ) { if ( this . parent == null ) return this ; return this . parent . add ( newFieldDeclaration , bracketBalanceValue ) ; } return this ; } public RecoveredElement add ( LocalDeclaration localDeclaration , int bracketBalanceValue ) { if ( this . fieldDeclaration . declarationSourceEnd != <NUM_LIT:0> && localDeclaration . declarationSourceStart > this . fieldDeclaration . declarationSourceEnd ) { resetPendingModifiers ( ) ; if ( this . parent == null ) return this ; return this . parent . add ( localDeclaration , bracketBalanceValue ) ; } Block block = new Block ( <NUM_LIT:0> ) ; block . sourceStart = ( ( Initializer ) this . fieldDeclaration ) . sourceStart ; RecoveredElement element = this . add ( block , <NUM_LIT:1> ) ; if ( this . initializerBody != null ) { this . initializerBody . attachPendingModifiers ( this . pendingAnnotations , this . pendingAnnotationCount , this . pendingModifiers , this . pendingModifersSourceStart ) ; } resetPendingModifiers ( ) ; return element . add ( localDeclaration , bracketBalanceValue ) ; } public RecoveredElement add ( Statement statement , int bracketBalanceValue ) { if ( this . fieldDeclaration . declarationSourceEnd != <NUM_LIT:0> && statement . sourceStart > this . fieldDeclaration . declarationSourceEnd ) { resetPendingModifiers ( ) ; if ( this . parent == null ) return this ; return this . parent . add ( statement , bracketBalanceValue ) ; } Block block = new Block ( <NUM_LIT:0> ) ; block . sourceStart = ( ( Initializer ) this . fieldDeclaration ) . sourceStart ; RecoveredElement element = this . add ( block , <NUM_LIT:1> ) ; if ( this . initializerBody != null ) { this . initializerBody . attachPendingModifiers ( this . pendingAnnotations , this . pendingAnnotationCount , this . pendingModifiers , this . pendingModifersSourceStart ) ; } resetPendingModifiers ( ) ; return element . add ( statement , bracketBalanceValue ) ; } public RecoveredElement add ( TypeDeclaration typeDeclaration , int bracketBalanceValue ) { if ( this . fieldDeclaration . declarationSourceEnd != <NUM_LIT:0> && typeDeclaration . declarationSourceStart > this . fieldDeclaration . declarationSourceEnd ) { resetPendingModifiers ( ) ; if ( this . parent == null ) return this ; return this . parent . add ( typeDeclaration , bracketBalanceValue ) ; } if ( ( typeDeclaration . bits & ASTNode . IsLocalType ) != <NUM_LIT:0> || parser ( ) . methodRecoveryActivated || parser ( ) . statementRecoveryActivated ) { Block block = new Block ( <NUM_LIT:0> ) ; block . sourceStart = ( ( Initializer ) this . fieldDeclaration ) . sourceStart ; RecoveredElement element = this . add ( block , <NUM_LIT:1> ) ; if ( this . initializerBody != null ) { this . initializerBody . attachPendingModifiers ( this . pendingAnnotations , this . pendingAnnotationCount , this . pendingModifiers , this . pendingModifersSourceStart ) ; } resetPendingModifiers ( ) ; return element . add ( typeDeclaration , bracketBalanceValue ) ; } if ( this . localTypes == null ) { this . localTypes = new RecoveredType [ <NUM_LIT:5> ] ; this . localTypeCount = <NUM_LIT:0> ; } else { if ( this . localTypeCount == this . localTypes . length ) { System . arraycopy ( this . localTypes , <NUM_LIT:0> , ( this . localTypes = new RecoveredType [ <NUM_LIT:2> * this . localTypeCount ] ) , <NUM_LIT:0> , this . localTypeCount ) ; } } RecoveredType element = new RecoveredType ( typeDeclaration , this , bracketBalanceValue ) ; this . localTypes [ this . localTypeCount ++ ] = element ; if ( this . pendingAnnotationCount > <NUM_LIT:0> ) { element . attach ( this . pendingAnnotations , this . pendingAnnotationCount , this . pendingModifiers , this . pendingModifersSourceStart ) ; } resetPendingModifiers ( ) ; if ( ! this . foundOpeningBrace ) { this . foundOpeningBrace = true ; this . bracketBalance ++ ; } return element ; } public RecoveredElement addAnnotationName ( int identifierPtr , int identifierLengthPtr , int annotationStart , int bracketBalanceValue ) { if ( this . pendingAnnotations == null ) { this . pendingAnnotations = new RecoveredAnnotation [ <NUM_LIT:5> ] ; this . pendingAnnotationCount = <NUM_LIT:0> ; } else { if ( this . pendingAnnotationCount == this . pendingAnnotations . length ) { System . arraycopy ( this . pendingAnnotations , <NUM_LIT:0> , ( this . pendingAnnotations = new RecoveredAnnotation [ <NUM_LIT:2> * this . pendingAnnotationCount ] ) , <NUM_LIT:0> , this . pendingAnnotationCount ) ; } } RecoveredAnnotation element = new RecoveredAnnotation ( identifierPtr , identifierLengthPtr , annotationStart , this , bracketBalanceValue ) ; this . pendingAnnotations [ this . pendingAnnotationCount ++ ] = element ; return element ; } public void addModifier ( int flag , int modifiersSourceStart ) { this . pendingModifiers |= flag ; if ( this . pendingModifersSourceStart < <NUM_LIT:0> ) { this . pendingModifersSourceStart = modifiersSourceStart ; } } public void resetPendingModifiers ( ) { this . pendingAnnotations = null ; this . pendingAnnotationCount = <NUM_LIT:0> ; this . pendingModifiers = <NUM_LIT:0> ; this . pendingModifersSourceStart = - <NUM_LIT:1> ; } public String toString ( int tab ) { StringBuffer result = new StringBuffer ( tabString ( tab ) ) ; result . append ( "<STR_LIT>" ) ; this . fieldDeclaration . print ( tab + <NUM_LIT:1> , result ) ; if ( this . annotations != null ) { for ( int i = <NUM_LIT:0> ; i < this . annotationCount ; i ++ ) { result . append ( "<STR_LIT:n>" ) ; result . append ( this . annotations [ i ] . toString ( tab + <NUM_LIT:1> ) ) ; } } if ( this . initializerBody != null ) { result . append ( "<STR_LIT:n>" ) ; result . append ( this . initializerBody . toString ( tab + <NUM_LIT:1> ) ) ; } return result . toString ( ) ; } public FieldDeclaration updatedFieldDeclaration ( int depth , Set knownTypes ) { if ( this . initializerBody != null ) { Block block = this . initializerBody . updatedBlock ( depth , knownTypes ) ; if ( block != null ) { Initializer initializer = ( Initializer ) this . fieldDeclaration ; initializer . block = block ; if ( initializer . declarationSourceEnd == <NUM_LIT:0> ) { initializer . declarationSourceEnd = block . sourceEnd ; initializer . bodyEnd = block . sourceEnd ; } } if ( this . localTypeCount > <NUM_LIT:0> ) this . fieldDeclaration . bits |= ASTNode . HasLocalType ; } if ( this . fieldDeclaration . sourceEnd == <NUM_LIT:0> ) { this . fieldDeclaration . sourceEnd = this . fieldDeclaration . declarationSourceEnd ; } return this . fieldDeclaration ; } public RecoveredElement updateOnClosingBrace ( int braceStart , int braceEnd ) { if ( ( -- this . bracketBalance <= <NUM_LIT:0> ) && ( this . parent != null ) ) { this . updateSourceEndIfNecessary ( braceStart , braceEnd ) ; return this . parent ; } return this ; } public RecoveredElement updateOnOpeningBrace ( int braceStart , int braceEnd ) { this . bracketBalance ++ ; return this ; } public void updateSourceEndIfNecessary ( int braceStart , int braceEnd ) { if ( this . fieldDeclaration . declarationSourceEnd == <NUM_LIT:0> ) { Initializer initializer = ( Initializer ) this . fieldDeclaration ; if ( parser ( ) . rBraceSuccessorStart >= braceEnd ) { if ( initializer . bodyStart < parser ( ) . rBraceEnd ) { initializer . declarationSourceEnd = parser ( ) . rBraceEnd ; } else { initializer . declarationSourceEnd = initializer . bodyStart ; } if ( initializer . bodyStart < parser ( ) . rBraceStart ) { initializer . bodyEnd = parser ( ) . rBraceStart ; } else { initializer . bodyEnd = initializer . bodyStart ; } } else { initializer . declarationSourceEnd = braceEnd ; initializer . bodyEnd = braceStart - <NUM_LIT:1> ; } if ( initializer . block != null ) { initializer . block . sourceEnd = initializer . declarationSourceEnd ; } } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . parser ; import java . util . HashSet ; import java . util . Set ; import org . eclipse . jdt . internal . compiler . ast . Annotation ; import org . eclipse . jdt . internal . compiler . ast . ArrayQualifiedTypeReference ; import org . eclipse . jdt . internal . compiler . ast . ArrayTypeReference ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . Expression ; import org . eclipse . jdt . internal . compiler . ast . LocalDeclaration ; import org . eclipse . jdt . internal . compiler . ast . Statement ; public class RecoveredLocalVariable extends RecoveredStatement { public RecoveredAnnotation [ ] annotations ; public int annotationCount ; public int modifiers ; public int modifiersStart ; public LocalDeclaration localDeclaration ; boolean alreadyCompletedLocalInitialization ; public RecoveredLocalVariable ( LocalDeclaration localDeclaration , RecoveredElement parent , int bracketBalance ) { super ( localDeclaration , parent , bracketBalance ) ; this . localDeclaration = localDeclaration ; this . alreadyCompletedLocalInitialization = localDeclaration . initialization != null ; } public RecoveredElement add ( Statement stmt , int bracketBalanceValue ) { if ( this . alreadyCompletedLocalInitialization || ! ( stmt instanceof Expression ) ) { return super . add ( stmt , bracketBalanceValue ) ; } else { this . alreadyCompletedLocalInitialization = true ; this . localDeclaration . initialization = ( Expression ) stmt ; this . localDeclaration . declarationSourceEnd = stmt . sourceEnd ; this . localDeclaration . declarationEnd = stmt . sourceEnd ; return this ; } } public void attach ( RecoveredAnnotation [ ] annots , int annotCount , int mods , int modsSourceStart ) { if ( annotCount > <NUM_LIT:0> ) { Annotation [ ] existingAnnotations = this . localDeclaration . annotations ; if ( existingAnnotations != null ) { this . annotations = new RecoveredAnnotation [ annotCount ] ; this . annotationCount = <NUM_LIT:0> ; next : for ( int i = <NUM_LIT:0> ; i < annotCount ; i ++ ) { for ( int j = <NUM_LIT:0> ; j < existingAnnotations . length ; j ++ ) { if ( annots [ i ] . annotation == existingAnnotations [ j ] ) continue next ; } this . annotations [ this . annotationCount ++ ] = annots [ i ] ; } } else { this . annotations = annots ; this . annotationCount = annotCount ; } } if ( mods != <NUM_LIT:0> ) { this . modifiers = mods ; this . modifiersStart = modsSourceStart ; } } public ASTNode parseTree ( ) { return this . localDeclaration ; } public int sourceEnd ( ) { return this . localDeclaration . declarationSourceEnd ; } public String toString ( int tab ) { return tabString ( tab ) + "<STR_LIT>" + this . localDeclaration . print ( tab + <NUM_LIT:1> , new StringBuffer ( <NUM_LIT:10> ) ) ; } public Statement updatedStatement ( int depth , Set knownTypes ) { if ( this . modifiers != <NUM_LIT:0> ) { this . localDeclaration . modifiers |= this . modifiers ; if ( this . modifiersStart < this . localDeclaration . declarationSourceStart ) { this . localDeclaration . declarationSourceStart = this . modifiersStart ; } } if ( this . annotationCount > <NUM_LIT:0> ) { int existingCount = this . localDeclaration . annotations == null ? <NUM_LIT:0> : this . localDeclaration . annotations . length ; Annotation [ ] annotationReferences = new Annotation [ existingCount + this . annotationCount ] ; if ( existingCount > <NUM_LIT:0> ) { System . arraycopy ( this . localDeclaration . annotations , <NUM_LIT:0> , annotationReferences , this . annotationCount , existingCount ) ; } for ( int i = <NUM_LIT:0> ; i < this . annotationCount ; i ++ ) { annotationReferences [ i ] = this . annotations [ i ] . updatedAnnotationReference ( ) ; } this . localDeclaration . annotations = annotationReferences ; int start = this . annotations [ <NUM_LIT:0> ] . annotation . sourceStart ; if ( start < this . localDeclaration . declarationSourceStart ) { this . localDeclaration . declarationSourceStart = start ; } } return this . localDeclaration ; } public RecoveredElement updateOnClosingBrace ( int braceStart , int braceEnd ) { if ( this . bracketBalance > <NUM_LIT:0> ) { this . bracketBalance -- ; if ( this . bracketBalance == <NUM_LIT:0> ) this . alreadyCompletedLocalInitialization = true ; return this ; } if ( this . parent != null ) { return this . parent . updateOnClosingBrace ( braceStart , braceEnd ) ; } return this ; } public RecoveredElement updateOnOpeningBrace ( int braceStart , int braceEnd ) { if ( this . localDeclaration . declarationSourceEnd == <NUM_LIT:0> && ( this . localDeclaration . type instanceof ArrayTypeReference || this . localDeclaration . type instanceof ArrayQualifiedTypeReference ) && ! this . alreadyCompletedLocalInitialization ) { this . bracketBalance ++ ; return null ; } this . updateSourceEndIfNecessary ( braceStart - <NUM_LIT:1> , braceEnd - <NUM_LIT:1> ) ; return this . parent . updateOnOpeningBrace ( braceStart , braceEnd ) ; } public void updateParseTree ( ) { updatedStatement ( <NUM_LIT:0> , new HashSet ( ) ) ; } public void updateSourceEndIfNecessary ( int bodyStart , int bodyEnd ) { if ( this . localDeclaration . declarationSourceEnd == <NUM_LIT:0> ) { this . localDeclaration . declarationSourceEnd = bodyEnd ; this . localDeclaration . declarationEnd = bodyEnd ; } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . parser ; import java . util . List ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . core . compiler . InvalidInputException ; import org . eclipse . jdt . internal . compiler . ast . * ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . util . Util ; public class JavadocParser extends AbstractCommentParser { public Javadoc docComment ; private int invalidParamReferencesPtr = - <NUM_LIT:1> ; private ASTNode [ ] invalidParamReferencesStack ; private long validValuePositions , invalidValuePositions ; public boolean shouldReportProblems = true ; private int tagWaitingForDescription ; public JavadocParser ( Parser sourceParser ) { super ( sourceParser ) ; this . kind = COMPIL_PARSER | TEXT_VERIF ; if ( sourceParser != null && sourceParser . options != null ) { this . setJavadocPositions = sourceParser . options . processAnnotations ; } } public boolean checkDeprecation ( int commentPtr ) { this . javadocStart = this . sourceParser . scanner . commentStarts [ commentPtr ] ; this . javadocEnd = this . sourceParser . scanner . commentStops [ commentPtr ] - <NUM_LIT:1> ; this . firstTagPosition = this . sourceParser . scanner . commentTagStarts [ commentPtr ] ; this . validValuePositions = - <NUM_LIT:1> ; this . invalidValuePositions = - <NUM_LIT:1> ; this . tagWaitingForDescription = NO_TAG_VALUE ; if ( this . checkDocComment ) { this . docComment = new Javadoc ( this . javadocStart , this . javadocEnd ) ; } else if ( this . setJavadocPositions ) { this . docComment = new Javadoc ( this . javadocStart , this . javadocEnd ) ; this . docComment . bits &= ~ ASTNode . ResolveJavadoc ; } else { this . docComment = null ; } if ( this . firstTagPosition == <NUM_LIT:0> ) { switch ( this . kind & PARSER_KIND ) { case COMPIL_PARSER : case SOURCE_PARSER : return false ; } } try { this . source = this . sourceParser . scanner . source ; if ( this . checkDocComment ) { this . scanner . lineEnds = this . sourceParser . scanner . lineEnds ; this . scanner . linePtr = this . sourceParser . scanner . linePtr ; this . lineEnds = this . scanner . lineEnds ; commentParse ( ) ; } else { Scanner sourceScanner = this . sourceParser . scanner ; int firstLineNumber = Util . getLineNumber ( this . javadocStart , sourceScanner . lineEnds , <NUM_LIT:0> , sourceScanner . linePtr ) ; int lastLineNumber = Util . getLineNumber ( this . javadocEnd , sourceScanner . lineEnds , <NUM_LIT:0> , sourceScanner . linePtr ) ; this . index = this . javadocStart + <NUM_LIT:3> ; this . deprecated = false ; nextLine : for ( int line = firstLineNumber ; line <= lastLineNumber ; line ++ ) { int lineStart = line == firstLineNumber ? this . javadocStart + <NUM_LIT:3> : this . sourceParser . scanner . getLineStart ( line ) ; this . index = lineStart ; this . lineEnd = line == lastLineNumber ? this . javadocEnd - <NUM_LIT:2> : this . sourceParser . scanner . getLineEnd ( line ) ; nextCharacter : while ( this . index < this . lineEnd ) { char c = readChar ( ) ; switch ( c ) { case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT:U+0020>' : case '<STR_LIT:\t>' : case '<STR_LIT:\n>' : case '<STR_LIT>' : continue nextCharacter ; case '<CHAR_LIT>' : parseSimpleTag ( ) ; if ( this . tagValue == TAG_DEPRECATED_VALUE ) { if ( this . abort ) break nextCharacter ; } } continue nextLine ; } } return this . deprecated ; } } finally { this . source = null ; } return this . deprecated ; } protected Object createArgumentReference ( char [ ] name , int dim , boolean isVarargs , Object typeRef , long [ ] dimPositions , long argNamePos ) throws InvalidInputException { try { TypeReference argTypeRef = ( TypeReference ) typeRef ; if ( dim > <NUM_LIT:0> ) { long pos = ( ( ( long ) argTypeRef . sourceStart ) << <NUM_LIT:32> ) + argTypeRef . sourceEnd ; if ( typeRef instanceof JavadocSingleTypeReference ) { JavadocSingleTypeReference singleRef = ( JavadocSingleTypeReference ) typeRef ; argTypeRef = new JavadocArraySingleTypeReference ( singleRef . token , dim , pos ) ; } else { JavadocQualifiedTypeReference qualifRef = ( JavadocQualifiedTypeReference ) typeRef ; argTypeRef = new JavadocArrayQualifiedTypeReference ( qualifRef , dim ) ; } } int argEnd = argTypeRef . sourceEnd ; if ( dim > <NUM_LIT:0> ) { argEnd = ( int ) dimPositions [ dim - <NUM_LIT:1> ] ; if ( isVarargs ) { argTypeRef . bits |= ASTNode . IsVarArgs ; } } if ( argNamePos >= <NUM_LIT:0> ) argEnd = ( int ) argNamePos ; return new JavadocArgumentExpression ( name , argTypeRef . sourceStart , argEnd , argTypeRef ) ; } catch ( ClassCastException ex ) { throw new InvalidInputException ( ) ; } } protected Object createFieldReference ( Object receiver ) throws InvalidInputException { try { TypeReference typeRef = ( TypeReference ) receiver ; if ( typeRef == null ) { char [ ] name = this . sourceParser . compilationUnit . getMainTypeName ( ) ; typeRef = new JavadocImplicitTypeReference ( name , this . memberStart ) ; } JavadocFieldReference field = new JavadocFieldReference ( this . identifierStack [ <NUM_LIT:0> ] , this . identifierPositionStack [ <NUM_LIT:0> ] ) ; field . receiver = typeRef ; field . tagSourceStart = this . tagSourceStart ; field . tagSourceEnd = this . tagSourceEnd ; field . tagValue = this . tagValue ; return field ; } catch ( ClassCastException ex ) { throw new InvalidInputException ( ) ; } } protected Object createMethodReference ( Object receiver , List arguments ) throws InvalidInputException { try { TypeReference typeRef = ( TypeReference ) receiver ; boolean isConstructor = false ; int length = this . identifierLengthStack [ <NUM_LIT:0> ] ; if ( typeRef == null ) { char [ ] name = this . sourceParser . compilationUnit . getMainTypeName ( ) ; TypeDeclaration typeDecl = getParsedTypeDeclaration ( ) ; if ( typeDecl != null ) { name = typeDecl . name ; } isConstructor = CharOperation . equals ( this . identifierStack [ length - <NUM_LIT:1> ] , name ) ; typeRef = new JavadocImplicitTypeReference ( name , this . memberStart ) ; } else { if ( typeRef instanceof JavadocSingleTypeReference ) { char [ ] name = ( ( JavadocSingleTypeReference ) typeRef ) . token ; isConstructor = CharOperation . equals ( this . identifierStack [ length - <NUM_LIT:1> ] , name ) ; } else if ( typeRef instanceof JavadocQualifiedTypeReference ) { char [ ] [ ] tokens = ( ( JavadocQualifiedTypeReference ) typeRef ) . tokens ; int last = tokens . length - <NUM_LIT:1> ; isConstructor = CharOperation . equals ( this . identifierStack [ length - <NUM_LIT:1> ] , tokens [ last ] ) ; if ( isConstructor ) { boolean valid = true ; if ( valid ) { for ( int i = <NUM_LIT:0> ; i < length - <NUM_LIT:1> && valid ; i ++ ) { valid = CharOperation . equals ( this . identifierStack [ i ] , tokens [ i ] ) ; } } if ( ! valid ) { if ( this . reportProblems ) { this . sourceParser . problemReporter ( ) . javadocInvalidMemberTypeQualification ( ( int ) ( this . identifierPositionStack [ <NUM_LIT:0> ] > > > <NUM_LIT:32> ) , ( int ) this . identifierPositionStack [ length - <NUM_LIT:1> ] , - <NUM_LIT:1> ) ; } return null ; } } } else { throw new InvalidInputException ( ) ; } } if ( arguments == null ) { if ( isConstructor ) { JavadocAllocationExpression allocation = new JavadocAllocationExpression ( this . identifierPositionStack [ length - <NUM_LIT:1> ] ) ; allocation . type = typeRef ; allocation . tagValue = this . tagValue ; allocation . sourceEnd = this . scanner . getCurrentTokenEndPosition ( ) ; if ( length == <NUM_LIT:1> ) { allocation . qualification = new char [ ] [ ] { this . identifierStack [ <NUM_LIT:0> ] } ; } else { System . arraycopy ( this . identifierStack , <NUM_LIT:0> , allocation . qualification = new char [ length ] [ ] , <NUM_LIT:0> , length ) ; allocation . sourceStart = ( int ) ( this . identifierPositionStack [ <NUM_LIT:0> ] > > > <NUM_LIT:32> ) ; } allocation . memberStart = this . memberStart ; return allocation ; } else { JavadocMessageSend msg = new JavadocMessageSend ( this . identifierStack [ length - <NUM_LIT:1> ] , this . identifierPositionStack [ length - <NUM_LIT:1> ] ) ; msg . receiver = typeRef ; msg . tagValue = this . tagValue ; msg . sourceEnd = this . scanner . getCurrentTokenEndPosition ( ) ; return msg ; } } else { JavadocArgumentExpression [ ] expressions = new JavadocArgumentExpression [ arguments . size ( ) ] ; arguments . toArray ( expressions ) ; if ( isConstructor ) { JavadocAllocationExpression allocation = new JavadocAllocationExpression ( this . identifierPositionStack [ length - <NUM_LIT:1> ] ) ; allocation . arguments = expressions ; allocation . type = typeRef ; allocation . tagValue = this . tagValue ; allocation . sourceEnd = this . scanner . getCurrentTokenEndPosition ( ) ; if ( length == <NUM_LIT:1> ) { allocation . qualification = new char [ ] [ ] { this . identifierStack [ <NUM_LIT:0> ] } ; } else { System . arraycopy ( this . identifierStack , <NUM_LIT:0> , allocation . qualification = new char [ length ] [ ] , <NUM_LIT:0> , length ) ; allocation . sourceStart = ( int ) ( this . identifierPositionStack [ <NUM_LIT:0> ] > > > <NUM_LIT:32> ) ; } allocation . memberStart = this . memberStart ; return allocation ; } else { JavadocMessageSend msg = new JavadocMessageSend ( this . identifierStack [ length - <NUM_LIT:1> ] , this . identifierPositionStack [ length - <NUM_LIT:1> ] , expressions ) ; msg . receiver = typeRef ; msg . tagValue = this . tagValue ; msg . sourceEnd = this . scanner . getCurrentTokenEndPosition ( ) ; return msg ; } } } catch ( ClassCastException ex ) { throw new InvalidInputException ( ) ; } } protected Object createReturnStatement ( ) { return new JavadocReturnStatement ( this . scanner . getCurrentTokenStartPosition ( ) , this . scanner . getCurrentTokenEndPosition ( ) ) ; } protected void createTag ( ) { this . tagValue = TAG_OTHERS_VALUE ; } protected Object createTypeReference ( int primitiveToken ) { TypeReference typeRef = null ; int size = this . identifierLengthStack [ this . identifierLengthPtr ] ; if ( size == <NUM_LIT:1> ) { typeRef = new JavadocSingleTypeReference ( this . identifierStack [ this . identifierPtr ] , this . identifierPositionStack [ this . identifierPtr ] , this . tagSourceStart , this . tagSourceEnd ) ; } else if ( size > <NUM_LIT:1> ) { char [ ] [ ] tokens = new char [ size ] [ ] ; System . arraycopy ( this . identifierStack , this . identifierPtr - size + <NUM_LIT:1> , tokens , <NUM_LIT:0> , size ) ; long [ ] positions = new long [ size ] ; System . arraycopy ( this . identifierPositionStack , this . identifierPtr - size + <NUM_LIT:1> , positions , <NUM_LIT:0> , size ) ; typeRef = new JavadocQualifiedTypeReference ( tokens , positions , this . tagSourceStart , this . tagSourceEnd ) ; } return typeRef ; } protected TypeDeclaration getParsedTypeDeclaration ( ) { int ptr = this . sourceParser . astPtr ; while ( ptr >= <NUM_LIT:0> ) { Object node = this . sourceParser . astStack [ ptr ] ; if ( node instanceof TypeDeclaration ) { TypeDeclaration typeDecl = ( TypeDeclaration ) node ; if ( typeDecl . bodyEnd == <NUM_LIT:0> ) { return typeDecl ; } } ptr -- ; } return null ; } protected boolean parseThrows ( ) { boolean valid = super . parseThrows ( ) ; this . tagWaitingForDescription = valid && this . reportProblems ? TAG_THROWS_VALUE : NO_TAG_VALUE ; return valid ; } protected boolean parseReturn ( ) { if ( this . returnStatement == null ) { this . returnStatement = createReturnStatement ( ) ; return true ; } if ( this . reportProblems ) { this . sourceParser . problemReporter ( ) . javadocDuplicatedReturnTag ( this . scanner . getCurrentTokenStartPosition ( ) , this . scanner . getCurrentTokenEndPosition ( ) ) ; } return false ; } protected void parseSimpleTag ( ) { char first = this . source [ this . index ++ ] ; if ( first == '<STR_LIT:\\>' && this . source [ this . index ] == '<CHAR_LIT>' ) { int c1 , c2 , c3 , c4 ; int pos = this . index ; this . index ++ ; while ( this . source [ this . index ] == '<CHAR_LIT>' ) this . index ++ ; if ( ! ( ( ( c1 = ScannerHelper . getHexadecimalValue ( this . source [ this . index ++ ] ) ) > <NUM_LIT:15> || c1 < <NUM_LIT:0> ) || ( ( c2 = ScannerHelper . getHexadecimalValue ( this . source [ this . index ++ ] ) ) > <NUM_LIT:15> || c2 < <NUM_LIT:0> ) || ( ( c3 = ScannerHelper . getHexadecimalValue ( this . source [ this . index ++ ] ) ) > <NUM_LIT:15> || c3 < <NUM_LIT:0> ) || ( ( c4 = ScannerHelper . getHexadecimalValue ( this . source [ this . index ++ ] ) ) > <NUM_LIT:15> || c4 < <NUM_LIT:0> ) ) ) { first = ( char ) ( ( ( c1 * <NUM_LIT:16> + c2 ) * <NUM_LIT:16> + c3 ) * <NUM_LIT:16> + c4 ) ; } else { this . index = pos ; } } switch ( first ) { case '<CHAR_LIT>' : if ( ( readChar ( ) == '<CHAR_LIT:e>' ) && ( readChar ( ) == '<CHAR_LIT>' ) && ( readChar ( ) == '<CHAR_LIT>' ) && ( readChar ( ) == '<CHAR_LIT:e>' ) && ( readChar ( ) == '<CHAR_LIT:c>' ) && ( readChar ( ) == '<CHAR_LIT:a>' ) && ( readChar ( ) == '<CHAR_LIT>' ) && ( readChar ( ) == '<CHAR_LIT:e>' ) && ( readChar ( ) == '<CHAR_LIT>' ) ) { char c = readChar ( ) ; if ( ScannerHelper . isWhitespace ( c ) || c == '<CHAR_LIT>' ) { this . abort = true ; this . deprecated = true ; this . tagValue = TAG_DEPRECATED_VALUE ; } } break ; } } protected boolean parseTag ( int previousPosition ) throws InvalidInputException { switch ( this . tagWaitingForDescription ) { case TAG_PARAM_VALUE : case TAG_THROWS_VALUE : if ( ! this . inlineTagStarted ) { int start = ( int ) ( this . identifierPositionStack [ <NUM_LIT:0> ] > > > <NUM_LIT:32> ) ; int end = ( int ) this . identifierPositionStack [ this . identifierPtr ] ; this . sourceParser . problemReporter ( ) . javadocMissingTagDescriptionAfterReference ( start , end , this . sourceParser . modifiers ) ; } break ; case NO_TAG_VALUE : break ; default : if ( ! this . inlineTagStarted ) { this . sourceParser . problemReporter ( ) . javadocMissingTagDescription ( TAG_NAMES [ this . tagWaitingForDescription ] , this . tagSourceStart , this . tagSourceEnd , this . sourceParser . modifiers ) ; } break ; } this . tagWaitingForDescription = NO_TAG_VALUE ; this . tagSourceStart = this . index ; this . tagSourceEnd = previousPosition ; this . scanner . startPosition = this . index ; int currentPosition = this . index ; char firstChar = readChar ( ) ; switch ( firstChar ) { case '<CHAR_LIT:U+0020>' : case '<CHAR_LIT>' : case '<CHAR_LIT:}>' : case '<CHAR_LIT>' : if ( this . reportProblems ) this . sourceParser . problemReporter ( ) . javadocInvalidTag ( previousPosition , currentPosition ) ; if ( this . textStart == - <NUM_LIT:1> ) this . textStart = currentPosition ; this . scanner . currentCharacter = firstChar ; return false ; default : if ( ScannerHelper . isWhitespace ( firstChar ) ) { if ( this . reportProblems ) this . sourceParser . problemReporter ( ) . javadocInvalidTag ( previousPosition , currentPosition ) ; if ( this . textStart == - <NUM_LIT:1> ) this . textStart = currentPosition ; this . scanner . currentCharacter = firstChar ; return false ; } break ; } char [ ] tagName = new char [ <NUM_LIT:32> ] ; int length = <NUM_LIT:0> ; char currentChar = firstChar ; int tagNameLength = tagName . length ; boolean validTag = true ; tagLoop : while ( true ) { if ( length == tagNameLength ) { System . arraycopy ( tagName , <NUM_LIT:0> , tagName = new char [ tagNameLength + <NUM_LIT:32> ] , <NUM_LIT:0> , tagNameLength ) ; tagNameLength = tagName . length ; } tagName [ length ++ ] = currentChar ; currentPosition = this . index ; currentChar = readChar ( ) ; switch ( currentChar ) { case '<CHAR_LIT:U+0020>' : case '<CHAR_LIT>' : case '<CHAR_LIT:}>' : break tagLoop ; case '<CHAR_LIT>' : validTag = false ; break ; default : if ( ScannerHelper . isWhitespace ( currentChar ) ) { break tagLoop ; } break ; } } this . tagSourceEnd = currentPosition - <NUM_LIT:1> ; this . scanner . currentCharacter = currentChar ; this . scanner . currentPosition = currentPosition ; this . index = this . tagSourceEnd + <NUM_LIT:1> ; if ( ! validTag ) { if ( this . reportProblems ) this . sourceParser . problemReporter ( ) . javadocInvalidTag ( this . tagSourceStart , this . tagSourceEnd ) ; if ( this . textStart == - <NUM_LIT:1> ) this . textStart = this . index ; this . scanner . currentCharacter = currentChar ; return false ; } this . tagValue = TAG_OTHERS_VALUE ; boolean valid = false ; switch ( firstChar ) { case '<CHAR_LIT:a>' : if ( length == TAG_AUTHOR_LENGTH && CharOperation . equals ( TAG_AUTHOR , tagName , <NUM_LIT:0> , length ) ) { this . tagValue = TAG_AUTHOR_VALUE ; this . tagWaitingForDescription = this . tagValue ; } break ; case '<CHAR_LIT:c>' : if ( length == TAG_CATEGORY_LENGTH && CharOperation . equals ( TAG_CATEGORY , tagName , <NUM_LIT:0> , length ) ) { this . tagValue = TAG_CATEGORY_VALUE ; if ( ! this . inlineTagStarted ) { valid = parseIdentifierTag ( false ) ; } } else if ( length == TAG_CODE_LENGTH && this . inlineTagStarted && CharOperation . equals ( TAG_CODE , tagName , <NUM_LIT:0> , length ) ) { this . tagValue = TAG_CODE_VALUE ; this . tagWaitingForDescription = this . tagValue ; } break ; case '<CHAR_LIT>' : if ( length == TAG_DEPRECATED_LENGTH && CharOperation . equals ( TAG_DEPRECATED , tagName , <NUM_LIT:0> , length ) ) { this . deprecated = true ; valid = true ; this . tagValue = TAG_DEPRECATED_VALUE ; this . tagWaitingForDescription = this . tagValue ; } else if ( length == TAG_DOC_ROOT_LENGTH && CharOperation . equals ( TAG_DOC_ROOT , tagName , <NUM_LIT:0> , length ) ) { valid = true ; this . tagValue = TAG_DOC_ROOT_VALUE ; } break ; case '<CHAR_LIT:e>' : if ( length == TAG_EXCEPTION_LENGTH && CharOperation . equals ( TAG_EXCEPTION , tagName , <NUM_LIT:0> , length ) ) { this . tagValue = TAG_EXCEPTION_VALUE ; if ( ! this . inlineTagStarted ) { valid = parseThrows ( ) ; } } break ; case '<CHAR_LIT>' : if ( length == TAG_INHERITDOC_LENGTH && CharOperation . equals ( TAG_INHERITDOC , tagName , <NUM_LIT:0> , length ) ) { switch ( this . lastBlockTagValue ) { case TAG_RETURN_VALUE : case TAG_THROWS_VALUE : case TAG_EXCEPTION_VALUE : case TAG_PARAM_VALUE : case NO_TAG_VALUE : valid = true ; if ( this . reportProblems ) { recordInheritedPosition ( ( ( ( long ) this . tagSourceStart ) << <NUM_LIT:32> ) + this . tagSourceEnd ) ; } if ( this . inlineTagStarted ) { parseInheritDocTag ( ) ; } break ; default : valid = false ; if ( this . reportProblems ) { this . sourceParser . problemReporter ( ) . javadocUnexpectedTag ( this . tagSourceStart , this . tagSourceEnd ) ; } } this . tagValue = TAG_INHERITDOC_VALUE ; } break ; case '<CHAR_LIT>' : if ( length == TAG_LINK_LENGTH && CharOperation . equals ( TAG_LINK , tagName , <NUM_LIT:0> , length ) ) { this . tagValue = TAG_LINK_VALUE ; if ( this . inlineTagStarted || ( this . kind & COMPLETION_PARSER ) != <NUM_LIT:0> ) { valid = parseReference ( ) ; } } else if ( length == TAG_LINKPLAIN_LENGTH && CharOperation . equals ( TAG_LINKPLAIN , tagName , <NUM_LIT:0> , length ) ) { this . tagValue = TAG_LINKPLAIN_VALUE ; if ( this . inlineTagStarted ) { valid = parseReference ( ) ; } } else if ( length == TAG_LITERAL_LENGTH && this . inlineTagStarted && CharOperation . equals ( TAG_LITERAL , tagName , <NUM_LIT:0> , length ) ) { this . tagValue = TAG_LITERAL_VALUE ; this . tagWaitingForDescription = this . tagValue ; } break ; case '<CHAR_LIT>' : if ( length == TAG_PARAM_LENGTH && CharOperation . equals ( TAG_PARAM , tagName , <NUM_LIT:0> , length ) ) { this . tagValue = TAG_PARAM_VALUE ; if ( ! this . inlineTagStarted ) { valid = parseParam ( ) ; } } break ; case '<CHAR_LIT>' : if ( length == TAG_RETURN_LENGTH && CharOperation . equals ( TAG_RETURN , tagName , <NUM_LIT:0> , length ) ) { this . tagValue = TAG_RETURN_VALUE ; if ( ! this . inlineTagStarted ) { valid = parseReturn ( ) ; } } break ; case '<CHAR_LIT>' : if ( length == TAG_SEE_LENGTH && CharOperation . equals ( TAG_SEE , tagName , <NUM_LIT:0> , length ) ) { this . tagValue = TAG_SEE_VALUE ; if ( ! this . inlineTagStarted ) { valid = parseReference ( ) ; } } else if ( length == TAG_SERIAL_LENGTH && CharOperation . equals ( TAG_SERIAL , tagName , <NUM_LIT:0> , length ) ) { this . tagValue = TAG_SERIAL_VALUE ; this . tagWaitingForDescription = this . tagValue ; } else if ( length == TAG_SERIAL_DATA_LENGTH && CharOperation . equals ( TAG_SERIAL_DATA , tagName , <NUM_LIT:0> , length ) ) { this . tagValue = TAG_SERIAL_DATA_VALUE ; this . tagWaitingForDescription = this . tagValue ; } else if ( length == TAG_SERIAL_FIELD_LENGTH && CharOperation . equals ( TAG_SERIAL_FIELD , tagName , <NUM_LIT:0> , length ) ) { this . tagValue = TAG_SERIAL_FIELD_VALUE ; this . tagWaitingForDescription = this . tagValue ; } else if ( length == TAG_SINCE_LENGTH && CharOperation . equals ( TAG_SINCE , tagName , <NUM_LIT:0> , length ) ) { this . tagValue = TAG_SINCE_VALUE ; this . tagWaitingForDescription = this . tagValue ; } break ; case '<CHAR_LIT>' : if ( length == TAG_THROWS_LENGTH && CharOperation . equals ( TAG_THROWS , tagName , <NUM_LIT:0> , length ) ) { this . tagValue = TAG_THROWS_VALUE ; if ( ! this . inlineTagStarted ) { valid = parseThrows ( ) ; } } break ; case '<CHAR_LIT>' : if ( length == TAG_VALUE_LENGTH && CharOperation . equals ( TAG_VALUE , tagName , <NUM_LIT:0> , length ) ) { this . tagValue = TAG_VALUE_VALUE ; if ( this . sourceLevel >= ClassFileConstants . JDK1_5 ) { if ( this . inlineTagStarted ) { valid = parseReference ( ) ; } } else { if ( this . validValuePositions == - <NUM_LIT:1> ) { if ( this . invalidValuePositions != - <NUM_LIT:1> ) { if ( this . reportProblems ) this . sourceParser . problemReporter ( ) . javadocUnexpectedTag ( ( int ) ( this . invalidValuePositions > > > <NUM_LIT:32> ) , ( int ) this . invalidValuePositions ) ; } if ( valid ) { this . validValuePositions = ( ( ( long ) this . tagSourceStart ) << <NUM_LIT:32> ) + this . tagSourceEnd ; this . invalidValuePositions = - <NUM_LIT:1> ; } else { this . invalidValuePositions = ( ( ( long ) this . tagSourceStart ) << <NUM_LIT:32> ) + this . tagSourceEnd ; } } else { if ( this . reportProblems ) this . sourceParser . problemReporter ( ) . javadocUnexpectedTag ( this . tagSourceStart , this . tagSourceEnd ) ; } } } else if ( length == TAG_VERSION_LENGTH && CharOperation . equals ( TAG_VERSION , tagName , <NUM_LIT:0> , length ) ) { this . tagValue = TAG_VERSION_VALUE ; this . tagWaitingForDescription = this . tagValue ; } else { createTag ( ) ; } break ; default : createTag ( ) ; break ; } this . textStart = this . index ; if ( this . tagValue != TAG_OTHERS_VALUE ) { if ( ! this . inlineTagStarted ) { this . lastBlockTagValue = this . tagValue ; } if ( ( this . inlineTagStarted && JAVADOC_TAG_TYPE [ this . tagValue ] == TAG_TYPE_BLOCK ) || ( ! this . inlineTagStarted && JAVADOC_TAG_TYPE [ this . tagValue ] == TAG_TYPE_INLINE ) ) { valid = false ; this . tagValue = TAG_OTHERS_VALUE ; this . tagWaitingForDescription = NO_TAG_VALUE ; if ( this . reportProblems ) { this . sourceParser . problemReporter ( ) . javadocUnexpectedTag ( this . tagSourceStart , this . tagSourceEnd ) ; } } } return valid ; } protected void parseInheritDocTag ( ) { } protected boolean parseParam ( ) throws InvalidInputException { boolean valid = super . parseParam ( ) ; this . tagWaitingForDescription = valid && this . reportProblems ? TAG_PARAM_VALUE : NO_TAG_VALUE ; return valid ; } protected boolean pushParamName ( boolean isTypeParam ) { ASTNode nameRef = null ; if ( isTypeParam ) { JavadocSingleTypeReference ref = new JavadocSingleTypeReference ( this . identifierStack [ <NUM_LIT:1> ] , this . identifierPositionStack [ <NUM_LIT:1> ] , this . tagSourceStart , this . tagSourceEnd ) ; nameRef = ref ; } else { JavadocSingleNameReference ref = new JavadocSingleNameReference ( this . identifierStack [ <NUM_LIT:0> ] , this . identifierPositionStack [ <NUM_LIT:0> ] , this . tagSourceStart , this . tagSourceEnd ) ; nameRef = ref ; } if ( this . astLengthPtr == - <NUM_LIT:1> ) { pushOnAstStack ( nameRef , true ) ; } else { if ( ! isTypeParam ) { for ( int i = THROWS_TAG_EXPECTED_ORDER ; i <= this . astLengthPtr ; i += ORDERED_TAGS_NUMBER ) { if ( this . astLengthStack [ i ] != <NUM_LIT:0> ) { if ( this . reportProblems ) this . sourceParser . problemReporter ( ) . javadocUnexpectedTag ( this . tagSourceStart , this . tagSourceEnd ) ; if ( this . invalidParamReferencesPtr == - <NUM_LIT> ) { this . invalidParamReferencesStack = new JavadocSingleNameReference [ <NUM_LIT:10> ] ; } int stackLength = this . invalidParamReferencesStack . length ; if ( ++ this . invalidParamReferencesPtr >= stackLength ) { System . arraycopy ( this . invalidParamReferencesStack , <NUM_LIT:0> , this . invalidParamReferencesStack = new JavadocSingleNameReference [ stackLength + AST_STACK_INCREMENT ] , <NUM_LIT:0> , stackLength ) ; } this . invalidParamReferencesStack [ this . invalidParamReferencesPtr ] = nameRef ; return false ; } } } switch ( this . astLengthPtr % ORDERED_TAGS_NUMBER ) { case PARAM_TAG_EXPECTED_ORDER : pushOnAstStack ( nameRef , false ) ; break ; case SEE_TAG_EXPECTED_ORDER : pushOnAstStack ( nameRef , true ) ; break ; default : return false ; } } return true ; } protected boolean pushSeeRef ( Object statement ) { if ( this . astLengthPtr == - <NUM_LIT:1> ) { pushOnAstStack ( null , true ) ; pushOnAstStack ( null , true ) ; pushOnAstStack ( statement , true ) ; } else { switch ( this . astLengthPtr % ORDERED_TAGS_NUMBER ) { case PARAM_TAG_EXPECTED_ORDER : pushOnAstStack ( null , true ) ; pushOnAstStack ( statement , true ) ; break ; case THROWS_TAG_EXPECTED_ORDER : pushOnAstStack ( statement , true ) ; break ; case SEE_TAG_EXPECTED_ORDER : pushOnAstStack ( statement , false ) ; break ; default : return false ; } } return true ; } protected void pushText ( int start , int end ) { this . tagWaitingForDescription = NO_TAG_VALUE ; } protected boolean pushThrowName ( Object typeRef ) { if ( this . astLengthPtr == - <NUM_LIT:1> ) { pushOnAstStack ( null , true ) ; pushOnAstStack ( typeRef , true ) ; } else { switch ( this . astLengthPtr % ORDERED_TAGS_NUMBER ) { case PARAM_TAG_EXPECTED_ORDER : pushOnAstStack ( typeRef , true ) ; break ; case THROWS_TAG_EXPECTED_ORDER : pushOnAstStack ( typeRef , false ) ; break ; case SEE_TAG_EXPECTED_ORDER : pushOnAstStack ( null , true ) ; pushOnAstStack ( typeRef , true ) ; break ; default : return false ; } } return true ; } protected void refreshInlineTagPosition ( int previousPosition ) { if ( this . tagWaitingForDescription != NO_TAG_VALUE ) { this . sourceParser . problemReporter ( ) . javadocMissingTagDescription ( TAG_NAMES [ this . tagWaitingForDescription ] , this . tagSourceStart , this . tagSourceEnd , this . sourceParser . modifiers ) ; this . tagWaitingForDescription = NO_TAG_VALUE ; } } protected void refreshReturnStatement ( ) { ( ( JavadocReturnStatement ) this . returnStatement ) . bits &= ~ ASTNode . Empty ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( "<STR_LIT>" ) . append ( this . checkDocComment ) . append ( "<STR_LIT:n>" ) ; buffer . append ( "<STR_LIT>" ) . append ( this . docComment ) . append ( "<STR_LIT:n>" ) ; buffer . append ( super . toString ( ) ) ; return buffer . toString ( ) ; } protected void updateDocComment ( ) { switch ( this . tagWaitingForDescription ) { case TAG_PARAM_VALUE : case TAG_THROWS_VALUE : if ( ! this . inlineTagStarted ) { int start = ( int ) ( this . identifierPositionStack [ <NUM_LIT:0> ] > > > <NUM_LIT:32> ) ; int end = ( int ) this . identifierPositionStack [ this . identifierPtr ] ; this . sourceParser . problemReporter ( ) . javadocMissingTagDescriptionAfterReference ( start , end , this . sourceParser . modifiers ) ; } break ; case NO_TAG_VALUE : break ; default : if ( ! this . inlineTagStarted ) { this . sourceParser . problemReporter ( ) . javadocMissingTagDescription ( TAG_NAMES [ this . tagWaitingForDescription ] , this . tagSourceStart , this . tagSourceEnd , this . sourceParser . modifiers ) ; } break ; } this . tagWaitingForDescription = NO_TAG_VALUE ; if ( this . inheritedPositions != null && this . inheritedPositionsPtr != this . inheritedPositions . length ) { System . arraycopy ( this . inheritedPositions , <NUM_LIT:0> , this . inheritedPositions = new long [ this . inheritedPositionsPtr ] , <NUM_LIT:0> , this . inheritedPositionsPtr ) ; } this . docComment . inheritedPositions = this . inheritedPositions ; this . docComment . valuePositions = this . validValuePositions != - <NUM_LIT:1> ? this . validValuePositions : this . invalidValuePositions ; if ( this . returnStatement != null ) { this . docComment . returnStatement = ( JavadocReturnStatement ) this . returnStatement ; } if ( this . invalidParamReferencesPtr >= <NUM_LIT:0> ) { this . docComment . invalidParameters = new JavadocSingleNameReference [ this . invalidParamReferencesPtr + <NUM_LIT:1> ] ; System . arraycopy ( this . invalidParamReferencesStack , <NUM_LIT:0> , this . docComment . invalidParameters , <NUM_LIT:0> , this . invalidParamReferencesPtr + <NUM_LIT:1> ) ; } if ( this . astLengthPtr == - <NUM_LIT:1> ) { return ; } int [ ] sizes = new int [ ORDERED_TAGS_NUMBER ] ; for ( int i = <NUM_LIT:0> ; i <= this . astLengthPtr ; i ++ ) { sizes [ i % ORDERED_TAGS_NUMBER ] += this . astLengthStack [ i ] ; } this . docComment . seeReferences = new Expression [ sizes [ SEE_TAG_EXPECTED_ORDER ] ] ; this . docComment . exceptionReferences = new TypeReference [ sizes [ THROWS_TAG_EXPECTED_ORDER ] ] ; int paramRefPtr = sizes [ PARAM_TAG_EXPECTED_ORDER ] ; this . docComment . paramReferences = new JavadocSingleNameReference [ paramRefPtr ] ; int paramTypeParamPtr = sizes [ PARAM_TAG_EXPECTED_ORDER ] ; this . docComment . paramTypeParameters = new JavadocSingleTypeReference [ paramTypeParamPtr ] ; while ( this . astLengthPtr >= <NUM_LIT:0> ) { int ptr = this . astLengthPtr % ORDERED_TAGS_NUMBER ; switch ( ptr ) { case SEE_TAG_EXPECTED_ORDER : int size = this . astLengthStack [ this . astLengthPtr -- ] ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) { this . docComment . seeReferences [ -- sizes [ ptr ] ] = ( Expression ) this . astStack [ this . astPtr -- ] ; } break ; case THROWS_TAG_EXPECTED_ORDER : size = this . astLengthStack [ this . astLengthPtr -- ] ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) { this . docComment . exceptionReferences [ -- sizes [ ptr ] ] = ( TypeReference ) this . astStack [ this . astPtr -- ] ; } break ; case PARAM_TAG_EXPECTED_ORDER : size = this . astLengthStack [ this . astLengthPtr -- ] ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) { Expression reference = ( Expression ) this . astStack [ this . astPtr -- ] ; if ( reference instanceof JavadocSingleNameReference ) this . docComment . paramReferences [ -- paramRefPtr ] = ( JavadocSingleNameReference ) reference ; else if ( reference instanceof JavadocSingleTypeReference ) this . docComment . paramTypeParameters [ -- paramTypeParamPtr ] = ( JavadocSingleTypeReference ) reference ; } break ; } } if ( paramRefPtr == <NUM_LIT:0> ) { this . docComment . paramTypeParameters = null ; } else if ( paramTypeParamPtr == <NUM_LIT:0> ) { this . docComment . paramReferences = null ; } else { int size = sizes [ PARAM_TAG_EXPECTED_ORDER ] ; System . arraycopy ( this . docComment . paramReferences , paramRefPtr , this . docComment . paramReferences = new JavadocSingleNameReference [ size - paramRefPtr ] , <NUM_LIT:0> , size - paramRefPtr ) ; System . arraycopy ( this . docComment . paramTypeParameters , paramTypeParamPtr , this . docComment . paramTypeParameters = new JavadocSingleTypeReference [ size - paramTypeParamPtr ] , <NUM_LIT:0> , size - paramTypeParamPtr ) ; } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . parser ; import org . eclipse . jdt . internal . compiler . ast . AbstractMethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . Block ; import org . eclipse . jdt . internal . compiler . ast . FieldDeclaration ; import org . eclipse . jdt . internal . compiler . ast . ImportReference ; import org . eclipse . jdt . internal . compiler . ast . LocalDeclaration ; import org . eclipse . jdt . internal . compiler . ast . Statement ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; import org . eclipse . jdt . internal . compiler . util . Util ; public class RecoveredElement { public RecoveredElement parent ; public int bracketBalance ; public boolean foundOpeningBrace ; protected Parser recoveringParser ; public RecoveredElement ( RecoveredElement parent , int bracketBalance ) { this ( parent , bracketBalance , null ) ; } public RecoveredElement ( RecoveredElement parent , int bracketBalance , Parser parser ) { this . parent = parent ; this . bracketBalance = bracketBalance ; this . recoveringParser = parser ; } public RecoveredElement addAnnotationName ( int identifierPtr , int identifierLengthPtr , int annotationStart , int bracketBalanceValue ) { resetPendingModifiers ( ) ; if ( this . parent == null ) return this ; this . updateSourceEndIfNecessary ( previousAvailableLineEnd ( annotationStart - <NUM_LIT:1> ) ) ; return this . parent . addAnnotationName ( identifierPtr , identifierLengthPtr , annotationStart , bracketBalanceValue ) ; } public RecoveredElement add ( AbstractMethodDeclaration methodDeclaration , int bracketBalanceValue ) { resetPendingModifiers ( ) ; if ( this . parent == null ) return this ; this . updateSourceEndIfNecessary ( previousAvailableLineEnd ( methodDeclaration . declarationSourceStart - <NUM_LIT:1> ) ) ; return this . parent . add ( methodDeclaration , bracketBalanceValue ) ; } public RecoveredElement add ( Block nestedBlockDeclaration , int bracketBalanceValue ) { resetPendingModifiers ( ) ; if ( this . parent == null ) return this ; this . updateSourceEndIfNecessary ( previousAvailableLineEnd ( nestedBlockDeclaration . sourceStart - <NUM_LIT:1> ) ) ; return this . parent . add ( nestedBlockDeclaration , bracketBalanceValue ) ; } public RecoveredElement add ( FieldDeclaration fieldDeclaration , int bracketBalanceValue ) { resetPendingModifiers ( ) ; if ( this . parent == null ) return this ; this . updateSourceEndIfNecessary ( previousAvailableLineEnd ( fieldDeclaration . declarationSourceStart - <NUM_LIT:1> ) ) ; return this . parent . add ( fieldDeclaration , bracketBalanceValue ) ; } public RecoveredElement add ( ImportReference importReference , int bracketBalanceValue ) { resetPendingModifiers ( ) ; if ( this . parent == null ) return this ; this . updateSourceEndIfNecessary ( previousAvailableLineEnd ( importReference . declarationSourceStart - <NUM_LIT:1> ) ) ; return this . parent . add ( importReference , bracketBalanceValue ) ; } public RecoveredElement add ( LocalDeclaration localDeclaration , int bracketBalanceValue ) { resetPendingModifiers ( ) ; if ( this . parent == null ) return this ; this . updateSourceEndIfNecessary ( previousAvailableLineEnd ( localDeclaration . declarationSourceStart - <NUM_LIT:1> ) ) ; return this . parent . add ( localDeclaration , bracketBalanceValue ) ; } public RecoveredElement add ( Statement statement , int bracketBalanceValue ) { resetPendingModifiers ( ) ; if ( this . parent == null ) return this ; if ( this instanceof RecoveredType ) { TypeDeclaration typeDeclaration = ( ( RecoveredType ) this ) . typeDeclaration ; if ( typeDeclaration != null && ( typeDeclaration . bits & ASTNode . IsAnonymousType ) != <NUM_LIT:0> ) { if ( statement . sourceStart > typeDeclaration . sourceStart && statement . sourceEnd < typeDeclaration . sourceEnd ) { return this ; } } } this . updateSourceEndIfNecessary ( previousAvailableLineEnd ( statement . sourceStart - <NUM_LIT:1> ) ) ; return this . parent . add ( statement , bracketBalanceValue ) ; } public RecoveredElement add ( TypeDeclaration typeDeclaration , int bracketBalanceValue ) { resetPendingModifiers ( ) ; if ( this . parent == null ) return this ; this . updateSourceEndIfNecessary ( previousAvailableLineEnd ( typeDeclaration . declarationSourceStart - <NUM_LIT:1> ) ) ; return this . parent . add ( typeDeclaration , bracketBalanceValue ) ; } protected void addBlockStatement ( RecoveredBlock recoveredBlock ) { Block block = recoveredBlock . blockDeclaration ; if ( block . statements != null ) { Statement [ ] statements = block . statements ; for ( int i = <NUM_LIT:0> ; i < statements . length ; i ++ ) { recoveredBlock . add ( statements [ i ] , <NUM_LIT:0> ) ; } } } public void addModifier ( int flag , int modifiersSourceStart ) { } public int depth ( ) { int depth = <NUM_LIT:0> ; RecoveredElement current = this ; while ( ( current = current . parent ) != null ) depth ++ ; return depth ; } public RecoveredInitializer enclosingInitializer ( ) { RecoveredElement current = this ; while ( current != null ) { if ( current instanceof RecoveredInitializer ) { return ( RecoveredInitializer ) current ; } current = current . parent ; } return null ; } public RecoveredMethod enclosingMethod ( ) { RecoveredElement current = this ; while ( current != null ) { if ( current instanceof RecoveredMethod ) { return ( RecoveredMethod ) current ; } current = current . parent ; } return null ; } public RecoveredType enclosingType ( ) { RecoveredElement current = this ; while ( current != null ) { if ( current instanceof RecoveredType ) { return ( RecoveredType ) current ; } current = current . parent ; } return null ; } public Parser parser ( ) { RecoveredElement current = this ; while ( current != null ) { if ( current . recoveringParser != null ) { return current . recoveringParser ; } current = current . parent ; } return null ; } public ASTNode parseTree ( ) { return null ; } public void resetPendingModifiers ( ) { } public void preserveEnclosingBlocks ( ) { RecoveredElement current = this ; while ( current != null ) { if ( current instanceof RecoveredBlock ) { ( ( RecoveredBlock ) current ) . preserveContent = true ; } if ( current instanceof RecoveredType ) { ( ( RecoveredType ) current ) . preserveContent = true ; } current = current . parent ; } } public int previousAvailableLineEnd ( int position ) { Parser parser = parser ( ) ; if ( parser == null ) return position ; Scanner scanner = parser . scanner ; if ( scanner . lineEnds == null ) return position ; int index = Util . getLineNumber ( position , scanner . lineEnds , <NUM_LIT:0> , scanner . linePtr ) ; if ( index < <NUM_LIT:2> ) return position ; int previousLineEnd = scanner . lineEnds [ index - <NUM_LIT:2> ] ; char [ ] source = scanner . source ; for ( int i = previousLineEnd + <NUM_LIT:1> ; i < position ; i ++ ) { if ( ! ( source [ i ] == '<CHAR_LIT:U+0020>' || source [ i ] == '<STR_LIT:\t>' ) ) return position ; } return previousLineEnd ; } public int sourceEnd ( ) { return <NUM_LIT:0> ; } protected String tabString ( int tab ) { StringBuffer result = new StringBuffer ( ) ; for ( int i = tab ; i > <NUM_LIT:0> ; i -- ) { result . append ( "<STR_LIT:U+0020U+0020>" ) ; } return result . toString ( ) ; } public RecoveredElement topElement ( ) { RecoveredElement current = this ; while ( current . parent != null ) { current = current . parent ; } return current ; } public String toString ( ) { return toString ( <NUM_LIT:0> ) ; } public String toString ( int tab ) { return super . toString ( ) ; } public RecoveredType type ( ) { RecoveredElement current = this ; while ( current != null ) { if ( current instanceof RecoveredType ) { return ( RecoveredType ) current ; } current = current . parent ; } return null ; } public void updateBodyStart ( int bodyStart ) { this . foundOpeningBrace = true ; } public void updateFromParserState ( ) { } public RecoveredElement updateOnClosingBrace ( int braceStart , int braceEnd ) { if ( ( -- this . bracketBalance <= <NUM_LIT:0> ) && ( this . parent != null ) ) { this . updateSourceEndIfNecessary ( braceStart , braceEnd ) ; return this . parent ; } return this ; } public RecoveredElement updateOnOpeningBrace ( int braceStart , int braceEnd ) { if ( this . bracketBalance ++ == <NUM_LIT:0> ) { updateBodyStart ( braceEnd + <NUM_LIT:1> ) ; return this ; } return null ; } public void updateParseTree ( ) { } public void updateSourceEndIfNecessary ( int braceStart , int braceEnd ) { } public void updateSourceEndIfNecessary ( int sourceEnd ) { this . updateSourceEndIfNecessary ( sourceEnd + <NUM_LIT:1> , sourceEnd ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . parser ; import org . eclipse . jdt . core . compiler . CharOperation ; public interface JavadocTagConstants { public static final char [ ] TAG_DEPRECATED = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] TAG_PARAM = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] TAG_RETURN = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] TAG_THROWS = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] TAG_EXCEPTION = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] TAG_SEE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] TAG_LINK = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] TAG_LINKPLAIN = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] TAG_INHERITDOC = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] TAG_VALUE = "<STR_LIT:value>" . toCharArray ( ) ; public static final char [ ] TAG_AUTHOR = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] TAG_CODE = "<STR_LIT:code>" . toCharArray ( ) ; public static final char [ ] TAG_DOC_ROOT = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] TAG_LITERAL = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] TAG_SERIAL = "<STR_LIT:serial>" . toCharArray ( ) ; public static final char [ ] TAG_SERIAL_DATA = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] TAG_SERIAL_FIELD = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] TAG_SINCE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] TAG_VERSION = "<STR_LIT:version>" . toCharArray ( ) ; public static final char [ ] TAG_CATEGORY = "<STR_LIT>" . toCharArray ( ) ; public static final int TAG_DEPRECATED_LENGTH = TAG_DEPRECATED . length ; public static final int TAG_PARAM_LENGTH = TAG_PARAM . length ; public static final int TAG_RETURN_LENGTH = TAG_RETURN . length ; public static final int TAG_THROWS_LENGTH = TAG_THROWS . length ; public static final int TAG_EXCEPTION_LENGTH = TAG_EXCEPTION . length ; public static final int TAG_SEE_LENGTH = TAG_SEE . length ; public static final int TAG_LINK_LENGTH = TAG_LINK . length ; public static final int TAG_LINKPLAIN_LENGTH = TAG_LINKPLAIN . length ; public static final int TAG_INHERITDOC_LENGTH = TAG_INHERITDOC . length ; public static final int TAG_VALUE_LENGTH = TAG_VALUE . length ; public static final int TAG_CATEGORY_LENGTH = TAG_CATEGORY . length ; public static final int TAG_AUTHOR_LENGTH = TAG_AUTHOR . length ; public static final int TAG_SERIAL_LENGTH = TAG_SERIAL . length ; public static final int TAG_SERIAL_DATA_LENGTH = TAG_SERIAL_DATA . length ; public static final int TAG_SERIAL_FIELD_LENGTH = TAG_SERIAL_FIELD . length ; public static final int TAG_SINCE_LENGTH = TAG_SINCE . length ; public static final int TAG_VERSION_LENGTH = TAG_VERSION . length ; public static final int TAG_CODE_LENGTH = TAG_CODE . length ; public static final int TAG_LITERAL_LENGTH = TAG_LITERAL . length ; public static final int TAG_DOC_ROOT_LENGTH = TAG_DOC_ROOT . length ; public static final int NO_TAG_VALUE = <NUM_LIT:0> ; public static final int TAG_DEPRECATED_VALUE = <NUM_LIT:1> ; public static final int TAG_PARAM_VALUE = <NUM_LIT:2> ; public static final int TAG_RETURN_VALUE = <NUM_LIT:3> ; public static final int TAG_THROWS_VALUE = <NUM_LIT:4> ; public static final int TAG_EXCEPTION_VALUE = <NUM_LIT:5> ; public static final int TAG_SEE_VALUE = <NUM_LIT:6> ; public static final int TAG_LINK_VALUE = <NUM_LIT:7> ; public static final int TAG_LINKPLAIN_VALUE = <NUM_LIT:8> ; public static final int TAG_INHERITDOC_VALUE = <NUM_LIT:9> ; public static final int TAG_VALUE_VALUE = <NUM_LIT:10> ; public static final int TAG_CATEGORY_VALUE = <NUM_LIT:11> ; public static final int TAG_AUTHOR_VALUE = <NUM_LIT:12> ; public static final int TAG_SERIAL_VALUE = <NUM_LIT> ; public static final int TAG_SERIAL_DATA_VALUE = <NUM_LIT> ; public static final int TAG_SERIAL_FIELD_VALUE = <NUM_LIT:15> ; public static final int TAG_SINCE_VALUE = <NUM_LIT:16> ; public static final int TAG_VERSION_VALUE = <NUM_LIT> ; public static final int TAG_CODE_VALUE = <NUM_LIT> ; public static final int TAG_LITERAL_VALUE = <NUM_LIT> ; public static final int TAG_DOC_ROOT_VALUE = <NUM_LIT:20> ; public static final int TAG_OTHERS_VALUE = <NUM_LIT:100> ; public static final char [ ] [ ] TAG_NAMES = { CharOperation . NO_CHAR , TAG_DEPRECATED , TAG_PARAM , TAG_RETURN , TAG_THROWS , TAG_EXCEPTION , TAG_SEE , TAG_LINK , TAG_LINKPLAIN , TAG_INHERITDOC , TAG_VALUE , TAG_CATEGORY , TAG_AUTHOR , TAG_SERIAL , TAG_SERIAL_DATA , TAG_SERIAL_FIELD , TAG_SINCE , TAG_VERSION , TAG_CODE , TAG_LITERAL , TAG_DOC_ROOT , } ; public final static int ORDERED_TAGS_NUMBER = <NUM_LIT:3> ; public final static int PARAM_TAG_EXPECTED_ORDER = <NUM_LIT:0> ; public final static int THROWS_TAG_EXPECTED_ORDER = <NUM_LIT:1> ; public final static int SEE_TAG_EXPECTED_ORDER = <NUM_LIT:2> ; public final static int BLOCK_IDX = <NUM_LIT:0> ; public final static int INLINE_IDX = <NUM_LIT:1> ; public final static char [ ] HREF_TAG = { '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT:e>' , '<CHAR_LIT>' } ; public static final char [ ] [ ] [ ] BLOCK_TAGS = { { TAG_AUTHOR , TAG_DEPRECATED , TAG_EXCEPTION , TAG_PARAM , TAG_RETURN , TAG_SEE , TAG_VERSION , TAG_CATEGORY } , { TAG_SINCE } , { TAG_SERIAL , TAG_SERIAL_DATA , TAG_SERIAL_FIELD , TAG_THROWS } , { } , { } , { } , { } , { } , } ; public static final char [ ] [ ] [ ] INLINE_TAGS = { { } , { } , { TAG_LINK } , { TAG_DOC_ROOT } , { TAG_INHERITDOC , TAG_LINKPLAIN , TAG_VALUE } , { TAG_CODE , TAG_LITERAL } , { } , { } , } ; public final static int INLINE_TAGS_LENGTH = INLINE_TAGS . length ; public final static int BLOCK_TAGS_LENGTH = BLOCK_TAGS . length ; public final static int ALL_TAGS_LENGTH = BLOCK_TAGS_LENGTH + INLINE_TAGS_LENGTH ; public final static short TAG_TYPE_NONE = <NUM_LIT:0> ; public final static short TAG_TYPE_INLINE = <NUM_LIT:1> ; public final static short TAG_TYPE_BLOCK = <NUM_LIT:2> ; public static final short [ ] JAVADOC_TAG_TYPE = { TAG_TYPE_NONE , TAG_TYPE_BLOCK , TAG_TYPE_BLOCK , TAG_TYPE_BLOCK , TAG_TYPE_BLOCK , TAG_TYPE_BLOCK , TAG_TYPE_BLOCK , TAG_TYPE_INLINE , TAG_TYPE_INLINE , TAG_TYPE_INLINE , TAG_TYPE_INLINE , TAG_TYPE_BLOCK , TAG_TYPE_BLOCK , TAG_TYPE_BLOCK , TAG_TYPE_BLOCK , TAG_TYPE_BLOCK , TAG_TYPE_BLOCK , TAG_TYPE_BLOCK , TAG_TYPE_INLINE , TAG_TYPE_INLINE , TAG_TYPE_INLINE } ; public static final char [ ] [ ] PACKAGE_TAGS = { TAG_SEE , TAG_SINCE , TAG_SERIAL , TAG_AUTHOR , TAG_VERSION , TAG_CATEGORY , TAG_LINK , TAG_LINKPLAIN , TAG_DOC_ROOT , TAG_VALUE , } ; public static final char [ ] [ ] COMPILATION_UNIT_TAGS = { } ; public static final char [ ] [ ] CLASS_TAGS = { TAG_SEE , TAG_SINCE , TAG_DEPRECATED , TAG_SERIAL , TAG_AUTHOR , TAG_VERSION , TAG_PARAM , TAG_CATEGORY , TAG_LINK , TAG_LINKPLAIN , TAG_DOC_ROOT , TAG_VALUE , TAG_CODE , TAG_LITERAL } ; public static final char [ ] [ ] FIELD_TAGS = { TAG_SEE , TAG_SINCE , TAG_DEPRECATED , TAG_SERIAL , TAG_SERIAL_FIELD , TAG_CATEGORY , TAG_LINK , TAG_LINKPLAIN , TAG_DOC_ROOT , TAG_VALUE , TAG_CODE , TAG_LITERAL } ; public static final char [ ] [ ] METHOD_TAGS = { TAG_SEE , TAG_SINCE , TAG_DEPRECATED , TAG_PARAM , TAG_RETURN , TAG_THROWS , TAG_EXCEPTION , TAG_SERIAL_DATA , TAG_CATEGORY , TAG_LINK , TAG_LINKPLAIN , TAG_INHERITDOC , TAG_DOC_ROOT , TAG_VALUE , TAG_CODE , TAG_LITERAL } ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . parser ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . Annotation ; import org . eclipse . jdt . internal . compiler . ast . Expression ; import org . eclipse . jdt . internal . compiler . ast . MarkerAnnotation ; import org . eclipse . jdt . internal . compiler . ast . MemberValuePair ; import org . eclipse . jdt . internal . compiler . ast . NormalAnnotation ; 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 . ast . TypeReference ; public class RecoveredAnnotation extends RecoveredElement { public static final int MARKER = <NUM_LIT:0> ; public static final int NORMAL = <NUM_LIT:1> ; public static final int SINGLE_MEMBER = <NUM_LIT:2> ; private int kind ; private int identifierPtr ; private int identifierLengthPtr ; private int sourceStart ; public boolean hasPendingMemberValueName ; public int memberValuPairEqualEnd = - <NUM_LIT:1> ; public Annotation annotation ; public RecoveredAnnotation ( int identifierPtr , int identifierLengthPtr , int sourceStart , RecoveredElement parent , int bracketBalance ) { super ( parent , bracketBalance ) ; this . kind = MARKER ; this . identifierPtr = identifierPtr ; this . identifierLengthPtr = identifierLengthPtr ; this . sourceStart = sourceStart ; } public RecoveredElement add ( TypeDeclaration typeDeclaration , int bracketBalanceValue ) { if ( this . annotation == null && ( typeDeclaration . bits & ASTNode . IsAnonymousType ) != <NUM_LIT:0> ) { return this ; } return super . add ( typeDeclaration , bracketBalanceValue ) ; } public RecoveredElement addAnnotationName ( int identPtr , int identLengthPtr , int annotationStart , int bracketBalanceValue ) { RecoveredAnnotation element = new RecoveredAnnotation ( identPtr , identLengthPtr , annotationStart , this , bracketBalanceValue ) ; return element ; } public RecoveredElement addAnnotation ( Annotation annot , int index ) { this . annotation = annot ; if ( this . parent != null ) return this . parent ; return this ; } public void updateFromParserState ( ) { Parser parser = parser ( ) ; if ( this . annotation == null && this . identifierPtr <= parser . identifierPtr ) { Annotation annot = null ; boolean needUpdateRParenPos = false ; MemberValuePair pendingMemberValueName = null ; if ( this . hasPendingMemberValueName && this . identifierPtr < parser . identifierPtr ) { char [ ] memberValueName = parser . identifierStack [ this . identifierPtr + <NUM_LIT:1> ] ; long pos = parser . identifierPositionStack [ this . identifierPtr + <NUM_LIT:1> ] ; int start = ( int ) ( pos > > > <NUM_LIT:32> ) ; int end = ( int ) pos ; int valueEnd = this . memberValuPairEqualEnd > - <NUM_LIT:1> ? this . memberValuPairEqualEnd : end ; SingleNameReference fakeExpression = new SingleNameReference ( RecoveryScanner . FAKE_IDENTIFIER , ( ( ( long ) valueEnd + <NUM_LIT:1> ) << <NUM_LIT:32> ) + ( valueEnd ) ) ; pendingMemberValueName = new MemberValuePair ( memberValueName , start , end , fakeExpression ) ; } parser . identifierPtr = this . identifierPtr ; parser . identifierLengthPtr = this . identifierLengthPtr ; TypeReference typeReference = parser . getAnnotationType ( ) ; switch ( this . kind ) { case NORMAL : if ( parser . astPtr > - <NUM_LIT:1> && parser . astStack [ parser . astPtr ] instanceof MemberValuePair ) { MemberValuePair [ ] memberValuePairs = null ; int argLength = parser . astLengthStack [ parser . astLengthPtr ] ; int argStart = parser . astPtr - argLength + <NUM_LIT:1> ; if ( argLength > <NUM_LIT:0> ) { int annotationEnd ; if ( pendingMemberValueName != null ) { memberValuePairs = new MemberValuePair [ argLength + <NUM_LIT:1> ] ; System . arraycopy ( parser . astStack , argStart , memberValuePairs , <NUM_LIT:0> , argLength ) ; parser . astLengthPtr -- ; parser . astPtr -= argLength ; memberValuePairs [ argLength ] = pendingMemberValueName ; annotationEnd = pendingMemberValueName . sourceEnd ; } else { memberValuePairs = new MemberValuePair [ argLength ] ; System . arraycopy ( parser . astStack , argStart , memberValuePairs , <NUM_LIT:0> , argLength ) ; parser . astLengthPtr -- ; parser . astPtr -= argLength ; MemberValuePair lastMemberValuePair = memberValuePairs [ memberValuePairs . length - <NUM_LIT:1> ] ; annotationEnd = lastMemberValuePair . value != null ? lastMemberValuePair . value instanceof Annotation ? ( ( Annotation ) lastMemberValuePair . value ) . declarationSourceEnd : lastMemberValuePair . value . sourceEnd : lastMemberValuePair . sourceEnd ; } NormalAnnotation normalAnnotation = new NormalAnnotation ( typeReference , this . sourceStart ) ; normalAnnotation . memberValuePairs = memberValuePairs ; normalAnnotation . declarationSourceEnd = annotationEnd ; normalAnnotation . bits |= ASTNode . IsRecovered ; annot = normalAnnotation ; needUpdateRParenPos = true ; } } break ; case SINGLE_MEMBER : if ( parser . expressionPtr > - <NUM_LIT:1> ) { Expression memberValue = parser . expressionStack [ parser . expressionPtr -- ] ; SingleMemberAnnotation singleMemberAnnotation = new SingleMemberAnnotation ( typeReference , this . sourceStart ) ; singleMemberAnnotation . memberValue = memberValue ; singleMemberAnnotation . declarationSourceEnd = memberValue . sourceEnd ; singleMemberAnnotation . bits |= ASTNode . IsRecovered ; annot = singleMemberAnnotation ; needUpdateRParenPos = true ; } break ; } if ( ! needUpdateRParenPos ) { if ( pendingMemberValueName != null ) { NormalAnnotation normalAnnotation = new NormalAnnotation ( typeReference , this . sourceStart ) ; normalAnnotation . memberValuePairs = new MemberValuePair [ ] { pendingMemberValueName } ; normalAnnotation . declarationSourceEnd = pendingMemberValueName . value . sourceEnd ; normalAnnotation . bits |= ASTNode . IsRecovered ; annot = normalAnnotation ; } else { MarkerAnnotation markerAnnotation = new MarkerAnnotation ( typeReference , this . sourceStart ) ; markerAnnotation . declarationSourceEnd = markerAnnotation . sourceEnd ; markerAnnotation . bits |= ASTNode . IsRecovered ; annot = markerAnnotation ; } } parser . currentElement = addAnnotation ( annot , this . identifierPtr ) ; parser . annotationRecoveryCheckPoint ( annot . sourceStart , annot . declarationSourceEnd ) ; if ( this . parent != null ) { this . parent . updateFromParserState ( ) ; } } } public ASTNode parseTree ( ) { return this . annotation ; } public void resetPendingModifiers ( ) { if ( this . parent != null ) this . parent . resetPendingModifiers ( ) ; } public void setKind ( int kind ) { this . kind = kind ; } public int sourceEnd ( ) { if ( this . annotation == null ) { Parser parser = parser ( ) ; if ( this . identifierPtr < parser . identifierPositionStack . length ) { return ( int ) parser . identifierPositionStack [ this . identifierPtr ] ; } else { return this . sourceStart ; } } return this . annotation . declarationSourceEnd ; } public String toString ( int tab ) { if ( this . annotation != null ) { return tabString ( tab ) + "<STR_LIT>" + this . annotation . print ( tab + <NUM_LIT:1> , new StringBuffer ( <NUM_LIT:10> ) ) ; } else { return tabString ( tab ) + "<STR_LIT>" + this . identifierPtr + "<STR_LIT>" + this . identifierLengthPtr + "<STR_LIT:n>" ; } } public Annotation updatedAnnotationReference ( ) { return this . annotation ; } public RecoveredElement updateOnClosingBrace ( int braceStart , int braceEnd ) { if ( this . bracketBalance > <NUM_LIT:0> ) { this . bracketBalance -- ; return this ; } if ( this . parent != null ) { return this . parent . updateOnClosingBrace ( braceStart , braceEnd ) ; } return this ; } public void updateParseTree ( ) { updatedAnnotationReference ( ) ; } } </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 . problem ; import java . io . IOException ; import org . eclipse . jdt . core . compiler . CategorizedProblem ; import org . eclipse . jdt . internal . compiler . CompilationResult ; public class AbortCompilationUnit extends AbortCompilation { private static final long serialVersionUID = - <NUM_LIT> ; public String encoding ; public AbortCompilationUnit ( CompilationResult compilationResult , CategorizedProblem problem ) { super ( compilationResult , problem ) ; } public AbortCompilationUnit ( CompilationResult compilationResult , IOException exception , String encoding ) { super ( compilationResult , exception ) ; this . encoding = encoding ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . problem ; public class ShouldNotImplement extends RuntimeException { private static final long serialVersionUID = <NUM_LIT> ; public ShouldNotImplement ( String message ) { super ( message ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . problem ; import java . io . CharConversionException ; import java . io . PrintWriter ; import java . io . StringWriter ; import java . util . Iterator ; import java . util . List ; 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 . core . compiler . InvalidInputException ; import org . eclipse . jdt . internal . compiler . CompilationResult ; import org . eclipse . jdt . internal . compiler . IErrorHandlingPolicy ; import org . eclipse . jdt . internal . compiler . IProblemFactory ; 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 . Annotation ; 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 . 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 . BinaryExpression ; import org . eclipse . jdt . internal . compiler . ast . Block ; import org . eclipse . jdt . internal . compiler . ast . BranchStatement ; import org . eclipse . jdt . internal . compiler . ast . CaseStatement ; import org . eclipse . jdt . internal . compiler . ast . CastExpression ; 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 . EqualExpression ; import org . eclipse . jdt . internal . compiler . ast . ExplicitConstructorCall ; import org . eclipse . jdt . internal . compiler . ast . Expression ; import org . eclipse . jdt . internal . compiler . ast . FakedTrackingVariable ; import org . eclipse . jdt . internal . compiler . ast . FieldDeclaration ; import org . eclipse . jdt . internal . compiler . ast . FieldReference ; 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 . LabeledStatement ; import org . eclipse . jdt . internal . compiler . ast . Literal ; import org . eclipse . jdt . internal . compiler . ast . LocalDeclaration ; 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 . NameReference ; import org . eclipse . jdt . internal . compiler . ast . ParameterizedQualifiedTypeReference ; import org . eclipse . jdt . internal . compiler . ast . ParameterizedSingleTypeReference ; import org . eclipse . jdt . internal . compiler . ast . QualifiedAllocationExpression ; import org . eclipse . jdt . internal . compiler . ast . QualifiedNameReference ; import org . eclipse . jdt . internal . compiler . ast . QualifiedTypeReference ; import org . eclipse . jdt . internal . compiler . ast . Reference ; import org . eclipse . jdt . internal . compiler . ast . ReturnStatement ; import org . eclipse . jdt . internal . compiler . ast . SingleNameReference ; import org . eclipse . jdt . internal . compiler . ast . Statement ; import org . eclipse . jdt . internal . compiler . ast . SwitchStatement ; import org . eclipse . jdt . internal . compiler . ast . ThisReference ; 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 . Wildcard ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . env . AccessRestriction ; import org . eclipse . jdt . internal . compiler . env . ICompilationUnit ; import org . eclipse . jdt . internal . compiler . flow . FlowInfo ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . impl . ReferenceContext ; import org . eclipse . jdt . internal . compiler . lookup . ArrayBinding ; import org . eclipse . jdt . internal . compiler . lookup . Binding ; import org . eclipse . jdt . internal . compiler . lookup . ExtraCompilerModifiers ; import org . eclipse . jdt . internal . compiler . lookup . FieldBinding ; import org . eclipse . jdt . internal . compiler . lookup . InvocationSite ; import org . eclipse . jdt . internal . compiler . lookup . LocalVariableBinding ; import org . eclipse . jdt . internal . compiler . lookup . MethodBinding ; import org . eclipse . jdt . internal . compiler . lookup . MethodScope ; import org . eclipse . jdt . internal . compiler . lookup . PackageBinding ; import org . eclipse . jdt . internal . compiler . lookup . ParameterizedGenericMethodBinding ; import org . eclipse . jdt . internal . compiler . lookup . ProblemMethodBinding ; import org . eclipse . jdt . internal . compiler . lookup . ProblemReasons ; import org . eclipse . jdt . internal . compiler . lookup . ProblemReferenceBinding ; import org . eclipse . jdt . internal . compiler . lookup . ReferenceBinding ; import org . eclipse . jdt . internal . compiler . lookup . Scope ; import org . eclipse . jdt . internal . compiler . lookup . SourceTypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . SyntheticArgumentBinding ; 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 . lookup . WildcardBinding ; import org . eclipse . jdt . internal . compiler . parser . JavadocTagConstants ; import org . eclipse . jdt . internal . compiler . parser . Parser ; import org . eclipse . jdt . internal . compiler . parser . RecoveryScanner ; import org . eclipse . jdt . internal . compiler . parser . Scanner ; import org . eclipse . jdt . internal . compiler . parser . TerminalTokens ; import org . eclipse . jdt . internal . compiler . util . Messages ; public class ProblemReporter extends ProblemHandler { public ReferenceContext referenceContext ; private Scanner positionScanner ; private final static byte FIELD_ACCESS = <NUM_LIT> , CONSTRUCTOR_ACCESS = <NUM_LIT> , METHOD_ACCESS = <NUM_LIT> ; public ProblemReporter ( IErrorHandlingPolicy policy , CompilerOptions options , IProblemFactory problemFactory ) { super ( policy , options , problemFactory ) ; } private static int getElaborationId ( int leadProblemId , byte elaborationVariant ) { return leadProblemId << <NUM_LIT:8> | elaborationVariant ; } public static int getIrritant ( int problemID ) { switch ( problemID ) { case IProblem . MaskedCatch : return CompilerOptions . MaskedCatchBlock ; case IProblem . UnusedImport : return CompilerOptions . UnusedImport ; case IProblem . MethodButWithConstructorName : return CompilerOptions . MethodWithConstructorName ; case IProblem . OverridingNonVisibleMethod : return CompilerOptions . OverriddenPackageDefaultMethod ; case IProblem . IncompatibleReturnTypeForNonInheritedInterfaceMethod : case IProblem . IncompatibleExceptionInThrowsClauseForNonInheritedInterfaceMethod : return CompilerOptions . IncompatibleNonInheritedInterfaceMethod ; case IProblem . OverridingDeprecatedMethod : case IProblem . UsingDeprecatedType : case IProblem . UsingDeprecatedMethod : case IProblem . UsingDeprecatedConstructor : case IProblem . UsingDeprecatedField : return CompilerOptions . UsingDeprecatedAPI ; case IProblem . LocalVariableIsNeverUsed : return CompilerOptions . UnusedLocalVariable ; case IProblem . ArgumentIsNeverUsed : return CompilerOptions . UnusedArgument ; case IProblem . NoImplicitStringConversionForCharArrayExpression : return CompilerOptions . NoImplicitStringConversion ; case IProblem . NeedToEmulateFieldReadAccess : case IProblem . NeedToEmulateFieldWriteAccess : case IProblem . NeedToEmulateMethodAccess : case IProblem . NeedToEmulateConstructorAccess : return CompilerOptions . AccessEmulation ; case IProblem . NonExternalizedStringLiteral : case IProblem . UnnecessaryNLSTag : return CompilerOptions . NonExternalizedString ; case IProblem . UseAssertAsAnIdentifier : return CompilerOptions . AssertUsedAsAnIdentifier ; case IProblem . UseEnumAsAnIdentifier : return CompilerOptions . EnumUsedAsAnIdentifier ; case IProblem . NonStaticAccessToStaticMethod : case IProblem . NonStaticAccessToStaticField : return CompilerOptions . NonStaticAccessToStatic ; case IProblem . IndirectAccessToStaticMethod : case IProblem . IndirectAccessToStaticField : case IProblem . IndirectAccessToStaticType : return CompilerOptions . IndirectStaticAccess ; case IProblem . AssignmentHasNoEffect : return CompilerOptions . NoEffectAssignment ; case IProblem . UnusedPrivateConstructor : case IProblem . UnusedPrivateMethod : case IProblem . UnusedPrivateField : case IProblem . UnusedPrivateType : return CompilerOptions . UnusedPrivateMember ; case IProblem . LocalVariableHidingLocalVariable : case IProblem . LocalVariableHidingField : case IProblem . ArgumentHidingLocalVariable : case IProblem . ArgumentHidingField : return CompilerOptions . LocalVariableHiding ; case IProblem . FieldHidingLocalVariable : case IProblem . FieldHidingField : return CompilerOptions . FieldHiding ; case IProblem . TypeParameterHidingType : case IProblem . TypeHidingTypeParameterFromType : case IProblem . TypeHidingTypeParameterFromMethod : case IProblem . TypeHidingType : return CompilerOptions . TypeHiding ; case IProblem . PossibleAccidentalBooleanAssignment : return CompilerOptions . AccidentalBooleanAssign ; case IProblem . SuperfluousSemicolon : case IProblem . EmptyControlFlowStatement : return CompilerOptions . EmptyStatement ; case IProblem . UndocumentedEmptyBlock : return CompilerOptions . UndocumentedEmptyBlock ; case IProblem . UnnecessaryCast : case IProblem . UnnecessaryInstanceof : return CompilerOptions . UnnecessaryTypeCheck ; case IProblem . FinallyMustCompleteNormally : return CompilerOptions . FinallyBlockNotCompleting ; case IProblem . UnusedMethodDeclaredThrownException : case IProblem . UnusedConstructorDeclaredThrownException : return CompilerOptions . UnusedDeclaredThrownException ; case IProblem . UnqualifiedFieldAccess : return CompilerOptions . UnqualifiedFieldAccess ; case IProblem . UnnecessaryElse : return CompilerOptions . UnnecessaryElse ; case IProblem . UnsafeRawConstructorInvocation : case IProblem . UnsafeRawMethodInvocation : case IProblem . UnsafeTypeConversion : case IProblem . UnsafeRawFieldAssignment : case IProblem . UnsafeGenericCast : case IProblem . UnsafeReturnTypeOverride : case IProblem . UnsafeRawGenericMethodInvocation : case IProblem . UnsafeRawGenericConstructorInvocation : case IProblem . UnsafeGenericArrayForVarargs : case IProblem . PotentialHeapPollutionFromVararg : return CompilerOptions . UncheckedTypeOperation ; case IProblem . RawTypeReference : return CompilerOptions . RawTypeReference ; case IProblem . MissingOverrideAnnotation : case IProblem . MissingOverrideAnnotationForInterfaceMethodImplementation : return CompilerOptions . MissingOverrideAnnotation ; case IProblem . FieldMissingDeprecatedAnnotation : case IProblem . MethodMissingDeprecatedAnnotation : case IProblem . TypeMissingDeprecatedAnnotation : return CompilerOptions . MissingDeprecatedAnnotation ; case IProblem . FinalBoundForTypeVariable : return CompilerOptions . FinalParameterBound ; case IProblem . MissingSerialVersion : return CompilerOptions . MissingSerialVersion ; case IProblem . ForbiddenReference : return CompilerOptions . ForbiddenReference ; case IProblem . DiscouragedReference : return CompilerOptions . DiscouragedReference ; case IProblem . MethodVarargsArgumentNeedCast : case IProblem . ConstructorVarargsArgumentNeedCast : return CompilerOptions . VarargsArgumentNeedCast ; case IProblem . NullLocalVariableReference : return CompilerOptions . NullReference ; case IProblem . PotentialNullLocalVariableReference : case IProblem . PotentialNullMessageSendReference : return CompilerOptions . PotentialNullReference ; case IProblem . RedundantLocalVariableNullAssignment : case IProblem . RedundantNullCheckOnNonNullLocalVariable : case IProblem . RedundantNullCheckOnNullLocalVariable : case IProblem . NonNullLocalVariableComparisonYieldsFalse : case IProblem . NullLocalVariableComparisonYieldsFalse : case IProblem . NullLocalVariableInstanceofYieldsFalse : case IProblem . RedundantNullCheckOnNonNullMessageSend : case IProblem . RedundantNullCheckOnSpecdNonNullLocalVariable : case IProblem . SpecdNonNullLocalVariableComparisonYieldsFalse : return CompilerOptions . RedundantNullCheck ; case IProblem . RequiredNonNullButProvidedNull : case IProblem . RequiredNonNullButProvidedSpecdNullable : case IProblem . IllegalReturnNullityRedefinition : case IProblem . IllegalRedefinitionToNonNullParameter : case IProblem . IllegalDefinitionToNonNullParameter : case IProblem . ParameterLackingNonNullAnnotation : case IProblem . ParameterLackingNullableAnnotation : case IProblem . CannotImplementIncompatibleNullness : return CompilerOptions . NullSpecViolation ; case IProblem . RequiredNonNullButProvidedPotentialNull : return CompilerOptions . NullAnnotationInferenceConflict ; case IProblem . RequiredNonNullButProvidedUnknown : return CompilerOptions . NullUncheckedConversion ; case IProblem . RedundantNullAnnotation : case IProblem . RedundantNullDefaultAnnotation : case IProblem . RedundantNullDefaultAnnotationPackage : case IProblem . RedundantNullDefaultAnnotationType : case IProblem . RedundantNullDefaultAnnotationMethod : return CompilerOptions . RedundantNullAnnotation ; case IProblem . BoxingConversion : case IProblem . UnboxingConversion : return CompilerOptions . AutoBoxing ; case IProblem . MissingEnumConstantCase : case IProblem . MissingEnumConstantCaseDespiteDefault : return CompilerOptions . MissingEnumConstantCase ; case IProblem . MissingDefaultCase : case IProblem . MissingEnumDefaultCase : return CompilerOptions . MissingDefaultCase ; case IProblem . AnnotationTypeUsedAsSuperInterface : return CompilerOptions . AnnotationSuperInterface ; case IProblem . UnhandledWarningToken : return CompilerOptions . UnhandledWarningToken ; case IProblem . UnusedWarningToken : return CompilerOptions . UnusedWarningToken ; case IProblem . UnusedLabel : return CompilerOptions . UnusedLabel ; case IProblem . JavadocUnexpectedTag : case IProblem . JavadocDuplicateTag : case IProblem . JavadocDuplicateReturnTag : case IProblem . JavadocInvalidThrowsClass : case IProblem . JavadocInvalidSeeReference : case IProblem . JavadocInvalidParamTagName : case IProblem . JavadocInvalidParamTagTypeParameter : case IProblem . JavadocMalformedSeeReference : case IProblem . JavadocInvalidSeeHref : case IProblem . JavadocInvalidSeeArgs : case IProblem . JavadocInvalidTag : case IProblem . JavadocUnterminatedInlineTag : case IProblem . JavadocMissingHashCharacter : case IProblem . JavadocEmptyReturnTag : case IProblem . JavadocUnexpectedText : case IProblem . JavadocInvalidParamName : case IProblem . JavadocDuplicateParamName : case IProblem . JavadocMissingParamName : case IProblem . JavadocMissingIdentifier : case IProblem . JavadocInvalidMemberTypeQualification : case IProblem . JavadocInvalidThrowsClassName : case IProblem . JavadocDuplicateThrowsClassName : case IProblem . JavadocMissingThrowsClassName : case IProblem . JavadocMissingSeeReference : case IProblem . JavadocInvalidValueReference : case IProblem . JavadocUndefinedField : case IProblem . JavadocAmbiguousField : case IProblem . JavadocUndefinedConstructor : case IProblem . JavadocAmbiguousConstructor : case IProblem . JavadocUndefinedMethod : case IProblem . JavadocAmbiguousMethod : case IProblem . JavadocAmbiguousMethodReference : case IProblem . JavadocParameterMismatch : case IProblem . JavadocUndefinedType : case IProblem . JavadocAmbiguousType : case IProblem . JavadocInternalTypeNameProvided : case IProblem . JavadocNoMessageSendOnArrayType : case IProblem . JavadocNoMessageSendOnBaseType : case IProblem . JavadocInheritedMethodHidesEnclosingName : case IProblem . JavadocInheritedFieldHidesEnclosingName : case IProblem . JavadocInheritedNameHidesEnclosingTypeName : case IProblem . JavadocNonStaticTypeFromStaticInvocation : case IProblem . JavadocGenericMethodTypeArgumentMismatch : case IProblem . JavadocNonGenericMethod : case IProblem . JavadocIncorrectArityForParameterizedMethod : case IProblem . JavadocParameterizedMethodArgumentTypeMismatch : case IProblem . JavadocTypeArgumentsForRawGenericMethod : case IProblem . JavadocGenericConstructorTypeArgumentMismatch : case IProblem . JavadocNonGenericConstructor : case IProblem . JavadocIncorrectArityForParameterizedConstructor : case IProblem . JavadocParameterizedConstructorArgumentTypeMismatch : case IProblem . JavadocTypeArgumentsForRawGenericConstructor : case IProblem . JavadocNotVisibleField : case IProblem . JavadocNotVisibleConstructor : case IProblem . JavadocNotVisibleMethod : case IProblem . JavadocNotVisibleType : case IProblem . JavadocUsingDeprecatedField : case IProblem . JavadocUsingDeprecatedConstructor : case IProblem . JavadocUsingDeprecatedMethod : case IProblem . JavadocUsingDeprecatedType : case IProblem . JavadocHiddenReference : case IProblem . JavadocMissingTagDescription : case IProblem . JavadocInvalidSeeUrlReference : return CompilerOptions . InvalidJavadoc ; case IProblem . JavadocMissingParamTag : case IProblem . JavadocMissingReturnTag : case IProblem . JavadocMissingThrowsTag : return CompilerOptions . MissingJavadocTags ; case IProblem . JavadocMissing : return CompilerOptions . MissingJavadocComments ; case IProblem . ParameterAssignment : return CompilerOptions . ParameterAssignment ; case IProblem . FallthroughCase : return CompilerOptions . FallthroughCase ; case IProblem . OverridingMethodWithoutSuperInvocation : return CompilerOptions . OverridingMethodWithoutSuperInvocation ; case IProblem . UnusedTypeArgumentsForMethodInvocation : case IProblem . UnusedTypeArgumentsForConstructorInvocation : return CompilerOptions . UnusedTypeArguments ; case IProblem . RedundantSuperinterface : return CompilerOptions . RedundantSuperinterface ; case IProblem . ComparingIdentical : return CompilerOptions . ComparingIdentical ; case IProblem . MissingSynchronizedModifierInInheritedMethod : return CompilerOptions . MissingSynchronizedModifierInInheritedMethod ; case IProblem . ShouldImplementHashcode : return CompilerOptions . ShouldImplementHashcode ; case IProblem . DeadCode : return CompilerOptions . DeadCode ; case IProblem . Task : return CompilerOptions . Tasks ; case IProblem . UnusedObjectAllocation : return CompilerOptions . UnusedObjectAllocation ; case IProblem . MethodCanBeStatic : return CompilerOptions . MethodCanBeStatic ; case IProblem . MethodCanBePotentiallyStatic : return CompilerOptions . MethodCanBePotentiallyStatic ; case IProblem . UnclosedCloseable : case IProblem . UnclosedCloseableAtExit : return CompilerOptions . UnclosedCloseable ; case IProblem . PotentiallyUnclosedCloseable : case IProblem . PotentiallyUnclosedCloseableAtExit : return CompilerOptions . PotentiallyUnclosedCloseable ; case IProblem . ExplicitlyClosedAutoCloseable : return CompilerOptions . ExplicitlyClosedAutoCloseable ; case IProblem . RedundantSpecificationOfTypeArguments : return CompilerOptions . RedundantSpecificationOfTypeArguments ; case IProblem . MissingNonNullByDefaultAnnotationOnPackage : case IProblem . MissingNonNullByDefaultAnnotationOnType : return CompilerOptions . MissingNonNullByDefaultAnnotation ; } return <NUM_LIT:0> ; } public static int getProblemCategory ( int severity , int problemID ) { categorizeOnIrritant : { if ( ( severity & ProblemSeverities . Fatal ) != <NUM_LIT:0> ) break categorizeOnIrritant ; int irritant = getIrritant ( problemID ) ; switch ( irritant ) { case CompilerOptions . MethodWithConstructorName : case CompilerOptions . AccessEmulation : case CompilerOptions . AssertUsedAsAnIdentifier : case CompilerOptions . NonStaticAccessToStatic : case CompilerOptions . UnqualifiedFieldAccess : case CompilerOptions . UndocumentedEmptyBlock : case CompilerOptions . IndirectStaticAccess : case CompilerOptions . FinalParameterBound : case CompilerOptions . EnumUsedAsAnIdentifier : case CompilerOptions . AnnotationSuperInterface : case CompilerOptions . AutoBoxing : case CompilerOptions . MissingOverrideAnnotation : case CompilerOptions . MissingDeprecatedAnnotation : case CompilerOptions . ParameterAssignment : case CompilerOptions . MethodCanBeStatic : case CompilerOptions . MethodCanBePotentiallyStatic : case CompilerOptions . ExplicitlyClosedAutoCloseable : return CategorizedProblem . CAT_CODE_STYLE ; case CompilerOptions . MaskedCatchBlock : case CompilerOptions . NoImplicitStringConversion : case CompilerOptions . NoEffectAssignment : case CompilerOptions . AccidentalBooleanAssign : case CompilerOptions . EmptyStatement : case CompilerOptions . FinallyBlockNotCompleting : case CompilerOptions . MissingSerialVersion : case CompilerOptions . VarargsArgumentNeedCast : case CompilerOptions . NullReference : case CompilerOptions . PotentialNullReference : case CompilerOptions . RedundantNullCheck : case CompilerOptions . MissingEnumConstantCase : case CompilerOptions . MissingDefaultCase : case CompilerOptions . FallthroughCase : case CompilerOptions . OverridingMethodWithoutSuperInvocation : case CompilerOptions . ComparingIdentical : case CompilerOptions . MissingSynchronizedModifierInInheritedMethod : case CompilerOptions . ShouldImplementHashcode : case CompilerOptions . DeadCode : case CompilerOptions . UnusedObjectAllocation : case CompilerOptions . UnclosedCloseable : case CompilerOptions . PotentiallyUnclosedCloseable : return CategorizedProblem . CAT_POTENTIAL_PROGRAMMING_PROBLEM ; case CompilerOptions . OverriddenPackageDefaultMethod : case CompilerOptions . IncompatibleNonInheritedInterfaceMethod : case CompilerOptions . LocalVariableHiding : case CompilerOptions . FieldHiding : case CompilerOptions . TypeHiding : return CategorizedProblem . CAT_NAME_SHADOWING_CONFLICT ; case CompilerOptions . UnusedLocalVariable : case CompilerOptions . UnusedArgument : case CompilerOptions . UnusedImport : case CompilerOptions . UnusedPrivateMember : case CompilerOptions . UnusedDeclaredThrownException : case CompilerOptions . UnnecessaryTypeCheck : case CompilerOptions . UnnecessaryElse : case CompilerOptions . UnhandledWarningToken : case CompilerOptions . UnusedWarningToken : case CompilerOptions . UnusedLabel : case CompilerOptions . RedundantSuperinterface : case CompilerOptions . RedundantSpecificationOfTypeArguments : return CategorizedProblem . CAT_UNNECESSARY_CODE ; case CompilerOptions . UsingDeprecatedAPI : return CategorizedProblem . CAT_DEPRECATION ; case CompilerOptions . NonExternalizedString : return CategorizedProblem . CAT_NLS ; case CompilerOptions . Task : return CategorizedProblem . CAT_UNSPECIFIED ; case CompilerOptions . MissingJavadocComments : case CompilerOptions . MissingJavadocTags : case CompilerOptions . InvalidJavadoc : case CompilerOptions . InvalidJavadoc | CompilerOptions . UsingDeprecatedAPI : return CategorizedProblem . CAT_JAVADOC ; case CompilerOptions . UncheckedTypeOperation : case CompilerOptions . RawTypeReference : return CategorizedProblem . CAT_UNCHECKED_RAW ; case CompilerOptions . ForbiddenReference : case CompilerOptions . DiscouragedReference : return CategorizedProblem . CAT_RESTRICTION ; case CompilerOptions . NullSpecViolation : case CompilerOptions . NullAnnotationInferenceConflict : case CompilerOptions . NullUncheckedConversion : case CompilerOptions . MissingNonNullByDefaultAnnotation : return CategorizedProblem . CAT_POTENTIAL_PROGRAMMING_PROBLEM ; case CompilerOptions . RedundantNullAnnotation : return CategorizedProblem . CAT_UNNECESSARY_CODE ; default : break categorizeOnIrritant ; } } switch ( problemID ) { case IProblem . IsClassPathCorrect : case IProblem . CorruptedSignature : return CategorizedProblem . CAT_BUILDPATH ; default : if ( ( problemID & IProblem . Syntax ) != <NUM_LIT:0> ) return CategorizedProblem . CAT_SYNTAX ; if ( ( problemID & IProblem . ImportRelated ) != <NUM_LIT:0> ) return CategorizedProblem . CAT_IMPORT ; if ( ( problemID & IProblem . TypeRelated ) != <NUM_LIT:0> ) return CategorizedProblem . CAT_TYPE ; if ( ( problemID & ( IProblem . FieldRelated | IProblem . MethodRelated | IProblem . ConstructorRelated ) ) != <NUM_LIT:0> ) return CategorizedProblem . CAT_MEMBER ; } return CategorizedProblem . CAT_INTERNAL ; } public void abortDueToInternalError ( String errorMessage ) { this . abortDueToInternalError ( errorMessage , null ) ; } public void abortDueToInternalError ( String errorMessage , ASTNode location ) { String [ ] arguments = new String [ ] { errorMessage } ; this . handle ( IProblem . Unclassified , arguments , arguments , ProblemSeverities . Error | ProblemSeverities . Abort | ProblemSeverities . Fatal , location == null ? <NUM_LIT:0> : location . sourceStart , location == null ? <NUM_LIT:0> : location . sourceEnd ) ; } public void abstractMethodCannotBeOverridden ( SourceTypeBinding type , MethodBinding concreteMethod ) { this . handle ( IProblem . AbstractMethodCannotBeOverridden , new String [ ] { new String ( type . sourceName ( ) ) , new String ( CharOperation . concat ( concreteMethod . declaringClass . readableName ( ) , concreteMethod . readableName ( ) , '<CHAR_LIT:.>' ) ) } , new String [ ] { new String ( type . sourceName ( ) ) , new String ( CharOperation . concat ( concreteMethod . declaringClass . shortReadableName ( ) , concreteMethod . shortReadableName ( ) , '<CHAR_LIT:.>' ) ) } , type . sourceStart ( ) , type . sourceEnd ( ) ) ; } public void abstractMethodInAbstractClass ( SourceTypeBinding type , AbstractMethodDeclaration methodDecl ) { if ( type . isEnum ( ) && type . isLocalType ( ) ) { FieldBinding field = type . scope . enclosingMethodScope ( ) . initializedField ; FieldDeclaration decl = field . sourceField ( ) ; String [ ] arguments = new String [ ] { new String ( decl . name ) , new String ( methodDecl . selector ) } ; this . handle ( IProblem . AbstractMethodInEnum , arguments , arguments , methodDecl . sourceStart , methodDecl . sourceEnd ) ; } else { String [ ] arguments = new String [ ] { new String ( type . sourceName ( ) ) , new String ( methodDecl . selector ) } ; this . handle ( IProblem . AbstractMethodInAbstractClass , arguments , arguments , methodDecl . sourceStart , methodDecl . sourceEnd ) ; } } public void abstractMethodInConcreteClass ( SourceTypeBinding type ) { if ( type . isEnum ( ) && type . isLocalType ( ) ) { FieldBinding field = type . scope . enclosingMethodScope ( ) . initializedField ; FieldDeclaration decl = field . sourceField ( ) ; String [ ] arguments = new String [ ] { new String ( decl . name ) } ; this . handle ( IProblem . EnumConstantCannotDefineAbstractMethod , arguments , arguments , decl . sourceStart ( ) , decl . sourceEnd ( ) ) ; } else { String [ ] arguments = new String [ ] { new String ( type . sourceName ( ) ) } ; this . handle ( IProblem . AbstractMethodsInConcreteClass , arguments , arguments , type . sourceStart ( ) , type . sourceEnd ( ) ) ; } } public void abstractMethodMustBeImplemented ( SourceTypeBinding type , MethodBinding abstractMethod ) { if ( type . scope != null && ! type . scope . shouldReport ( IProblem . IncompatibleReturnType ) ) { return ; } if ( type . isEnum ( ) && type . isLocalType ( ) ) { FieldBinding field = type . scope . enclosingMethodScope ( ) . initializedField ; FieldDeclaration decl = field . sourceField ( ) ; this . handle ( IProblem . EnumConstantMustImplementAbstractMethod , new String [ ] { new String ( abstractMethod . selector ) , typesAsString ( abstractMethod , false ) , new String ( decl . name ) , } , new String [ ] { new String ( abstractMethod . selector ) , typesAsString ( abstractMethod , true ) , new String ( decl . name ) , } , decl . sourceStart ( ) , decl . sourceEnd ( ) ) ; } else { this . handle ( IProblem . AbstractMethodMustBeImplemented , new String [ ] { new String ( abstractMethod . selector ) , typesAsString ( abstractMethod , false ) , new String ( abstractMethod . declaringClass . readableName ( ) ) , new String ( type . readableName ( ) ) , } , new String [ ] { new String ( abstractMethod . selector ) , typesAsString ( abstractMethod , true ) , new String ( abstractMethod . declaringClass . shortReadableName ( ) ) , new String ( type . shortReadableName ( ) ) , } , type . sourceStart ( ) , type . sourceEnd ( ) ) ; } } public void abstractMethodMustBeImplemented ( SourceTypeBinding type , MethodBinding abstractMethod , MethodBinding concreteMethod ) { this . handle ( IProblem . AbstractMethodMustBeImplementedOverConcreteMethod , new String [ ] { new String ( abstractMethod . selector ) , typesAsString ( abstractMethod , false ) , new String ( abstractMethod . declaringClass . readableName ( ) ) , new String ( type . readableName ( ) ) , new String ( concreteMethod . selector ) , typesAsString ( concreteMethod , false ) , new String ( concreteMethod . declaringClass . readableName ( ) ) , } , new String [ ] { new String ( abstractMethod . selector ) , typesAsString ( abstractMethod , true ) , new String ( abstractMethod . declaringClass . shortReadableName ( ) ) , new String ( type . shortReadableName ( ) ) , new String ( concreteMethod . selector ) , typesAsString ( concreteMethod , true ) , new String ( concreteMethod . declaringClass . shortReadableName ( ) ) , } , type . sourceStart ( ) , type . sourceEnd ( ) ) ; } public void abstractMethodNeedingNoBody ( AbstractMethodDeclaration method ) { this . handle ( IProblem . BodyForAbstractMethod , NoArgument , NoArgument , method . sourceStart , method . sourceEnd , method , method . compilationResult ( ) ) ; } public void alreadyDefinedLabel ( char [ ] labelName , ASTNode location ) { String [ ] arguments = new String [ ] { new String ( labelName ) } ; this . handle ( IProblem . DuplicateLabel , arguments , arguments , location . sourceStart , location . sourceEnd ) ; } public void annotationCannotOverrideMethod ( MethodBinding overrideMethod , MethodBinding inheritedMethod ) { ASTNode location = overrideMethod . sourceMethod ( ) ; this . handle ( IProblem . AnnotationCannotOverrideMethod , new String [ ] { new String ( overrideMethod . declaringClass . readableName ( ) ) , new String ( inheritedMethod . declaringClass . readableName ( ) ) , new String ( inheritedMethod . selector ) , typesAsString ( inheritedMethod , false ) } , new String [ ] { new String ( overrideMethod . declaringClass . shortReadableName ( ) ) , new String ( inheritedMethod . declaringClass . shortReadableName ( ) ) , new String ( inheritedMethod . selector ) , typesAsString ( inheritedMethod , true ) } , location . sourceStart , location . sourceEnd ) ; } public void annotationCircularity ( TypeBinding sourceType , TypeBinding otherType , TypeReference reference ) { if ( sourceType == otherType ) this . handle ( IProblem . AnnotationCircularitySelfReference , new String [ ] { new String ( sourceType . readableName ( ) ) } , new String [ ] { new String ( sourceType . shortReadableName ( ) ) } , reference . sourceStart , reference . sourceEnd ) ; else this . handle ( IProblem . AnnotationCircularity , new String [ ] { new String ( sourceType . readableName ( ) ) , new String ( otherType . readableName ( ) ) } , new String [ ] { new String ( sourceType . shortReadableName ( ) ) , new String ( otherType . shortReadableName ( ) ) } , reference . sourceStart , reference . sourceEnd ) ; } public void annotationMembersCannotHaveParameters ( AnnotationMethodDeclaration annotationMethodDeclaration ) { this . handle ( IProblem . AnnotationMembersCannotHaveParameters , NoArgument , NoArgument , annotationMethodDeclaration . sourceStart , annotationMethodDeclaration . sourceEnd ) ; } public void annotationMembersCannotHaveTypeParameters ( AnnotationMethodDeclaration annotationMethodDeclaration ) { this . handle ( IProblem . AnnotationMembersCannotHaveTypeParameters , NoArgument , NoArgument , annotationMethodDeclaration . sourceStart , annotationMethodDeclaration . sourceEnd ) ; } public void annotationTypeDeclarationCannotHaveConstructor ( ConstructorDeclaration constructorDeclaration ) { this . handle ( IProblem . AnnotationTypeDeclarationCannotHaveConstructor , NoArgument , NoArgument , constructorDeclaration . sourceStart , constructorDeclaration . sourceEnd ) ; } public void annotationTypeDeclarationCannotHaveSuperclass ( TypeDeclaration typeDeclaration ) { this . handle ( IProblem . AnnotationTypeDeclarationCannotHaveSuperclass , NoArgument , NoArgument , typeDeclaration . sourceStart , typeDeclaration . sourceEnd ) ; } public void annotationTypeDeclarationCannotHaveSuperinterfaces ( TypeDeclaration typeDeclaration ) { this . handle ( IProblem . AnnotationTypeDeclarationCannotHaveSuperinterfaces , NoArgument , NoArgument , typeDeclaration . sourceStart , typeDeclaration . sourceEnd ) ; } public void annotationTypeUsedAsSuperinterface ( SourceTypeBinding type , TypeReference superInterfaceRef , ReferenceBinding superType ) { this . handle ( IProblem . AnnotationTypeUsedAsSuperInterface , new String [ ] { new String ( superType . readableName ( ) ) , new String ( type . sourceName ( ) ) } , new String [ ] { new String ( superType . shortReadableName ( ) ) , new String ( type . sourceName ( ) ) } , superInterfaceRef . sourceStart , superInterfaceRef . sourceEnd ) ; } public void annotationValueMustBeAnnotation ( TypeBinding annotationType , char [ ] name , Expression value , TypeBinding expectedType ) { String str = new String ( name ) ; this . handle ( IProblem . AnnotationValueMustBeAnnotation , new String [ ] { new String ( annotationType . readableName ( ) ) , str , new String ( expectedType . readableName ( ) ) , } , new String [ ] { new String ( annotationType . shortReadableName ( ) ) , str , new String ( expectedType . readableName ( ) ) , } , value . sourceStart , value . sourceEnd ) ; } public void annotationValueMustBeArrayInitializer ( TypeBinding annotationType , char [ ] name , Expression value ) { String str = new String ( name ) ; this . handle ( IProblem . AnnotationValueMustBeArrayInitializer , new String [ ] { new String ( annotationType . readableName ( ) ) , str } , new String [ ] { new String ( annotationType . shortReadableName ( ) ) , str } , value . sourceStart , value . sourceEnd ) ; } public void annotationValueMustBeClassLiteral ( TypeBinding annotationType , char [ ] name , Expression value ) { String str = new String ( name ) ; this . handle ( IProblem . AnnotationValueMustBeClassLiteral , new String [ ] { new String ( annotationType . readableName ( ) ) , str } , new String [ ] { new String ( annotationType . shortReadableName ( ) ) , str } , value . sourceStart , value . sourceEnd ) ; } public void annotationValueMustBeConstant ( TypeBinding annotationType , char [ ] name , Expression value , boolean isEnum ) { String str = new String ( name ) ; if ( isEnum ) { this . handle ( IProblem . AnnotationValueMustBeAnEnumConstant , new String [ ] { new String ( annotationType . readableName ( ) ) , str } , new String [ ] { new String ( annotationType . shortReadableName ( ) ) , str } , value . sourceStart , value . sourceEnd ) ; } else { this . handle ( IProblem . AnnotationValueMustBeConstant , new String [ ] { new String ( annotationType . readableName ( ) ) , str } , new String [ ] { new String ( annotationType . shortReadableName ( ) ) , str } , value . sourceStart , value . sourceEnd ) ; } } public void anonymousClassCannotExtendFinalClass ( TypeReference reference , TypeBinding type ) { this . handle ( IProblem . AnonymousClassCannotExtendFinalClass , new String [ ] { new String ( type . readableName ( ) ) } , new String [ ] { new String ( type . shortReadableName ( ) ) } , reference . sourceStart , reference . sourceEnd ) ; } public void argumentTypeCannotBeVoid ( SourceTypeBinding type , AbstractMethodDeclaration methodDecl , Argument arg ) { String [ ] arguments = new String [ ] { new String ( methodDecl . selector ) , new String ( arg . name ) } ; this . handle ( IProblem . ArgumentTypeCannotBeVoid , arguments , arguments , methodDecl . sourceStart , methodDecl . sourceEnd ) ; } public void argumentTypeCannotBeVoidArray ( Argument arg ) { this . handle ( IProblem . CannotAllocateVoidArray , NoArgument , NoArgument , arg . type . sourceStart , arg . type . sourceEnd ) ; } public void arrayConstantsOnlyInArrayInitializers ( int sourceStart , int sourceEnd ) { this . handle ( IProblem . ArrayConstantsOnlyInArrayInitializers , NoArgument , NoArgument , sourceStart , sourceEnd ) ; } public void assignmentHasNoEffect ( AbstractVariableDeclaration location , char [ ] name ) { int severity = computeSeverity ( IProblem . AssignmentHasNoEffect ) ; if ( severity == ProblemSeverities . Ignore ) return ; String [ ] arguments = new String [ ] { new String ( name ) } ; int start = location . sourceStart ; int end = location . sourceEnd ; if ( location . initialization != null ) { end = location . initialization . sourceEnd ; } this . handle ( IProblem . AssignmentHasNoEffect , arguments , arguments , severity , start , end ) ; } public void assignmentHasNoEffect ( Assignment location , char [ ] name ) { int severity = computeSeverity ( IProblem . AssignmentHasNoEffect ) ; if ( severity == ProblemSeverities . Ignore ) return ; String [ ] arguments = new String [ ] { new String ( name ) } ; this . handle ( IProblem . AssignmentHasNoEffect , arguments , arguments , severity , location . sourceStart , location . sourceEnd ) ; } public void attemptToReturnNonVoidExpression ( ReturnStatement returnStatement , TypeBinding expectedType ) { this . handle ( IProblem . VoidMethodReturnsValue , new String [ ] { new String ( expectedType . readableName ( ) ) } , new String [ ] { new String ( expectedType . shortReadableName ( ) ) } , returnStatement . sourceStart , returnStatement . sourceEnd ) ; } public void attemptToReturnVoidValue ( ReturnStatement returnStatement ) { this . handle ( IProblem . MethodReturnsVoid , NoArgument , NoArgument , returnStatement . sourceStart , returnStatement . sourceEnd ) ; } public void autoboxing ( Expression expression , TypeBinding originalType , TypeBinding convertedType ) { if ( this . options . getSeverity ( CompilerOptions . AutoBoxing ) == ProblemSeverities . Ignore ) return ; this . handle ( originalType . isBaseType ( ) ? IProblem . BoxingConversion : IProblem . UnboxingConversion , new String [ ] { new String ( originalType . readableName ( ) ) , new String ( convertedType . readableName ( ) ) , } , new String [ ] { new String ( originalType . shortReadableName ( ) ) , new String ( convertedType . shortReadableName ( ) ) , } , expression . sourceStart , expression . sourceEnd ) ; } public void boundCannotBeArray ( ASTNode location , TypeBinding type ) { this . handle ( IProblem . BoundCannotBeArray , new String [ ] { new String ( type . readableName ( ) ) } , new String [ ] { new String ( type . shortReadableName ( ) ) } , location . sourceStart , location . sourceEnd ) ; } public void boundMustBeAnInterface ( ASTNode location , TypeBinding type ) { this . handle ( IProblem . BoundMustBeAnInterface , new String [ ] { new String ( type . readableName ( ) ) } , new String [ ] { new String ( type . shortReadableName ( ) ) } , location . sourceStart , location . sourceEnd ) ; } public void bytecodeExceeds64KLimit ( AbstractMethodDeclaration location ) { MethodBinding method = location . binding ; if ( location . isConstructor ( ) ) { this . handle ( IProblem . BytecodeExceeds64KLimitForConstructor , new String [ ] { new String ( location . selector ) , typesAsString ( method , false ) } , new String [ ] { new String ( location . selector ) , typesAsString ( method , true ) } , ProblemSeverities . Error | ProblemSeverities . Abort | ProblemSeverities . Fatal , location . sourceStart , location . sourceEnd ) ; } else { this . handle ( IProblem . BytecodeExceeds64KLimit , new String [ ] { new String ( location . selector ) , typesAsString ( method , false ) } , new String [ ] { new String ( location . selector ) , typesAsString ( method , true ) } , ProblemSeverities . Error | ProblemSeverities . Abort | ProblemSeverities . Fatal , location . sourceStart , location . sourceEnd ) ; } } public void bytecodeExceeds64KLimit ( TypeDeclaration location ) { this . handle ( IProblem . BytecodeExceeds64KLimitForClinit , NoArgument , NoArgument , ProblemSeverities . Error | ProblemSeverities . Abort | ProblemSeverities . Fatal , location . sourceStart , location . sourceEnd ) ; } public void cannotAllocateVoidArray ( Expression expression ) { this . handle ( IProblem . CannotAllocateVoidArray , NoArgument , NoArgument , expression . sourceStart , expression . sourceEnd ) ; } public void cannotAssignToFinalField ( FieldBinding field , ASTNode location ) { this . handle ( IProblem . FinalFieldAssignment , new String [ ] { ( field . declaringClass == null ? "<STR_LIT>" : new String ( field . declaringClass . readableName ( ) ) ) , new String ( field . readableName ( ) ) } , new String [ ] { ( field . declaringClass == null ? "<STR_LIT>" : new String ( field . declaringClass . shortReadableName ( ) ) ) , new String ( field . shortReadableName ( ) ) } , nodeSourceStart ( field , location ) , nodeSourceEnd ( field , location ) ) ; } public void cannotAssignToFinalLocal ( LocalVariableBinding local , ASTNode location ) { int problemId = <NUM_LIT:0> ; if ( ( local . tagBits & TagBits . MultiCatchParameter ) != <NUM_LIT:0> ) { problemId = IProblem . AssignmentToMultiCatchParameter ; } else if ( ( local . tagBits & TagBits . IsResource ) != <NUM_LIT:0> ) { problemId = IProblem . AssignmentToResource ; } else { problemId = IProblem . NonBlankFinalLocalAssignment ; } String [ ] arguments = new String [ ] { new String ( local . readableName ( ) ) } ; this . handle ( problemId , arguments , arguments , nodeSourceStart ( local , location ) , nodeSourceEnd ( local , location ) ) ; } public void cannotAssignToFinalOuterLocal ( LocalVariableBinding local , ASTNode location ) { String [ ] arguments = new String [ ] { new String ( local . readableName ( ) ) } ; this . handle ( IProblem . FinalOuterLocalAssignment , arguments , arguments , nodeSourceStart ( local , location ) , nodeSourceEnd ( local , location ) ) ; } public void cannotDefineDimensionsAndInitializer ( ArrayAllocationExpression expresssion ) { this . handle ( IProblem . CannotDefineDimensionExpressionsWithInit , NoArgument , NoArgument , expresssion . sourceStart , expresssion . sourceEnd ) ; } public void cannotDireclyInvokeAbstractMethod ( MessageSend messageSend , MethodBinding method ) { this . handle ( IProblem . DirectInvocationOfAbstractMethod , new String [ ] { new String ( method . declaringClass . readableName ( ) ) , new String ( method . selector ) , typesAsString ( method , false ) } , new String [ ] { new String ( method . declaringClass . shortReadableName ( ) ) , new String ( method . selector ) , typesAsString ( method , true ) } , messageSend . sourceStart , messageSend . sourceEnd ) ; } public void cannotExtendEnum ( SourceTypeBinding type , TypeReference superclass , TypeBinding superTypeBinding ) { String name = new String ( type . sourceName ( ) ) ; String superTypeFullName = new String ( superTypeBinding . readableName ( ) ) ; String superTypeShortName = new String ( superTypeBinding . shortReadableName ( ) ) ; if ( superTypeShortName . equals ( name ) ) superTypeShortName = superTypeFullName ; this . handle ( IProblem . CannotExtendEnum , new String [ ] { superTypeFullName , name } , new String [ ] { superTypeShortName , name } , superclass . sourceStart , superclass . sourceEnd ) ; } public void cannotImportPackage ( ImportReference importRef ) { String [ ] arguments = new String [ ] { CharOperation . toString ( importRef . tokens ) } ; this . handle ( IProblem . CannotImportPackage , arguments , arguments , importRef . sourceStart , importRef . sourceEnd ) ; } public void cannotInstantiate ( TypeReference typeRef , TypeBinding type ) { this . handle ( IProblem . InvalidClassInstantiation , new String [ ] { new String ( type . readableName ( ) ) } , new String [ ] { new String ( type . shortReadableName ( ) ) } , typeRef . sourceStart , typeRef . sourceEnd ) ; } public void cannotInvokeSuperConstructorInEnum ( ExplicitConstructorCall constructorCall , MethodBinding enumConstructor ) { this . handle ( IProblem . CannotInvokeSuperConstructorInEnum , new String [ ] { new String ( enumConstructor . declaringClass . sourceName ( ) ) , typesAsString ( enumConstructor , false ) , } , new String [ ] { new String ( enumConstructor . declaringClass . sourceName ( ) ) , typesAsString ( enumConstructor , true ) , } , constructorCall . sourceStart , constructorCall . sourceEnd ) ; } public void cannotReadSource ( CompilationUnitDeclaration unit , AbortCompilationUnit abortException , boolean verbose ) { String fileName = new String ( unit . compilationResult . fileName ) ; if ( abortException . exception instanceof CharConversionException ) { String encoding = abortException . encoding ; if ( encoding == null ) { encoding = System . getProperty ( "<STR_LIT>" ) ; } String [ ] arguments = new String [ ] { fileName , encoding } ; this . handle ( IProblem . InvalidEncoding , arguments , arguments , <NUM_LIT:0> , <NUM_LIT:0> ) ; return ; } StringWriter stringWriter = new StringWriter ( ) ; PrintWriter writer = new PrintWriter ( stringWriter ) ; if ( verbose ) { abortException . exception . printStackTrace ( writer ) ; System . err . println ( stringWriter . toString ( ) ) ; stringWriter = new StringWriter ( ) ; writer = new PrintWriter ( stringWriter ) ; } writer . print ( abortException . exception . getClass ( ) . getName ( ) ) ; writer . print ( '<CHAR_LIT::>' ) ; writer . print ( abortException . exception . getMessage ( ) ) ; String exceptionTrace = stringWriter . toString ( ) ; String [ ] arguments = new String [ ] { fileName , exceptionTrace } ; this . handle ( IProblem . CannotReadSource , arguments , arguments , <NUM_LIT:0> , <NUM_LIT:0> ) ; } public void cannotReferToNonFinalOuterLocal ( LocalVariableBinding local , ASTNode location ) { String [ ] arguments = new String [ ] { new String ( local . readableName ( ) ) } ; this . handle ( IProblem . OuterLocalMustBeFinal , arguments , arguments , nodeSourceStart ( local , location ) , nodeSourceEnd ( local , location ) ) ; } public void cannotReturnInInitializer ( ASTNode location ) { this . handle ( IProblem . CannotReturnInInitializer , NoArgument , NoArgument , location . sourceStart , location . sourceEnd ) ; } public void cannotThrowNull ( ASTNode expression ) { this . handle ( IProblem . CannotThrowNull , NoArgument , NoArgument , expression . sourceStart , expression . sourceEnd ) ; } public void cannotThrowType ( ASTNode exception , TypeBinding expectedType ) { this . handle ( IProblem . CannotThrowType , new String [ ] { new String ( expectedType . readableName ( ) ) } , new String [ ] { new String ( expectedType . shortReadableName ( ) ) } , exception . sourceStart , exception . sourceEnd ) ; } public void cannotUseQualifiedEnumConstantInCaseLabel ( Reference location , FieldBinding field ) { this . handle ( IProblem . IllegalQualifiedEnumConstantLabel , new String [ ] { String . valueOf ( field . declaringClass . readableName ( ) ) , String . valueOf ( field . name ) } , new String [ ] { String . valueOf ( field . declaringClass . shortReadableName ( ) ) , String . valueOf ( field . name ) } , location . sourceStart ( ) , location . sourceEnd ( ) ) ; } public void cannotUseSuperInCodeSnippet ( int start , int end ) { this . handle ( IProblem . CannotUseSuperInCodeSnippet , NoArgument , NoArgument , ProblemSeverities . Error | ProblemSeverities . Abort | ProblemSeverities . Fatal , start , end ) ; } public void cannotUseSuperInJavaLangObject ( ASTNode reference ) { this . handle ( IProblem . ObjectHasNoSuperclass , NoArgument , NoArgument , reference . sourceStart , reference . sourceEnd ) ; } public void caseExpressionMustBeConstant ( Expression expression ) { this . handle ( IProblem . NonConstantExpression , NoArgument , NoArgument , expression . sourceStart , expression . sourceEnd ) ; } public void classExtendFinalClass ( SourceTypeBinding type , TypeReference superclass , TypeBinding superTypeBinding ) { String name = new String ( type . sourceName ( ) ) ; String superTypeFullName = new String ( superTypeBinding . readableName ( ) ) ; String superTypeShortName = new String ( superTypeBinding . shortReadableName ( ) ) ; if ( superTypeShortName . equals ( name ) ) superTypeShortName = superTypeFullName ; this . handle ( IProblem . ClassExtendFinalClass , new String [ ] { superTypeFullName , name } , new String [ ] { superTypeShortName , name } , superclass . sourceStart , superclass . sourceEnd ) ; } public void codeSnippetMissingClass ( String missing , int start , int end ) { String [ ] arguments = new String [ ] { missing } ; this . handle ( IProblem . CodeSnippetMissingClass , arguments , arguments , ProblemSeverities . Error | ProblemSeverities . Abort | ProblemSeverities . Fatal , start , end ) ; } public void codeSnippetMissingMethod ( String className , String missingMethod , String argumentTypes , int start , int end ) { String [ ] arguments = new String [ ] { className , missingMethod , argumentTypes } ; this . handle ( IProblem . CodeSnippetMissingMethod , arguments , arguments , ProblemSeverities . Error | ProblemSeverities . Abort | ProblemSeverities . Fatal , start , end ) ; } public void comparingIdenticalExpressions ( Expression comparison ) { int severity = computeSeverity ( IProblem . ComparingIdentical ) ; if ( severity == ProblemSeverities . Ignore ) return ; this . handle ( IProblem . ComparingIdentical , NoArgument , NoArgument , severity , comparison . sourceStart , comparison . sourceEnd ) ; } public int computeSeverity ( int problemID ) { switch ( problemID ) { case IProblem . VarargsConflict : return ProblemSeverities . Warning ; case IProblem . TypeCollidesWithPackage : return ProblemSeverities . Warning ; case IProblem . JavadocInvalidParamName : case IProblem . JavadocDuplicateParamName : case IProblem . JavadocMissingParamName : case IProblem . JavadocInvalidMemberTypeQualification : case IProblem . JavadocInvalidThrowsClassName : case IProblem . JavadocDuplicateThrowsClassName : case IProblem . JavadocMissingThrowsClassName : case IProblem . JavadocMissingSeeReference : case IProblem . JavadocInvalidValueReference : case IProblem . JavadocUndefinedField : case IProblem . JavadocAmbiguousField : case IProblem . JavadocUndefinedConstructor : case IProblem . JavadocAmbiguousConstructor : case IProblem . JavadocUndefinedMethod : case IProblem . JavadocAmbiguousMethod : case IProblem . JavadocAmbiguousMethodReference : case IProblem . JavadocParameterMismatch : case IProblem . JavadocUndefinedType : case IProblem . JavadocAmbiguousType : case IProblem . JavadocInternalTypeNameProvided : case IProblem . JavadocNoMessageSendOnArrayType : case IProblem . JavadocNoMessageSendOnBaseType : case IProblem . JavadocInheritedMethodHidesEnclosingName : case IProblem . JavadocInheritedFieldHidesEnclosingName : case IProblem . JavadocInheritedNameHidesEnclosingTypeName : case IProblem . JavadocNonStaticTypeFromStaticInvocation : case IProblem . JavadocGenericMethodTypeArgumentMismatch : case IProblem . JavadocNonGenericMethod : case IProblem . JavadocIncorrectArityForParameterizedMethod : case IProblem . JavadocParameterizedMethodArgumentTypeMismatch : case IProblem . JavadocTypeArgumentsForRawGenericMethod : case IProblem . JavadocGenericConstructorTypeArgumentMismatch : case IProblem . JavadocNonGenericConstructor : case IProblem . JavadocIncorrectArityForParameterizedConstructor : case IProblem . JavadocParameterizedConstructorArgumentTypeMismatch : case IProblem . JavadocTypeArgumentsForRawGenericConstructor : if ( ! this . options . reportInvalidJavadocTags ) { return ProblemSeverities . Ignore ; } break ; case IProblem . JavadocUsingDeprecatedField : case IProblem . JavadocUsingDeprecatedConstructor : case IProblem . JavadocUsingDeprecatedMethod : case IProblem . JavadocUsingDeprecatedType : if ( ! ( this . options . reportInvalidJavadocTags && this . options . reportInvalidJavadocTagsDeprecatedRef ) ) { return ProblemSeverities . Ignore ; } break ; case IProblem . JavadocNotVisibleField : case IProblem . JavadocNotVisibleConstructor : case IProblem . JavadocNotVisibleMethod : case IProblem . JavadocNotVisibleType : case IProblem . JavadocHiddenReference : if ( ! ( this . options . reportInvalidJavadocTags && this . options . reportInvalidJavadocTagsNotVisibleRef ) ) { return ProblemSeverities . Ignore ; } break ; case IProblem . JavadocEmptyReturnTag : if ( CompilerOptions . NO_TAG . equals ( this . options . reportMissingJavadocTagDescription ) ) { return ProblemSeverities . Ignore ; } break ; case IProblem . JavadocMissingTagDescription : if ( ! CompilerOptions . ALL_STANDARD_TAGS . equals ( this . options . reportMissingJavadocTagDescription ) ) { return ProblemSeverities . Ignore ; } break ; } int irritant = getIrritant ( problemID ) ; if ( irritant != <NUM_LIT:0> ) { if ( ( problemID & IProblem . Javadoc ) != <NUM_LIT:0> && ! this . options . docCommentSupport ) return ProblemSeverities . Ignore ; return this . options . getSeverity ( irritant ) ; } return ProblemSeverities . Error | ProblemSeverities . Fatal ; } public void conditionalArgumentsIncompatibleTypes ( ConditionalExpression expression , TypeBinding trueType , TypeBinding falseType ) { this . handle ( IProblem . IncompatibleTypesInConditionalOperator , new String [ ] { new String ( trueType . readableName ( ) ) , new String ( falseType . readableName ( ) ) } , new String [ ] { new String ( trueType . sourceName ( ) ) , new String ( falseType . sourceName ( ) ) } , expression . sourceStart , expression . sourceEnd ) ; } public void conflictingImport ( ImportReference importRef ) { String [ ] arguments = new String [ ] { CharOperation . toString ( importRef . tokens ) } ; this . handle ( IProblem . ConflictingImport , arguments , arguments , importRef . sourceStart , importRef . sourceEnd ) ; } public void constantOutOfRange ( Literal literal , TypeBinding literalType ) { String [ ] arguments = new String [ ] { new String ( literalType . readableName ( ) ) , new String ( literal . source ( ) ) } ; this . handle ( IProblem . NumericValueOutOfRange , arguments , arguments , literal . sourceStart , literal . sourceEnd ) ; } public void corruptedSignature ( TypeBinding enclosingType , char [ ] signature , int position ) { this . handle ( IProblem . CorruptedSignature , new String [ ] { new String ( enclosingType . readableName ( ) ) , new String ( signature ) , String . valueOf ( position ) } , new String [ ] { new String ( enclosingType . shortReadableName ( ) ) , new String ( signature ) , String . valueOf ( position ) } , ProblemSeverities . Error | ProblemSeverities . Abort | ProblemSeverities . Fatal , <NUM_LIT:0> , <NUM_LIT:0> ) ; } public void deprecatedField ( FieldBinding field , ASTNode location ) { int severity = computeSeverity ( IProblem . UsingDeprecatedField ) ; if ( severity == ProblemSeverities . Ignore ) return ; this . handle ( IProblem . UsingDeprecatedField , new String [ ] { new String ( field . declaringClass . readableName ( ) ) , new String ( field . name ) } , new String [ ] { new String ( field . declaringClass . shortReadableName ( ) ) , new String ( field . name ) } , severity , nodeSourceStart ( field , location ) , nodeSourceEnd ( field , location ) ) ; } public void deprecatedMethod ( MethodBinding method , ASTNode location ) { boolean isConstructor = method . isConstructor ( ) ; int severity = computeSeverity ( isConstructor ? IProblem . UsingDeprecatedConstructor : IProblem . UsingDeprecatedMethod ) ; if ( severity == ProblemSeverities . Ignore ) return ; if ( isConstructor ) { int start = - <NUM_LIT:1> ; if ( location instanceof AllocationExpression ) { AllocationExpression allocationExpression = ( AllocationExpression ) location ; if ( allocationExpression . enumConstant != null ) { start = allocationExpression . enumConstant . sourceStart ; } start = allocationExpression . type . sourceStart ; } this . handle ( IProblem . UsingDeprecatedConstructor , new String [ ] { new String ( method . declaringClass . readableName ( ) ) , typesAsString ( method , false ) } , new String [ ] { new String ( method . declaringClass . shortReadableName ( ) ) , typesAsString ( method , true ) } , severity , ( start == - <NUM_LIT:1> ) ? location . sourceStart : start , location . sourceEnd ) ; } else { int start = - <NUM_LIT:1> ; if ( location instanceof MessageSend ) { start = ( int ) ( ( ( MessageSend ) location ) . nameSourcePosition > > > <NUM_LIT:32> ) ; } this . handle ( IProblem . UsingDeprecatedMethod , new String [ ] { new String ( method . declaringClass . readableName ( ) ) , new String ( method . selector ) , typesAsString ( method , false ) } , new String [ ] { new String ( method . declaringClass . shortReadableName ( ) ) , new String ( method . selector ) , typesAsString ( method , true ) } , severity , ( start == - <NUM_LIT:1> ) ? location . sourceStart : start , location . sourceEnd ) ; } } public void deprecatedType ( TypeBinding type , ASTNode location ) { deprecatedType ( type , location , Integer . MAX_VALUE ) ; } public void deprecatedType ( TypeBinding type , ASTNode location , int index ) { if ( location == null ) return ; int severity = computeSeverity ( IProblem . UsingDeprecatedType ) ; if ( severity == ProblemSeverities . Ignore ) return ; type = type . leafComponentType ( ) ; int sourceStart = - <NUM_LIT:1> ; if ( location instanceof QualifiedTypeReference ) { QualifiedTypeReference ref = ( QualifiedTypeReference ) location ; if ( index < Integer . MAX_VALUE ) { sourceStart = ( int ) ( ref . sourcePositions [ index ] > > <NUM_LIT:32> ) ; } } this . handle ( IProblem . UsingDeprecatedType , new String [ ] { new String ( type . readableName ( ) ) } , new String [ ] { new String ( type . shortReadableName ( ) ) } , severity , ( sourceStart == - <NUM_LIT:1> ) ? location . sourceStart : sourceStart , nodeSourceEnd ( null , location , index ) ) ; } public void disallowedTargetForAnnotation ( Annotation annotation ) { this . handle ( IProblem . DisallowedTargetForAnnotation , new String [ ] { new String ( annotation . resolvedType . readableName ( ) ) } , new String [ ] { new String ( annotation . resolvedType . shortReadableName ( ) ) } , annotation . sourceStart , annotation . sourceEnd ) ; } public void polymorphicMethodNotBelow17 ( ASTNode node ) { this . handle ( IProblem . PolymorphicMethodNotBelow17 , NoArgument , NoArgument , node . sourceStart , node . sourceEnd ) ; } public void multiCatchNotBelow17 ( ASTNode node ) { this . handle ( IProblem . MultiCatchNotBelow17 , NoArgument , NoArgument , node . sourceStart , node . sourceEnd ) ; } public void duplicateAnnotation ( Annotation annotation ) { this . handle ( IProblem . DuplicateAnnotation , new String [ ] { new String ( annotation . resolvedType . readableName ( ) ) } , new String [ ] { new String ( annotation . resolvedType . shortReadableName ( ) ) } , annotation . sourceStart , annotation . sourceEnd ) ; } public void duplicateAnnotationValue ( TypeBinding annotationType , MemberValuePair memberValuePair ) { String name = new String ( memberValuePair . name ) ; this . handle ( IProblem . DuplicateAnnotationMember , new String [ ] { name , new String ( annotationType . readableName ( ) ) } , new String [ ] { name , new String ( annotationType . shortReadableName ( ) ) } , memberValuePair . sourceStart , memberValuePair . sourceEnd ) ; } public void duplicateBounds ( ASTNode location , TypeBinding type ) { this . handle ( IProblem . DuplicateBounds , new String [ ] { new String ( type . readableName ( ) ) } , new String [ ] { new String ( type . shortReadableName ( ) ) } , location . sourceStart , location . sourceEnd ) ; } public void duplicateCase ( CaseStatement caseStatement ) { this . handle ( IProblem . DuplicateCase , NoArgument , NoArgument , caseStatement . sourceStart , caseStatement . sourceEnd ) ; } public void duplicateDefaultCase ( ASTNode statement ) { this . handle ( IProblem . DuplicateDefaultCase , NoArgument , NoArgument , statement . sourceStart , statement . sourceEnd ) ; } public void duplicateEnumSpecialMethod ( SourceTypeBinding type , AbstractMethodDeclaration methodDecl ) { MethodBinding method = methodDecl . binding ; this . handle ( IProblem . CannotDeclareEnumSpecialMethod , new String [ ] { new String ( methodDecl . selector ) , new String ( method . declaringClass . readableName ( ) ) , typesAsString ( method , false ) } , new String [ ] { new String ( methodDecl . selector ) , new String ( method . declaringClass . shortReadableName ( ) ) , typesAsString ( method , true ) } , methodDecl . sourceStart , methodDecl . sourceEnd ) ; } public void duplicateFieldInType ( SourceTypeBinding type , FieldDeclaration fieldDecl ) { this . handle ( IProblem . DuplicateField , new String [ ] { new String ( type . sourceName ( ) ) , new String ( fieldDecl . name ) } , new String [ ] { new String ( type . shortReadableName ( ) ) , new String ( fieldDecl . name ) } , fieldDecl . sourceStart , fieldDecl . sourceEnd ) ; } public void duplicateImport ( ImportReference importRef ) { String [ ] arguments = new String [ ] { CharOperation . toString ( importRef . tokens ) } ; this . handle ( IProblem . DuplicateImport , arguments , arguments , importRef . sourceStart , importRef . sourceEnd ) ; } public void duplicateInheritedMethods ( SourceTypeBinding type , MethodBinding inheritedMethod1 , MethodBinding inheritedMethod2 ) { if ( inheritedMethod1 . declaringClass != inheritedMethod2 . declaringClass ) { this . handle ( IProblem . DuplicateInheritedMethods , new String [ ] { new String ( inheritedMethod1 . selector ) , typesAsString ( inheritedMethod1 , inheritedMethod1 . original ( ) . parameters , false ) , typesAsString ( inheritedMethod2 , inheritedMethod2 . original ( ) . parameters , false ) , new String ( inheritedMethod1 . declaringClass . readableName ( ) ) , new String ( inheritedMethod2 . declaringClass . readableName ( ) ) , } , new String [ ] { new String ( inheritedMethod1 . selector ) , typesAsString ( inheritedMethod1 , inheritedMethod1 . original ( ) . parameters , true ) , typesAsString ( inheritedMethod2 , inheritedMethod2 . original ( ) . parameters , true ) , new String ( inheritedMethod1 . declaringClass . shortReadableName ( ) ) , new String ( inheritedMethod2 . declaringClass . shortReadableName ( ) ) , } , type . sourceStart ( ) , type . sourceEnd ( ) ) ; return ; } this . handle ( IProblem . DuplicateParameterizedMethods , new String [ ] { new String ( inheritedMethod1 . selector ) , new String ( inheritedMethod1 . declaringClass . readableName ( ) ) , typesAsString ( inheritedMethod1 , inheritedMethod1 . original ( ) . parameters , false ) , typesAsString ( inheritedMethod2 , inheritedMethod2 . original ( ) . parameters , false ) } , new String [ ] { new String ( inheritedMethod1 . selector ) , new String ( inheritedMethod1 . declaringClass . shortReadableName ( ) ) , typesAsString ( inheritedMethod1 , inheritedMethod1 . original ( ) . parameters , true ) , typesAsString ( inheritedMethod2 , inheritedMethod2 . original ( ) . parameters , true ) } , type . sourceStart ( ) , type . sourceEnd ( ) ) ; } public void duplicateInitializationOfBlankFinalField ( FieldBinding field , Reference reference ) { String [ ] arguments = new String [ ] { new String ( field . readableName ( ) ) } ; this . handle ( IProblem . DuplicateBlankFinalFieldInitialization , arguments , arguments , nodeSourceStart ( field , reference ) , nodeSourceEnd ( field , reference ) ) ; } public void duplicateInitializationOfFinalLocal ( LocalVariableBinding local , ASTNode location ) { String [ ] arguments = new String [ ] { new String ( local . readableName ( ) ) } ; this . handle ( IProblem . DuplicateFinalLocalInitialization , arguments , arguments , nodeSourceStart ( local , location ) , nodeSourceEnd ( local , location ) ) ; } public void duplicateMethodInType ( SourceTypeBinding type , AbstractMethodDeclaration methodDecl , boolean equalParameters , int severity ) { MethodBinding method = methodDecl . binding ; if ( equalParameters ) { this . handle ( IProblem . DuplicateMethod , new String [ ] { new String ( methodDecl . selector ) , new String ( method . declaringClass . readableName ( ) ) , typesAsString ( method , false ) } , new String [ ] { new String ( methodDecl . selector ) , new String ( method . declaringClass . shortReadableName ( ) ) , typesAsString ( method , true ) } , severity , methodDecl . sourceStart , methodDecl . sourceEnd ) ; } else { int length = method . parameters . length ; TypeBinding [ ] erasures = new TypeBinding [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { erasures [ i ] = method . parameters [ i ] . erasure ( ) ; } this . handle ( IProblem . DuplicateMethodErasure , new String [ ] { new String ( methodDecl . selector ) , new String ( method . declaringClass . readableName ( ) ) , typesAsString ( method , false ) , typesAsString ( method , erasures , false ) } , new String [ ] { new String ( methodDecl . selector ) , new String ( method . declaringClass . shortReadableName ( ) ) , typesAsString ( method , true ) , typesAsString ( method , erasures , true ) } , severity , methodDecl . sourceStart , methodDecl . sourceEnd ) ; } } public void duplicateModifierForField ( ReferenceBinding type , FieldDeclaration fieldDecl ) { String [ ] arguments = new String [ ] { new String ( fieldDecl . name ) } ; this . handle ( IProblem . DuplicateModifierForField , arguments , arguments , fieldDecl . sourceStart , fieldDecl . sourceEnd ) ; } public void duplicateModifierForMethod ( ReferenceBinding type , AbstractMethodDeclaration methodDecl ) { this . handle ( IProblem . DuplicateModifierForMethod , new String [ ] { new String ( type . sourceName ( ) ) , new String ( methodDecl . selector ) } , new String [ ] { new String ( type . shortReadableName ( ) ) , new String ( methodDecl . selector ) } , methodDecl . sourceStart , methodDecl . sourceEnd ) ; } public void duplicateModifierForType ( SourceTypeBinding type ) { String [ ] arguments = new String [ ] { new String ( type . sourceName ( ) ) } ; this . handle ( IProblem . DuplicateModifierForType , arguments , arguments , type . sourceStart ( ) , type . sourceEnd ( ) ) ; } public void duplicateModifierForVariable ( LocalDeclaration localDecl , boolean complainForArgument ) { String [ ] arguments = new String [ ] { new String ( localDecl . name ) } ; this . handle ( complainForArgument ? IProblem . DuplicateModifierForArgument : IProblem . DuplicateModifierForVariable , arguments , arguments , localDecl . sourceStart , localDecl . sourceEnd ) ; } public void duplicateNestedType ( TypeDeclaration typeDecl ) { String [ ] arguments = new String [ ] { new String ( typeDecl . name ) } ; this . handle ( IProblem . DuplicateNestedType , arguments , arguments , typeDecl . sourceStart , typeDecl . sourceEnd ) ; } public void duplicateSuperinterface ( SourceTypeBinding type , TypeReference reference , ReferenceBinding superType ) { this . handle ( IProblem . DuplicateSuperInterface , new String [ ] { new String ( superType . readableName ( ) ) , new String ( type . sourceName ( ) ) } , new String [ ] { new String ( superType . shortReadableName ( ) ) , new String ( type . sourceName ( ) ) } , reference . sourceStart , reference . sourceEnd ) ; } public void duplicateTargetInTargetAnnotation ( TypeBinding annotationType , NameReference reference ) { FieldBinding field = reference . fieldBinding ( ) ; String name = new String ( field . name ) ; this . handle ( IProblem . DuplicateTargetInTargetAnnotation , new String [ ] { name , new String ( annotationType . readableName ( ) ) } , new String [ ] { name , new String ( annotationType . shortReadableName ( ) ) } , nodeSourceStart ( field , reference ) , nodeSourceEnd ( field , reference ) ) ; } public void duplicateTypeParameterInType ( TypeParameter typeParameter ) { this . handle ( IProblem . DuplicateTypeVariable , new String [ ] { new String ( typeParameter . name ) } , new String [ ] { new String ( typeParameter . name ) } , typeParameter . sourceStart , typeParameter . sourceEnd ) ; } public void duplicateTypes ( CompilationUnitDeclaration compUnitDecl , TypeDeclaration typeDecl ) { String [ ] arguments = new String [ ] { new String ( compUnitDecl . getFileName ( ) ) , new String ( typeDecl . name ) } ; this . referenceContext = typeDecl ; int end = typeDecl . sourceEnd ; if ( end <= <NUM_LIT:0> ) { end = - <NUM_LIT:1> ; } this . handle ( IProblem . DuplicateTypes , arguments , arguments , typeDecl . sourceStart , end , compUnitDecl . compilationResult ) ; } public void emptyControlFlowStatement ( int sourceStart , int sourceEnd ) { this . handle ( IProblem . EmptyControlFlowStatement , NoArgument , NoArgument , sourceStart , sourceEnd ) ; } public void enumAbstractMethodMustBeImplemented ( AbstractMethodDeclaration method ) { MethodBinding abstractMethod = method . binding ; this . handle ( IProblem . EnumAbstractMethodMustBeImplemented , new String [ ] { new String ( abstractMethod . selector ) , typesAsString ( abstractMethod , false ) , new String ( abstractMethod . declaringClass . readableName ( ) ) , } , new String [ ] { new String ( abstractMethod . selector ) , typesAsString ( abstractMethod , true ) , new String ( abstractMethod . declaringClass . shortReadableName ( ) ) , } , method . sourceStart ( ) , method . sourceEnd ( ) ) ; } public void enumConstantMustImplementAbstractMethod ( AbstractMethodDeclaration method , FieldDeclaration field ) { MethodBinding abstractMethod = method . binding ; this . handle ( IProblem . EnumConstantMustImplementAbstractMethod , new String [ ] { new String ( abstractMethod . selector ) , typesAsString ( abstractMethod , false ) , new String ( field . name ) , } , new String [ ] { new String ( abstractMethod . selector ) , typesAsString ( abstractMethod , true ) , new String ( field . name ) , } , field . sourceStart ( ) , field . sourceEnd ( ) ) ; } public void enumConstantsCannotBeSurroundedByParenthesis ( Expression expression ) { this . handle ( IProblem . EnumConstantsCannotBeSurroundedByParenthesis , NoArgument , NoArgument , expression . sourceStart , expression . sourceEnd ) ; } public void enumStaticFieldUsedDuringInitialization ( FieldBinding field , ASTNode location ) { this . handle ( IProblem . EnumStaticFieldInInInitializerContext , new String [ ] { new String ( field . declaringClass . readableName ( ) ) , new String ( field . name ) } , new String [ ] { new String ( field . declaringClass . shortReadableName ( ) ) , new String ( field . name ) } , nodeSourceStart ( field , location ) , nodeSourceEnd ( field , location ) ) ; } public void enumSwitchCannotTargetField ( Reference reference , FieldBinding field ) { this . handle ( IProblem . EnumSwitchCannotTargetField , new String [ ] { String . valueOf ( field . declaringClass . readableName ( ) ) , String . valueOf ( field . name ) } , new String [ ] { String . valueOf ( field . declaringClass . shortReadableName ( ) ) , String . valueOf ( field . name ) } , nodeSourceStart ( field , reference ) , nodeSourceEnd ( field , reference ) ) ; } public void errorNoMethodFor ( MessageSend messageSend , TypeBinding recType , TypeBinding [ ] params ) { StringBuffer buffer = new StringBuffer ( ) ; StringBuffer shortBuffer = new StringBuffer ( ) ; for ( int i = <NUM_LIT:0> , length = params . length ; i < length ; i ++ ) { if ( i != <NUM_LIT:0> ) { buffer . append ( "<STR_LIT:U+002CU+0020>" ) ; shortBuffer . append ( "<STR_LIT:U+002CU+0020>" ) ; } buffer . append ( new String ( params [ i ] . readableName ( ) ) ) ; shortBuffer . append ( new String ( params [ i ] . shortReadableName ( ) ) ) ; } int id = recType . isArrayType ( ) ? IProblem . NoMessageSendOnArrayType : IProblem . NoMessageSendOnBaseType ; this . handle ( id , new String [ ] { new String ( recType . readableName ( ) ) , new String ( messageSend . selector ) , buffer . toString ( ) } , new String [ ] { new String ( recType . shortReadableName ( ) ) , new String ( messageSend . selector ) , shortBuffer . toString ( ) } , messageSend . sourceStart , messageSend . sourceEnd ) ; } public void errorThisSuperInStatic ( ASTNode reference ) { String [ ] arguments = new String [ ] { reference . isSuper ( ) ? "<STR_LIT>" : "<STR_LIT>" } ; this . handle ( IProblem . ThisInStaticContext , arguments , arguments , reference . sourceStart , reference . sourceEnd ) ; } public void expressionShouldBeAVariable ( Expression expression ) { this . handle ( IProblem . ExpressionShouldBeAVariable , NoArgument , NoArgument , expression . sourceStart , expression . sourceEnd ) ; } public void fakeReachable ( ASTNode location ) { int sourceStart = location . sourceStart ; int sourceEnd = location . sourceEnd ; if ( location instanceof LocalDeclaration ) { LocalDeclaration declaration = ( LocalDeclaration ) location ; sourceStart = declaration . declarationSourceStart ; sourceEnd = declaration . declarationSourceEnd ; } this . handle ( IProblem . DeadCode , NoArgument , NoArgument , sourceStart , sourceEnd ) ; } public void fieldHiding ( FieldDeclaration fieldDecl , Binding hiddenVariable ) { FieldBinding field = fieldDecl . binding ; if ( CharOperation . equals ( TypeConstants . SERIALVERSIONUID , field . name ) && field . isStatic ( ) && field . isPrivate ( ) && field . isFinal ( ) && TypeBinding . LONG == field . type ) { ReferenceBinding referenceBinding = field . declaringClass ; if ( referenceBinding != null ) { if ( referenceBinding . findSuperTypeOriginatingFrom ( TypeIds . T_JavaIoSerializable , false ) != null ) { return ; } } } if ( CharOperation . equals ( TypeConstants . SERIALPERSISTENTFIELDS , field . name ) && field . isStatic ( ) && field . isPrivate ( ) && field . isFinal ( ) && field . type . dimensions ( ) == <NUM_LIT:1> && CharOperation . equals ( TypeConstants . CharArray_JAVA_IO_OBJECTSTREAMFIELD , field . type . leafComponentType ( ) . readableName ( ) ) ) { ReferenceBinding referenceBinding = field . declaringClass ; if ( referenceBinding != null ) { if ( referenceBinding . findSuperTypeOriginatingFrom ( TypeIds . T_JavaIoSerializable , false ) != null ) { return ; } } } boolean isLocal = hiddenVariable instanceof LocalVariableBinding ; int severity = computeSeverity ( isLocal ? IProblem . FieldHidingLocalVariable : IProblem . FieldHidingField ) ; if ( severity == ProblemSeverities . Ignore ) return ; if ( isLocal ) { this . handle ( IProblem . FieldHidingLocalVariable , new String [ ] { new String ( field . declaringClass . readableName ( ) ) , new String ( field . name ) } , new String [ ] { new String ( field . declaringClass . shortReadableName ( ) ) , new String ( field . name ) } , severity , nodeSourceStart ( hiddenVariable , fieldDecl ) , nodeSourceEnd ( hiddenVariable , fieldDecl ) ) ; } else if ( hiddenVariable instanceof FieldBinding ) { FieldBinding hiddenField = ( FieldBinding ) hiddenVariable ; this . handle ( IProblem . FieldHidingField , new String [ ] { new String ( field . declaringClass . readableName ( ) ) , new String ( field . name ) , new String ( hiddenField . declaringClass . readableName ( ) ) } , new String [ ] { new String ( field . declaringClass . shortReadableName ( ) ) , new String ( field . name ) , new String ( hiddenField . declaringClass . shortReadableName ( ) ) } , severity , nodeSourceStart ( hiddenField , fieldDecl ) , nodeSourceEnd ( hiddenField , fieldDecl ) ) ; } } public void fieldsOrThisBeforeConstructorInvocation ( ThisReference reference ) { this . handle ( IProblem . ThisSuperDuringConstructorInvocation , NoArgument , NoArgument , reference . sourceStart , reference . sourceEnd ) ; } public void finallyMustCompleteNormally ( Block finallyBlock ) { this . handle ( IProblem . FinallyMustCompleteNormally , NoArgument , NoArgument , finallyBlock . sourceStart , finallyBlock . sourceEnd ) ; } public void finalMethodCannotBeOverridden ( MethodBinding currentMethod , MethodBinding inheritedMethod ) { this . handle ( IProblem . FinalMethodCannotBeOverridden , new String [ ] { new String ( inheritedMethod . declaringClass . readableName ( ) ) } , new String [ ] { new String ( inheritedMethod . declaringClass . shortReadableName ( ) ) } , currentMethod . sourceStart ( ) , currentMethod . sourceEnd ( ) ) ; } public void finalVariableBound ( TypeVariableBinding typeVariable , TypeReference typeRef ) { if ( this . options . sourceLevel < ClassFileConstants . JDK1_5 ) return ; int severity = computeSeverity ( IProblem . FinalBoundForTypeVariable ) ; if ( severity == ProblemSeverities . Ignore ) return ; this . handle ( IProblem . FinalBoundForTypeVariable , new String [ ] { new String ( typeVariable . sourceName ) , new String ( typeRef . resolvedType . readableName ( ) ) } , new String [ ] { new String ( typeVariable . sourceName ) , new String ( typeRef . resolvedType . shortReadableName ( ) ) } , severity , typeRef . sourceStart , typeRef . sourceEnd ) ; } public void forbiddenReference ( FieldBinding field , ASTNode location , byte classpathEntryType , String classpathEntryName , int problemId ) { int severity = computeSeverity ( problemId ) ; if ( severity == ProblemSeverities . Ignore ) return ; this . handle ( problemId , new String [ ] { new String ( field . readableName ( ) ) } , getElaborationId ( IProblem . ForbiddenReference , ( byte ) ( FIELD_ACCESS | classpathEntryType ) ) , new String [ ] { classpathEntryName , new String ( field . shortReadableName ( ) ) , new String ( field . declaringClass . shortReadableName ( ) ) } , severity , nodeSourceStart ( field , location ) , nodeSourceEnd ( field , location ) ) ; } public void forbiddenReference ( MethodBinding method , ASTNode location , byte classpathEntryType , String classpathEntryName , int problemId ) { int severity = computeSeverity ( problemId ) ; if ( severity == ProblemSeverities . Ignore ) return ; if ( method . isConstructor ( ) ) this . handle ( problemId , new String [ ] { new String ( method . readableName ( ) ) } , getElaborationId ( IProblem . ForbiddenReference , ( byte ) ( CONSTRUCTOR_ACCESS | classpathEntryType ) ) , new String [ ] { classpathEntryName , new String ( method . shortReadableName ( ) ) } , severity , location . sourceStart , location . sourceEnd ) ; else this . handle ( problemId , new String [ ] { new String ( method . readableName ( ) ) } , getElaborationId ( IProblem . ForbiddenReference , ( byte ) ( METHOD_ACCESS | classpathEntryType ) ) , new String [ ] { classpathEntryName , new String ( method . shortReadableName ( ) ) , new String ( method . declaringClass . shortReadableName ( ) ) } , severity , location . sourceStart , location . sourceEnd ) ; } public void forbiddenReference ( TypeBinding type , ASTNode location , byte classpathEntryType , String classpathEntryName , int problemId ) { if ( location == null ) return ; int severity = computeSeverity ( problemId ) ; if ( severity == ProblemSeverities . Ignore ) return ; this . handle ( problemId , new String [ ] { new String ( type . readableName ( ) ) } , getElaborationId ( IProblem . ForbiddenReference , classpathEntryType ) , new String [ ] { classpathEntryName , new String ( type . shortReadableName ( ) ) } , severity , location . sourceStart , location . sourceEnd ) ; } public void forwardReference ( Reference reference , int indexInQualification , FieldBinding field ) { this . handle ( IProblem . ReferenceToForwardField , NoArgument , NoArgument , nodeSourceStart ( field , reference , indexInQualification ) , nodeSourceEnd ( field , reference , indexInQualification ) ) ; } public void forwardTypeVariableReference ( ASTNode location , TypeVariableBinding type ) { this . handle ( IProblem . ReferenceToForwardTypeVariable , new String [ ] { new String ( type . readableName ( ) ) } , new String [ ] { new String ( type . shortReadableName ( ) ) } , location . sourceStart , location . sourceEnd ) ; } public void genericTypeCannotExtendThrowable ( TypeDeclaration typeDecl ) { ASTNode location = typeDecl . binding . isAnonymousType ( ) ? typeDecl . allocation . type : typeDecl . superclass ; this . handle ( IProblem . GenericTypeCannotExtendThrowable , new String [ ] { new String ( typeDecl . binding . readableName ( ) ) } , new String [ ] { new String ( typeDecl . binding . shortReadableName ( ) ) } , location . sourceStart , location . sourceEnd ) ; } private void handle ( int problemId , String [ ] problemArguments , int elaborationId , String [ ] messageArguments , int severity , int problemStartPosition , int problemEndPosition ) { this . handle ( problemId , problemArguments , elaborationId , messageArguments , severity , problemStartPosition , problemEndPosition , this . referenceContext , this . referenceContext == null ? null : this . referenceContext . compilationResult ( ) ) ; this . referenceContext = null ; } private void handle ( int problemId , String [ ] problemArguments , String [ ] messageArguments , int problemStartPosition , int problemEndPosition ) { this . handle ( problemId , problemArguments , messageArguments , problemStartPosition , problemEndPosition , this . referenceContext , this . referenceContext == null ? null : this . referenceContext . compilationResult ( ) ) ; this . referenceContext = null ; } private void handle ( int problemId , String [ ] problemArguments , String [ ] messageArguments , int problemStartPosition , int problemEndPosition , CompilationResult unitResult ) { this . handle ( problemId , problemArguments , messageArguments , problemStartPosition , problemEndPosition , this . referenceContext , unitResult ) ; this . referenceContext = null ; } private void handle ( int problemId , String [ ] problemArguments , String [ ] messageArguments , int severity , int problemStartPosition , int problemEndPosition ) { this . handle ( problemId , problemArguments , <NUM_LIT:0> , messageArguments , severity , problemStartPosition , problemEndPosition ) ; } public void hiddenCatchBlock ( ReferenceBinding exceptionType , ASTNode location ) { this . handle ( IProblem . MaskedCatch , new String [ ] { new String ( exceptionType . readableName ( ) ) , } , new String [ ] { new String ( exceptionType . shortReadableName ( ) ) , } , location . sourceStart , location . sourceEnd ) ; } public void hierarchyCircularity ( SourceTypeBinding sourceType , ReferenceBinding superType , TypeReference reference ) { int start = <NUM_LIT:0> ; int end = <NUM_LIT:0> ; if ( reference == null ) { start = sourceType . sourceStart ( ) ; end = sourceType . sourceEnd ( ) ; } else { start = reference . sourceStart ; end = reference . sourceEnd ; } if ( sourceType == superType ) this . handle ( IProblem . HierarchyCircularitySelfReference , new String [ ] { new String ( sourceType . readableName ( ) ) } , new String [ ] { new String ( sourceType . shortReadableName ( ) ) } , start , end ) ; else this . handle ( IProblem . HierarchyCircularity , new String [ ] { new String ( sourceType . readableName ( ) ) , new String ( superType . readableName ( ) ) } , new String [ ] { new String ( sourceType . shortReadableName ( ) ) , new String ( superType . shortReadableName ( ) ) } , start , end ) ; } public void hierarchyCircularity ( TypeVariableBinding type , ReferenceBinding superType , TypeReference reference ) { int start = <NUM_LIT:0> ; int end = <NUM_LIT:0> ; start = reference . sourceStart ; end = reference . sourceEnd ; if ( type == superType ) this . handle ( IProblem . HierarchyCircularitySelfReference , new String [ ] { new String ( type . readableName ( ) ) } , new String [ ] { new String ( type . shortReadableName ( ) ) } , start , end ) ; else this . handle ( IProblem . HierarchyCircularity , new String [ ] { new String ( type . readableName ( ) ) , new String ( superType . readableName ( ) ) } , new String [ ] { new String ( type . shortReadableName ( ) ) , new String ( superType . shortReadableName ( ) ) } , start , end ) ; } public void hierarchyHasProblems ( SourceTypeBinding type ) { String [ ] arguments = new String [ ] { new String ( type . sourceName ( ) ) } ; this . handle ( IProblem . HierarchyHasProblems , arguments , arguments , type . sourceStart ( ) , type . sourceEnd ( ) ) ; } public void illegalAbstractModifierCombinationForMethod ( ReferenceBinding type , AbstractMethodDeclaration methodDecl ) { String [ ] arguments = new String [ ] { new String ( type . sourceName ( ) ) , new String ( methodDecl . selector ) } ; this . handle ( IProblem . IllegalAbstractModifierCombinationForMethod , arguments , arguments , methodDecl . sourceStart , methodDecl . sourceEnd ) ; } public void illegalAccessFromTypeVariable ( TypeVariableBinding variable , ASTNode location ) { if ( ( location . bits & ASTNode . InsideJavadoc ) != <NUM_LIT:0> ) { javadocInvalidReference ( location . sourceStart , location . sourceEnd ) ; } else { String [ ] arguments = new String [ ] { new String ( variable . sourceName ) } ; this . handle ( IProblem . IllegalAccessFromTypeVariable , arguments , arguments , location . sourceStart , location . sourceEnd ) ; } } public void illegalClassLiteralForTypeVariable ( TypeVariableBinding variable , ASTNode location ) { String [ ] arguments = new String [ ] { new String ( variable . sourceName ) } ; this . handle ( IProblem . IllegalClassLiteralForTypeVariable , arguments , arguments , location . sourceStart , location . sourceEnd ) ; } public void illegalExtendedDimensions ( AnnotationMethodDeclaration annotationTypeMemberDeclaration ) { this . handle ( IProblem . IllegalExtendedDimensions , NoArgument , NoArgument , annotationTypeMemberDeclaration . sourceStart , annotationTypeMemberDeclaration . sourceEnd ) ; } public void illegalExtendedDimensions ( Argument argument ) { this . handle ( IProblem . IllegalExtendedDimensionsForVarArgs , NoArgument , NoArgument , argument . sourceStart , argument . sourceEnd ) ; } public void illegalGenericArray ( TypeBinding leafComponentType , ASTNode location ) { this . handle ( IProblem . IllegalGenericArray , new String [ ] { new String ( leafComponentType . readableName ( ) ) } , new String [ ] { new String ( leafComponentType . shortReadableName ( ) ) } , location . sourceStart , location . sourceEnd ) ; } public void illegalInstanceOfGenericType ( TypeBinding checkedType , ASTNode location ) { TypeBinding erasedType = checkedType . leafComponentType ( ) . erasure ( ) ; StringBuffer recommendedFormBuffer = new StringBuffer ( <NUM_LIT:10> ) ; if ( erasedType instanceof ReferenceBinding ) { ReferenceBinding referenceBinding = ( ReferenceBinding ) erasedType ; recommendedFormBuffer . append ( referenceBinding . qualifiedSourceName ( ) ) ; } else { recommendedFormBuffer . append ( erasedType . sourceName ( ) ) ; } int count = erasedType . typeVariables ( ) . length ; if ( count > <NUM_LIT:0> ) { recommendedFormBuffer . append ( '<CHAR_LIT>' ) ; for ( int i = <NUM_LIT:0> ; i < count ; i ++ ) { if ( i > <NUM_LIT:0> ) { recommendedFormBuffer . append ( '<CHAR_LIT:U+002C>' ) ; } recommendedFormBuffer . append ( '<CHAR_LIT>' ) ; } recommendedFormBuffer . append ( '<CHAR_LIT:>>' ) ; } for ( int i = <NUM_LIT:0> , dim = checkedType . dimensions ( ) ; i < dim ; i ++ ) { recommendedFormBuffer . append ( "<STR_LIT:[]>" ) ; } String recommendedForm = recommendedFormBuffer . toString ( ) ; if ( checkedType . leafComponentType ( ) . isTypeVariable ( ) ) { this . handle ( IProblem . IllegalInstanceofTypeParameter , new String [ ] { new String ( checkedType . readableName ( ) ) , recommendedForm , } , new String [ ] { new String ( checkedType . shortReadableName ( ) ) , recommendedForm , } , location . sourceStart , location . sourceEnd ) ; return ; } this . handle ( IProblem . IllegalInstanceofParameterizedType , new String [ ] { new String ( checkedType . readableName ( ) ) , recommendedForm , } , new String [ ] { new String ( checkedType . shortReadableName ( ) ) , recommendedForm , } , location . sourceStart , location . sourceEnd ) ; } public void illegalLocalTypeDeclaration ( TypeDeclaration typeDeclaration ) { if ( isRecoveredName ( typeDeclaration . name ) ) return ; int problemID = <NUM_LIT:0> ; if ( ( typeDeclaration . modifiers & ClassFileConstants . AccEnum ) != <NUM_LIT:0> ) { problemID = IProblem . CannotDefineEnumInLocalType ; } else if ( ( typeDeclaration . modifiers & ClassFileConstants . AccAnnotation ) != <NUM_LIT:0> ) { problemID = IProblem . CannotDefineAnnotationInLocalType ; } else if ( ( typeDeclaration . modifiers & ClassFileConstants . AccInterface ) != <NUM_LIT:0> ) { problemID = IProblem . CannotDefineInterfaceInLocalType ; } if ( problemID != <NUM_LIT:0> ) { String [ ] arguments = new String [ ] { new String ( typeDeclaration . name ) } ; this . handle ( problemID , arguments , arguments , typeDeclaration . sourceStart , typeDeclaration . sourceEnd ) ; } } public void illegalModifierCombinationFinalAbstractForClass ( SourceTypeBinding type ) { String [ ] arguments = new String [ ] { new String ( type . sourceName ( ) ) } ; this . handle ( IProblem . IllegalModifierCombinationFinalAbstractForClass , arguments , arguments , type . sourceStart ( ) , type . sourceEnd ( ) ) ; } public void illegalModifierCombinationFinalVolatileForField ( ReferenceBinding type , FieldDeclaration fieldDecl ) { String [ ] arguments = new String [ ] { new String ( fieldDecl . name ) } ; this . handle ( IProblem . IllegalModifierCombinationFinalVolatileForField , arguments , arguments , fieldDecl . sourceStart , fieldDecl . sourceEnd ) ; } public void illegalModifierForAnnotationField ( FieldDeclaration fieldDecl ) { String name = new String ( fieldDecl . name ) ; this . handle ( IProblem . IllegalModifierForAnnotationField , new String [ ] { new String ( fieldDecl . binding . declaringClass . readableName ( ) ) , name , } , new String [ ] { new String ( fieldDecl . binding . declaringClass . shortReadableName ( ) ) , name , } , fieldDecl . sourceStart , fieldDecl . sourceEnd ) ; } public void illegalModifierForAnnotationMember ( AbstractMethodDeclaration methodDecl ) { this . handle ( IProblem . IllegalModifierForAnnotationMethod , new String [ ] { new String ( methodDecl . binding . declaringClass . readableName ( ) ) , new String ( methodDecl . selector ) , } , new String [ ] { new String ( methodDecl . binding . declaringClass . shortReadableName ( ) ) , new String ( methodDecl . selector ) , } , methodDecl . sourceStart , methodDecl . sourceEnd ) ; } public void illegalModifierForAnnotationMemberType ( SourceTypeBinding type ) { String [ ] arguments = new String [ ] { new String ( type . sourceName ( ) ) } ; this . handle ( IProblem . IllegalModifierForAnnotationMemberType , arguments , arguments , type . sourceStart ( ) , type . sourceEnd ( ) ) ; } public void illegalModifierForAnnotationType ( SourceTypeBinding type ) { String [ ] arguments = new String [ ] { new String ( type . sourceName ( ) ) } ; this . handle ( IProblem . IllegalModifierForAnnotationType , arguments , arguments , type . sourceStart ( ) , type . sourceEnd ( ) ) ; } public void illegalModifierForClass ( SourceTypeBinding type ) { String [ ] arguments = new String [ ] { new String ( type . sourceName ( ) ) } ; this . handle ( IProblem . IllegalModifierForClass , arguments , arguments , type . sourceStart ( ) , type . sourceEnd ( ) ) ; } public void illegalModifierForEnum ( SourceTypeBinding type ) { String [ ] arguments = new String [ ] { new String ( type . sourceName ( ) ) } ; this . handle ( IProblem . IllegalModifierForEnum , arguments , arguments , type . sourceStart ( ) , type . sourceEnd ( ) ) ; } public void illegalModifierForEnumConstant ( ReferenceBinding type , FieldDeclaration fieldDecl ) { String [ ] arguments = new String [ ] { new String ( fieldDecl . name ) } ; this . handle ( IProblem . IllegalModifierForEnumConstant , arguments , arguments , fieldDecl . sourceStart , fieldDecl . sourceEnd ) ; } public void illegalModifierForEnumConstructor ( AbstractMethodDeclaration constructor ) { this . handle ( IProblem . IllegalModifierForEnumConstructor , NoArgument , NoArgument , constructor . sourceStart , constructor . sourceEnd ) ; } public void illegalModifierForField ( ReferenceBinding type , FieldDeclaration fieldDecl ) { String [ ] arguments = new String [ ] { new String ( fieldDecl . name ) } ; this . handle ( IProblem . IllegalModifierForField , arguments , arguments , fieldDecl . sourceStart , fieldDecl . sourceEnd ) ; } public void illegalModifierForInterface ( SourceTypeBinding type ) { String [ ] arguments = new String [ ] { new String ( type . sourceName ( ) ) } ; this . handle ( IProblem . IllegalModifierForInterface , arguments , arguments , type . sourceStart ( ) , type . sourceEnd ( ) ) ; } public void illegalModifierForInterfaceField ( FieldDeclaration fieldDecl ) { String name = new String ( fieldDecl . name ) ; this . handle ( IProblem . IllegalModifierForInterfaceField , new String [ ] { new String ( fieldDecl . binding . declaringClass . readableName ( ) ) , name , } , new String [ ] { new String ( fieldDecl . binding . declaringClass . shortReadableName ( ) ) , name , } , fieldDecl . sourceStart , fieldDecl . sourceEnd ) ; } public void illegalModifierForInterfaceMethod ( AbstractMethodDeclaration methodDecl ) { this . handle ( IProblem . IllegalModifierForInterfaceMethod , new String [ ] { new String ( methodDecl . selector ) } , new String [ ] { new String ( methodDecl . selector ) } , methodDecl . sourceStart , methodDecl . sourceEnd ) ; } public void illegalModifierForLocalClass ( SourceTypeBinding type ) { String [ ] arguments = new String [ ] { new String ( type . sourceName ( ) ) } ; this . handle ( IProblem . IllegalModifierForLocalClass , arguments , arguments , type . sourceStart ( ) , type . sourceEnd ( ) ) ; } public void illegalModifierForMemberClass ( SourceTypeBinding type ) { String [ ] arguments = new String [ ] { new String ( type . sourceName ( ) ) } ; this . handle ( IProblem . IllegalModifierForMemberClass , arguments , arguments , type . sourceStart ( ) , type . sourceEnd ( ) ) ; } public void illegalModifierForMemberEnum ( SourceTypeBinding type ) { String [ ] arguments = new String [ ] { new String ( type . sourceName ( ) ) } ; this . handle ( IProblem . IllegalModifierForMemberEnum , arguments , arguments , type . sourceStart ( ) , type . sourceEnd ( ) ) ; } public void illegalModifierForMemberInterface ( SourceTypeBinding type ) { String [ ] arguments = new String [ ] { new String ( type . sourceName ( ) ) } ; this . handle ( IProblem . IllegalModifierForMemberInterface , arguments , arguments , type . sourceStart ( ) , type . sourceEnd ( ) ) ; } public void illegalModifierForMethod ( AbstractMethodDeclaration methodDecl ) { this . handle ( methodDecl . isConstructor ( ) ? IProblem . IllegalModifierForConstructor : IProblem . IllegalModifierForMethod , new String [ ] { new String ( methodDecl . selector ) } , new String [ ] { new String ( methodDecl . selector ) } , methodDecl . sourceStart , methodDecl . sourceEnd ) ; } public void illegalModifierForVariable ( LocalDeclaration localDecl , boolean complainAsArgument ) { String [ ] arguments = new String [ ] { new String ( localDecl . name ) } ; this . handle ( complainAsArgument ? IProblem . IllegalModifierForArgument : IProblem . IllegalModifierForVariable , arguments , arguments , localDecl . sourceStart , localDecl . sourceEnd ) ; } public void illegalPrimitiveOrArrayTypeForEnclosingInstance ( TypeBinding enclosingType , ASTNode location ) { this . handle ( IProblem . IllegalPrimitiveOrArrayTypeForEnclosingInstance , new String [ ] { new String ( enclosingType . readableName ( ) ) } , new String [ ] { new String ( enclosingType . shortReadableName ( ) ) } , location . sourceStart , location . sourceEnd ) ; } public void illegalQualifiedParameterizedTypeAllocation ( TypeReference qualifiedTypeReference , TypeBinding allocatedType ) { this . handle ( IProblem . IllegalQualifiedParameterizedTypeAllocation , new String [ ] { new String ( allocatedType . readableName ( ) ) , new String ( allocatedType . enclosingType ( ) . readableName ( ) ) , } , new String [ ] { new String ( allocatedType . shortReadableName ( ) ) , new String ( allocatedType . enclosingType ( ) . shortReadableName ( ) ) , } , qualifiedTypeReference . sourceStart , qualifiedTypeReference . sourceEnd ) ; } public void illegalStaticModifierForMemberType ( SourceTypeBinding type ) { String [ ] arguments = new String [ ] { new String ( type . sourceName ( ) ) } ; this . handle ( IProblem . IllegalStaticModifierForMemberType , arguments , arguments , type . sourceStart ( ) , type . sourceEnd ( ) ) ; } public void illegalUsageOfQualifiedTypeReference ( QualifiedTypeReference qualifiedTypeReference ) { StringBuffer buffer = new StringBuffer ( ) ; char [ ] [ ] tokens = qualifiedTypeReference . tokens ; for ( int i = <NUM_LIT:0> ; i < tokens . length ; i ++ ) { if ( i > <NUM_LIT:0> ) buffer . append ( '<CHAR_LIT:.>' ) ; buffer . append ( tokens [ i ] ) ; } String [ ] arguments = new String [ ] { String . valueOf ( buffer ) } ; this . handle ( IProblem . IllegalUsageOfQualifiedTypeReference , arguments , arguments , qualifiedTypeReference . sourceStart , qualifiedTypeReference . sourceEnd ) ; } public void illegalUsageOfWildcard ( TypeReference wildcard ) { this . handle ( IProblem . InvalidUsageOfWildcard , NoArgument , NoArgument , wildcard . sourceStart , wildcard . sourceEnd ) ; } public void illegalVararg ( Argument argType , AbstractMethodDeclaration methodDecl ) { String [ ] arguments = new String [ ] { CharOperation . toString ( argType . type . getTypeName ( ) ) , new String ( methodDecl . selector ) } ; this . handle ( IProblem . IllegalVararg , arguments , arguments , argType . sourceStart , argType . sourceEnd ) ; } public void illegalVisibilityModifierCombinationForField ( ReferenceBinding type , FieldDeclaration fieldDecl ) { String [ ] arguments = new String [ ] { new String ( fieldDecl . name ) } ; this . handle ( IProblem . IllegalVisibilityModifierCombinationForField , arguments , arguments , fieldDecl . sourceStart , fieldDecl . sourceEnd ) ; } public void illegalVisibilityModifierCombinationForMemberType ( SourceTypeBinding type ) { String [ ] arguments = new String [ ] { new String ( type . sourceName ( ) ) } ; this . handle ( IProblem . IllegalVisibilityModifierCombinationForMemberType , arguments , arguments , type . sourceStart ( ) , type . sourceEnd ( ) ) ; } public void illegalVisibilityModifierCombinationForMethod ( ReferenceBinding type , AbstractMethodDeclaration methodDecl ) { String [ ] arguments = new String [ ] { new String ( type . sourceName ( ) ) , new String ( methodDecl . selector ) } ; this . handle ( IProblem . IllegalVisibilityModifierCombinationForMethod , arguments , arguments , methodDecl . sourceStart , methodDecl . sourceEnd ) ; } public void illegalVisibilityModifierForInterfaceMemberType ( SourceTypeBinding type ) { String [ ] arguments = new String [ ] { new String ( type . sourceName ( ) ) } ; this . handle ( IProblem . IllegalVisibilityModifierForInterfaceMemberType , arguments , arguments , type . sourceStart ( ) , type . sourceEnd ( ) ) ; } public void illegalVoidExpression ( ASTNode location ) { this . handle ( IProblem . InvalidVoidExpression , NoArgument , NoArgument , location . sourceStart , location . sourceEnd ) ; } public void importProblem ( ImportReference importRef , Binding expectedImport ) { if ( expectedImport instanceof FieldBinding ) { int id = IProblem . UndefinedField ; FieldBinding field = ( FieldBinding ) expectedImport ; String [ ] readableArguments = null ; String [ ] shortArguments = null ; switch ( expectedImport . problemId ( ) ) { case ProblemReasons . NotVisible : id = IProblem . NotVisibleField ; readableArguments = new String [ ] { CharOperation . toString ( importRef . tokens ) , new String ( field . declaringClass . readableName ( ) ) } ; shortArguments = new String [ ] { CharOperation . toString ( importRef . tokens ) , new String ( field . declaringClass . shortReadableName ( ) ) } ; break ; case ProblemReasons . Ambiguous : id = IProblem . AmbiguousField ; readableArguments = new String [ ] { new String ( field . readableName ( ) ) } ; shortArguments = new String [ ] { new String ( field . readableName ( ) ) } ; break ; case ProblemReasons . ReceiverTypeNotVisible : id = IProblem . NotVisibleType ; readableArguments = new String [ ] { new String ( field . declaringClass . leafComponentType ( ) . readableName ( ) ) } ; shortArguments = new String [ ] { new String ( field . declaringClass . leafComponentType ( ) . shortReadableName ( ) ) } ; break ; } this . handle ( id , readableArguments , shortArguments , nodeSourceStart ( field , importRef ) , nodeSourceEnd ( field , importRef ) ) ; return ; } if ( expectedImport . problemId ( ) == ProblemReasons . NotFound ) { char [ ] [ ] tokens = expectedImport instanceof ProblemReferenceBinding ? ( ( ProblemReferenceBinding ) expectedImport ) . compoundName : importRef . tokens ; String [ ] arguments = new String [ ] { CharOperation . toString ( tokens ) } ; this . handle ( IProblem . ImportNotFound , arguments , arguments , importRef . sourceStart , ( int ) importRef . sourcePositions [ tokens . length - <NUM_LIT:1> ] ) ; return ; } if ( expectedImport . problemId ( ) == ProblemReasons . InvalidTypeForStaticImport ) { char [ ] [ ] tokens = importRef . tokens ; String [ ] arguments = new String [ ] { CharOperation . toString ( tokens ) } ; this . handle ( IProblem . InvalidTypeForStaticImport , arguments , arguments , importRef . sourceStart , ( int ) importRef . sourcePositions [ tokens . length - <NUM_LIT:1> ] ) ; return ; } invalidType ( importRef , ( TypeBinding ) expectedImport ) ; } public void incompatibleExceptionInThrowsClause ( SourceTypeBinding type , MethodBinding currentMethod , MethodBinding inheritedMethod , ReferenceBinding exceptionType ) { if ( type == currentMethod . declaringClass ) { int id ; if ( currentMethod . declaringClass . isInterface ( ) && ! inheritedMethod . isPublic ( ) ) { id = IProblem . IncompatibleExceptionInThrowsClauseForNonInheritedInterfaceMethod ; } else { id = IProblem . IncompatibleExceptionInThrowsClause ; } this . handle ( id , new String [ ] { new String ( exceptionType . sourceName ( ) ) , new String ( CharOperation . concat ( inheritedMethod . declaringClass . readableName ( ) , inheritedMethod . readableName ( ) , '<CHAR_LIT:.>' ) ) } , new String [ ] { new String ( exceptionType . sourceName ( ) ) , new String ( CharOperation . concat ( inheritedMethod . declaringClass . shortReadableName ( ) , inheritedMethod . shortReadableName ( ) , '<CHAR_LIT:.>' ) ) } , currentMethod . sourceStart ( ) , currentMethod . sourceEnd ( ) ) ; } else this . handle ( IProblem . IncompatibleExceptionInInheritedMethodThrowsClause , new String [ ] { new String ( exceptionType . sourceName ( ) ) , new String ( CharOperation . concat ( currentMethod . declaringClass . sourceName ( ) , currentMethod . readableName ( ) , '<CHAR_LIT:.>' ) ) , new String ( CharOperation . concat ( inheritedMethod . declaringClass . readableName ( ) , inheritedMethod . readableName ( ) , '<CHAR_LIT:.>' ) ) } , new String [ ] { new String ( exceptionType . sourceName ( ) ) , new String ( CharOperation . concat ( currentMethod . declaringClass . sourceName ( ) , currentMethod . shortReadableName ( ) , '<CHAR_LIT:.>' ) ) , new String ( CharOperation . concat ( inheritedMethod . declaringClass . shortReadableName ( ) , inheritedMethod . shortReadableName ( ) , '<CHAR_LIT:.>' ) ) } , type . sourceStart ( ) , type . sourceEnd ( ) ) ; } public void incompatibleReturnType ( MethodBinding currentMethod , MethodBinding inheritedMethod ) { if ( currentMethod . declaringClass instanceof SourceTypeBinding ) { SourceTypeBinding stb = ( SourceTypeBinding ) currentMethod . declaringClass ; if ( stb . scope != null && ! stb . scope . shouldReport ( IProblem . IncompatibleReturnType ) ) { return ; } } StringBuffer methodSignature = new StringBuffer ( ) ; methodSignature . append ( inheritedMethod . declaringClass . readableName ( ) ) . append ( '<CHAR_LIT:.>' ) . append ( inheritedMethod . readableName ( ) ) ; StringBuffer shortSignature = new StringBuffer ( ) ; shortSignature . append ( inheritedMethod . declaringClass . shortReadableName ( ) ) . append ( '<CHAR_LIT:.>' ) . append ( inheritedMethod . shortReadableName ( ) ) ; int id ; final ReferenceBinding declaringClass = currentMethod . declaringClass ; if ( declaringClass . isInterface ( ) && ! inheritedMethod . isPublic ( ) ) { id = IProblem . IncompatibleReturnTypeForNonInheritedInterfaceMethod ; } else { id = IProblem . IncompatibleReturnType ; } AbstractMethodDeclaration method = currentMethod . sourceMethod ( ) ; int sourceStart = <NUM_LIT:0> ; int sourceEnd = <NUM_LIT:0> ; if ( method == null ) { if ( declaringClass instanceof SourceTypeBinding ) { SourceTypeBinding sourceTypeBinding = ( SourceTypeBinding ) declaringClass ; sourceStart = sourceTypeBinding . sourceStart ( ) ; sourceEnd = sourceTypeBinding . sourceEnd ( ) ; } } else if ( method . isConstructor ( ) ) { sourceStart = method . sourceStart ; sourceEnd = method . sourceEnd ; } else { TypeReference returnType = ( ( MethodDeclaration ) method ) . returnType ; sourceStart = returnType . sourceStart ; if ( returnType instanceof ParameterizedSingleTypeReference ) { ParameterizedSingleTypeReference typeReference = ( ParameterizedSingleTypeReference ) returnType ; TypeReference [ ] typeArguments = typeReference . typeArguments ; if ( typeArguments [ typeArguments . length - <NUM_LIT:1> ] . sourceEnd > typeReference . sourceEnd ) { sourceEnd = retrieveClosingAngleBracketPosition ( typeReference . sourceEnd ) ; } else { sourceEnd = returnType . sourceEnd ; } } else if ( returnType instanceof ParameterizedQualifiedTypeReference ) { ParameterizedQualifiedTypeReference typeReference = ( ParameterizedQualifiedTypeReference ) returnType ; sourceEnd = retrieveClosingAngleBracketPosition ( typeReference . sourceEnd ) ; } else { sourceEnd = returnType . sourceEnd ; } } this . handle ( id , new String [ ] { methodSignature . toString ( ) } , new String [ ] { shortSignature . toString ( ) } , sourceStart , sourceEnd ) ; } public void incorrectArityForParameterizedType ( ASTNode location , TypeBinding type , TypeBinding [ ] argumentTypes ) { incorrectArityForParameterizedType ( location , type , argumentTypes , Integer . MAX_VALUE ) ; } public void incorrectArityForParameterizedType ( ASTNode location , TypeBinding type , TypeBinding [ ] argumentTypes , int index ) { if ( location == null ) { this . handle ( IProblem . IncorrectArityForParameterizedType , new String [ ] { new String ( type . readableName ( ) ) , typesAsString ( argumentTypes , false ) } , new String [ ] { new String ( type . shortReadableName ( ) ) , typesAsString ( argumentTypes , true ) } , ProblemSeverities . AbortCompilation | ProblemSeverities . Error | ProblemSeverities . Fatal , <NUM_LIT:0> , <NUM_LIT:0> ) ; return ; } this . handle ( IProblem . IncorrectArityForParameterizedType , new String [ ] { new String ( type . readableName ( ) ) , typesAsString ( argumentTypes , false ) } , new String [ ] { new String ( type . shortReadableName ( ) ) , typesAsString ( argumentTypes , true ) } , location . sourceStart , nodeSourceEnd ( null , location , index ) ) ; } public void diamondNotBelow17 ( ASTNode location ) { diamondNotBelow17 ( location , Integer . MAX_VALUE ) ; } public void diamondNotBelow17 ( ASTNode location , int index ) { if ( location == null ) { this . handle ( IProblem . DiamondNotBelow17 , NoArgument , NoArgument , ProblemSeverities . AbortCompilation | ProblemSeverities . Error | ProblemSeverities . Fatal , <NUM_LIT:0> , <NUM_LIT:0> ) ; return ; } this . handle ( IProblem . DiamondNotBelow17 , NoArgument , NoArgument , location . sourceStart , nodeSourceEnd ( null , location , index ) ) ; } public void incorrectLocationForNonEmptyDimension ( ArrayAllocationExpression expression , int index ) { this . handle ( IProblem . IllegalDimension , NoArgument , NoArgument , expression . dimensions [ index ] . sourceStart , expression . dimensions [ index ] . sourceEnd ) ; } public void incorrectSwitchType ( Expression expression , TypeBinding testType ) { if ( this . options . sourceLevel < ClassFileConstants . JDK1_7 ) { if ( testType . id == TypeIds . T_JavaLangString ) { this . handle ( IProblem . SwitchOnStringsNotBelow17 , new String [ ] { new String ( testType . readableName ( ) ) } , new String [ ] { new String ( testType . shortReadableName ( ) ) } , expression . sourceStart , expression . sourceEnd ) ; } else { if ( this . options . sourceLevel < ClassFileConstants . JDK1_5 && testType . isEnum ( ) ) { this . handle ( IProblem . SwitchOnEnumNotBelow15 , new String [ ] { new String ( testType . readableName ( ) ) } , new String [ ] { new String ( testType . shortReadableName ( ) ) } , expression . sourceStart , expression . sourceEnd ) ; } else { this . handle ( IProblem . IncorrectSwitchType , new String [ ] { new String ( testType . readableName ( ) ) } , new String [ ] { new String ( testType . shortReadableName ( ) ) } , expression . sourceStart , expression . sourceEnd ) ; } } } else { this . handle ( IProblem . IncorrectSwitchType17 , new String [ ] { new String ( testType . readableName ( ) ) } , new String [ ] { new String ( testType . shortReadableName ( ) ) } , expression . sourceStart , expression . sourceEnd ) ; } } public void indirectAccessToStaticField ( ASTNode location , FieldBinding field ) { int severity = computeSeverity ( IProblem . IndirectAccessToStaticField ) ; if ( severity == ProblemSeverities . Ignore ) return ; this . handle ( IProblem . IndirectAccessToStaticField , new String [ ] { new String ( field . declaringClass . readableName ( ) ) , new String ( field . name ) } , new String [ ] { new String ( field . declaringClass . shortReadableName ( ) ) , new String ( field . name ) } , severity , nodeSourceStart ( field , location ) , nodeSourceEnd ( field , location ) ) ; } public void indirectAccessToStaticMethod ( ASTNode location , MethodBinding method ) { int severity = computeSeverity ( IProblem . IndirectAccessToStaticMethod ) ; if ( severity == ProblemSeverities . Ignore ) return ; this . handle ( IProblem . IndirectAccessToStaticMethod , new String [ ] { new String ( method . declaringClass . readableName ( ) ) , new String ( method . selector ) , typesAsString ( method , false ) } , new String [ ] { new String ( method . declaringClass . shortReadableName ( ) ) , new String ( method . selector ) , typesAsString ( method , true ) } , severity , location . sourceStart , location . sourceEnd ) ; } private void inheritedMethodReducesVisibility ( int sourceStart , int sourceEnd , MethodBinding concreteMethod , MethodBinding [ ] abstractMethods ) { StringBuffer concreteSignature = new StringBuffer ( ) ; concreteSignature . append ( concreteMethod . declaringClass . readableName ( ) ) . append ( '<CHAR_LIT:.>' ) . append ( concreteMethod . readableName ( ) ) ; StringBuffer shortSignature = new StringBuffer ( ) ; shortSignature . append ( concreteMethod . declaringClass . shortReadableName ( ) ) . append ( '<CHAR_LIT:.>' ) . append ( concreteMethod . shortReadableName ( ) ) ; this . handle ( IProblem . InheritedMethodReducesVisibility , new String [ ] { concreteSignature . toString ( ) , new String ( abstractMethods [ <NUM_LIT:0> ] . declaringClass . readableName ( ) ) } , new String [ ] { shortSignature . toString ( ) , new String ( abstractMethods [ <NUM_LIT:0> ] . declaringClass . shortReadableName ( ) ) } , sourceStart , sourceEnd ) ; } public void inheritedMethodReducesVisibility ( SourceTypeBinding type , MethodBinding concreteMethod , MethodBinding [ ] abstractMethods ) { inheritedMethodReducesVisibility ( type . sourceStart ( ) , type . sourceEnd ( ) , concreteMethod , abstractMethods ) ; } public void inheritedMethodReducesVisibility ( TypeParameter typeParameter , MethodBinding concreteMethod , MethodBinding [ ] abstractMethods ) { inheritedMethodReducesVisibility ( typeParameter . sourceStart ( ) , typeParameter . sourceEnd ( ) , concreteMethod , abstractMethods ) ; } public void inheritedMethodsHaveIncompatibleReturnTypes ( ASTNode location , MethodBinding [ ] inheritedMethods , int length ) { StringBuffer methodSignatures = new StringBuffer ( ) ; StringBuffer shortSignatures = new StringBuffer ( ) ; for ( int i = length ; -- i >= <NUM_LIT:0> ; ) { methodSignatures . append ( inheritedMethods [ i ] . declaringClass . readableName ( ) ) . append ( '<CHAR_LIT:.>' ) . append ( inheritedMethods [ i ] . readableName ( ) ) ; shortSignatures . append ( inheritedMethods [ i ] . declaringClass . shortReadableName ( ) ) . append ( '<CHAR_LIT:.>' ) . append ( inheritedMethods [ i ] . shortReadableName ( ) ) ; if ( i != <NUM_LIT:0> ) { methodSignatures . append ( "<STR_LIT:U+002CU+0020>" ) ; shortSignatures . append ( "<STR_LIT:U+002CU+0020>" ) ; } } this . handle ( IProblem . InheritedIncompatibleReturnType , new String [ ] { methodSignatures . toString ( ) } , new String [ ] { shortSignatures . toString ( ) } , location . sourceStart , location . sourceEnd ) ; } public void inheritedMethodsHaveIncompatibleReturnTypes ( SourceTypeBinding type , MethodBinding [ ] inheritedMethods , int length ) { StringBuffer methodSignatures = new StringBuffer ( ) ; StringBuffer shortSignatures = new StringBuffer ( ) ; for ( int i = length ; -- i >= <NUM_LIT:0> ; ) { methodSignatures . append ( inheritedMethods [ i ] . declaringClass . readableName ( ) ) . append ( '<CHAR_LIT:.>' ) . append ( inheritedMethods [ i ] . readableName ( ) ) ; shortSignatures . append ( inheritedMethods [ i ] . declaringClass . shortReadableName ( ) ) . append ( '<CHAR_LIT:.>' ) . append ( inheritedMethods [ i ] . shortReadableName ( ) ) ; if ( i != <NUM_LIT:0> ) { methodSignatures . append ( "<STR_LIT:U+002CU+0020>" ) ; shortSignatures . append ( "<STR_LIT:U+002CU+0020>" ) ; } } this . handle ( IProblem . InheritedIncompatibleReturnType , new String [ ] { methodSignatures . toString ( ) } , new String [ ] { shortSignatures . toString ( ) } , type . sourceStart ( ) , type . sourceEnd ( ) ) ; } public void inheritedMethodsHaveNameClash ( SourceTypeBinding type , MethodBinding oneMethod , MethodBinding twoMethod ) { this . handle ( IProblem . MethodNameClash , new String [ ] { new String ( oneMethod . selector ) , typesAsString ( oneMethod . original ( ) , false ) , new String ( oneMethod . declaringClass . readableName ( ) ) , typesAsString ( twoMethod . original ( ) , false ) , new String ( twoMethod . declaringClass . readableName ( ) ) , } , new String [ ] { new String ( oneMethod . selector ) , typesAsString ( oneMethod . original ( ) , true ) , new String ( oneMethod . declaringClass . shortReadableName ( ) ) , typesAsString ( twoMethod . original ( ) , true ) , new String ( twoMethod . declaringClass . shortReadableName ( ) ) , } , type . sourceStart ( ) , type . sourceEnd ( ) ) ; } public void initializerMustCompleteNormally ( FieldDeclaration fieldDecl ) { this . handle ( IProblem . InitializerMustCompleteNormally , NoArgument , NoArgument , fieldDecl . sourceStart , fieldDecl . sourceEnd ) ; } public void innerTypesCannotDeclareStaticInitializers ( ReferenceBinding innerType , Initializer initializer ) { this . handle ( IProblem . CannotDefineStaticInitializerInLocalType , new String [ ] { new String ( innerType . readableName ( ) ) } , new String [ ] { new String ( innerType . shortReadableName ( ) ) } , initializer . sourceStart , initializer . sourceStart ) ; } public void interfaceCannotHaveConstructors ( ConstructorDeclaration constructor ) { this . handle ( IProblem . InterfaceCannotHaveConstructors , NoArgument , NoArgument , constructor . sourceStart , constructor . sourceEnd , constructor , constructor . compilationResult ( ) ) ; } public void interfaceCannotHaveInitializers ( char [ ] sourceName , FieldDeclaration fieldDecl ) { String [ ] arguments = new String [ ] { new String ( sourceName ) } ; this . handle ( IProblem . InterfaceCannotHaveInitializers , arguments , arguments , fieldDecl . sourceStart , fieldDecl . sourceEnd ) ; } public void invalidAnnotationMemberType ( MethodDeclaration methodDecl ) { this . handle ( IProblem . InvalidAnnotationMemberType , new String [ ] { new String ( methodDecl . binding . returnType . readableName ( ) ) , new String ( methodDecl . selector ) , new String ( methodDecl . binding . declaringClass . readableName ( ) ) , } , new String [ ] { new String ( methodDecl . binding . returnType . shortReadableName ( ) ) , new String ( methodDecl . selector ) , new String ( methodDecl . binding . declaringClass . shortReadableName ( ) ) , } , methodDecl . returnType . sourceStart , methodDecl . returnType . sourceEnd ) ; } public void invalidBreak ( ASTNode location ) { this . handle ( IProblem . InvalidBreak , NoArgument , NoArgument , location . sourceStart , location . sourceEnd ) ; } public void invalidConstructor ( Statement statement , MethodBinding targetConstructor ) { boolean insideDefaultConstructor = ( this . referenceContext instanceof ConstructorDeclaration ) && ( ( ConstructorDeclaration ) this . referenceContext ) . isDefaultConstructor ( ) ; boolean insideImplicitConstructorCall = ( statement instanceof ExplicitConstructorCall ) && ( ( ( ExplicitConstructorCall ) statement ) . accessMode == ExplicitConstructorCall . ImplicitSuper ) ; int sourceStart = statement . sourceStart ; int sourceEnd = statement . sourceEnd ; if ( statement instanceof AllocationExpression ) { AllocationExpression allocation = ( AllocationExpression ) statement ; if ( allocation . enumConstant != null ) { sourceStart = allocation . enumConstant . sourceStart ; sourceEnd = allocation . enumConstant . sourceEnd ; } } int id = IProblem . UndefinedConstructor ; MethodBinding shownConstructor = targetConstructor ; switch ( targetConstructor . problemId ( ) ) { case ProblemReasons . NotFound : ProblemMethodBinding problemConstructor = ( ProblemMethodBinding ) targetConstructor ; if ( problemConstructor . closestMatch != null ) { if ( ( problemConstructor . closestMatch . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { missingTypeInConstructor ( statement , problemConstructor . closestMatch ) ; return ; } } if ( insideDefaultConstructor ) { id = IProblem . UndefinedConstructorInDefaultConstructor ; } else if ( insideImplicitConstructorCall ) { id = IProblem . UndefinedConstructorInImplicitConstructorCall ; } else { id = IProblem . UndefinedConstructor ; } break ; case ProblemReasons . NotVisible : if ( insideDefaultConstructor ) { id = IProblem . NotVisibleConstructorInDefaultConstructor ; } else if ( insideImplicitConstructorCall ) { id = IProblem . NotVisibleConstructorInImplicitConstructorCall ; } else { id = IProblem . NotVisibleConstructor ; } problemConstructor = ( ProblemMethodBinding ) targetConstructor ; if ( problemConstructor . closestMatch != null ) { shownConstructor = problemConstructor . closestMatch . original ( ) ; } break ; case ProblemReasons . Ambiguous : if ( insideDefaultConstructor ) { id = IProblem . AmbiguousConstructorInDefaultConstructor ; } else if ( insideImplicitConstructorCall ) { id = IProblem . AmbiguousConstructorInImplicitConstructorCall ; } else { id = IProblem . AmbiguousConstructor ; } break ; case ProblemReasons . ParameterBoundMismatch : problemConstructor = ( ProblemMethodBinding ) targetConstructor ; ParameterizedGenericMethodBinding substitutedConstructor = ( ParameterizedGenericMethodBinding ) problemConstructor . closestMatch ; shownConstructor = substitutedConstructor . original ( ) ; int augmentedLength = problemConstructor . parameters . length ; TypeBinding inferredTypeArgument = problemConstructor . parameters [ augmentedLength - <NUM_LIT:2> ] ; TypeVariableBinding typeParameter = ( TypeVariableBinding ) problemConstructor . parameters [ augmentedLength - <NUM_LIT:1> ] ; TypeBinding [ ] invocationArguments = new TypeBinding [ augmentedLength - <NUM_LIT:2> ] ; System . arraycopy ( problemConstructor . parameters , <NUM_LIT:0> , invocationArguments , <NUM_LIT:0> , augmentedLength - <NUM_LIT:2> ) ; this . handle ( IProblem . GenericConstructorTypeArgumentMismatch , new String [ ] { new String ( shownConstructor . declaringClass . sourceName ( ) ) , typesAsString ( shownConstructor , false ) , new String ( shownConstructor . declaringClass . readableName ( ) ) , typesAsString ( invocationArguments , false ) , new String ( inferredTypeArgument . readableName ( ) ) , new String ( typeParameter . sourceName ) , parameterBoundAsString ( typeParameter , false ) } , new String [ ] { new String ( shownConstructor . declaringClass . sourceName ( ) ) , typesAsString ( shownConstructor , true ) , new String ( shownConstructor . declaringClass . shortReadableName ( ) ) , typesAsString ( invocationArguments , true ) , new String ( inferredTypeArgument . shortReadableName ( ) ) , new String ( typeParameter . sourceName ) , parameterBoundAsString ( typeParameter , true ) } , sourceStart , sourceEnd ) ; return ; case ProblemReasons . TypeParameterArityMismatch : problemConstructor = ( ProblemMethodBinding ) targetConstructor ; shownConstructor = problemConstructor . closestMatch ; if ( shownConstructor . typeVariables == Binding . NO_TYPE_VARIABLES ) { this . handle ( IProblem . NonGenericConstructor , new String [ ] { new String ( shownConstructor . declaringClass . sourceName ( ) ) , typesAsString ( shownConstructor , false ) , new String ( shownConstructor . declaringClass . readableName ( ) ) , typesAsString ( targetConstructor , false ) } , new String [ ] { new String ( shownConstructor . declaringClass . sourceName ( ) ) , typesAsString ( shownConstructor , true ) , new String ( shownConstructor . declaringClass . shortReadableName ( ) ) , typesAsString ( targetConstructor , true ) } , sourceStart , sourceEnd ) ; } else { this . handle ( IProblem . IncorrectArityForParameterizedConstructor , new String [ ] { new String ( shownConstructor . declaringClass . sourceName ( ) ) , typesAsString ( shownConstructor , false ) , new String ( shownConstructor . declaringClass . readableName ( ) ) , typesAsString ( shownConstructor . typeVariables , false ) , typesAsString ( targetConstructor , false ) } , new String [ ] { new String ( shownConstructor . declaringClass . sourceName ( ) ) , typesAsString ( shownConstructor , true ) , new String ( shownConstructor . declaringClass . shortReadableName ( ) ) , typesAsString ( shownConstructor . typeVariables , true ) , typesAsString ( targetConstructor , true ) } , sourceStart , sourceEnd ) ; } return ; case ProblemReasons . ParameterizedMethodTypeMismatch : problemConstructor = ( ProblemMethodBinding ) targetConstructor ; shownConstructor = problemConstructor . closestMatch ; this . handle ( IProblem . ParameterizedConstructorArgumentTypeMismatch , new String [ ] { new String ( shownConstructor . declaringClass . sourceName ( ) ) , typesAsString ( shownConstructor , false ) , new String ( shownConstructor . declaringClass . readableName ( ) ) , typesAsString ( ( ( ParameterizedGenericMethodBinding ) shownConstructor ) . typeArguments , false ) , typesAsString ( targetConstructor , false ) } , new String [ ] { new String ( shownConstructor . declaringClass . sourceName ( ) ) , typesAsString ( shownConstructor , true ) , new String ( shownConstructor . declaringClass . shortReadableName ( ) ) , typesAsString ( ( ( ParameterizedGenericMethodBinding ) shownConstructor ) . typeArguments , true ) , typesAsString ( targetConstructor , true ) } , sourceStart , sourceEnd ) ; return ; case ProblemReasons . TypeArgumentsForRawGenericMethod : problemConstructor = ( ProblemMethodBinding ) targetConstructor ; shownConstructor = problemConstructor . closestMatch ; this . handle ( IProblem . TypeArgumentsForRawGenericConstructor , new String [ ] { new String ( shownConstructor . declaringClass . sourceName ( ) ) , typesAsString ( shownConstructor , false ) , new String ( shownConstructor . declaringClass . readableName ( ) ) , typesAsString ( targetConstructor , false ) } , new String [ ] { new String ( shownConstructor . declaringClass . sourceName ( ) ) , typesAsString ( shownConstructor , true ) , new String ( shownConstructor . declaringClass . shortReadableName ( ) ) , typesAsString ( targetConstructor , true ) } , sourceStart , sourceEnd ) ; return ; case ProblemReasons . VarargsElementTypeNotVisible : problemConstructor = ( ProblemMethodBinding ) targetConstructor ; shownConstructor = problemConstructor . closestMatch ; TypeBinding varargsElementType = shownConstructor . parameters [ shownConstructor . parameters . length - <NUM_LIT:1> ] . leafComponentType ( ) ; this . handle ( IProblem . VarargsElementTypeNotVisibleForConstructor , new String [ ] { new String ( shownConstructor . declaringClass . sourceName ( ) ) , typesAsString ( shownConstructor , false ) , new String ( shownConstructor . declaringClass . readableName ( ) ) , new String ( varargsElementType . readableName ( ) ) } , new String [ ] { new String ( shownConstructor . declaringClass . sourceName ( ) ) , typesAsString ( shownConstructor , true ) , new String ( shownConstructor . declaringClass . shortReadableName ( ) ) , new String ( varargsElementType . shortReadableName ( ) ) } , sourceStart , sourceEnd ) ; return ; case ProblemReasons . NoError : default : needImplementation ( statement ) ; break ; } this . handle ( id , new String [ ] { new String ( targetConstructor . declaringClass . readableName ( ) ) , typesAsString ( shownConstructor , false ) } , new String [ ] { new String ( targetConstructor . declaringClass . shortReadableName ( ) ) , typesAsString ( shownConstructor , true ) } , sourceStart , sourceEnd ) ; } public void invalidContinue ( ASTNode location ) { this . handle ( IProblem . InvalidContinue , NoArgument , NoArgument , location . sourceStart , location . sourceEnd ) ; } public void invalidEnclosingType ( Expression expression , TypeBinding type , ReferenceBinding enclosingType ) { if ( enclosingType . isAnonymousType ( ) ) enclosingType = enclosingType . superclass ( ) ; if ( enclosingType . sourceName != null && enclosingType . sourceName . length == <NUM_LIT:0> ) return ; int flag = IProblem . UndefinedType ; switch ( type . problemId ( ) ) { case ProblemReasons . NotFound : flag = IProblem . UndefinedType ; break ; case ProblemReasons . NotVisible : flag = IProblem . NotVisibleType ; break ; case ProblemReasons . Ambiguous : flag = IProblem . AmbiguousType ; break ; case ProblemReasons . InternalNameProvided : flag = IProblem . InternalTypeNameProvided ; break ; case ProblemReasons . NoError : default : needImplementation ( expression ) ; break ; } this . handle ( flag , new String [ ] { new String ( enclosingType . readableName ( ) ) + "<STR_LIT:.>" + new String ( type . readableName ( ) ) } , new String [ ] { new String ( enclosingType . shortReadableName ( ) ) + "<STR_LIT:.>" + new String ( type . shortReadableName ( ) ) } , expression . sourceStart , expression . sourceEnd ) ; } public void invalidExplicitConstructorCall ( ASTNode location ) { this . handle ( IProblem . InvalidExplicitConstructorCall , NoArgument , NoArgument , location . sourceStart , location . sourceEnd ) ; } public void invalidExpressionAsStatement ( Expression expression ) { this . handle ( IProblem . InvalidExpressionAsStatement , NoArgument , NoArgument , expression . sourceStart , expression . sourceEnd ) ; } public void invalidField ( FieldReference fieldRef , TypeBinding searchedType ) { if ( isRecoveredName ( fieldRef . token ) ) return ; int id = IProblem . UndefinedField ; FieldBinding field = fieldRef . binding ; switch ( field . problemId ( ) ) { case ProblemReasons . NotFound : if ( ( searchedType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . handle ( IProblem . UndefinedType , new String [ ] { new String ( searchedType . leafComponentType ( ) . readableName ( ) ) } , new String [ ] { new String ( searchedType . leafComponentType ( ) . shortReadableName ( ) ) } , fieldRef . receiver . sourceStart , fieldRef . receiver . sourceEnd ) ; return ; } id = IProblem . UndefinedField ; break ; case ProblemReasons . NotVisible : this . handle ( IProblem . NotVisibleField , new String [ ] { new String ( fieldRef . token ) , new String ( field . declaringClass . readableName ( ) ) } , new String [ ] { new String ( fieldRef . token ) , new String ( field . declaringClass . shortReadableName ( ) ) } , nodeSourceStart ( field , fieldRef ) , nodeSourceEnd ( field , fieldRef ) ) ; return ; case ProblemReasons . Ambiguous : id = IProblem . AmbiguousField ; break ; case ProblemReasons . NonStaticReferenceInStaticContext : id = IProblem . NonStaticFieldFromStaticInvocation ; break ; case ProblemReasons . NonStaticReferenceInConstructorInvocation : id = IProblem . InstanceFieldDuringConstructorInvocation ; break ; case ProblemReasons . InheritedNameHidesEnclosingName : id = IProblem . InheritedFieldHidesEnclosingName ; break ; case ProblemReasons . ReceiverTypeNotVisible : this . handle ( IProblem . NotVisibleType , new String [ ] { new String ( searchedType . leafComponentType ( ) . readableName ( ) ) } , new String [ ] { new String ( searchedType . leafComponentType ( ) . shortReadableName ( ) ) } , fieldRef . receiver . sourceStart , fieldRef . receiver . sourceEnd ) ; return ; case ProblemReasons . NoError : default : needImplementation ( fieldRef ) ; break ; } String [ ] arguments = new String [ ] { new String ( field . readableName ( ) ) } ; this . handle ( id , arguments , arguments , nodeSourceStart ( field , fieldRef ) , nodeSourceEnd ( field , fieldRef ) ) ; } public void invalidField ( NameReference nameRef , FieldBinding field ) { if ( nameRef instanceof QualifiedNameReference ) { QualifiedNameReference ref = ( QualifiedNameReference ) nameRef ; if ( isRecoveredName ( ref . tokens ) ) return ; } else { SingleNameReference ref = ( SingleNameReference ) nameRef ; if ( isRecoveredName ( ref . token ) ) return ; } int id = IProblem . UndefinedField ; switch ( field . problemId ( ) ) { case ProblemReasons . NotFound : TypeBinding declaringClass = field . declaringClass ; if ( declaringClass != null && ( declaringClass . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . handle ( IProblem . UndefinedType , new String [ ] { new String ( field . declaringClass . readableName ( ) ) } , new String [ ] { new String ( field . declaringClass . shortReadableName ( ) ) } , nameRef . sourceStart , nameRef . sourceEnd ) ; return ; } String [ ] arguments = new String [ ] { new String ( field . readableName ( ) ) } ; this . handle ( id , arguments , arguments , nodeSourceStart ( field , nameRef ) , nodeSourceEnd ( field , nameRef ) ) ; return ; case ProblemReasons . NotVisible : char [ ] name = field . readableName ( ) ; name = CharOperation . lastSegment ( name , '<CHAR_LIT:.>' ) ; this . handle ( IProblem . NotVisibleField , new String [ ] { new String ( name ) , new String ( field . declaringClass . readableName ( ) ) } , new String [ ] { new String ( name ) , new String ( field . declaringClass . shortReadableName ( ) ) } , nodeSourceStart ( field , nameRef ) , nodeSourceEnd ( field , nameRef ) ) ; return ; case ProblemReasons . Ambiguous : id = IProblem . AmbiguousField ; break ; case ProblemReasons . NonStaticReferenceInStaticContext : id = IProblem . NonStaticFieldFromStaticInvocation ; break ; case ProblemReasons . NonStaticReferenceInConstructorInvocation : id = IProblem . InstanceFieldDuringConstructorInvocation ; break ; case ProblemReasons . InheritedNameHidesEnclosingName : id = IProblem . InheritedFieldHidesEnclosingName ; break ; case ProblemReasons . ReceiverTypeNotVisible : this . handle ( IProblem . NotVisibleType , new String [ ] { new String ( field . declaringClass . readableName ( ) ) } , new String [ ] { new String ( field . declaringClass . shortReadableName ( ) ) } , nameRef . sourceStart , nameRef . sourceEnd ) ; return ; case ProblemReasons . NoError : default : needImplementation ( nameRef ) ; break ; } String [ ] arguments = new String [ ] { new String ( field . readableName ( ) ) } ; this . handle ( id , arguments , arguments , nameRef . sourceStart , nameRef . sourceEnd ) ; } public void invalidField ( QualifiedNameReference nameRef , FieldBinding field , int index , TypeBinding searchedType ) { if ( isRecoveredName ( nameRef . tokens ) ) return ; if ( searchedType . isBaseType ( ) ) { this . handle ( IProblem . NoFieldOnBaseType , new String [ ] { new String ( searchedType . readableName ( ) ) , CharOperation . toString ( CharOperation . subarray ( nameRef . tokens , <NUM_LIT:0> , index ) ) , new String ( nameRef . tokens [ index ] ) } , new String [ ] { new String ( searchedType . sourceName ( ) ) , CharOperation . toString ( CharOperation . subarray ( nameRef . tokens , <NUM_LIT:0> , index ) ) , new String ( nameRef . tokens [ index ] ) } , nameRef . sourceStart , ( int ) nameRef . sourcePositions [ index ] ) ; return ; } int id = IProblem . UndefinedField ; switch ( field . problemId ( ) ) { case ProblemReasons . NotFound : if ( ( searchedType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . handle ( IProblem . UndefinedType , new String [ ] { new String ( searchedType . leafComponentType ( ) . readableName ( ) ) } , new String [ ] { new String ( searchedType . leafComponentType ( ) . shortReadableName ( ) ) } , nameRef . sourceStart , ( int ) nameRef . sourcePositions [ index - <NUM_LIT:1> ] ) ; return ; } String fieldName = new String ( nameRef . tokens [ index ] ) ; String [ ] arguments = new String [ ] { fieldName } ; this . handle ( id , arguments , arguments , nodeSourceStart ( field , nameRef ) , nodeSourceEnd ( field , nameRef ) ) ; return ; case ProblemReasons . NotVisible : fieldName = new String ( nameRef . tokens [ index ] ) ; this . handle ( IProblem . NotVisibleField , new String [ ] { fieldName , new String ( field . declaringClass . readableName ( ) ) } , new String [ ] { fieldName , new String ( field . declaringClass . shortReadableName ( ) ) } , nodeSourceStart ( field , nameRef ) , nodeSourceEnd ( field , nameRef ) ) ; return ; case ProblemReasons . Ambiguous : id = IProblem . AmbiguousField ; break ; case ProblemReasons . NonStaticReferenceInStaticContext : id = IProblem . NonStaticFieldFromStaticInvocation ; break ; case ProblemReasons . NonStaticReferenceInConstructorInvocation : id = IProblem . InstanceFieldDuringConstructorInvocation ; break ; case ProblemReasons . InheritedNameHidesEnclosingName : id = IProblem . InheritedFieldHidesEnclosingName ; break ; case ProblemReasons . ReceiverTypeNotVisible : this . handle ( IProblem . NotVisibleType , new String [ ] { new String ( searchedType . leafComponentType ( ) . readableName ( ) ) } , new String [ ] { new String ( searchedType . leafComponentType ( ) . shortReadableName ( ) ) } , nameRef . sourceStart , ( int ) nameRef . sourcePositions [ index - <NUM_LIT:1> ] ) ; return ; case ProblemReasons . NoError : default : needImplementation ( nameRef ) ; break ; } String [ ] arguments = new String [ ] { CharOperation . toString ( CharOperation . subarray ( nameRef . tokens , <NUM_LIT:0> , index + <NUM_LIT:1> ) ) } ; this . handle ( id , arguments , arguments , nameRef . sourceStart , ( int ) nameRef . sourcePositions [ index ] ) ; } public void invalidFileNameForPackageAnnotations ( Annotation annotation ) { this . handle ( IProblem . InvalidFileNameForPackageAnnotations , NoArgument , NoArgument , annotation . sourceStart , annotation . sourceEnd ) ; } public void invalidMethod ( MessageSend messageSend , MethodBinding method ) { if ( isRecoveredName ( messageSend . selector ) ) return ; int id = IProblem . UndefinedMethod ; MethodBinding shownMethod = method ; switch ( method . problemId ( ) ) { case ProblemReasons . NotFound : if ( ( method . declaringClass . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . handle ( IProblem . UndefinedType , new String [ ] { new String ( method . declaringClass . readableName ( ) ) } , new String [ ] { new String ( method . declaringClass . shortReadableName ( ) ) } , messageSend . receiver . sourceStart , messageSend . receiver . sourceEnd ) ; return ; } id = IProblem . UndefinedMethod ; ProblemMethodBinding problemMethod = ( ProblemMethodBinding ) method ; if ( problemMethod . closestMatch != null ) { shownMethod = problemMethod . closestMatch ; if ( ( shownMethod . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { missingTypeInMethod ( messageSend , shownMethod ) ; return ; } String closestParameterTypeNames = typesAsString ( shownMethod , false ) ; String parameterTypeNames = typesAsString ( problemMethod . parameters , false ) ; String closestParameterTypeShortNames = typesAsString ( shownMethod , true ) ; String parameterTypeShortNames = typesAsString ( problemMethod . parameters , true ) ; this . handle ( IProblem . ParameterMismatch , new String [ ] { new String ( shownMethod . declaringClass . readableName ( ) ) , new String ( shownMethod . selector ) , closestParameterTypeNames , parameterTypeNames } , new String [ ] { new String ( shownMethod . declaringClass . shortReadableName ( ) ) , new String ( shownMethod . selector ) , closestParameterTypeShortNames , parameterTypeShortNames } , ( int ) ( messageSend . nameSourcePosition > > > <NUM_LIT:32> ) , ( int ) messageSend . nameSourcePosition ) ; return ; } break ; case ProblemReasons . NotVisible : id = IProblem . NotVisibleMethod ; problemMethod = ( ProblemMethodBinding ) method ; if ( problemMethod . closestMatch != null ) { shownMethod = problemMethod . closestMatch . original ( ) ; } break ; case ProblemReasons . Ambiguous : id = IProblem . AmbiguousMethod ; break ; case ProblemReasons . InheritedNameHidesEnclosingName : id = IProblem . InheritedMethodHidesEnclosingName ; break ; case ProblemReasons . NonStaticReferenceInConstructorInvocation : id = IProblem . InstanceMethodDuringConstructorInvocation ; break ; case ProblemReasons . NonStaticReferenceInStaticContext : id = IProblem . StaticMethodRequested ; break ; case ProblemReasons . ReceiverTypeNotVisible : this . handle ( IProblem . NotVisibleType , new String [ ] { new String ( method . declaringClass . readableName ( ) ) } , new String [ ] { new String ( method . declaringClass . shortReadableName ( ) ) } , messageSend . receiver . sourceStart , messageSend . receiver . sourceEnd ) ; return ; case ProblemReasons . ParameterBoundMismatch : problemMethod = ( ProblemMethodBinding ) method ; ParameterizedGenericMethodBinding substitutedMethod = ( ParameterizedGenericMethodBinding ) problemMethod . closestMatch ; shownMethod = substitutedMethod . original ( ) ; int augmentedLength = problemMethod . parameters . length ; TypeBinding inferredTypeArgument = problemMethod . parameters [ augmentedLength - <NUM_LIT:2> ] ; TypeVariableBinding typeParameter = ( TypeVariableBinding ) problemMethod . parameters [ augmentedLength - <NUM_LIT:1> ] ; TypeBinding [ ] invocationArguments = new TypeBinding [ augmentedLength - <NUM_LIT:2> ] ; System . arraycopy ( problemMethod . parameters , <NUM_LIT:0> , invocationArguments , <NUM_LIT:0> , augmentedLength - <NUM_LIT:2> ) ; this . handle ( IProblem . GenericMethodTypeArgumentMismatch , new String [ ] { new String ( shownMethod . selector ) , typesAsString ( shownMethod , false ) , new String ( shownMethod . declaringClass . readableName ( ) ) , typesAsString ( invocationArguments , false ) , new String ( inferredTypeArgument . readableName ( ) ) , new String ( typeParameter . sourceName ) , parameterBoundAsString ( typeParameter , false ) } , new String [ ] { new String ( shownMethod . selector ) , typesAsString ( shownMethod , true ) , new String ( shownMethod . declaringClass . shortReadableName ( ) ) , typesAsString ( invocationArguments , true ) , new String ( inferredTypeArgument . shortReadableName ( ) ) , new String ( typeParameter . sourceName ) , parameterBoundAsString ( typeParameter , true ) } , ( int ) ( messageSend . nameSourcePosition > > > <NUM_LIT:32> ) , ( int ) messageSend . nameSourcePosition ) ; return ; case ProblemReasons . TypeParameterArityMismatch : problemMethod = ( ProblemMethodBinding ) method ; shownMethod = problemMethod . closestMatch ; if ( shownMethod . typeVariables == Binding . NO_TYPE_VARIABLES ) { this . handle ( IProblem . NonGenericMethod , new String [ ] { new String ( shownMethod . selector ) , typesAsString ( shownMethod , false ) , new String ( shownMethod . declaringClass . readableName ( ) ) , typesAsString ( method , false ) } , new String [ ] { new String ( shownMethod . selector ) , typesAsString ( shownMethod , true ) , new String ( shownMethod . declaringClass . shortReadableName ( ) ) , typesAsString ( method , true ) } , ( int ) ( messageSend . nameSourcePosition > > > <NUM_LIT:32> ) , ( int ) messageSend . nameSourcePosition ) ; } else { this . handle ( IProblem . IncorrectArityForParameterizedMethod , new String [ ] { new String ( shownMethod . selector ) , typesAsString ( shownMethod , false ) , new String ( shownMethod . declaringClass . readableName ( ) ) , typesAsString ( shownMethod . typeVariables , false ) , typesAsString ( method , false ) } , new String [ ] { new String ( shownMethod . selector ) , typesAsString ( shownMethod , true ) , new String ( shownMethod . declaringClass . shortReadableName ( ) ) , typesAsString ( shownMethod . typeVariables , true ) , typesAsString ( method , true ) } , ( int ) ( messageSend . nameSourcePosition > > > <NUM_LIT:32> ) , ( int ) messageSend . nameSourcePosition ) ; } return ; case ProblemReasons . ParameterizedMethodTypeMismatch : problemMethod = ( ProblemMethodBinding ) method ; shownMethod = problemMethod . closestMatch ; this . handle ( IProblem . ParameterizedMethodArgumentTypeMismatch , new String [ ] { new String ( shownMethod . selector ) , typesAsString ( shownMethod , false ) , new String ( shownMethod . declaringClass . readableName ( ) ) , typesAsString ( ( ( ParameterizedGenericMethodBinding ) shownMethod ) . typeArguments , false ) , typesAsString ( method , false ) } , new String [ ] { new String ( shownMethod . selector ) , typesAsString ( shownMethod , true ) , new String ( shownMethod . declaringClass . shortReadableName ( ) ) , typesAsString ( ( ( ParameterizedGenericMethodBinding ) shownMethod ) . typeArguments , true ) , typesAsString ( method , true ) } , ( int ) ( messageSend . nameSourcePosition > > > <NUM_LIT:32> ) , ( int ) messageSend . nameSourcePosition ) ; return ; case ProblemReasons . TypeArgumentsForRawGenericMethod : problemMethod = ( ProblemMethodBinding ) method ; shownMethod = problemMethod . closestMatch ; this . handle ( IProblem . TypeArgumentsForRawGenericMethod , new String [ ] { new String ( shownMethod . selector ) , typesAsString ( shownMethod , false ) , new String ( shownMethod . declaringClass . readableName ( ) ) , typesAsString ( method , false ) } , new String [ ] { new String ( shownMethod . selector ) , typesAsString ( shownMethod , true ) , new String ( shownMethod . declaringClass . shortReadableName ( ) ) , typesAsString ( method , true ) } , ( int ) ( messageSend . nameSourcePosition > > > <NUM_LIT:32> ) , ( int ) messageSend . nameSourcePosition ) ; return ; case ProblemReasons . VarargsElementTypeNotVisible : problemMethod = ( ProblemMethodBinding ) method ; if ( problemMethod . closestMatch != null ) { shownMethod = problemMethod . closestMatch . original ( ) ; } TypeBinding varargsElementType = shownMethod . parameters [ shownMethod . parameters . length - <NUM_LIT:1> ] . leafComponentType ( ) ; this . handle ( IProblem . VarargsElementTypeNotVisible , new String [ ] { new String ( shownMethod . selector ) , typesAsString ( shownMethod , false ) , new String ( shownMethod . declaringClass . readableName ( ) ) , new String ( varargsElementType . readableName ( ) ) } , new String [ ] { new String ( shownMethod . selector ) , typesAsString ( shownMethod , true ) , new String ( shownMethod . declaringClass . shortReadableName ( ) ) , new String ( varargsElementType . shortReadableName ( ) ) } , ( int ) ( messageSend . nameSourcePosition > > > <NUM_LIT:32> ) , ( int ) messageSend . nameSourcePosition ) ; return ; case ProblemReasons . NoError : default : needImplementation ( messageSend ) ; break ; } this . handle ( id , new String [ ] { new String ( method . declaringClass . readableName ( ) ) , new String ( shownMethod . selector ) , typesAsString ( shownMethod , false ) } , new String [ ] { new String ( method . declaringClass . shortReadableName ( ) ) , new String ( shownMethod . selector ) , typesAsString ( shownMethod , true ) } , ( int ) ( messageSend . nameSourcePosition > > > <NUM_LIT:32> ) , ( int ) messageSend . nameSourcePosition ) ; } public void invalidNullToSynchronize ( Expression expression ) { this . handle ( IProblem . InvalidNullToSynchronized , NoArgument , NoArgument , expression . sourceStart , expression . sourceEnd ) ; } public void invalidOperator ( BinaryExpression expression , TypeBinding leftType , TypeBinding rightType ) { String leftName = new String ( leftType . readableName ( ) ) ; String rightName = new String ( rightType . readableName ( ) ) ; String leftShortName = new String ( leftType . shortReadableName ( ) ) ; String rightShortName = new String ( rightType . shortReadableName ( ) ) ; if ( leftShortName . equals ( rightShortName ) ) { leftShortName = leftName ; rightShortName = rightName ; } this . handle ( IProblem . InvalidOperator , new String [ ] { expression . operatorToString ( ) , leftName + "<STR_LIT:U+002CU+0020>" + rightName } , new String [ ] { expression . operatorToString ( ) , leftShortName + "<STR_LIT:U+002CU+0020>" + rightShortName } , expression . sourceStart , expression . sourceEnd ) ; } public void invalidOperator ( CompoundAssignment assign , TypeBinding leftType , TypeBinding rightType ) { String leftName = new String ( leftType . readableName ( ) ) ; String rightName = new String ( rightType . readableName ( ) ) ; String leftShortName = new String ( leftType . shortReadableName ( ) ) ; String rightShortName = new String ( rightType . shortReadableName ( ) ) ; if ( leftShortName . equals ( rightShortName ) ) { leftShortName = leftName ; rightShortName = rightName ; } this . handle ( IProblem . InvalidOperator , new String [ ] { assign . operatorToString ( ) , leftName + "<STR_LIT:U+002CU+0020>" + rightName } , new String [ ] { assign . operatorToString ( ) , leftShortName + "<STR_LIT:U+002CU+0020>" + rightShortName } , assign . sourceStart , assign . sourceEnd ) ; } public void invalidOperator ( UnaryExpression expression , TypeBinding type ) { this . handle ( IProblem . InvalidOperator , new String [ ] { expression . operatorToString ( ) , new String ( type . readableName ( ) ) } , new String [ ] { expression . operatorToString ( ) , new String ( type . shortReadableName ( ) ) } , expression . sourceStart , expression . sourceEnd ) ; } public void invalidParameterizedExceptionType ( TypeBinding exceptionType , ASTNode location ) { this . handle ( IProblem . InvalidParameterizedExceptionType , new String [ ] { new String ( exceptionType . readableName ( ) ) } , new String [ ] { new String ( exceptionType . shortReadableName ( ) ) } , location . sourceStart , location . sourceEnd ) ; } public void invalidParenthesizedExpression ( ASTNode reference ) { this . handle ( IProblem . InvalidParenthesizedExpression , NoArgument , NoArgument , reference . sourceStart , reference . sourceEnd ) ; } public void invalidType ( ASTNode location , TypeBinding type ) { if ( type instanceof ReferenceBinding ) { if ( isRecoveredName ( ( ( ReferenceBinding ) type ) . compoundName ) ) return ; } else if ( type instanceof ArrayBinding ) { TypeBinding leafType = ( ( ArrayBinding ) type ) . leafComponentType ; if ( leafType instanceof ReferenceBinding ) { if ( isRecoveredName ( ( ( ReferenceBinding ) leafType ) . compoundName ) ) return ; } } if ( type . isParameterizedType ( ) ) { List missingTypes = type . collectMissingTypes ( null ) ; if ( missingTypes != null ) { ReferenceContext savedContext = this . referenceContext ; for ( Iterator iterator = missingTypes . iterator ( ) ; iterator . hasNext ( ) ; ) { try { invalidType ( location , ( TypeBinding ) iterator . next ( ) ) ; } finally { this . referenceContext = savedContext ; } } return ; } } int id = IProblem . UndefinedType ; switch ( type . problemId ( ) ) { case ProblemReasons . NotFound : id = IProblem . UndefinedType ; break ; case ProblemReasons . NotVisible : id = IProblem . NotVisibleType ; break ; case ProblemReasons . Ambiguous : id = IProblem . AmbiguousType ; break ; case ProblemReasons . InternalNameProvided : id = IProblem . InternalTypeNameProvided ; break ; case ProblemReasons . InheritedNameHidesEnclosingName : id = IProblem . InheritedTypeHidesEnclosingName ; break ; case ProblemReasons . NonStaticReferenceInStaticContext : id = IProblem . NonStaticTypeFromStaticInvocation ; break ; case ProblemReasons . IllegalSuperTypeVariable : id = IProblem . IllegalTypeVariableSuperReference ; break ; case ProblemReasons . NoError : default : needImplementation ( location ) ; break ; } int end = location . sourceEnd ; if ( location instanceof QualifiedNameReference ) { QualifiedNameReference ref = ( QualifiedNameReference ) location ; if ( isRecoveredName ( ref . tokens ) ) return ; if ( ref . indexOfFirstFieldBinding >= <NUM_LIT:1> ) end = ( int ) ref . sourcePositions [ ref . indexOfFirstFieldBinding - <NUM_LIT:1> ] ; } else if ( location instanceof ParameterizedQualifiedTypeReference ) { ParameterizedQualifiedTypeReference ref = ( ParameterizedQualifiedTypeReference ) location ; if ( isRecoveredName ( ref . tokens ) ) return ; if ( type instanceof ReferenceBinding ) { char [ ] [ ] name = ( ( ReferenceBinding ) type ) . compoundName ; end = ( int ) ref . sourcePositions [ name . length - <NUM_LIT:1> ] ; } } else if ( location instanceof ArrayQualifiedTypeReference ) { ArrayQualifiedTypeReference arrayQualifiedTypeReference = ( ArrayQualifiedTypeReference ) location ; if ( isRecoveredName ( arrayQualifiedTypeReference . tokens ) ) return ; TypeBinding leafType = type . leafComponentType ( ) ; if ( leafType instanceof ReferenceBinding ) { char [ ] [ ] name = ( ( ReferenceBinding ) leafType ) . compoundName ; end = ( int ) arrayQualifiedTypeReference . sourcePositions [ name . length - <NUM_LIT:1> ] ; } else { long [ ] positions = arrayQualifiedTypeReference . sourcePositions ; end = ( int ) positions [ positions . length - <NUM_LIT:1> ] ; } } else if ( location instanceof QualifiedTypeReference ) { QualifiedTypeReference ref = ( QualifiedTypeReference ) location ; if ( isRecoveredName ( ref . tokens ) ) return ; if ( type instanceof ReferenceBinding ) { char [ ] [ ] name = ( ( ReferenceBinding ) type ) . compoundName ; if ( name . length <= ref . sourcePositions . length ) end = ( int ) ref . sourcePositions [ name . length - <NUM_LIT:1> ] ; } } else if ( location instanceof ImportReference ) { ImportReference ref = ( ImportReference ) location ; if ( isRecoveredName ( ref . tokens ) ) return ; if ( type instanceof ReferenceBinding ) { char [ ] [ ] name = ( ( ReferenceBinding ) type ) . compoundName ; end = ( int ) ref . sourcePositions [ name . length - <NUM_LIT:1> ] ; } } else if ( location instanceof ArrayTypeReference ) { ArrayTypeReference arrayTypeReference = ( ArrayTypeReference ) location ; if ( isRecoveredName ( arrayTypeReference . token ) ) return ; end = arrayTypeReference . originalSourceEnd ; } this . handle ( id , new String [ ] { new String ( type . leafComponentType ( ) . readableName ( ) ) } , new String [ ] { new String ( type . leafComponentType ( ) . shortReadableName ( ) ) } , location . sourceStart , end ) ; } public void invalidTypeForCollection ( Expression expression ) { this . handle ( IProblem . InvalidTypeForCollection , NoArgument , NoArgument , expression . sourceStart , expression . sourceEnd ) ; } public void invalidTypeForCollectionTarget14 ( Expression expression ) { this . handle ( IProblem . InvalidTypeForCollectionTarget14 , NoArgument , NoArgument , expression . sourceStart , expression . sourceEnd ) ; } public void invalidTypeToSynchronize ( Expression expression , TypeBinding type ) { this . handle ( IProblem . InvalidTypeToSynchronized , new String [ ] { new String ( type . readableName ( ) ) } , new String [ ] { new String ( type . shortReadableName ( ) ) } , expression . sourceStart , expression . sourceEnd ) ; } public void invalidTypeVariableAsException ( TypeBinding exceptionType , ASTNode location ) { this . handle ( IProblem . InvalidTypeVariableExceptionType , new String [ ] { new String ( exceptionType . readableName ( ) ) } , new String [ ] { new String ( exceptionType . shortReadableName ( ) ) } , location . sourceStart , location . sourceEnd ) ; } public void invalidUnaryExpression ( Expression expression ) { this . handle ( IProblem . InvalidUnaryExpression , NoArgument , NoArgument , expression . sourceStart , expression . sourceEnd ) ; } public void invalidUsageOfAnnotation ( Annotation annotation ) { this . handle ( IProblem . InvalidUsageOfAnnotations , NoArgument , NoArgument , annotation . sourceStart , annotation . sourceEnd ) ; } public void invalidUsageOfAnnotationDeclarations ( TypeDeclaration annotationTypeDeclaration ) { this . handle ( IProblem . InvalidUsageOfAnnotationDeclarations , NoArgument , NoArgument , annotationTypeDeclaration . sourceStart , annotationTypeDeclaration . sourceEnd ) ; } public void invalidUsageOfEnumDeclarations ( TypeDeclaration enumDeclaration ) { this . handle ( IProblem . InvalidUsageOfEnumDeclarations , NoArgument , NoArgument , enumDeclaration . sourceStart , enumDeclaration . sourceEnd ) ; } public void invalidUsageOfForeachStatements ( LocalDeclaration elementVariable , Expression collection ) { this . handle ( IProblem . InvalidUsageOfForeachStatements , NoArgument , NoArgument , elementVariable . declarationSourceStart , collection . sourceEnd ) ; } public void invalidUsageOfStaticImports ( ImportReference staticImport ) { this . handle ( IProblem . InvalidUsageOfStaticImports , NoArgument , NoArgument , staticImport . declarationSourceStart , staticImport . declarationSourceEnd ) ; } public void invalidUsageOfTypeArguments ( TypeReference firstTypeReference , TypeReference lastTypeReference ) { this . handle ( IProblem . InvalidUsageOfTypeArguments , NoArgument , NoArgument , firstTypeReference . sourceStart , lastTypeReference . sourceEnd ) ; } public void invalidUsageOfTypeParameters ( TypeParameter firstTypeParameter , TypeParameter lastTypeParameter ) { this . handle ( IProblem . InvalidUsageOfTypeParameters , NoArgument , NoArgument , firstTypeParameter . declarationSourceStart , lastTypeParameter . declarationSourceEnd ) ; } public void invalidUsageOfTypeParametersForAnnotationDeclaration ( TypeDeclaration annotationTypeDeclaration ) { TypeParameter [ ] parameters = annotationTypeDeclaration . typeParameters ; int length = parameters . length ; this . handle ( IProblem . InvalidUsageOfTypeParametersForAnnotationDeclaration , NoArgument , NoArgument , parameters [ <NUM_LIT:0> ] . declarationSourceStart , parameters [ length - <NUM_LIT:1> ] . declarationSourceEnd ) ; } public void invalidUsageOfTypeParametersForEnumDeclaration ( TypeDeclaration annotationTypeDeclaration ) { TypeParameter [ ] parameters = annotationTypeDeclaration . typeParameters ; int length = parameters . length ; this . handle ( IProblem . InvalidUsageOfTypeParametersForEnumDeclaration , NoArgument , NoArgument , parameters [ <NUM_LIT:0> ] . declarationSourceStart , parameters [ length - <NUM_LIT:1> ] . declarationSourceEnd ) ; } public void invalidUsageOfVarargs ( Argument argument ) { this . handle ( IProblem . InvalidUsageOfVarargs , NoArgument , NoArgument , argument . type . sourceStart , argument . sourceEnd ) ; } public void isClassPathCorrect ( char [ ] [ ] wellKnownTypeName , CompilationUnitDeclaration compUnitDecl , Object location ) { this . referenceContext = compUnitDecl ; String [ ] arguments = new String [ ] { CharOperation . toString ( wellKnownTypeName ) } ; int start = <NUM_LIT:0> , end = <NUM_LIT:0> ; if ( location != null ) { if ( location instanceof InvocationSite ) { InvocationSite site = ( InvocationSite ) location ; start = site . sourceStart ( ) ; end = site . sourceEnd ( ) ; } else if ( location instanceof ASTNode ) { ASTNode node = ( ASTNode ) location ; start = node . sourceStart ( ) ; end = node . sourceEnd ( ) ; } } this . handle ( IProblem . IsClassPathCorrect , arguments , arguments , start , end ) ; } private boolean isIdentifier ( int token ) { return token == TerminalTokens . TokenNameIdentifier ; } private boolean isKeyword ( int token ) { switch ( token ) { case TerminalTokens . TokenNameabstract : case TerminalTokens . TokenNameassert : case TerminalTokens . TokenNamebyte : case TerminalTokens . TokenNamebreak : case TerminalTokens . TokenNameboolean : case TerminalTokens . TokenNamecase : case TerminalTokens . TokenNamechar : case TerminalTokens . TokenNamecatch : case TerminalTokens . TokenNameclass : case TerminalTokens . TokenNamecontinue : case TerminalTokens . TokenNamedo : case TerminalTokens . TokenNamedouble : case TerminalTokens . TokenNamedefault : case TerminalTokens . TokenNameelse : case TerminalTokens . TokenNameextends : case TerminalTokens . TokenNamefor : case TerminalTokens . TokenNamefinal : case TerminalTokens . TokenNamefloat : case TerminalTokens . TokenNamefalse : case TerminalTokens . TokenNamefinally : case TerminalTokens . TokenNameif : case TerminalTokens . TokenNameint : case TerminalTokens . TokenNameimport : case TerminalTokens . TokenNameinterface : case TerminalTokens . TokenNameimplements : case TerminalTokens . TokenNameinstanceof : case TerminalTokens . TokenNamelong : case TerminalTokens . TokenNamenew : case TerminalTokens . TokenNamenull : case TerminalTokens . TokenNamenative : case TerminalTokens . TokenNamepublic : case TerminalTokens . TokenNamepackage : case TerminalTokens . TokenNameprivate : case TerminalTokens . TokenNameprotected : case TerminalTokens . TokenNamereturn : case TerminalTokens . TokenNameshort : case TerminalTokens . TokenNamesuper : case TerminalTokens . TokenNamestatic : case TerminalTokens . TokenNameswitch : case TerminalTokens . TokenNamestrictfp : case TerminalTokens . TokenNamesynchronized : case TerminalTokens . TokenNametry : case TerminalTokens . TokenNamethis : case TerminalTokens . TokenNametrue : case TerminalTokens . TokenNamethrow : case TerminalTokens . TokenNamethrows : case TerminalTokens . TokenNametransient : case TerminalTokens . TokenNamevoid : case TerminalTokens . TokenNamevolatile : case TerminalTokens . TokenNamewhile : return true ; default : return false ; } } private boolean isLiteral ( int token ) { return Scanner . isLiteral ( token ) ; } private boolean isRecoveredName ( char [ ] simpleName ) { return simpleName == RecoveryScanner . FAKE_IDENTIFIER ; } private boolean isRecoveredName ( char [ ] [ ] qualifiedName ) { if ( qualifiedName == null ) return false ; for ( int i = <NUM_LIT:0> ; i < qualifiedName . length ; i ++ ) { if ( qualifiedName [ i ] == RecoveryScanner . FAKE_IDENTIFIER ) return true ; } return false ; } public void javadocAmbiguousMethodReference ( int sourceStart , int sourceEnd , Binding fieldBinding , int modifiers ) { int severity = computeSeverity ( IProblem . JavadocAmbiguousMethodReference ) ; if ( severity == ProblemSeverities . Ignore ) return ; if ( javadocVisibility ( this . options . reportInvalidJavadocTagsVisibility , modifiers ) ) { String [ ] arguments = new String [ ] { new String ( fieldBinding . readableName ( ) ) } ; handle ( IProblem . JavadocAmbiguousMethodReference , arguments , arguments , severity , sourceStart , sourceEnd ) ; } } public void javadocDeprecatedField ( FieldBinding field , ASTNode location , int modifiers ) { int severity = computeSeverity ( IProblem . JavadocUsingDeprecatedField ) ; if ( severity == ProblemSeverities . Ignore ) return ; if ( javadocVisibility ( this . options . reportInvalidJavadocTagsVisibility , modifiers ) ) { this . handle ( IProblem . JavadocUsingDeprecatedField , new String [ ] { new String ( field . declaringClass . readableName ( ) ) , new String ( field . name ) } , new String [ ] { new String ( field . declaringClass . shortReadableName ( ) ) , new String ( field . name ) } , severity , nodeSourceStart ( field , location ) , nodeSourceEnd ( field , location ) ) ; } } public void javadocDeprecatedMethod ( MethodBinding method , ASTNode location , int modifiers ) { boolean isConstructor = method . isConstructor ( ) ; int severity = computeSeverity ( isConstructor ? IProblem . JavadocUsingDeprecatedConstructor : IProblem . JavadocUsingDeprecatedMethod ) ; if ( severity == ProblemSeverities . Ignore ) return ; if ( javadocVisibility ( this . options . reportInvalidJavadocTagsVisibility , modifiers ) ) { if ( isConstructor ) { this . handle ( IProblem . JavadocUsingDeprecatedConstructor , new String [ ] { new String ( method . declaringClass . readableName ( ) ) , typesAsString ( method , false ) } , new String [ ] { new String ( method . declaringClass . shortReadableName ( ) ) , typesAsString ( method , true ) } , severity , location . sourceStart , location . sourceEnd ) ; } else { this . handle ( IProblem . JavadocUsingDeprecatedMethod , new String [ ] { new String ( method . declaringClass . readableName ( ) ) , new String ( method . selector ) , typesAsString ( method , false ) } , new String [ ] { new String ( method . declaringClass . shortReadableName ( ) ) , new String ( method . selector ) , typesAsString ( method , true ) } , severity , location . sourceStart , location . sourceEnd ) ; } } } public void javadocDeprecatedType ( TypeBinding type , ASTNode location , int modifiers ) { javadocDeprecatedType ( type , location , modifiers , Integer . MAX_VALUE ) ; } public void javadocDeprecatedType ( TypeBinding type , ASTNode location , int modifiers , int index ) { if ( location == null ) return ; int severity = computeSeverity ( IProblem . JavadocUsingDeprecatedType ) ; if ( severity == ProblemSeverities . Ignore ) return ; if ( javadocVisibility ( this . options . reportInvalidJavadocTagsVisibility , modifiers ) ) { if ( type . isMemberType ( ) && type instanceof ReferenceBinding && ! javadocVisibility ( this . options . reportInvalidJavadocTagsVisibility , ( ( ReferenceBinding ) type ) . modifiers ) ) { this . handle ( IProblem . JavadocHiddenReference , NoArgument , NoArgument , location . sourceStart , location . sourceEnd ) ; } else { this . handle ( IProblem . JavadocUsingDeprecatedType , new String [ ] { new String ( type . readableName ( ) ) } , new String [ ] { new String ( type . shortReadableName ( ) ) } , severity , location . sourceStart , nodeSourceEnd ( null , location , index ) ) ; } } } public void javadocDuplicatedParamTag ( char [ ] token , int sourceStart , int sourceEnd , int modifiers ) { int severity = computeSeverity ( IProblem . JavadocDuplicateParamName ) ; if ( severity == ProblemSeverities . Ignore ) return ; if ( javadocVisibility ( this . options . reportInvalidJavadocTagsVisibility , modifiers ) ) { String [ ] arguments = new String [ ] { String . valueOf ( token ) } ; this . handle ( IProblem . JavadocDuplicateParamName , arguments , arguments , severity , sourceStart , sourceEnd ) ; } } public void javadocDuplicatedReturnTag ( int sourceStart , int sourceEnd ) { this . handle ( IProblem . JavadocDuplicateReturnTag , NoArgument , NoArgument , sourceStart , sourceEnd ) ; } public void javadocDuplicatedTag ( char [ ] tagName , int sourceStart , int sourceEnd ) { String [ ] arguments = new String [ ] { new String ( tagName ) } ; this . handle ( IProblem . JavadocDuplicateTag , arguments , arguments , sourceStart , sourceEnd ) ; } public void javadocDuplicatedThrowsClassName ( TypeReference typeReference , int modifiers ) { int severity = computeSeverity ( IProblem . JavadocDuplicateThrowsClassName ) ; if ( severity == ProblemSeverities . Ignore ) return ; if ( javadocVisibility ( this . options . reportInvalidJavadocTagsVisibility , modifiers ) ) { String [ ] arguments = new String [ ] { String . valueOf ( typeReference . resolvedType . sourceName ( ) ) } ; this . handle ( IProblem . JavadocDuplicateThrowsClassName , arguments , arguments , severity , typeReference . sourceStart , typeReference . sourceEnd ) ; } } public void javadocEmptyReturnTag ( int sourceStart , int sourceEnd , int modifiers ) { int severity = computeSeverity ( IProblem . JavadocEmptyReturnTag ) ; if ( severity == ProblemSeverities . Ignore ) return ; if ( javadocVisibility ( this . options . reportInvalidJavadocTagsVisibility , modifiers ) ) { String [ ] arguments = new String [ ] { new String ( JavadocTagConstants . TAG_RETURN ) } ; this . handle ( IProblem . JavadocEmptyReturnTag , arguments , arguments , sourceStart , sourceEnd ) ; } } public void javadocErrorNoMethodFor ( MessageSend messageSend , TypeBinding recType , TypeBinding [ ] params , int modifiers ) { int id = recType . isArrayType ( ) ? IProblem . JavadocNoMessageSendOnArrayType : IProblem . JavadocNoMessageSendOnBaseType ; int severity = computeSeverity ( id ) ; if ( severity == ProblemSeverities . Ignore ) return ; StringBuffer buffer = new StringBuffer ( ) ; StringBuffer shortBuffer = new StringBuffer ( ) ; for ( int i = <NUM_LIT:0> , length = params . length ; i < length ; i ++ ) { if ( i != <NUM_LIT:0> ) { buffer . append ( "<STR_LIT:U+002CU+0020>" ) ; shortBuffer . append ( "<STR_LIT:U+002CU+0020>" ) ; } buffer . append ( new String ( params [ i ] . readableName ( ) ) ) ; shortBuffer . append ( new String ( params [ i ] . shortReadableName ( ) ) ) ; } if ( javadocVisibility ( this . options . reportInvalidJavadocTagsVisibility , modifiers ) ) { this . handle ( id , new String [ ] { new String ( recType . readableName ( ) ) , new String ( messageSend . selector ) , buffer . toString ( ) } , new String [ ] { new String ( recType . shortReadableName ( ) ) , new String ( messageSend . selector ) , shortBuffer . toString ( ) } , severity , messageSend . sourceStart , messageSend . sourceEnd ) ; } } public void javadocHiddenReference ( int sourceStart , int sourceEnd , Scope scope , int modifiers ) { Scope currentScope = scope ; while ( currentScope . parent . kind != Scope . COMPILATION_UNIT_SCOPE ) { if ( ! javadocVisibility ( this . options . reportInvalidJavadocTagsVisibility , currentScope . getDeclarationModifiers ( ) ) ) { return ; } currentScope = currentScope . parent ; } String [ ] arguments = new String [ ] { this . options . getVisibilityString ( this . options . reportInvalidJavadocTagsVisibility ) , this . options . getVisibilityString ( modifiers ) } ; this . handle ( IProblem . JavadocHiddenReference , arguments , arguments , sourceStart , sourceEnd ) ; } public void javadocInvalidConstructor ( Statement statement , MethodBinding targetConstructor , int modifiers ) { if ( ! javadocVisibility ( this . options . reportInvalidJavadocTagsVisibility , modifiers ) ) return ; int sourceStart = statement . sourceStart ; int sourceEnd = statement . sourceEnd ; if ( statement instanceof AllocationExpression ) { AllocationExpression allocation = ( AllocationExpression ) statement ; if ( allocation . enumConstant != null ) { sourceStart = allocation . enumConstant . sourceStart ; sourceEnd = allocation . enumConstant . sourceEnd ; } } int id = IProblem . JavadocUndefinedConstructor ; ProblemMethodBinding problemConstructor = null ; MethodBinding shownConstructor = null ; switch ( targetConstructor . problemId ( ) ) { case ProblemReasons . NotFound : id = IProblem . JavadocUndefinedConstructor ; break ; case ProblemReasons . NotVisible : id = IProblem . JavadocNotVisibleConstructor ; break ; case ProblemReasons . Ambiguous : id = IProblem . JavadocAmbiguousConstructor ; break ; case ProblemReasons . ParameterBoundMismatch : int severity = computeSeverity ( IProblem . JavadocGenericConstructorTypeArgumentMismatch ) ; if ( severity == ProblemSeverities . Ignore ) return ; problemConstructor = ( ProblemMethodBinding ) targetConstructor ; ParameterizedGenericMethodBinding substitutedConstructor = ( ParameterizedGenericMethodBinding ) problemConstructor . closestMatch ; shownConstructor = substitutedConstructor . original ( ) ; int augmentedLength = problemConstructor . parameters . length ; TypeBinding inferredTypeArgument = problemConstructor . parameters [ augmentedLength - <NUM_LIT:2> ] ; TypeVariableBinding typeParameter = ( TypeVariableBinding ) problemConstructor . parameters [ augmentedLength - <NUM_LIT:1> ] ; TypeBinding [ ] invocationArguments = new TypeBinding [ augmentedLength - <NUM_LIT:2> ] ; System . arraycopy ( problemConstructor . parameters , <NUM_LIT:0> , invocationArguments , <NUM_LIT:0> , augmentedLength - <NUM_LIT:2> ) ; this . handle ( IProblem . JavadocGenericConstructorTypeArgumentMismatch , new String [ ] { new String ( shownConstructor . declaringClass . sourceName ( ) ) , typesAsString ( shownConstructor , false ) , new String ( shownConstructor . declaringClass . readableName ( ) ) , typesAsString ( invocationArguments , false ) , new String ( inferredTypeArgument . readableName ( ) ) , new String ( typeParameter . sourceName ) , parameterBoundAsString ( typeParameter , false ) } , new String [ ] { new String ( shownConstructor . declaringClass . sourceName ( ) ) , typesAsString ( shownConstructor , true ) , new String ( shownConstructor . declaringClass . shortReadableName ( ) ) , typesAsString ( invocationArguments , true ) , new String ( inferredTypeArgument . shortReadableName ( ) ) , new String ( typeParameter . sourceName ) , parameterBoundAsString ( typeParameter , true ) } , severity , sourceStart , sourceEnd ) ; return ; case ProblemReasons . TypeParameterArityMismatch : problemConstructor = ( ProblemMethodBinding ) targetConstructor ; shownConstructor = problemConstructor . closestMatch ; boolean noTypeVariables = shownConstructor . typeVariables == Binding . NO_TYPE_VARIABLES ; severity = computeSeverity ( noTypeVariables ? IProblem . JavadocNonGenericConstructor : IProblem . JavadocIncorrectArityForParameterizedConstructor ) ; if ( severity == ProblemSeverities . Ignore ) return ; if ( noTypeVariables ) { this . handle ( IProblem . JavadocNonGenericConstructor , new String [ ] { new String ( shownConstructor . declaringClass . sourceName ( ) ) , typesAsString ( shownConstructor , false ) , new String ( shownConstructor . declaringClass . readableName ( ) ) , typesAsString ( targetConstructor , false ) } , new String [ ] { new String ( shownConstructor . declaringClass . sourceName ( ) ) , typesAsString ( shownConstructor , true ) , new String ( shownConstructor . declaringClass . shortReadableName ( ) ) , typesAsString ( targetConstructor , true ) } , severity , sourceStart , sourceEnd ) ; } else { this . handle ( IProblem . JavadocIncorrectArityForParameterizedConstructor , new String [ ] { new String ( shownConstructor . declaringClass . sourceName ( ) ) , typesAsString ( shownConstructor , false ) , new String ( shownConstructor . declaringClass . readableName ( ) ) , typesAsString ( shownConstructor . typeVariables , false ) , typesAsString ( targetConstructor , false ) } , new String [ ] { new String ( shownConstructor . declaringClass . sourceName ( ) ) , typesAsString ( shownConstructor , true ) , new String ( shownConstructor . declaringClass . shortReadableName ( ) ) , typesAsString ( shownConstructor . typeVariables , true ) , typesAsString ( targetConstructor , true ) } , severity , sourceStart , sourceEnd ) ; } return ; case ProblemReasons . ParameterizedMethodTypeMismatch : severity = computeSeverity ( IProblem . JavadocParameterizedConstructorArgumentTypeMismatch ) ; if ( severity == ProblemSeverities . Ignore ) return ; problemConstructor = ( ProblemMethodBinding ) targetConstructor ; shownConstructor = problemConstructor . closestMatch ; this . handle ( IProblem . JavadocParameterizedConstructorArgumentTypeMismatch , new String [ ] { new String ( shownConstructor . declaringClass . sourceName ( ) ) , typesAsString ( shownConstructor , false ) , new String ( shownConstructor . declaringClass . readableName ( ) ) , typesAsString ( ( ( ParameterizedGenericMethodBinding ) shownConstructor ) . typeArguments , false ) , typesAsString ( targetConstructor , false ) } , new String [ ] { new String ( shownConstructor . declaringClass . sourceName ( ) ) , typesAsString ( shownConstructor , true ) , new String ( shownConstructor . declaringClass . shortReadableName ( ) ) , typesAsString ( ( ( ParameterizedGenericMethodBinding ) shownConstructor ) . typeArguments , true ) , typesAsString ( targetConstructor , true ) } , severity , sourceStart , sourceEnd ) ; return ; case ProblemReasons . TypeArgumentsForRawGenericMethod : severity = computeSeverity ( IProblem . JavadocTypeArgumentsForRawGenericConstructor ) ; if ( severity == ProblemSeverities . Ignore ) return ; problemConstructor = ( ProblemMethodBinding ) targetConstructor ; shownConstructor = problemConstructor . closestMatch ; this . handle ( IProblem . JavadocTypeArgumentsForRawGenericConstructor , new String [ ] { new String ( shownConstructor . declaringClass . sourceName ( ) ) , typesAsString ( shownConstructor , false ) , new String ( shownConstructor . declaringClass . readableName ( ) ) , typesAsString ( targetConstructor , false ) } , new String [ ] { new String ( shownConstructor . declaringClass . sourceName ( ) ) , typesAsString ( shownConstructor , true ) , new String ( shownConstructor . declaringClass . shortReadableName ( ) ) , typesAsString ( targetConstructor , true ) } , severity , sourceStart , sourceEnd ) ; return ; case ProblemReasons . NoError : default : needImplementation ( statement ) ; break ; } int severity = computeSeverity ( id ) ; if ( severity == ProblemSeverities . Ignore ) return ; this . handle ( id , new String [ ] { new String ( targetConstructor . declaringClass . readableName ( ) ) , typesAsString ( targetConstructor , false ) } , new String [ ] { new String ( targetConstructor . declaringClass . shortReadableName ( ) ) , typesAsString ( targetConstructor , true ) } , severity , statement . sourceStart , statement . sourceEnd ) ; } public void javadocInvalidField ( FieldReference fieldRef , Binding fieldBinding , TypeBinding searchedType , int modifiers ) { int id = IProblem . JavadocUndefinedField ; switch ( fieldBinding . problemId ( ) ) { case ProblemReasons . NotFound : id = IProblem . JavadocUndefinedField ; break ; case ProblemReasons . NotVisible : id = IProblem . JavadocNotVisibleField ; break ; case ProblemReasons . Ambiguous : id = IProblem . JavadocAmbiguousField ; break ; case ProblemReasons . NoError : default : needImplementation ( fieldRef ) ; break ; } int severity = computeSeverity ( id ) ; if ( severity == ProblemSeverities . Ignore ) return ; if ( javadocVisibility ( this . options . reportInvalidJavadocTagsVisibility , modifiers ) ) { String [ ] arguments = new String [ ] { new String ( fieldBinding . readableName ( ) ) } ; handle ( id , arguments , arguments , severity , fieldRef . sourceStart , fieldRef . sourceEnd ) ; } } public void javadocInvalidMemberTypeQualification ( int sourceStart , int sourceEnd , int modifiers ) { if ( javadocVisibility ( this . options . reportInvalidJavadocTagsVisibility , modifiers ) ) { this . handle ( IProblem . JavadocInvalidMemberTypeQualification , NoArgument , NoArgument , sourceStart , sourceEnd ) ; } } public void javadocInvalidMethod ( MessageSend messageSend , MethodBinding method , int modifiers ) { if ( ! javadocVisibility ( this . options . reportInvalidJavadocTagsVisibility , modifiers ) ) return ; ProblemMethodBinding problemMethod = null ; MethodBinding shownMethod = null ; int id = IProblem . JavadocUndefinedMethod ; switch ( method . problemId ( ) ) { case ProblemReasons . NotFound : id = IProblem . JavadocUndefinedMethod ; problemMethod = ( ProblemMethodBinding ) method ; if ( problemMethod . closestMatch != null ) { int severity = computeSeverity ( IProblem . JavadocParameterMismatch ) ; if ( severity == ProblemSeverities . Ignore ) return ; String closestParameterTypeNames = typesAsString ( problemMethod . closestMatch , false ) ; String parameterTypeNames = typesAsString ( method , false ) ; String closestParameterTypeShortNames = typesAsString ( problemMethod . closestMatch , true ) ; String parameterTypeShortNames = typesAsString ( method , true ) ; if ( closestParameterTypeShortNames . equals ( parameterTypeShortNames ) ) { closestParameterTypeShortNames = closestParameterTypeNames ; parameterTypeShortNames = parameterTypeNames ; } this . handle ( IProblem . JavadocParameterMismatch , new String [ ] { new String ( problemMethod . closestMatch . declaringClass . readableName ( ) ) , new String ( problemMethod . closestMatch . selector ) , closestParameterTypeNames , parameterTypeNames } , new String [ ] { new String ( problemMethod . closestMatch . declaringClass . shortReadableName ( ) ) , new String ( problemMethod . closestMatch . selector ) , closestParameterTypeShortNames , parameterTypeShortNames } , severity , ( int ) ( messageSend . nameSourcePosition > > > <NUM_LIT:32> ) , ( int ) messageSend . nameSourcePosition ) ; return ; } break ; case ProblemReasons . NotVisible : id = IProblem . JavadocNotVisibleMethod ; break ; case ProblemReasons . Ambiguous : id = IProblem . JavadocAmbiguousMethod ; break ; case ProblemReasons . ParameterBoundMismatch : int severity = computeSeverity ( IProblem . JavadocGenericMethodTypeArgumentMismatch ) ; if ( severity == ProblemSeverities . Ignore ) return ; problemMethod = ( ProblemMethodBinding ) method ; ParameterizedGenericMethodBinding substitutedMethod = ( ParameterizedGenericMethodBinding ) problemMethod . closestMatch ; shownMethod = substitutedMethod . original ( ) ; int augmentedLength = problemMethod . parameters . length ; TypeBinding inferredTypeArgument = problemMethod . parameters [ augmentedLength - <NUM_LIT:2> ] ; TypeVariableBinding typeParameter = ( TypeVariableBinding ) problemMethod . parameters [ augmentedLength - <NUM_LIT:1> ] ; TypeBinding [ ] invocationArguments = new TypeBinding [ augmentedLength - <NUM_LIT:2> ] ; System . arraycopy ( problemMethod . parameters , <NUM_LIT:0> , invocationArguments , <NUM_LIT:0> , augmentedLength - <NUM_LIT:2> ) ; this . handle ( IProblem . JavadocGenericMethodTypeArgumentMismatch , new String [ ] { new String ( shownMethod . selector ) , typesAsString ( shownMethod , false ) , new String ( shownMethod . declaringClass . readableName ( ) ) , typesAsString ( invocationArguments , false ) , new String ( inferredTypeArgument . readableName ( ) ) , new String ( typeParameter . sourceName ) , parameterBoundAsString ( typeParameter , false ) } , new String [ ] { new String ( shownMethod . selector ) , typesAsString ( shownMethod , true ) , new String ( shownMethod . declaringClass . shortReadableName ( ) ) , typesAsString ( invocationArguments , true ) , new String ( inferredTypeArgument . shortReadableName ( ) ) , new String ( typeParameter . sourceName ) , parameterBoundAsString ( typeParameter , true ) } , severity , ( int ) ( messageSend . nameSourcePosition > > > <NUM_LIT:32> ) , ( int ) messageSend . nameSourcePosition ) ; return ; case ProblemReasons . TypeParameterArityMismatch : problemMethod = ( ProblemMethodBinding ) method ; shownMethod = problemMethod . closestMatch ; boolean noTypeVariables = shownMethod . typeVariables == Binding . NO_TYPE_VARIABLES ; severity = computeSeverity ( noTypeVariables ? IProblem . JavadocNonGenericMethod : IProblem . JavadocIncorrectArityForParameterizedMethod ) ; if ( severity == ProblemSeverities . Ignore ) return ; if ( noTypeVariables ) { this . handle ( IProblem . JavadocNonGenericMethod , new String [ ] { new String ( shownMethod . selector ) , typesAsString ( shownMethod , false ) , new String ( shownMethod . declaringClass . readableName ( ) ) , typesAsString ( method , false ) } , new String [ ] { new String ( shownMethod . selector ) , typesAsString ( shownMethod , true ) , new String ( shownMethod . declaringClass . shortReadableName ( ) ) , typesAsString ( method , true ) } , severity , ( int ) ( messageSend . nameSourcePosition > > > <NUM_LIT:32> ) , ( int ) messageSend . nameSourcePosition ) ; } else { this . handle ( IProblem . JavadocIncorrectArityForParameterizedMethod , new String [ ] { new String ( shownMethod . selector ) , typesAsString ( shownMethod , false ) , new String ( shownMethod . declaringClass . readableName ( ) ) , typesAsString ( shownMethod . typeVariables , false ) , typesAsString ( method , false ) } , new String [ ] { new String ( shownMethod . selector ) , typesAsString ( shownMethod , true ) , new String ( shownMethod . declaringClass . shortReadableName ( ) ) , typesAsString ( shownMethod . typeVariables , true ) , typesAsString ( method , true ) } , severity , ( int ) ( messageSend . nameSourcePosition > > > <NUM_LIT:32> ) , ( int ) messageSend . nameSourcePosition ) ; } return ; case ProblemReasons . ParameterizedMethodTypeMismatch : severity = computeSeverity ( IProblem . JavadocParameterizedMethodArgumentTypeMismatch ) ; if ( severity == ProblemSeverities . Ignore ) return ; problemMethod = ( ProblemMethodBinding ) method ; shownMethod = problemMethod . closestMatch ; this . handle ( IProblem . JavadocParameterizedMethodArgumentTypeMismatch , new String [ ] { new String ( shownMethod . selector ) , typesAsString ( shownMethod , false ) , new String ( shownMethod . declaringClass . readableName ( ) ) , typesAsString ( ( ( ParameterizedGenericMethodBinding ) shownMethod ) . typeArguments , false ) , typesAsString ( method , false ) } , new String [ ] { new String ( shownMethod . selector ) , typesAsString ( shownMethod , true ) , new String ( shownMethod . declaringClass . shortReadableName ( ) ) , typesAsString ( ( ( ParameterizedGenericMethodBinding ) shownMethod ) . typeArguments , true ) , typesAsString ( method , true ) } , severity , ( int ) ( messageSend . nameSourcePosition > > > <NUM_LIT:32> ) , ( int ) messageSend . nameSourcePosition ) ; return ; case ProblemReasons . TypeArgumentsForRawGenericMethod : severity = computeSeverity ( IProblem . JavadocTypeArgumentsForRawGenericMethod ) ; if ( severity == ProblemSeverities . Ignore ) return ; problemMethod = ( ProblemMethodBinding ) method ; shownMethod = problemMethod . closestMatch ; this . handle ( IProblem . JavadocTypeArgumentsForRawGenericMethod , new String [ ] { new String ( shownMethod . selector ) , typesAsString ( shownMethod , false ) , new String ( shownMethod . declaringClass . readableName ( ) ) , typesAsString ( method , false ) } , new String [ ] { new String ( shownMethod . selector ) , typesAsString ( shownMethod , true ) , new String ( shownMethod . declaringClass . shortReadableName ( ) ) , typesAsString ( method , true ) } , severity , ( int ) ( messageSend . nameSourcePosition > > > <NUM_LIT:32> ) , ( int ) messageSend . nameSourcePosition ) ; return ; case ProblemReasons . NoError : default : needImplementation ( messageSend ) ; break ; } int severity = computeSeverity ( id ) ; if ( severity == ProblemSeverities . Ignore ) return ; this . handle ( id , new String [ ] { new String ( method . declaringClass . readableName ( ) ) , new String ( method . selector ) , typesAsString ( method , false ) } , new String [ ] { new String ( method . declaringClass . shortReadableName ( ) ) , new String ( method . selector ) , typesAsString ( method , true ) } , severity , ( int ) ( messageSend . nameSourcePosition > > > <NUM_LIT:32> ) , ( int ) messageSend . nameSourcePosition ) ; } public void javadocInvalidParamTagName ( int sourceStart , int sourceEnd ) { this . handle ( IProblem . JavadocInvalidParamTagName , NoArgument , NoArgument , sourceStart , sourceEnd ) ; } public void javadocInvalidParamTypeParameter ( int sourceStart , int sourceEnd ) { this . handle ( IProblem . JavadocInvalidParamTagTypeParameter , NoArgument , NoArgument , sourceStart , sourceEnd ) ; } public void javadocInvalidReference ( int sourceStart , int sourceEnd ) { this . handle ( IProblem . JavadocInvalidSeeReference , NoArgument , NoArgument , sourceStart , sourceEnd ) ; } public void javadocInvalidSeeHref ( int sourceStart , int sourceEnd ) { this . handle ( IProblem . JavadocInvalidSeeHref , NoArgument , NoArgument , sourceStart , sourceEnd ) ; } public void javadocInvalidSeeReferenceArgs ( int sourceStart , int sourceEnd ) { this . handle ( IProblem . JavadocInvalidSeeArgs , NoArgument , NoArgument , sourceStart , sourceEnd ) ; } public void javadocInvalidSeeUrlReference ( int sourceStart , int sourceEnd ) { this . handle ( IProblem . JavadocInvalidSeeUrlReference , NoArgument , NoArgument , sourceStart , sourceEnd ) ; } public void javadocInvalidTag ( int sourceStart , int sourceEnd ) { this . handle ( IProblem . JavadocInvalidTag , NoArgument , NoArgument , sourceStart , sourceEnd ) ; } public void javadocInvalidThrowsClass ( int sourceStart , int sourceEnd ) { this . handle ( IProblem . JavadocInvalidThrowsClass , NoArgument , NoArgument , sourceStart , sourceEnd ) ; } public void javadocInvalidThrowsClassName ( TypeReference typeReference , int modifiers ) { int severity = computeSeverity ( IProblem . JavadocInvalidThrowsClassName ) ; if ( severity == ProblemSeverities . Ignore ) return ; if ( javadocVisibility ( this . options . reportInvalidJavadocTagsVisibility , modifiers ) ) { String [ ] arguments = new String [ ] { String . valueOf ( typeReference . resolvedType . sourceName ( ) ) } ; this . handle ( IProblem . JavadocInvalidThrowsClassName , arguments , arguments , severity , typeReference . sourceStart , typeReference . sourceEnd ) ; } } public void javadocInvalidType ( ASTNode location , TypeBinding type , int modifiers ) { if ( javadocVisibility ( this . options . reportInvalidJavadocTagsVisibility , modifiers ) ) { int id = IProblem . JavadocUndefinedType ; switch ( type . problemId ( ) ) { case ProblemReasons . NotFound : id = IProblem . JavadocUndefinedType ; break ; case ProblemReasons . NotVisible : id = IProblem . JavadocNotVisibleType ; break ; case ProblemReasons . Ambiguous : id = IProblem . JavadocAmbiguousType ; break ; case ProblemReasons . InternalNameProvided : id = IProblem . JavadocInternalTypeNameProvided ; break ; case ProblemReasons . InheritedNameHidesEnclosingName : id = IProblem . JavadocInheritedNameHidesEnclosingTypeName ; break ; case ProblemReasons . NonStaticReferenceInStaticContext : id = IProblem . JavadocNonStaticTypeFromStaticInvocation ; break ; case ProblemReasons . NoError : default : needImplementation ( location ) ; break ; } int severity = computeSeverity ( id ) ; if ( severity == ProblemSeverities . Ignore ) return ; this . handle ( id , new String [ ] { new String ( type . readableName ( ) ) } , new String [ ] { new String ( type . shortReadableName ( ) ) } , severity , location . sourceStart , location . sourceEnd ) ; } } public void javadocInvalidValueReference ( int sourceStart , int sourceEnd , int modifiers ) { if ( javadocVisibility ( this . options . reportInvalidJavadocTagsVisibility , modifiers ) ) this . handle ( IProblem . JavadocInvalidValueReference , NoArgument , NoArgument , sourceStart , sourceEnd ) ; } public void javadocMalformedSeeReference ( int sourceStart , int sourceEnd ) { this . handle ( IProblem . JavadocMalformedSeeReference , NoArgument , NoArgument , sourceStart , sourceEnd ) ; } public void javadocMissing ( int sourceStart , int sourceEnd , int modifiers ) { int severity = computeSeverity ( IProblem . JavadocMissing ) ; this . javadocMissing ( sourceStart , sourceEnd , severity , modifiers ) ; } public void javadocMissing ( int sourceStart , int sourceEnd , int severity , int modifiers ) { if ( severity == ProblemSeverities . Ignore ) return ; boolean overriding = ( modifiers & ( ExtraCompilerModifiers . AccImplementing | ExtraCompilerModifiers . AccOverriding ) ) != <NUM_LIT:0> ; boolean report = ( this . options . getSeverity ( CompilerOptions . MissingJavadocComments ) != ProblemSeverities . Ignore ) && ( ! overriding || this . options . reportMissingJavadocCommentsOverriding ) ; if ( report ) { String arg = javadocVisibilityArgument ( this . options . reportMissingJavadocCommentsVisibility , modifiers ) ; if ( arg != null ) { String [ ] arguments = new String [ ] { arg } ; this . handle ( IProblem . JavadocMissing , arguments , arguments , severity , sourceStart , sourceEnd ) ; } } } public void javadocMissingHashCharacter ( int sourceStart , int sourceEnd , String ref ) { int severity = computeSeverity ( IProblem . JavadocMissingHashCharacter ) ; if ( severity == ProblemSeverities . Ignore ) return ; String [ ] arguments = new String [ ] { ref } ; this . handle ( IProblem . JavadocMissingHashCharacter , arguments , arguments , severity , sourceStart , sourceEnd ) ; } public void javadocMissingIdentifier ( int sourceStart , int sourceEnd , int modifiers ) { if ( javadocVisibility ( this . options . reportInvalidJavadocTagsVisibility , modifiers ) ) this . handle ( IProblem . JavadocMissingIdentifier , NoArgument , NoArgument , sourceStart , sourceEnd ) ; } public void javadocMissingParamName ( int sourceStart , int sourceEnd , int modifiers ) { if ( javadocVisibility ( this . options . reportInvalidJavadocTagsVisibility , modifiers ) ) this . handle ( IProblem . JavadocMissingParamName , NoArgument , NoArgument , sourceStart , sourceEnd ) ; } public void javadocMissingParamTag ( char [ ] name , int sourceStart , int sourceEnd , int modifiers ) { int severity = computeSeverity ( IProblem . JavadocMissingParamTag ) ; if ( severity == ProblemSeverities . Ignore ) return ; boolean overriding = ( modifiers & ( ExtraCompilerModifiers . AccImplementing | ExtraCompilerModifiers . AccOverriding ) ) != <NUM_LIT:0> ; boolean report = ( this . options . getSeverity ( CompilerOptions . MissingJavadocTags ) != ProblemSeverities . Ignore ) && ( ! overriding || this . options . reportMissingJavadocTagsOverriding ) ; if ( report && javadocVisibility ( this . options . reportMissingJavadocTagsVisibility , modifiers ) ) { String [ ] arguments = new String [ ] { String . valueOf ( name ) } ; this . handle ( IProblem . JavadocMissingParamTag , arguments , arguments , severity , sourceStart , sourceEnd ) ; } } public void javadocMissingReference ( int sourceStart , int sourceEnd , int modifiers ) { if ( javadocVisibility ( this . options . reportInvalidJavadocTagsVisibility , modifiers ) ) this . handle ( IProblem . JavadocMissingSeeReference , NoArgument , NoArgument , sourceStart , sourceEnd ) ; } public void javadocMissingReturnTag ( int sourceStart , int sourceEnd , int modifiers ) { boolean overriding = ( modifiers & ( ExtraCompilerModifiers . AccImplementing | ExtraCompilerModifiers . AccOverriding ) ) != <NUM_LIT:0> ; boolean report = ( this . options . getSeverity ( CompilerOptions . MissingJavadocTags ) != ProblemSeverities . Ignore ) && ( ! overriding || this . options . reportMissingJavadocTagsOverriding ) ; if ( report && javadocVisibility ( this . options . reportMissingJavadocTagsVisibility , modifiers ) ) { this . handle ( IProblem . JavadocMissingReturnTag , NoArgument , NoArgument , sourceStart , sourceEnd ) ; } } public void javadocMissingTagDescription ( char [ ] tokenName , int sourceStart , int sourceEnd , int modifiers ) { int severity = computeSeverity ( IProblem . JavadocMissingTagDescription ) ; if ( severity == ProblemSeverities . Ignore ) return ; if ( javadocVisibility ( this . options . reportInvalidJavadocTagsVisibility , modifiers ) ) { String [ ] arguments = new String [ ] { new String ( tokenName ) } ; this . handle ( IProblem . JavadocEmptyReturnTag , arguments , arguments , sourceStart , sourceEnd ) ; } } public void javadocMissingTagDescriptionAfterReference ( int sourceStart , int sourceEnd , int modifiers ) { int severity = computeSeverity ( IProblem . JavadocMissingTagDescription ) ; if ( severity == ProblemSeverities . Ignore ) return ; if ( javadocVisibility ( this . options . reportInvalidJavadocTagsVisibility , modifiers ) ) { this . handle ( IProblem . JavadocMissingTagDescription , NoArgument , NoArgument , severity , sourceStart , sourceEnd ) ; } } public void javadocMissingThrowsClassName ( int sourceStart , int sourceEnd , int modifiers ) { if ( javadocVisibility ( this . options . reportInvalidJavadocTagsVisibility , modifiers ) ) { this . handle ( IProblem . JavadocMissingThrowsClassName , NoArgument , NoArgument , sourceStart , sourceEnd ) ; } } public void javadocMissingThrowsTag ( TypeReference typeRef , int modifiers ) { int severity = computeSeverity ( IProblem . JavadocMissingThrowsTag ) ; if ( severity == ProblemSeverities . Ignore ) return ; boolean overriding = ( modifiers & ( ExtraCompilerModifiers . AccImplementing | ExtraCompilerModifiers . AccOverriding ) ) != <NUM_LIT:0> ; boolean report = ( this . options . getSeverity ( CompilerOptions . MissingJavadocTags ) != ProblemSeverities . Ignore ) && ( ! overriding || this . options . reportMissingJavadocTagsOverriding ) ; if ( report && javadocVisibility ( this . options . reportMissingJavadocTagsVisibility , modifiers ) ) { String [ ] arguments = new String [ ] { String . valueOf ( typeRef . resolvedType . sourceName ( ) ) } ; this . handle ( IProblem . JavadocMissingThrowsTag , arguments , arguments , severity , typeRef . sourceStart , typeRef . sourceEnd ) ; } } public void javadocUndeclaredParamTagName ( char [ ] token , int sourceStart , int sourceEnd , int modifiers ) { int severity = computeSeverity ( IProblem . JavadocInvalidParamName ) ; if ( severity == ProblemSeverities . Ignore ) return ; if ( javadocVisibility ( this . options . reportInvalidJavadocTagsVisibility , modifiers ) ) { String [ ] arguments = new String [ ] { String . valueOf ( token ) } ; this . handle ( IProblem . JavadocInvalidParamName , arguments , arguments , severity , sourceStart , sourceEnd ) ; } } public void javadocUnexpectedTag ( int sourceStart , int sourceEnd ) { this . handle ( IProblem . JavadocUnexpectedTag , NoArgument , NoArgument , sourceStart , sourceEnd ) ; } public void javadocUnexpectedText ( int sourceStart , int sourceEnd ) { this . handle ( IProblem . JavadocUnexpectedText , NoArgument , NoArgument , sourceStart , sourceEnd ) ; } public void javadocUnterminatedInlineTag ( int sourceStart , int sourceEnd ) { this . handle ( IProblem . JavadocUnterminatedInlineTag , NoArgument , NoArgument , sourceStart , sourceEnd ) ; } private boolean javadocVisibility ( int visibility , int modifiers ) { if ( modifiers < <NUM_LIT:0> ) return true ; switch ( modifiers & ExtraCompilerModifiers . AccVisibilityMASK ) { case ClassFileConstants . AccPublic : return true ; case ClassFileConstants . AccProtected : return ( visibility != ClassFileConstants . AccPublic ) ; case ClassFileConstants . AccDefault : return ( visibility == ClassFileConstants . AccDefault || visibility == ClassFileConstants . AccPrivate ) ; case ClassFileConstants . AccPrivate : return ( visibility == ClassFileConstants . AccPrivate ) ; } return true ; } private String javadocVisibilityArgument ( int visibility , int modifiers ) { String argument = null ; switch ( modifiers & ExtraCompilerModifiers . AccVisibilityMASK ) { case ClassFileConstants . AccPublic : argument = CompilerOptions . PUBLIC ; break ; case ClassFileConstants . AccProtected : if ( visibility != ClassFileConstants . AccPublic ) { argument = CompilerOptions . PROTECTED ; } break ; case ClassFileConstants . AccDefault : if ( visibility == ClassFileConstants . AccDefault || visibility == ClassFileConstants . AccPrivate ) { argument = CompilerOptions . DEFAULT ; } break ; case ClassFileConstants . AccPrivate : if ( visibility == ClassFileConstants . AccPrivate ) { argument = CompilerOptions . PRIVATE ; } break ; } return argument ; } public void localVariableHiding ( LocalDeclaration local , Binding hiddenVariable , boolean isSpecialArgHidingField ) { if ( hiddenVariable instanceof LocalVariableBinding ) { int id = ( local instanceof Argument ) ? IProblem . ArgumentHidingLocalVariable : IProblem . LocalVariableHidingLocalVariable ; int severity = computeSeverity ( id ) ; if ( severity == ProblemSeverities . Ignore ) return ; String [ ] arguments = new String [ ] { new String ( local . name ) } ; this . handle ( id , arguments , arguments , severity , nodeSourceStart ( hiddenVariable , local ) , nodeSourceEnd ( hiddenVariable , local ) ) ; } else if ( hiddenVariable instanceof FieldBinding ) { if ( isSpecialArgHidingField && ! this . options . reportSpecialParameterHidingField ) { return ; } int id = ( local instanceof Argument ) ? IProblem . ArgumentHidingField : IProblem . LocalVariableHidingField ; int severity = computeSeverity ( id ) ; if ( severity == ProblemSeverities . Ignore ) return ; FieldBinding field = ( FieldBinding ) hiddenVariable ; this . handle ( id , new String [ ] { new String ( local . name ) , new String ( field . declaringClass . readableName ( ) ) } , new String [ ] { new String ( local . name ) , new String ( field . declaringClass . shortReadableName ( ) ) } , severity , local . sourceStart , local . sourceEnd ) ; } } public void localVariableNonNullComparedToNull ( LocalVariableBinding local , ASTNode location ) { int severity = computeSeverity ( IProblem . NonNullLocalVariableComparisonYieldsFalse ) ; if ( severity == ProblemSeverities . Ignore ) return ; String [ ] arguments ; int problemId ; if ( local . isNonNull ( ) ) { char [ ] [ ] annotationName = this . options . nonNullAnnotationName ; arguments = new String [ ] { new String ( local . name ) , new String ( annotationName [ annotationName . length - <NUM_LIT:1> ] ) } ; problemId = IProblem . SpecdNonNullLocalVariableComparisonYieldsFalse ; } else { arguments = new String [ ] { new String ( local . name ) } ; problemId = IProblem . NonNullLocalVariableComparisonYieldsFalse ; } this . handle ( problemId , arguments , arguments , severity , nodeSourceStart ( local , location ) , nodeSourceEnd ( local , location ) ) ; } public void localVariableNullComparedToNonNull ( LocalVariableBinding local , ASTNode location ) { int severity = computeSeverity ( IProblem . NullLocalVariableComparisonYieldsFalse ) ; if ( severity == ProblemSeverities . Ignore ) return ; String [ ] arguments = new String [ ] { new String ( local . name ) } ; this . handle ( IProblem . NullLocalVariableComparisonYieldsFalse , arguments , arguments , severity , nodeSourceStart ( local , location ) , nodeSourceEnd ( local , location ) ) ; } public void localVariableNullInstanceof ( LocalVariableBinding local , ASTNode location ) { int severity = computeSeverity ( IProblem . NullLocalVariableInstanceofYieldsFalse ) ; if ( severity == ProblemSeverities . Ignore ) return ; String [ ] arguments = new String [ ] { new String ( local . name ) } ; this . handle ( IProblem . NullLocalVariableInstanceofYieldsFalse , arguments , arguments , severity , nodeSourceStart ( local , location ) , nodeSourceEnd ( local , location ) ) ; } public void localVariableNullReference ( LocalVariableBinding local , ASTNode location ) { int severity = computeSeverity ( IProblem . NullLocalVariableReference ) ; if ( severity == ProblemSeverities . Ignore ) return ; String [ ] arguments = new String [ ] { new String ( local . name ) } ; this . handle ( IProblem . NullLocalVariableReference , arguments , arguments , severity , nodeSourceStart ( local , location ) , nodeSourceEnd ( local , location ) ) ; } public void localVariablePotentialNullReference ( LocalVariableBinding local , ASTNode location ) { int severity = computeSeverity ( IProblem . PotentialNullLocalVariableReference ) ; if ( severity == ProblemSeverities . Ignore ) return ; String [ ] arguments = new String [ ] { new String ( local . name ) } ; this . handle ( IProblem . PotentialNullLocalVariableReference , arguments , arguments , severity , nodeSourceStart ( local , location ) , nodeSourceEnd ( local , location ) ) ; } public void localVariableRedundantCheckOnNonNull ( LocalVariableBinding local , ASTNode location ) { int severity = computeSeverity ( IProblem . RedundantNullCheckOnNonNullLocalVariable ) ; if ( severity == ProblemSeverities . Ignore ) return ; String [ ] arguments ; int problemId ; if ( local . isNonNull ( ) ) { char [ ] [ ] annotationName = this . options . nonNullAnnotationName ; arguments = new String [ ] { new String ( local . name ) , new String ( annotationName [ annotationName . length - <NUM_LIT:1> ] ) } ; problemId = IProblem . RedundantNullCheckOnSpecdNonNullLocalVariable ; } else { arguments = new String [ ] { new String ( local . name ) } ; problemId = IProblem . RedundantNullCheckOnNonNullLocalVariable ; } this . handle ( problemId , arguments , arguments , severity , nodeSourceStart ( local , location ) , nodeSourceEnd ( local , location ) ) ; } public void localVariableRedundantCheckOnNull ( LocalVariableBinding local , ASTNode location ) { int severity = computeSeverity ( IProblem . RedundantNullCheckOnNullLocalVariable ) ; if ( severity == ProblemSeverities . Ignore ) return ; String [ ] arguments = new String [ ] { new String ( local . name ) } ; this . handle ( IProblem . RedundantNullCheckOnNullLocalVariable , arguments , arguments , severity , nodeSourceStart ( local , location ) , nodeSourceEnd ( local , location ) ) ; } public void localVariableRedundantNullAssignment ( LocalVariableBinding local , ASTNode location ) { if ( ( location . bits & ASTNode . FirstAssignmentToLocal ) != <NUM_LIT:0> ) return ; int severity = computeSeverity ( IProblem . RedundantLocalVariableNullAssignment ) ; if ( severity == ProblemSeverities . Ignore ) return ; String [ ] arguments = new String [ ] { new String ( local . name ) } ; this . handle ( IProblem . RedundantLocalVariableNullAssignment , arguments , arguments , severity , nodeSourceStart ( local , location ) , nodeSourceEnd ( local , location ) ) ; } public void methodMustOverride ( AbstractMethodDeclaration method , long complianceLevel ) { MethodBinding binding = method . binding ; this . handle ( complianceLevel == ClassFileConstants . JDK1_5 ? IProblem . MethodMustOverride : IProblem . MethodMustOverrideOrImplement , new String [ ] { new String ( binding . selector ) , typesAsString ( binding , false ) , new String ( binding . declaringClass . readableName ( ) ) , } , new String [ ] { new String ( binding . selector ) , typesAsString ( binding , true ) , new String ( binding . declaringClass . shortReadableName ( ) ) , } , method . sourceStart , method . sourceEnd ) ; } public void methodNameClash ( MethodBinding currentMethod , MethodBinding inheritedMethod , int severity ) { if ( currentMethod . declaringClass instanceof SourceTypeBinding ) { SourceTypeBinding stb = ( SourceTypeBinding ) currentMethod . declaringClass ; if ( stb . scope != null && ! stb . scope . shouldReport ( IProblem . MethodNameClash ) ) { return ; } } this . handle ( IProblem . MethodNameClash , new String [ ] { new String ( currentMethod . selector ) , typesAsString ( currentMethod , false ) , new String ( currentMethod . declaringClass . readableName ( ) ) , typesAsString ( inheritedMethod , false ) , new String ( inheritedMethod . declaringClass . readableName ( ) ) , } , new String [ ] { new String ( currentMethod . selector ) , typesAsString ( currentMethod , true ) , new String ( currentMethod . declaringClass . shortReadableName ( ) ) , typesAsString ( inheritedMethod , true ) , new String ( inheritedMethod . declaringClass . shortReadableName ( ) ) , } , severity , currentMethod . sourceStart ( ) , currentMethod . sourceEnd ( ) ) ; } public void methodNameClashHidden ( MethodBinding currentMethod , MethodBinding inheritedMethod ) { this . handle ( IProblem . MethodNameClashHidden , new String [ ] { new String ( currentMethod . selector ) , typesAsString ( currentMethod , currentMethod . parameters , false ) , new String ( currentMethod . declaringClass . readableName ( ) ) , typesAsString ( inheritedMethod , inheritedMethod . parameters , false ) , new String ( inheritedMethod . declaringClass . readableName ( ) ) , } , new String [ ] { new String ( currentMethod . selector ) , typesAsString ( currentMethod , currentMethod . parameters , true ) , new String ( currentMethod . declaringClass . shortReadableName ( ) ) , typesAsString ( inheritedMethod , inheritedMethod . parameters , true ) , new String ( inheritedMethod . declaringClass . shortReadableName ( ) ) , } , currentMethod . sourceStart ( ) , currentMethod . sourceEnd ( ) ) ; } public void methodNeedBody ( AbstractMethodDeclaration methodDecl ) { this . handle ( IProblem . MethodRequiresBody , NoArgument , NoArgument , methodDecl . sourceStart , methodDecl . sourceEnd ) ; } public void methodNeedingNoBody ( MethodDeclaration methodDecl ) { this . handle ( ( ( methodDecl . modifiers & ClassFileConstants . AccNative ) != <NUM_LIT:0> ) ? IProblem . BodyForNativeMethod : IProblem . BodyForAbstractMethod , NoArgument , NoArgument , methodDecl . sourceStart , methodDecl . sourceEnd ) ; } public void methodWithConstructorName ( MethodDeclaration methodDecl ) { this . handle ( IProblem . MethodButWithConstructorName , NoArgument , NoArgument , methodDecl . sourceStart , methodDecl . sourceEnd ) ; } public void methodCanBeDeclaredStatic ( MethodDeclaration methodDecl ) { int severity = computeSeverity ( IProblem . MethodCanBeStatic ) ; if ( severity == ProblemSeverities . Ignore ) return ; MethodBinding method = methodDecl . binding ; this . handle ( IProblem . MethodCanBeStatic , new String [ ] { new String ( method . declaringClass . readableName ( ) ) , new String ( method . selector ) , typesAsString ( method , false ) } , new String [ ] { new String ( method . declaringClass . shortReadableName ( ) ) , new String ( method . selector ) , typesAsString ( method , true ) } , severity , methodDecl . sourceStart , methodDecl . sourceEnd ) ; } public void methodCanBePotentiallyDeclaredStatic ( MethodDeclaration methodDecl ) { int severity = computeSeverity ( IProblem . MethodCanBePotentiallyStatic ) ; if ( severity == ProblemSeverities . Ignore ) return ; MethodBinding method = methodDecl . binding ; this . handle ( IProblem . MethodCanBePotentiallyStatic , new String [ ] { new String ( method . declaringClass . readableName ( ) ) , new String ( method . selector ) , typesAsString ( method , false ) } , new String [ ] { new String ( method . declaringClass . shortReadableName ( ) ) , new String ( method . selector ) , typesAsString ( method , true ) } , severity , methodDecl . sourceStart , methodDecl . sourceEnd ) ; } public void missingDeprecatedAnnotationForField ( FieldDeclaration field ) { int severity = computeSeverity ( IProblem . FieldMissingDeprecatedAnnotation ) ; if ( severity == ProblemSeverities . Ignore ) return ; FieldBinding binding = field . binding ; this . handle ( IProblem . FieldMissingDeprecatedAnnotation , new String [ ] { new String ( binding . declaringClass . readableName ( ) ) , new String ( binding . name ) , } , new String [ ] { new String ( binding . declaringClass . shortReadableName ( ) ) , new String ( binding . name ) , } , severity , nodeSourceStart ( binding , field ) , nodeSourceEnd ( binding , field ) ) ; } public void missingDeprecatedAnnotationForMethod ( AbstractMethodDeclaration method ) { int severity = computeSeverity ( IProblem . MethodMissingDeprecatedAnnotation ) ; if ( severity == ProblemSeverities . Ignore ) return ; MethodBinding binding = method . binding ; this . handle ( IProblem . MethodMissingDeprecatedAnnotation , new String [ ] { new String ( binding . selector ) , typesAsString ( binding , false ) , new String ( binding . declaringClass . readableName ( ) ) , } , new String [ ] { new String ( binding . selector ) , typesAsString ( binding , true ) , new String ( binding . declaringClass . shortReadableName ( ) ) , } , severity , method . sourceStart , method . sourceEnd ) ; } public void missingDeprecatedAnnotationForType ( TypeDeclaration type ) { int severity = computeSeverity ( IProblem . TypeMissingDeprecatedAnnotation ) ; if ( severity == ProblemSeverities . Ignore ) return ; TypeBinding binding = type . binding ; this . handle ( IProblem . TypeMissingDeprecatedAnnotation , new String [ ] { new String ( binding . readableName ( ) ) , } , new String [ ] { new String ( binding . shortReadableName ( ) ) , } , severity , type . sourceStart , type . sourceEnd ) ; } public void missingEnumConstantCase ( SwitchStatement switchStatement , FieldBinding enumConstant ) { this . handle ( switchStatement . defaultCase == null ? IProblem . MissingEnumConstantCase : IProblem . MissingEnumConstantCaseDespiteDefault , new String [ ] { new String ( enumConstant . declaringClass . readableName ( ) ) , new String ( enumConstant . name ) } , new String [ ] { new String ( enumConstant . declaringClass . shortReadableName ( ) ) , new String ( enumConstant . name ) } , switchStatement . expression . sourceStart , switchStatement . expression . sourceEnd ) ; } public void missingDefaultCase ( SwitchStatement switchStatement , boolean isEnumSwitch , TypeBinding expressionType ) { if ( isEnumSwitch ) { this . handle ( IProblem . MissingEnumDefaultCase , new String [ ] { new String ( expressionType . readableName ( ) ) } , new String [ ] { new String ( expressionType . shortReadableName ( ) ) } , switchStatement . expression . sourceStart , switchStatement . expression . sourceEnd ) ; } else { this . handle ( IProblem . MissingDefaultCase , NoArgument , NoArgument , switchStatement . expression . sourceStart , switchStatement . expression . sourceEnd ) ; } } public void missingOverrideAnnotation ( AbstractMethodDeclaration method ) { int severity = computeSeverity ( IProblem . MissingOverrideAnnotation ) ; if ( severity == ProblemSeverities . Ignore ) return ; MethodBinding binding = method . binding ; this . handle ( IProblem . MissingOverrideAnnotation , new String [ ] { new String ( binding . selector ) , typesAsString ( binding , false ) , new String ( binding . declaringClass . readableName ( ) ) , } , new String [ ] { new String ( binding . selector ) , typesAsString ( binding , true ) , new String ( binding . declaringClass . shortReadableName ( ) ) , } , severity , method . sourceStart , method . sourceEnd ) ; } public void missingOverrideAnnotationForInterfaceMethodImplementation ( AbstractMethodDeclaration method ) { int severity = computeSeverity ( IProblem . MissingOverrideAnnotationForInterfaceMethodImplementation ) ; if ( severity == ProblemSeverities . Ignore ) return ; MethodBinding binding = method . binding ; this . handle ( IProblem . MissingOverrideAnnotationForInterfaceMethodImplementation , new String [ ] { new String ( binding . selector ) , typesAsString ( binding , false ) , new String ( binding . declaringClass . readableName ( ) ) , } , new String [ ] { new String ( binding . selector ) , typesAsString ( binding , true ) , new String ( binding . declaringClass . shortReadableName ( ) ) , } , severity , method . sourceStart , method . sourceEnd ) ; } public void missingReturnType ( AbstractMethodDeclaration methodDecl ) { this . handle ( IProblem . MissingReturnType , NoArgument , NoArgument , methodDecl . sourceStart , methodDecl . sourceEnd ) ; } public void missingSemiColon ( Expression expression ) { this . handle ( IProblem . MissingSemiColon , NoArgument , NoArgument , expression . sourceStart , expression . sourceEnd ) ; } public void missingSerialVersion ( TypeDeclaration typeDecl ) { String [ ] arguments = new String [ ] { new String ( typeDecl . name ) } ; this . handle ( IProblem . MissingSerialVersion , arguments , arguments , typeDecl . sourceStart , typeDecl . sourceEnd ) ; } public void missingSynchronizedOnInheritedMethod ( MethodBinding currentMethod , MethodBinding inheritedMethod ) { this . handle ( IProblem . MissingSynchronizedModifierInInheritedMethod , new String [ ] { new String ( currentMethod . declaringClass . readableName ( ) ) , new String ( currentMethod . selector ) , typesAsString ( currentMethod , false ) , } , new String [ ] { new String ( currentMethod . declaringClass . shortReadableName ( ) ) , new String ( currentMethod . selector ) , typesAsString ( currentMethod , true ) , } , currentMethod . sourceStart ( ) , currentMethod . sourceEnd ( ) ) ; } public void missingTypeInConstructor ( ASTNode location , MethodBinding constructor ) { List missingTypes = constructor . collectMissingTypes ( null ) ; if ( missingTypes == null ) { System . err . println ( "<STR_LIT>" + constructor + "<STR_LIT>" ) ; return ; } TypeBinding missingType = ( TypeBinding ) missingTypes . get ( <NUM_LIT:0> ) ; int start = location . sourceStart ; int end = location . sourceEnd ; if ( location instanceof QualifiedAllocationExpression ) { QualifiedAllocationExpression qualifiedAllocation = ( QualifiedAllocationExpression ) location ; if ( qualifiedAllocation . anonymousType != null ) { start = qualifiedAllocation . anonymousType . sourceStart ; end = qualifiedAllocation . anonymousType . sourceEnd ; } } this . handle ( IProblem . MissingTypeInConstructor , new String [ ] { new String ( constructor . declaringClass . readableName ( ) ) , typesAsString ( constructor , false ) , new String ( missingType . readableName ( ) ) , } , new String [ ] { new String ( constructor . declaringClass . shortReadableName ( ) ) , typesAsString ( constructor , true ) , new String ( missingType . shortReadableName ( ) ) , } , start , end ) ; } public void missingTypeInMethod ( MessageSend messageSend , MethodBinding method ) { List missingTypes = method . collectMissingTypes ( null ) ; if ( missingTypes == null ) { System . err . println ( "<STR_LIT>" + method + "<STR_LIT>" ) ; return ; } TypeBinding missingType = ( TypeBinding ) missingTypes . get ( <NUM_LIT:0> ) ; this . handle ( IProblem . MissingTypeInMethod , new String [ ] { new String ( method . declaringClass . readableName ( ) ) , new String ( method . selector ) , typesAsString ( method , false ) , new String ( missingType . readableName ( ) ) , } , new String [ ] { new String ( method . declaringClass . shortReadableName ( ) ) , new String ( method . selector ) , typesAsString ( method , true ) , new String ( missingType . shortReadableName ( ) ) , } , ( int ) ( messageSend . nameSourcePosition > > > <NUM_LIT:32> ) , ( int ) messageSend . nameSourcePosition ) ; } public void missingValueForAnnotationMember ( Annotation annotation , char [ ] memberName ) { String memberString = new String ( memberName ) ; this . handle ( IProblem . MissingValueForAnnotationMember , new String [ ] { new String ( annotation . resolvedType . readableName ( ) ) , memberString } , new String [ ] { new String ( annotation . resolvedType . shortReadableName ( ) ) , memberString } , annotation . sourceStart , annotation . sourceEnd ) ; } public void mustDefineDimensionsOrInitializer ( ArrayAllocationExpression expression ) { this . handle ( IProblem . MustDefineEitherDimensionExpressionsOrInitializer , NoArgument , NoArgument , expression . sourceStart , expression . sourceEnd ) ; } public void mustUseAStaticMethod ( MessageSend messageSend , MethodBinding method ) { this . handle ( IProblem . StaticMethodRequested , new String [ ] { new String ( method . declaringClass . readableName ( ) ) , new String ( method . selector ) , typesAsString ( method , false ) } , new String [ ] { new String ( method . declaringClass . shortReadableName ( ) ) , new String ( method . selector ) , typesAsString ( method , true ) } , messageSend . sourceStart , messageSend . sourceEnd ) ; } public void nativeMethodsCannotBeStrictfp ( ReferenceBinding type , AbstractMethodDeclaration methodDecl ) { String [ ] arguments = new String [ ] { new String ( type . sourceName ( ) ) , new String ( methodDecl . selector ) } ; this . handle ( IProblem . NativeMethodsCannotBeStrictfp , arguments , arguments , methodDecl . sourceStart , methodDecl . sourceEnd ) ; } public void needImplementation ( ASTNode location ) { this . abortDueToInternalError ( Messages . abort_missingCode , location ) ; } public void needToEmulateFieldAccess ( FieldBinding field , ASTNode location , boolean isReadAccess ) { int id = isReadAccess ? IProblem . NeedToEmulateFieldReadAccess : IProblem . NeedToEmulateFieldWriteAccess ; int severity = computeSeverity ( id ) ; if ( severity == ProblemSeverities . Ignore ) return ; this . handle ( id , new String [ ] { new String ( field . declaringClass . readableName ( ) ) , new String ( field . name ) } , new String [ ] { new String ( field . declaringClass . shortReadableName ( ) ) , new String ( field . name ) } , severity , nodeSourceStart ( field , location ) , nodeSourceEnd ( field , location ) ) ; } public void needToEmulateMethodAccess ( MethodBinding method , ASTNode location ) { if ( method . isConstructor ( ) ) { int severity = computeSeverity ( IProblem . NeedToEmulateConstructorAccess ) ; if ( severity == ProblemSeverities . Ignore ) return ; if ( method . declaringClass . isEnum ( ) ) return ; this . handle ( IProblem . NeedToEmulateConstructorAccess , new String [ ] { new String ( method . declaringClass . readableName ( ) ) , typesAsString ( method , false ) } , new String [ ] { new String ( method . declaringClass . shortReadableName ( ) ) , typesAsString ( method , true ) } , severity , location . sourceStart , location . sourceEnd ) ; return ; } int severity = computeSeverity ( IProblem . NeedToEmulateMethodAccess ) ; if ( severity == ProblemSeverities . Ignore ) return ; this . handle ( IProblem . NeedToEmulateMethodAccess , new String [ ] { new String ( method . declaringClass . readableName ( ) ) , new String ( method . selector ) , typesAsString ( method , false ) } , new String [ ] { new String ( method . declaringClass . shortReadableName ( ) ) , new String ( method . selector ) , typesAsString ( method , true ) } , severity , location . sourceStart , location . sourceEnd ) ; } public void noAdditionalBoundAfterTypeVariable ( TypeReference boundReference ) { this . handle ( IProblem . NoAdditionalBoundAfterTypeVariable , new String [ ] { new String ( boundReference . resolvedType . readableName ( ) ) } , new String [ ] { new String ( boundReference . resolvedType . shortReadableName ( ) ) } , boundReference . sourceStart , boundReference . sourceEnd ) ; } private int nodeSourceEnd ( Binding field , ASTNode node ) { return nodeSourceEnd ( field , node , <NUM_LIT:0> ) ; } private int nodeSourceEnd ( Binding field , ASTNode node , int index ) { if ( node instanceof ArrayTypeReference ) { return ( ( ArrayTypeReference ) node ) . originalSourceEnd ; } else if ( node instanceof QualifiedNameReference ) { QualifiedNameReference ref = ( QualifiedNameReference ) node ; if ( ref . binding == field ) { if ( index == <NUM_LIT:0> ) { return ( int ) ( ref . sourcePositions [ ref . indexOfFirstFieldBinding - <NUM_LIT:1> ] ) ; } else { int length = ref . sourcePositions . length ; if ( index < length ) { return ( int ) ( ref . sourcePositions [ index ] ) ; } return ( int ) ( ref . sourcePositions [ <NUM_LIT:0> ] ) ; } } FieldBinding [ ] otherFields = ref . otherBindings ; if ( otherFields != null ) { int offset = ref . indexOfFirstFieldBinding ; if ( index != <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> , length = otherFields . length ; i < length ; i ++ ) { if ( ( otherFields [ i ] == field ) && ( i + offset == index ) ) { return ( int ) ( ref . sourcePositions [ i + offset ] ) ; } } } else { for ( int i = <NUM_LIT:0> , length = otherFields . length ; i < length ; i ++ ) { if ( otherFields [ i ] == field ) return ( int ) ( ref . sourcePositions [ i + offset ] ) ; } } } } else if ( node instanceof ParameterizedQualifiedTypeReference ) { ParameterizedQualifiedTypeReference reference = ( ParameterizedQualifiedTypeReference ) node ; if ( index < reference . sourcePositions . length ) { return ( int ) reference . sourcePositions [ index ] ; } } else if ( node instanceof ArrayQualifiedTypeReference ) { ArrayQualifiedTypeReference reference = ( ArrayQualifiedTypeReference ) node ; int length = reference . sourcePositions . length ; if ( index < length ) { return ( int ) reference . sourcePositions [ index ] ; } return ( int ) reference . sourcePositions [ length - <NUM_LIT:1> ] ; } else if ( node instanceof QualifiedTypeReference ) { QualifiedTypeReference reference = ( QualifiedTypeReference ) node ; int length = reference . sourcePositions . length ; if ( index < length ) { return ( int ) reference . sourcePositions [ index ] ; } } return node . sourceEnd ; } private int nodeSourceStart ( Binding field , ASTNode node ) { return nodeSourceStart ( field , node , <NUM_LIT:0> ) ; } private int nodeSourceStart ( Binding field , ASTNode node , int index ) { if ( node instanceof FieldReference ) { FieldReference fieldReference = ( FieldReference ) node ; return ( int ) ( fieldReference . nameSourcePosition > > <NUM_LIT:32> ) ; } else if ( node instanceof QualifiedNameReference ) { QualifiedNameReference ref = ( QualifiedNameReference ) node ; if ( ref . binding == field ) { if ( index == <NUM_LIT:0> ) { return ( int ) ( ref . sourcePositions [ ref . indexOfFirstFieldBinding - <NUM_LIT:1> ] > > <NUM_LIT:32> ) ; } else { return ( int ) ( ref . sourcePositions [ index ] > > <NUM_LIT:32> ) ; } } FieldBinding [ ] otherFields = ref . otherBindings ; if ( otherFields != null ) { int offset = ref . indexOfFirstFieldBinding ; if ( index != <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> , length = otherFields . length ; i < length ; i ++ ) { if ( ( otherFields [ i ] == field ) && ( i + offset == index ) ) { return ( int ) ( ref . sourcePositions [ i + offset ] > > <NUM_LIT:32> ) ; } } } else { for ( int i = <NUM_LIT:0> , length = otherFields . length ; i < length ; i ++ ) { if ( otherFields [ i ] == field ) { return ( int ) ( ref . sourcePositions [ i + offset ] > > <NUM_LIT:32> ) ; } } } } } else if ( node instanceof ParameterizedQualifiedTypeReference ) { ParameterizedQualifiedTypeReference reference = ( ParameterizedQualifiedTypeReference ) node ; return ( int ) ( reference . sourcePositions [ <NUM_LIT:0> ] > > > <NUM_LIT:32> ) ; } return node . sourceStart ; } public void noMoreAvailableSpaceForArgument ( LocalVariableBinding local , ASTNode location ) { String [ ] arguments = new String [ ] { new String ( local . name ) } ; this . handle ( local instanceof SyntheticArgumentBinding ? IProblem . TooManySyntheticArgumentSlots : IProblem . TooManyArgumentSlots , arguments , arguments , ProblemSeverities . Abort | ProblemSeverities . Error | ProblemSeverities . Fatal , nodeSourceStart ( local , location ) , nodeSourceEnd ( local , location ) ) ; } public void noMoreAvailableSpaceForConstant ( TypeDeclaration typeDeclaration ) { this . handle ( IProblem . TooManyBytesForStringConstant , new String [ ] { new String ( typeDeclaration . binding . readableName ( ) ) } , new String [ ] { new String ( typeDeclaration . binding . shortReadableName ( ) ) } , ProblemSeverities . Abort | ProblemSeverities . Error | ProblemSeverities . Fatal , typeDeclaration . sourceStart , typeDeclaration . sourceEnd ) ; } public void noMoreAvailableSpaceForLocal ( LocalVariableBinding local , ASTNode location ) { String [ ] arguments = new String [ ] { new String ( local . name ) } ; this . handle ( IProblem . TooManyLocalVariableSlots , arguments , arguments , ProblemSeverities . Abort | ProblemSeverities . Error | ProblemSeverities . Fatal , nodeSourceStart ( local , location ) , nodeSourceEnd ( local , location ) ) ; } public void noMoreAvailableSpaceInConstantPool ( TypeDeclaration typeDeclaration ) { this . handle ( IProblem . TooManyConstantsInConstantPool , new String [ ] { new String ( typeDeclaration . binding . readableName ( ) ) } , new String [ ] { new String ( typeDeclaration . binding . shortReadableName ( ) ) } , ProblemSeverities . Abort | ProblemSeverities . Error | ProblemSeverities . Fatal , typeDeclaration . sourceStart , typeDeclaration . sourceEnd ) ; } public void nonExternalizedStringLiteral ( ASTNode location ) { this . handle ( IProblem . NonExternalizedStringLiteral , NoArgument , NoArgument , location . sourceStart , location . sourceEnd ) ; } public void nonGenericTypeCannotBeParameterized ( int index , ASTNode location , TypeBinding type , TypeBinding [ ] argumentTypes ) { if ( location == null ) { this . handle ( IProblem . NonGenericType , new String [ ] { new String ( type . readableName ( ) ) , typesAsString ( argumentTypes , false ) } , new String [ ] { new String ( type . shortReadableName ( ) ) , typesAsString ( argumentTypes , true ) } , ProblemSeverities . AbortCompilation | ProblemSeverities . Error | ProblemSeverities . Fatal , <NUM_LIT:0> , <NUM_LIT:0> ) ; return ; } this . handle ( IProblem . NonGenericType , new String [ ] { new String ( type . readableName ( ) ) , typesAsString ( argumentTypes , false ) } , new String [ ] { new String ( type . shortReadableName ( ) ) , typesAsString ( argumentTypes , true ) } , nodeSourceStart ( null , location ) , nodeSourceEnd ( null , location , index ) ) ; } public void nonStaticAccessToStaticField ( ASTNode location , FieldBinding field ) { nonStaticAccessToStaticField ( location , field , - <NUM_LIT:1> ) ; } public void nonStaticAccessToStaticField ( ASTNode location , FieldBinding field , int index ) { int severity = computeSeverity ( IProblem . NonStaticAccessToStaticField ) ; if ( severity == ProblemSeverities . Ignore ) return ; this . handle ( IProblem . NonStaticAccessToStaticField , new String [ ] { new String ( field . declaringClass . readableName ( ) ) , new String ( field . name ) } , new String [ ] { new String ( field . declaringClass . shortReadableName ( ) ) , new String ( field . name ) } , severity , nodeSourceStart ( field , location , index ) , nodeSourceEnd ( field , location , index ) ) ; } public void nonStaticAccessToStaticMethod ( ASTNode location , MethodBinding method ) { this . handle ( IProblem . NonStaticAccessToStaticMethod , new String [ ] { new String ( method . declaringClass . readableName ( ) ) , new String ( method . selector ) , typesAsString ( method , false ) } , new String [ ] { new String ( method . declaringClass . shortReadableName ( ) ) , new String ( method . selector ) , typesAsString ( method , true ) } , location . sourceStart , location . sourceEnd ) ; } public void nonStaticContextForEnumMemberType ( SourceTypeBinding type ) { String [ ] arguments = new String [ ] { new String ( type . sourceName ( ) ) } ; this . handle ( IProblem . NonStaticContextForEnumMemberType , arguments , arguments , type . sourceStart ( ) , type . sourceEnd ( ) ) ; } public void noSuchEnclosingInstance ( TypeBinding targetType , ASTNode location , boolean isConstructorCall ) { int id ; if ( isConstructorCall ) { id = IProblem . EnclosingInstanceInConstructorCall ; } else if ( ( location instanceof ExplicitConstructorCall ) && ( ( ExplicitConstructorCall ) location ) . accessMode == ExplicitConstructorCall . ImplicitSuper ) { id = IProblem . MissingEnclosingInstanceForConstructorCall ; } else if ( location instanceof AllocationExpression && ( ( ( AllocationExpression ) location ) . binding . declaringClass . isMemberType ( ) || ( ( ( AllocationExpression ) location ) . binding . declaringClass . isAnonymousType ( ) && ( ( AllocationExpression ) location ) . binding . declaringClass . superclass ( ) . isMemberType ( ) ) ) ) { id = IProblem . MissingEnclosingInstance ; } else { id = IProblem . IncorrectEnclosingInstanceReference ; } this . handle ( id , new String [ ] { new String ( targetType . readableName ( ) ) } , new String [ ] { new String ( targetType . shortReadableName ( ) ) } , location . sourceStart , location . sourceEnd ) ; } public void notCompatibleTypesError ( EqualExpression expression , TypeBinding leftType , TypeBinding rightType ) { String leftName = new String ( leftType . readableName ( ) ) ; String rightName = new String ( rightType . readableName ( ) ) ; String leftShortName = new String ( leftType . shortReadableName ( ) ) ; String rightShortName = new String ( rightType . shortReadableName ( ) ) ; if ( leftShortName . equals ( rightShortName ) ) { leftShortName = leftName ; rightShortName = rightName ; } this . handle ( IProblem . IncompatibleTypesInEqualityOperator , new String [ ] { leftName , rightName } , new String [ ] { leftShortName , rightShortName } , expression . sourceStart , expression . sourceEnd ) ; } public void notCompatibleTypesError ( InstanceOfExpression expression , TypeBinding leftType , TypeBinding rightType ) { String leftName = new String ( leftType . readableName ( ) ) ; String rightName = new String ( rightType . readableName ( ) ) ; String leftShortName = new String ( leftType . shortReadableName ( ) ) ; String rightShortName = new String ( rightType . shortReadableName ( ) ) ; if ( leftShortName . equals ( rightShortName ) ) { leftShortName = leftName ; rightShortName = rightName ; } this . handle ( IProblem . IncompatibleTypesInConditionalOperator , new String [ ] { leftName , rightName } , new String [ ] { leftShortName , rightShortName } , expression . sourceStart , expression . sourceEnd ) ; } public void notCompatibleTypesErrorInForeach ( Expression expression , TypeBinding leftType , TypeBinding rightType ) { String leftName = new String ( leftType . readableName ( ) ) ; String rightName = new String ( rightType . readableName ( ) ) ; String leftShortName = new String ( leftType . shortReadableName ( ) ) ; String rightShortName = new String ( rightType . shortReadableName ( ) ) ; if ( leftShortName . equals ( rightShortName ) ) { leftShortName = leftName ; rightShortName = rightName ; } this . handle ( IProblem . IncompatibleTypesInForeach , new String [ ] { leftName , rightName } , new String [ ] { leftShortName , rightShortName } , expression . sourceStart , expression . sourceEnd ) ; } public void objectCannotBeGeneric ( TypeDeclaration typeDecl ) { this . handle ( IProblem . ObjectCannotBeGeneric , NoArgument , NoArgument , typeDecl . typeParameters [ <NUM_LIT:0> ] . sourceStart , typeDecl . typeParameters [ typeDecl . typeParameters . length - <NUM_LIT:1> ] . sourceEnd ) ; } public void objectCannotHaveSuperTypes ( SourceTypeBinding type ) { this . handle ( IProblem . ObjectCannotHaveSuperTypes , NoArgument , NoArgument , type . sourceStart ( ) , type . sourceEnd ( ) ) ; } public void objectMustBeClass ( SourceTypeBinding type ) { this . handle ( IProblem . ObjectMustBeClass , NoArgument , NoArgument , type . sourceStart ( ) , type . sourceEnd ( ) ) ; } public void operatorOnlyValidOnNumericType ( CompoundAssignment assignment , TypeBinding leftType , TypeBinding rightType ) { String leftName = new String ( leftType . readableName ( ) ) ; String rightName = new String ( rightType . readableName ( ) ) ; String leftShortName = new String ( leftType . shortReadableName ( ) ) ; String rightShortName = new String ( rightType . shortReadableName ( ) ) ; if ( leftShortName . equals ( rightShortName ) ) { leftShortName = leftName ; rightShortName = rightName ; } this . handle ( IProblem . TypeMismatch , new String [ ] { leftName , rightName } , new String [ ] { leftShortName , rightShortName } , assignment . sourceStart , assignment . sourceEnd ) ; } public void overridesDeprecatedMethod ( MethodBinding localMethod , MethodBinding inheritedMethod ) { this . handle ( IProblem . OverridingDeprecatedMethod , new String [ ] { new String ( CharOperation . concat ( localMethod . declaringClass . readableName ( ) , localMethod . readableName ( ) , '<CHAR_LIT:.>' ) ) , new String ( inheritedMethod . declaringClass . readableName ( ) ) } , new String [ ] { new String ( CharOperation . concat ( localMethod . declaringClass . shortReadableName ( ) , localMethod . shortReadableName ( ) , '<CHAR_LIT:.>' ) ) , new String ( inheritedMethod . declaringClass . shortReadableName ( ) ) } , localMethod . sourceStart ( ) , localMethod . sourceEnd ( ) ) ; } public void overridesMethodWithoutSuperInvocation ( MethodBinding localMethod ) { this . handle ( IProblem . OverridingMethodWithoutSuperInvocation , new String [ ] { new String ( CharOperation . concat ( localMethod . declaringClass . readableName ( ) , localMethod . readableName ( ) , '<CHAR_LIT:.>' ) ) } , new String [ ] { new String ( CharOperation . concat ( localMethod . declaringClass . shortReadableName ( ) , localMethod . shortReadableName ( ) , '<CHAR_LIT:.>' ) ) } , localMethod . sourceStart ( ) , localMethod . sourceEnd ( ) ) ; } public void overridesPackageDefaultMethod ( MethodBinding localMethod , MethodBinding inheritedMethod ) { this . handle ( IProblem . OverridingNonVisibleMethod , new String [ ] { new String ( CharOperation . concat ( localMethod . declaringClass . readableName ( ) , localMethod . readableName ( ) , '<CHAR_LIT:.>' ) ) , new String ( inheritedMethod . declaringClass . readableName ( ) ) } , new String [ ] { new String ( CharOperation . concat ( localMethod . declaringClass . shortReadableName ( ) , localMethod . shortReadableName ( ) , '<CHAR_LIT:.>' ) ) , new String ( inheritedMethod . declaringClass . shortReadableName ( ) ) } , localMethod . sourceStart ( ) , localMethod . sourceEnd ( ) ) ; } public void packageCollidesWithType ( CompilationUnitDeclaration compUnitDecl ) { String [ ] arguments = new String [ ] { CharOperation . toString ( compUnitDecl . currentPackage . tokens ) } ; this . handle ( IProblem . PackageCollidesWithType , arguments , arguments , compUnitDecl . currentPackage . sourceStart , compUnitDecl . currentPackage . sourceEnd ) ; } public void packageIsNotExpectedPackage ( CompilationUnitDeclaration compUnitDecl ) { boolean hasPackageDeclaration = compUnitDecl . currentPackage == null ; String [ ] arguments = new String [ ] { CharOperation . toString ( compUnitDecl . compilationResult . compilationUnit . getPackageName ( ) ) , hasPackageDeclaration ? "<STR_LIT>" : CharOperation . toString ( compUnitDecl . currentPackage . tokens ) , } ; int end ; if ( compUnitDecl . sourceEnd <= <NUM_LIT:0> ) { end = - <NUM_LIT:1> ; } else { end = hasPackageDeclaration ? <NUM_LIT:0> : compUnitDecl . currentPackage . sourceEnd ; } this . handle ( IProblem . PackageIsNotExpectedPackage , arguments , arguments , hasPackageDeclaration ? <NUM_LIT:0> : compUnitDecl . currentPackage . sourceStart , end ) ; } public void parameterAssignment ( LocalVariableBinding local , ASTNode location ) { int severity = computeSeverity ( IProblem . ParameterAssignment ) ; if ( severity == ProblemSeverities . Ignore ) return ; String [ ] arguments = new String [ ] { new String ( local . readableName ( ) ) } ; this . handle ( IProblem . ParameterAssignment , arguments , arguments , severity , nodeSourceStart ( local , location ) , nodeSourceEnd ( local , location ) ) ; } private String parameterBoundAsString ( TypeVariableBinding typeVariable , boolean makeShort ) { StringBuffer nameBuffer = new StringBuffer ( <NUM_LIT:10> ) ; if ( typeVariable . firstBound == typeVariable . superclass ) { nameBuffer . append ( makeShort ? typeVariable . superclass . shortReadableName ( ) : typeVariable . superclass . readableName ( ) ) ; } int length ; if ( ( length = typeVariable . superInterfaces . length ) > <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( i > <NUM_LIT:0> || typeVariable . firstBound == typeVariable . superclass ) nameBuffer . append ( "<STR_LIT>" ) ; nameBuffer . append ( makeShort ? typeVariable . superInterfaces [ i ] . shortReadableName ( ) : typeVariable . superInterfaces [ i ] . readableName ( ) ) ; } } return nameBuffer . toString ( ) ; } public void parameterizedMemberTypeMissingArguments ( ASTNode location , TypeBinding type , int index ) { if ( location == null ) { this . handle ( IProblem . MissingArgumentsForParameterizedMemberType , new String [ ] { new String ( type . readableName ( ) ) } , new String [ ] { new String ( type . shortReadableName ( ) ) } , ProblemSeverities . AbortCompilation | ProblemSeverities . Error | ProblemSeverities . Fatal , <NUM_LIT:0> , <NUM_LIT:0> ) ; return ; } this . handle ( IProblem . MissingArgumentsForParameterizedMemberType , new String [ ] { new String ( type . readableName ( ) ) } , new String [ ] { new String ( type . shortReadableName ( ) ) } , location . sourceStart , nodeSourceEnd ( null , location , index ) ) ; } public void parseError ( int startPosition , int endPosition , int currentToken , char [ ] currentTokenSource , String errorTokenName , String [ ] possibleTokens ) { if ( possibleTokens . length == <NUM_LIT:0> ) { if ( isKeyword ( currentToken ) ) { String [ ] arguments = new String [ ] { new String ( currentTokenSource ) } ; this . handle ( IProblem . ParsingErrorOnKeywordNoSuggestion , arguments , arguments , startPosition , endPosition ) ; return ; } else { String [ ] arguments = new String [ ] { errorTokenName } ; this . handle ( IProblem . ParsingErrorNoSuggestion , arguments , arguments , startPosition , endPosition ) ; return ; } } StringBuffer list = new StringBuffer ( <NUM_LIT:20> ) ; for ( int i = <NUM_LIT:0> , max = possibleTokens . length ; i < max ; i ++ ) { if ( i > <NUM_LIT:0> ) list . append ( "<STR_LIT:U+002CU+0020>" ) ; list . append ( '<CHAR_LIT:">' ) ; list . append ( possibleTokens [ i ] ) ; list . append ( '<CHAR_LIT:">' ) ; } if ( isKeyword ( currentToken ) ) { String [ ] arguments = new String [ ] { new String ( currentTokenSource ) , list . toString ( ) } ; this . handle ( IProblem . ParsingErrorOnKeyword , arguments , arguments , startPosition , endPosition ) ; return ; } if ( isLiteral ( currentToken ) || isIdentifier ( currentToken ) ) { errorTokenName = new String ( currentTokenSource ) ; } String [ ] arguments = new String [ ] { errorTokenName , list . toString ( ) } ; this . handle ( IProblem . ParsingError , arguments , arguments , startPosition , endPosition ) ; } public void parseErrorDeleteToken ( int start , int end , int currentKind , char [ ] errorTokenSource , String errorTokenName ) { syntaxError ( IProblem . ParsingErrorDeleteToken , start , end , currentKind , errorTokenSource , errorTokenName , null ) ; } public void parseErrorDeleteTokens ( int start , int end ) { this . handle ( IProblem . ParsingErrorDeleteTokens , NoArgument , NoArgument , start , end ) ; } public void parseErrorInsertAfterToken ( int start , int end , int currentKind , char [ ] errorTokenSource , String errorTokenName , String expectedToken ) { syntaxError ( IProblem . ParsingErrorInsertTokenAfter , start , end , currentKind , errorTokenSource , errorTokenName , expectedToken ) ; } public void parseErrorInsertBeforeToken ( int start , int end , int currentKind , char [ ] errorTokenSource , String errorTokenName , String expectedToken ) { syntaxError ( IProblem . ParsingErrorInsertTokenBefore , start , end , currentKind , errorTokenSource , errorTokenName , expectedToken ) ; } public void parseErrorInsertToComplete ( int start , int end , String inserted , String completed ) { String [ ] arguments = new String [ ] { inserted , completed } ; this . handle ( IProblem . ParsingErrorInsertToComplete , arguments , arguments , start , end ) ; } public void parseErrorInsertToCompletePhrase ( int start , int end , String inserted ) { String [ ] arguments = new String [ ] { inserted } ; this . handle ( IProblem . ParsingErrorInsertToCompletePhrase , arguments , arguments , start , end ) ; } public void parseErrorInsertToCompleteScope ( int start , int end , String inserted ) { String [ ] arguments = new String [ ] { inserted } ; this . handle ( IProblem . ParsingErrorInsertToCompleteScope , arguments , arguments , start , end ) ; } public void parseErrorInvalidToken ( int start , int end , int currentKind , char [ ] errorTokenSource , String errorTokenName , String expectedToken ) { syntaxError ( IProblem . ParsingErrorInvalidToken , start , end , currentKind , errorTokenSource , errorTokenName , expectedToken ) ; } public void parseErrorMergeTokens ( int start , int end , String expectedToken ) { String [ ] arguments = new String [ ] { expectedToken } ; this . handle ( IProblem . ParsingErrorMergeTokens , arguments , arguments , start , end ) ; } public void parseErrorMisplacedConstruct ( int start , int end ) { this . handle ( IProblem . ParsingErrorMisplacedConstruct , NoArgument , NoArgument , start , end ) ; } public void parseErrorNoSuggestion ( int start , int end , int currentKind , char [ ] errorTokenSource , String errorTokenName ) { syntaxError ( IProblem . ParsingErrorNoSuggestion , start , end , currentKind , errorTokenSource , errorTokenName , null ) ; } public void parseErrorNoSuggestionForTokens ( int start , int end ) { this . handle ( IProblem . ParsingErrorNoSuggestionForTokens , NoArgument , NoArgument , start , end ) ; } public void parseErrorReplaceToken ( int start , int end , int currentKind , char [ ] errorTokenSource , String errorTokenName , String expectedToken ) { syntaxError ( IProblem . ParsingError , start , end , currentKind , errorTokenSource , errorTokenName , expectedToken ) ; } public void parseErrorReplaceTokens ( int start , int end , String expectedToken ) { String [ ] arguments = new String [ ] { expectedToken } ; this . handle ( IProblem . ParsingErrorReplaceTokens , arguments , arguments , start , end ) ; } public void parseErrorUnexpectedEnd ( int start , int end ) { String [ ] arguments ; if ( this . referenceContext instanceof ConstructorDeclaration ) { arguments = new String [ ] { Messages . parser_endOfConstructor } ; } else if ( this . referenceContext instanceof MethodDeclaration ) { arguments = new String [ ] { Messages . parser_endOfMethod } ; } else if ( this . referenceContext instanceof TypeDeclaration ) { arguments = new String [ ] { Messages . parser_endOfInitializer } ; } else { arguments = new String [ ] { Messages . parser_endOfFile } ; } this . handle ( IProblem . ParsingErrorUnexpectedEOF , arguments , arguments , start , end ) ; } public void possibleAccidentalBooleanAssignment ( Assignment assignment ) { this . handle ( IProblem . PossibleAccidentalBooleanAssignment , NoArgument , NoArgument , assignment . sourceStart , assignment . sourceEnd ) ; } public void possibleFallThroughCase ( CaseStatement caseStatement ) { this . handle ( IProblem . FallthroughCase , NoArgument , NoArgument , caseStatement . sourceStart , caseStatement . sourceEnd ) ; } public void publicClassMustMatchFileName ( CompilationUnitDeclaration compUnitDecl , TypeDeclaration typeDecl ) { this . referenceContext = typeDecl ; String [ ] arguments = new String [ ] { new String ( compUnitDecl . getFileName ( ) ) , new String ( typeDecl . name ) } ; this . handle ( IProblem . PublicClassMustMatchFileName , arguments , arguments , typeDecl . sourceStart , typeDecl . sourceEnd , compUnitDecl . compilationResult ) ; } public void rawMemberTypeCannotBeParameterized ( ASTNode location , ReferenceBinding type , TypeBinding [ ] argumentTypes ) { if ( location == null ) { this . handle ( IProblem . RawMemberTypeCannotBeParameterized , new String [ ] { new String ( type . readableName ( ) ) , typesAsString ( argumentTypes , false ) , new String ( type . enclosingType ( ) . readableName ( ) ) } , new String [ ] { new String ( type . shortReadableName ( ) ) , typesAsString ( argumentTypes , true ) , new String ( type . enclosingType ( ) . shortReadableName ( ) ) } , ProblemSeverities . AbortCompilation | ProblemSeverities . Error | ProblemSeverities . Fatal , <NUM_LIT:0> , <NUM_LIT:0> ) ; return ; } this . handle ( IProblem . RawMemberTypeCannotBeParameterized , new String [ ] { new String ( type . readableName ( ) ) , typesAsString ( argumentTypes , false ) , new String ( type . enclosingType ( ) . readableName ( ) ) } , new String [ ] { new String ( type . shortReadableName ( ) ) , typesAsString ( argumentTypes , true ) , new String ( type . enclosingType ( ) . shortReadableName ( ) ) } , location . sourceStart , location . sourceEnd ) ; } public void rawTypeReference ( ASTNode location , TypeBinding type ) { if ( this . options . sourceLevel < ClassFileConstants . JDK1_5 ) return ; type = type . leafComponentType ( ) ; this . handle ( IProblem . RawTypeReference , new String [ ] { new String ( type . readableName ( ) ) , new String ( type . erasure ( ) . readableName ( ) ) , } , new String [ ] { new String ( type . shortReadableName ( ) ) , new String ( type . erasure ( ) . shortReadableName ( ) ) , } , location . sourceStart , nodeSourceEnd ( null , location , Integer . MAX_VALUE ) ) ; } public void recursiveConstructorInvocation ( ExplicitConstructorCall constructorCall ) { this . handle ( IProblem . RecursiveConstructorInvocation , new String [ ] { new String ( constructorCall . binding . declaringClass . readableName ( ) ) , typesAsString ( constructorCall . binding , false ) } , new String [ ] { new String ( constructorCall . binding . declaringClass . shortReadableName ( ) ) , typesAsString ( constructorCall . binding , true ) } , constructorCall . sourceStart , constructorCall . sourceEnd ) ; } public void redefineArgument ( Argument arg ) { String [ ] arguments = new String [ ] { new String ( arg . name ) } ; this . handle ( IProblem . RedefinedArgument , arguments , arguments , arg . sourceStart , arg . sourceEnd ) ; } public void redefineLocal ( LocalDeclaration localDecl ) { String [ ] arguments = new String [ ] { new String ( localDecl . name ) } ; this . handle ( IProblem . RedefinedLocal , arguments , arguments , localDecl . sourceStart , localDecl . sourceEnd ) ; } public void redundantSuperInterface ( SourceTypeBinding type , TypeReference reference , ReferenceBinding superinterface , ReferenceBinding declaringType ) { int severity = computeSeverity ( IProblem . RedundantSuperinterface ) ; if ( severity != ProblemSeverities . Ignore ) { this . handle ( IProblem . RedundantSuperinterface , new String [ ] { new String ( superinterface . readableName ( ) ) , new String ( type . readableName ( ) ) , new String ( declaringType . readableName ( ) ) } , new String [ ] { new String ( superinterface . shortReadableName ( ) ) , new String ( type . shortReadableName ( ) ) , new String ( declaringType . shortReadableName ( ) ) } , severity , reference . sourceStart , reference . sourceEnd ) ; } } public void referenceMustBeArrayTypeAt ( TypeBinding arrayType , ArrayReference arrayRef ) { this . handle ( IProblem . ArrayReferenceRequired , new String [ ] { new String ( arrayType . readableName ( ) ) } , new String [ ] { new String ( arrayType . shortReadableName ( ) ) } , arrayRef . sourceStart , arrayRef . sourceEnd ) ; } public void reset ( ) { this . positionScanner = null ; } public void resourceHasToImplementAutoCloseable ( TypeBinding binding , TypeReference typeReference ) { if ( this . options . sourceLevel < ClassFileConstants . JDK1_7 ) { return ; } this . handle ( IProblem . ResourceHasToImplementAutoCloseable , new String [ ] { new String ( binding . readableName ( ) ) } , new String [ ] { new String ( binding . shortReadableName ( ) ) } , typeReference . sourceStart , typeReference . sourceEnd ) ; } private int retrieveClosingAngleBracketPosition ( int start ) { if ( this . referenceContext == null ) return start ; CompilationResult compilationResult = this . referenceContext . compilationResult ( ) ; if ( compilationResult == null ) return start ; ICompilationUnit compilationUnit = compilationResult . getCompilationUnit ( ) ; if ( compilationUnit == null ) return start ; char [ ] contents = compilationUnit . getContents ( ) ; if ( contents . length == <NUM_LIT:0> ) return start ; if ( this . positionScanner == null ) { this . positionScanner = new Scanner ( false , false , false , this . options . sourceLevel , this . options . complianceLevel , null , null , false ) ; this . positionScanner . returnOnlyGreater = true ; } this . positionScanner . setSource ( contents ) ; this . positionScanner . resetTo ( start , contents . length ) ; int end = start ; int count = <NUM_LIT:0> ; try { int token ; loop : while ( ( token = this . positionScanner . getNextToken ( ) ) != TerminalTokens . TokenNameEOF ) { switch ( token ) { case TerminalTokens . TokenNameLESS : count ++ ; break ; case TerminalTokens . TokenNameGREATER : count -- ; if ( count == <NUM_LIT:0> ) { end = this . positionScanner . currentPosition - <NUM_LIT:1> ; break loop ; } break ; case TerminalTokens . TokenNameLBRACE : break loop ; } } } catch ( InvalidInputException e ) { } return end ; } private int retrieveEndingPositionAfterOpeningParenthesis ( int sourceStart , int sourceEnd , int numberOfParen ) { if ( this . referenceContext == null ) return sourceEnd ; CompilationResult compilationResult = this . referenceContext . compilationResult ( ) ; if ( compilationResult == null ) return sourceEnd ; ICompilationUnit compilationUnit = compilationResult . getCompilationUnit ( ) ; if ( compilationUnit == null ) return sourceEnd ; char [ ] contents = compilationUnit . getContents ( ) ; if ( contents . length == <NUM_LIT:0> ) return sourceEnd ; if ( this . positionScanner == null ) { this . positionScanner = new Scanner ( false , false , false , this . options . sourceLevel , this . options . complianceLevel , null , null , false ) ; } this . positionScanner . setSource ( contents ) ; this . positionScanner . resetTo ( sourceStart , sourceEnd ) ; try { int token ; int previousSourceEnd = sourceEnd ; while ( ( token = this . positionScanner . getNextToken ( ) ) != TerminalTokens . TokenNameEOF ) { switch ( token ) { case TerminalTokens . TokenNameRPAREN : return previousSourceEnd ; default : previousSourceEnd = this . positionScanner . currentPosition - <NUM_LIT:1> ; } } } catch ( InvalidInputException e ) { } return sourceEnd ; } private int retrieveStartingPositionAfterOpeningParenthesis ( int sourceStart , int sourceEnd , int numberOfParen ) { if ( this . referenceContext == null ) return sourceStart ; CompilationResult compilationResult = this . referenceContext . compilationResult ( ) ; if ( compilationResult == null ) return sourceStart ; ICompilationUnit compilationUnit = compilationResult . getCompilationUnit ( ) ; if ( compilationUnit == null ) return sourceStart ; char [ ] contents = compilationUnit . getContents ( ) ; if ( contents . length == <NUM_LIT:0> ) return sourceStart ; if ( this . positionScanner == null ) { this . positionScanner = new Scanner ( false , false , false , this . options . sourceLevel , this . options . complianceLevel , null , null , false ) ; } this . positionScanner . setSource ( contents ) ; this . positionScanner . resetTo ( sourceStart , sourceEnd ) ; int count = <NUM_LIT:0> ; try { int token ; while ( ( token = this . positionScanner . getNextToken ( ) ) != TerminalTokens . TokenNameEOF ) { switch ( token ) { case TerminalTokens . TokenNameLPAREN : count ++ ; if ( count == numberOfParen ) { this . positionScanner . getNextToken ( ) ; return this . positionScanner . startPosition ; } } } } catch ( InvalidInputException e ) { } return sourceStart ; } public void returnTypeCannotBeVoidArray ( MethodDeclaration methodDecl ) { this . handle ( IProblem . CannotAllocateVoidArray , NoArgument , NoArgument , methodDecl . returnType . sourceStart , methodDecl . returnType . sourceEnd ) ; } public void scannerError ( Parser parser , String errorTokenName ) { Scanner scanner = parser . scanner ; int flag = IProblem . ParsingErrorNoSuggestion ; int startPos = scanner . startPosition ; int endPos = scanner . currentPosition - <NUM_LIT:1> ; if ( errorTokenName . equals ( Scanner . END_OF_SOURCE ) ) flag = IProblem . EndOfSource ; else if ( errorTokenName . equals ( Scanner . INVALID_HEXA ) ) flag = IProblem . InvalidHexa ; else if ( errorTokenName . equals ( Scanner . ILLEGAL_HEXA_LITERAL ) ) flag = IProblem . IllegalHexaLiteral ; else if ( errorTokenName . equals ( Scanner . INVALID_OCTAL ) ) flag = IProblem . InvalidOctal ; else if ( errorTokenName . equals ( Scanner . INVALID_CHARACTER_CONSTANT ) ) flag = IProblem . InvalidCharacterConstant ; else if ( errorTokenName . equals ( Scanner . INVALID_ESCAPE ) ) flag = IProblem . InvalidEscape ; else if ( errorTokenName . equals ( Scanner . INVALID_UNICODE_ESCAPE ) ) { flag = IProblem . InvalidUnicodeEscape ; char [ ] source = scanner . source ; int checkPos = scanner . currentPosition - <NUM_LIT:1> ; if ( checkPos >= source . length ) checkPos = source . length - <NUM_LIT:1> ; while ( checkPos >= startPos ) { if ( source [ checkPos ] == '<STR_LIT:\\>' ) break ; checkPos -- ; } startPos = checkPos ; } else if ( errorTokenName . equals ( Scanner . INVALID_LOW_SURROGATE ) ) { flag = IProblem . InvalidLowSurrogate ; } else if ( errorTokenName . equals ( Scanner . INVALID_HIGH_SURROGATE ) ) { flag = IProblem . InvalidHighSurrogate ; char [ ] source = scanner . source ; int checkPos = scanner . startPosition + <NUM_LIT:1> ; while ( checkPos <= endPos ) { if ( source [ checkPos ] == '<STR_LIT:\\>' ) break ; checkPos ++ ; } endPos = checkPos - <NUM_LIT:1> ; } else if ( errorTokenName . equals ( Scanner . INVALID_FLOAT ) ) flag = IProblem . InvalidFloat ; else if ( errorTokenName . equals ( Scanner . UNTERMINATED_STRING ) ) flag = IProblem . UnterminatedString ; else if ( errorTokenName . equals ( Scanner . UNTERMINATED_COMMENT ) ) flag = IProblem . UnterminatedComment ; else if ( errorTokenName . equals ( Scanner . INVALID_CHAR_IN_STRING ) ) flag = IProblem . UnterminatedString ; else if ( errorTokenName . equals ( Scanner . INVALID_DIGIT ) ) flag = IProblem . InvalidDigit ; else if ( errorTokenName . equals ( Scanner . INVALID_BINARY ) ) flag = IProblem . InvalidBinary ; else if ( errorTokenName . equals ( Scanner . BINARY_LITERAL_NOT_BELOW_17 ) ) flag = IProblem . BinaryLiteralNotBelow17 ; else if ( errorTokenName . equals ( Scanner . INVALID_UNDERSCORE ) ) flag = IProblem . IllegalUnderscorePosition ; else if ( errorTokenName . equals ( Scanner . UNDERSCORES_IN_LITERALS_NOT_BELOW_17 ) ) flag = IProblem . UnderscoresInLiteralsNotBelow17 ; String [ ] arguments = flag == IProblem . ParsingErrorNoSuggestion ? new String [ ] { errorTokenName } : NoArgument ; this . handle ( flag , arguments , arguments , startPos , endPos , parser . compilationUnit . compilationResult ) ; } public void shouldImplementHashcode ( SourceTypeBinding type ) { this . handle ( IProblem . ShouldImplementHashcode , new String [ ] { new String ( type . readableName ( ) ) } , new String [ ] { new String ( type . shortReadableName ( ) ) } , type . sourceStart ( ) , type . sourceEnd ( ) ) ; } public void shouldReturn ( TypeBinding returnType , ASTNode location ) { this . handle ( methodHasMissingSwitchDefault ( ) ? IProblem . ShouldReturnValueHintMissingDefault : IProblem . ShouldReturnValue , new String [ ] { new String ( returnType . readableName ( ) ) } , new String [ ] { new String ( returnType . shortReadableName ( ) ) } , location . sourceStart , location . sourceEnd ) ; } public void signalNoImplicitStringConversionForCharArrayExpression ( Expression expression ) { this . handle ( IProblem . NoImplicitStringConversionForCharArrayExpression , NoArgument , NoArgument , expression . sourceStart , expression . sourceEnd ) ; } public void staticAndInstanceConflict ( MethodBinding currentMethod , MethodBinding inheritedMethod ) { if ( currentMethod . isStatic ( ) ) this . handle ( IProblem . CannotHideAnInstanceMethodWithAStaticMethod , new String [ ] { new String ( inheritedMethod . declaringClass . readableName ( ) ) } , new String [ ] { new String ( inheritedMethod . declaringClass . shortReadableName ( ) ) } , currentMethod . sourceStart ( ) , currentMethod . sourceEnd ( ) ) ; else this . handle ( IProblem . CannotOverrideAStaticMethodWithAnInstanceMethod , new String [ ] { new String ( inheritedMethod . declaringClass . readableName ( ) ) } , new String [ ] { new String ( inheritedMethod . declaringClass . shortReadableName ( ) ) } , currentMethod . sourceStart ( ) , currentMethod . sourceEnd ( ) ) ; } public void staticFieldAccessToNonStaticVariable ( ASTNode location , FieldBinding field ) { String [ ] arguments = new String [ ] { new String ( field . readableName ( ) ) } ; this . handle ( IProblem . NonStaticFieldFromStaticInvocation , arguments , arguments , nodeSourceStart ( field , location ) , nodeSourceEnd ( field , location ) ) ; } public void staticInheritedMethodConflicts ( SourceTypeBinding type , MethodBinding concreteMethod , MethodBinding [ ] abstractMethods ) { this . handle ( IProblem . StaticInheritedMethodConflicts , new String [ ] { new String ( concreteMethod . readableName ( ) ) , new String ( abstractMethods [ <NUM_LIT:0> ] . declaringClass . readableName ( ) ) } , new String [ ] { new String ( concreteMethod . readableName ( ) ) , new String ( abstractMethods [ <NUM_LIT:0> ] . declaringClass . shortReadableName ( ) ) } , type . sourceStart ( ) , type . sourceEnd ( ) ) ; } public void staticMemberOfParameterizedType ( ASTNode location , ReferenceBinding type , int index ) { if ( location == null ) { this . handle ( IProblem . StaticMemberOfParameterizedType , new String [ ] { new String ( type . readableName ( ) ) , new String ( type . enclosingType ( ) . readableName ( ) ) , } , new String [ ] { new String ( type . shortReadableName ( ) ) , new String ( type . enclosingType ( ) . shortReadableName ( ) ) , } , ProblemSeverities . AbortCompilation | ProblemSeverities . Error | ProblemSeverities . Fatal , <NUM_LIT:0> , <NUM_LIT:0> ) ; return ; } this . handle ( IProblem . StaticMemberOfParameterizedType , new String [ ] { new String ( type . readableName ( ) ) , new String ( type . enclosingType ( ) . readableName ( ) ) , } , new String [ ] { new String ( type . shortReadableName ( ) ) , new String ( type . enclosingType ( ) . shortReadableName ( ) ) , } , location . sourceStart , nodeSourceEnd ( null , location , index ) ) ; } public void stringConstantIsExceedingUtf8Limit ( ASTNode location ) { this . handle ( IProblem . StringConstantIsExceedingUtf8Limit , NoArgument , NoArgument , location . sourceStart , location . sourceEnd ) ; } public void superclassMustBeAClass ( SourceTypeBinding type , TypeReference superclassRef , ReferenceBinding superType ) { this . handle ( IProblem . SuperclassMustBeAClass , new String [ ] { new String ( superType . readableName ( ) ) , new String ( type . sourceName ( ) ) } , new String [ ] { new String ( superType . shortReadableName ( ) ) , new String ( type . sourceName ( ) ) } , superclassRef . sourceStart , superclassRef . sourceEnd ) ; } public void superfluousSemicolon ( int sourceStart , int sourceEnd ) { this . handle ( IProblem . SuperfluousSemicolon , NoArgument , NoArgument , sourceStart , sourceEnd ) ; } public void superinterfaceMustBeAnInterface ( SourceTypeBinding type , TypeReference superInterfaceRef , ReferenceBinding superType ) { this . handle ( IProblem . SuperInterfaceMustBeAnInterface , new String [ ] { new String ( superType . readableName ( ) ) , new String ( type . sourceName ( ) ) } , new String [ ] { new String ( superType . shortReadableName ( ) ) , new String ( type . sourceName ( ) ) } , superInterfaceRef . sourceStart , superInterfaceRef . sourceEnd ) ; } public void superinterfacesCollide ( TypeBinding type , ASTNode decl , TypeBinding superType , TypeBinding inheritedSuperType ) { this . handle ( IProblem . SuperInterfacesCollide , new String [ ] { new String ( superType . readableName ( ) ) , new String ( inheritedSuperType . readableName ( ) ) , new String ( type . sourceName ( ) ) } , new String [ ] { new String ( superType . shortReadableName ( ) ) , new String ( inheritedSuperType . shortReadableName ( ) ) , new String ( type . sourceName ( ) ) } , decl . sourceStart , decl . sourceEnd ) ; } public void superTypeCannotUseWildcard ( SourceTypeBinding type , TypeReference superclass , TypeBinding superTypeBinding ) { String name = new String ( type . sourceName ( ) ) ; String superTypeFullName = new String ( superTypeBinding . readableName ( ) ) ; String superTypeShortName = new String ( superTypeBinding . shortReadableName ( ) ) ; if ( superTypeShortName . equals ( name ) ) superTypeShortName = superTypeFullName ; this . handle ( IProblem . SuperTypeUsingWildcard , new String [ ] { superTypeFullName , name } , new String [ ] { superTypeShortName , name } , superclass . sourceStart , superclass . sourceEnd ) ; } private void syntaxError ( int id , int startPosition , int endPosition , int currentKind , char [ ] currentTokenSource , String errorTokenName , String expectedToken ) { String eTokenName ; if ( isKeyword ( currentKind ) || isLiteral ( currentKind ) || isIdentifier ( currentKind ) ) { eTokenName = new String ( currentTokenSource ) ; } else { eTokenName = errorTokenName ; } String [ ] arguments ; if ( expectedToken != null ) { arguments = new String [ ] { eTokenName , expectedToken } ; } else { arguments = new String [ ] { eTokenName } ; } this . handle ( id , arguments , arguments , startPosition , endPosition ) ; } public void task ( String tag , String message , String priority , int start , int end ) { this . handle ( IProblem . Task , new String [ ] { tag , message , priority } , new String [ ] { tag , message , priority } , start , end ) ; } public void tooManyDimensions ( ASTNode expression ) { this . handle ( IProblem . TooManyArrayDimensions , NoArgument , NoArgument , expression . sourceStart , expression . sourceEnd ) ; } public void tooManyFields ( TypeDeclaration typeDeclaration ) { this . handle ( IProblem . TooManyFields , new String [ ] { new String ( typeDeclaration . binding . readableName ( ) ) } , new String [ ] { new String ( typeDeclaration . binding . shortReadableName ( ) ) } , ProblemSeverities . Abort | ProblemSeverities . Error | ProblemSeverities . Fatal , typeDeclaration . sourceStart , typeDeclaration . sourceEnd ) ; } public void tooManyMethods ( TypeDeclaration typeDeclaration ) { this . handle ( IProblem . TooManyMethods , new String [ ] { new String ( typeDeclaration . binding . readableName ( ) ) } , new String [ ] { new String ( typeDeclaration . binding . shortReadableName ( ) ) } , ProblemSeverities . Abort | ProblemSeverities . Error | ProblemSeverities . Fatal , typeDeclaration . sourceStart , typeDeclaration . sourceEnd ) ; } public void tooManyParametersForSyntheticMethod ( AbstractMethodDeclaration method ) { MethodBinding binding = method . binding ; String selector = null ; if ( binding . isConstructor ( ) ) { selector = new String ( binding . declaringClass . sourceName ( ) ) ; } else { selector = new String ( method . selector ) ; } this . handle ( IProblem . TooManyParametersForSyntheticMethod , new String [ ] { selector , typesAsString ( binding , false ) , new String ( binding . declaringClass . readableName ( ) ) , } , new String [ ] { selector , typesAsString ( binding , true ) , new String ( binding . declaringClass . shortReadableName ( ) ) , } , ProblemSeverities . AbortMethod | ProblemSeverities . Error | ProblemSeverities . Fatal , method . sourceStart , method . sourceEnd ) ; } public void typeCastError ( CastExpression expression , TypeBinding leftType , TypeBinding rightType ) { String leftName = new String ( leftType . readableName ( ) ) ; String rightName = new String ( rightType . readableName ( ) ) ; String leftShortName = new String ( leftType . shortReadableName ( ) ) ; String rightShortName = new String ( rightType . shortReadableName ( ) ) ; if ( leftShortName . equals ( rightShortName ) ) { leftShortName = leftName ; rightShortName = rightName ; } this . handle ( IProblem . IllegalCast , new String [ ] { rightName , leftName } , new String [ ] { rightShortName , leftShortName } , expression . sourceStart , expression . sourceEnd ) ; } public void typeCollidesWithEnclosingType ( TypeDeclaration typeDecl ) { String [ ] arguments = new String [ ] { new String ( typeDecl . name ) } ; this . handle ( IProblem . HidingEnclosingType , arguments , arguments , typeDecl . sourceStart , typeDecl . sourceEnd ) ; } public void typeCollidesWithPackage ( CompilationUnitDeclaration compUnitDecl , TypeDeclaration typeDecl ) { this . referenceContext = typeDecl ; String [ ] arguments = new String [ ] { new String ( compUnitDecl . getFileName ( ) ) , new String ( typeDecl . name ) } ; this . handle ( IProblem . TypeCollidesWithPackage , arguments , arguments , typeDecl . sourceStart , typeDecl . sourceEnd , compUnitDecl . compilationResult ) ; } public void typeHiding ( TypeDeclaration typeDecl , TypeBinding hiddenType ) { int severity = computeSeverity ( IProblem . TypeHidingType ) ; if ( severity == ProblemSeverities . Ignore ) return ; this . handle ( IProblem . TypeHidingType , new String [ ] { new String ( typeDecl . name ) , new String ( hiddenType . shortReadableName ( ) ) } , new String [ ] { new String ( typeDecl . name ) , new String ( hiddenType . readableName ( ) ) } , severity , typeDecl . sourceStart , typeDecl . sourceEnd ) ; } public void typeHiding ( TypeDeclaration typeDecl , TypeVariableBinding hiddenTypeParameter ) { int severity = computeSeverity ( IProblem . TypeHidingTypeParameterFromType ) ; if ( severity == ProblemSeverities . Ignore ) return ; if ( hiddenTypeParameter . declaringElement instanceof TypeBinding ) { TypeBinding declaringType = ( TypeBinding ) hiddenTypeParameter . declaringElement ; this . handle ( IProblem . TypeHidingTypeParameterFromType , new String [ ] { new String ( typeDecl . name ) , new String ( hiddenTypeParameter . readableName ( ) ) , new String ( declaringType . readableName ( ) ) } , new String [ ] { new String ( typeDecl . name ) , new String ( hiddenTypeParameter . shortReadableName ( ) ) , new String ( declaringType . shortReadableName ( ) ) } , severity , typeDecl . sourceStart , typeDecl . sourceEnd ) ; } else { MethodBinding declaringMethod = ( MethodBinding ) hiddenTypeParameter . declaringElement ; this . handle ( IProblem . TypeHidingTypeParameterFromMethod , new String [ ] { new String ( typeDecl . name ) , new String ( hiddenTypeParameter . readableName ( ) ) , new String ( declaringMethod . selector ) , typesAsString ( declaringMethod , false ) , new String ( declaringMethod . declaringClass . readableName ( ) ) , } , new String [ ] { new String ( typeDecl . name ) , new String ( hiddenTypeParameter . shortReadableName ( ) ) , new String ( declaringMethod . selector ) , typesAsString ( declaringMethod , true ) , new String ( declaringMethod . declaringClass . shortReadableName ( ) ) , } , severity , typeDecl . sourceStart , typeDecl . sourceEnd ) ; } } public void typeHiding ( TypeParameter typeParam , Binding hidden ) { int severity = computeSeverity ( IProblem . TypeParameterHidingType ) ; if ( severity == ProblemSeverities . Ignore ) return ; TypeBinding hiddenType = ( TypeBinding ) hidden ; this . handle ( IProblem . TypeParameterHidingType , new String [ ] { new String ( typeParam . name ) , new String ( hiddenType . readableName ( ) ) } , new String [ ] { new String ( typeParam . name ) , new String ( hiddenType . shortReadableName ( ) ) } , severity , typeParam . sourceStart , typeParam . sourceEnd ) ; } public void typeMismatchError ( TypeBinding actualType , TypeBinding expectedType , ASTNode location , ASTNode expectingLocation ) { if ( this . options . sourceLevel < ClassFileConstants . JDK1_5 ) { if ( actualType instanceof TypeVariableBinding ) actualType = actualType . erasure ( ) ; if ( expectedType instanceof TypeVariableBinding ) expectedType = expectedType . erasure ( ) ; } if ( actualType != null && ( actualType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . handle ( IProblem . UndefinedType , new String [ ] { new String ( actualType . leafComponentType ( ) . readableName ( ) ) } , new String [ ] { new String ( actualType . leafComponentType ( ) . shortReadableName ( ) ) } , location . sourceStart , location . sourceEnd ) ; return ; } if ( expectingLocation != null && ( expectedType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . handle ( IProblem . UndefinedType , new String [ ] { new String ( expectedType . leafComponentType ( ) . readableName ( ) ) } , new String [ ] { new String ( expectedType . leafComponentType ( ) . shortReadableName ( ) ) } , expectingLocation . sourceStart , expectingLocation . sourceEnd ) ; return ; } char [ ] actualShortReadableName = actualType . shortReadableName ( ) ; char [ ] expectedShortReadableName = expectedType . shortReadableName ( ) ; if ( CharOperation . equals ( actualShortReadableName , expectedShortReadableName ) ) { actualShortReadableName = actualType . readableName ( ) ; expectedShortReadableName = expectedType . readableName ( ) ; } this . handle ( IProblem . TypeMismatch , new String [ ] { new String ( actualType . readableName ( ) ) , new String ( expectedType . readableName ( ) ) } , new String [ ] { new String ( actualShortReadableName ) , new String ( expectedShortReadableName ) } , location . sourceStart , location . sourceEnd ) ; } public void typeMismatchError ( TypeBinding typeArgument , TypeVariableBinding typeParameter , ReferenceBinding genericType , ASTNode location ) { if ( location == null ) { this . handle ( IProblem . TypeArgumentMismatch , new String [ ] { new String ( typeArgument . readableName ( ) ) , new String ( genericType . readableName ( ) ) , new String ( typeParameter . sourceName ) , parameterBoundAsString ( typeParameter , false ) } , new String [ ] { new String ( typeArgument . shortReadableName ( ) ) , new String ( genericType . shortReadableName ( ) ) , new String ( typeParameter . sourceName ) , parameterBoundAsString ( typeParameter , true ) } , ProblemSeverities . AbortCompilation | ProblemSeverities . Error | ProblemSeverities . Fatal , <NUM_LIT:0> , <NUM_LIT:0> ) ; return ; } this . handle ( IProblem . TypeArgumentMismatch , new String [ ] { new String ( typeArgument . readableName ( ) ) , new String ( genericType . readableName ( ) ) , new String ( typeParameter . sourceName ) , parameterBoundAsString ( typeParameter , false ) } , new String [ ] { new String ( typeArgument . shortReadableName ( ) ) , new String ( genericType . shortReadableName ( ) ) , new String ( typeParameter . sourceName ) , parameterBoundAsString ( typeParameter , true ) } , location . sourceStart , location . sourceEnd ) ; } private String typesAsString ( MethodBinding methodBinding , boolean makeShort ) { return typesAsString ( methodBinding , methodBinding . parameters , makeShort ) ; } private String typesAsString ( MethodBinding methodBinding , TypeBinding [ ] parameters , boolean makeShort ) { if ( methodBinding . isPolymorphic ( ) ) { TypeBinding [ ] types = methodBinding . original ( ) . parameters ; StringBuffer buffer = new StringBuffer ( <NUM_LIT:10> ) ; for ( int i = <NUM_LIT:0> , length = types . length ; i < length ; i ++ ) { if ( i != <NUM_LIT:0> ) { buffer . append ( "<STR_LIT:U+002CU+0020>" ) ; } TypeBinding type = types [ i ] ; boolean isVarargType = i == length - <NUM_LIT:1> ; if ( isVarargType ) { type = ( ( ArrayBinding ) type ) . elementsType ( ) ; } buffer . append ( new String ( makeShort ? type . shortReadableName ( ) : type . readableName ( ) ) ) ; if ( isVarargType ) { buffer . append ( "<STR_LIT:...>" ) ; } } return buffer . toString ( ) ; } StringBuffer buffer = new StringBuffer ( <NUM_LIT:10> ) ; for ( int i = <NUM_LIT:0> , length = parameters . length ; i < length ; i ++ ) { if ( i != <NUM_LIT:0> ) { buffer . append ( "<STR_LIT:U+002CU+0020>" ) ; } TypeBinding type = parameters [ i ] ; boolean isVarargType = methodBinding . isVarargs ( ) && i == length - <NUM_LIT:1> ; if ( isVarargType ) { type = ( ( ArrayBinding ) type ) . elementsType ( ) ; } buffer . append ( new String ( makeShort ? type . shortReadableName ( ) : type . readableName ( ) ) ) ; if ( isVarargType ) { buffer . append ( "<STR_LIT:...>" ) ; } } return buffer . toString ( ) ; } private String typesAsString ( TypeBinding [ ] types , boolean makeShort ) { StringBuffer buffer = new StringBuffer ( <NUM_LIT:10> ) ; for ( int i = <NUM_LIT:0> , length = types . length ; i < length ; i ++ ) { if ( i != <NUM_LIT:0> ) { buffer . append ( "<STR_LIT:U+002CU+0020>" ) ; } TypeBinding type = types [ i ] ; buffer . append ( new String ( makeShort ? type . shortReadableName ( ) : type . readableName ( ) ) ) ; } return buffer . toString ( ) ; } public void undefinedAnnotationValue ( TypeBinding annotationType , MemberValuePair memberValuePair ) { if ( isRecoveredName ( memberValuePair . name ) ) return ; String name = new String ( memberValuePair . name ) ; this . handle ( IProblem . UndefinedAnnotationMember , new String [ ] { name , new String ( annotationType . readableName ( ) ) } , new String [ ] { name , new String ( annotationType . shortReadableName ( ) ) } , memberValuePair . sourceStart , memberValuePair . sourceEnd ) ; } public void undefinedLabel ( BranchStatement statement ) { if ( isRecoveredName ( statement . label ) ) return ; String [ ] arguments = new String [ ] { new String ( statement . label ) } ; this . handle ( IProblem . UndefinedLabel , arguments , arguments , statement . sourceStart , statement . sourceEnd ) ; } public void undefinedTypeVariableSignature ( char [ ] variableName , ReferenceBinding binaryType ) { this . handle ( IProblem . UndefinedTypeVariable , new String [ ] { new String ( variableName ) , new String ( binaryType . readableName ( ) ) } , new String [ ] { new String ( variableName ) , new String ( binaryType . shortReadableName ( ) ) } , ProblemSeverities . AbortCompilation | ProblemSeverities . Error | ProblemSeverities . Fatal , <NUM_LIT:0> , <NUM_LIT:0> ) ; } public void undocumentedEmptyBlock ( int blockStart , int blockEnd ) { this . handle ( IProblem . UndocumentedEmptyBlock , NoArgument , NoArgument , blockStart , blockEnd ) ; } public void unexpectedStaticModifierForField ( SourceTypeBinding type , FieldDeclaration fieldDecl ) { String [ ] arguments = new String [ ] { new String ( fieldDecl . name ) } ; this . handle ( IProblem . UnexpectedStaticModifierForField , arguments , arguments , fieldDecl . sourceStart , fieldDecl . sourceEnd ) ; } public void unexpectedStaticModifierForMethod ( ReferenceBinding type , AbstractMethodDeclaration methodDecl ) { String [ ] arguments = new String [ ] { new String ( type . sourceName ( ) ) , new String ( methodDecl . selector ) } ; this . handle ( IProblem . UnexpectedStaticModifierForMethod , arguments , arguments , methodDecl . sourceStart , methodDecl . sourceEnd ) ; } public void unhandledException ( TypeBinding exceptionType , ASTNode location ) { boolean insideDefaultConstructor = ( this . referenceContext instanceof ConstructorDeclaration ) && ( ( ConstructorDeclaration ) this . referenceContext ) . isDefaultConstructor ( ) ; boolean insideImplicitConstructorCall = ( location instanceof ExplicitConstructorCall ) && ( ( ( ExplicitConstructorCall ) location ) . accessMode == ExplicitConstructorCall . ImplicitSuper ) ; int sourceEnd = location . sourceEnd ; if ( location instanceof LocalDeclaration ) { sourceEnd = ( ( LocalDeclaration ) location ) . declarationEnd ; } this . handle ( insideDefaultConstructor ? IProblem . UnhandledExceptionInDefaultConstructor : ( insideImplicitConstructorCall ? IProblem . UndefinedConstructorInImplicitConstructorCall : IProblem . UnhandledException ) , new String [ ] { new String ( exceptionType . readableName ( ) ) } , new String [ ] { new String ( exceptionType . shortReadableName ( ) ) } , location . sourceStart , sourceEnd ) ; } public void unhandledExceptionFromAutoClose ( TypeBinding exceptionType , ASTNode location ) { LocalVariableBinding localBinding = ( ( LocalDeclaration ) location ) . binding ; if ( localBinding != null ) { this . handle ( IProblem . UnhandledExceptionOnAutoClose , new String [ ] { new String ( exceptionType . readableName ( ) ) , new String ( localBinding . readableName ( ) ) } , new String [ ] { new String ( exceptionType . shortReadableName ( ) ) , new String ( localBinding . shortReadableName ( ) ) } , location . sourceStart , location . sourceEnd ) ; } } public void unhandledWarningToken ( Expression token ) { String [ ] arguments = new String [ ] { token . constant . stringValue ( ) } ; this . handle ( IProblem . UnhandledWarningToken , arguments , arguments , token . sourceStart , token . sourceEnd ) ; } public void uninitializedBlankFinalField ( FieldBinding field , ASTNode location ) { String [ ] arguments = new String [ ] { new String ( field . readableName ( ) ) } ; this . handle ( methodHasMissingSwitchDefault ( ) ? IProblem . UninitializedBlankFinalFieldHintMissingDefault : IProblem . UninitializedBlankFinalField , arguments , arguments , nodeSourceStart ( field , location ) , nodeSourceEnd ( field , location ) ) ; } public void uninitializedLocalVariable ( LocalVariableBinding binding , ASTNode location ) { binding . tagBits |= TagBits . NotInitialized ; String [ ] arguments = new String [ ] { new String ( binding . readableName ( ) ) } ; this . handle ( methodHasMissingSwitchDefault ( ) ? IProblem . UninitializedLocalVariableHintMissingDefault : IProblem . UninitializedLocalVariable , arguments , arguments , nodeSourceStart ( binding , location ) , nodeSourceEnd ( binding , location ) ) ; } private boolean methodHasMissingSwitchDefault ( ) { MethodScope methodScope = null ; if ( this . referenceContext instanceof Block ) { methodScope = ( ( Block ) this . referenceContext ) . scope . methodScope ( ) ; } else if ( this . referenceContext instanceof AbstractMethodDeclaration ) { methodScope = ( ( AbstractMethodDeclaration ) this . referenceContext ) . scope ; } return methodScope != null && methodScope . hasMissingSwitchDefault ; } public void unmatchedBracket ( int position , ReferenceContext context , CompilationResult compilationResult ) { this . handle ( IProblem . UnmatchedBracket , NoArgument , NoArgument , position , position , context , compilationResult ) ; } public void unnecessaryCast ( CastExpression castExpression ) { int severity = computeSeverity ( IProblem . UnnecessaryCast ) ; if ( severity == ProblemSeverities . Ignore ) return ; TypeBinding castedExpressionType = castExpression . expression . resolvedType ; this . handle ( IProblem . UnnecessaryCast , new String [ ] { new String ( castedExpressionType . readableName ( ) ) , new String ( castExpression . type . resolvedType . readableName ( ) ) } , new String [ ] { new String ( castedExpressionType . shortReadableName ( ) ) , new String ( castExpression . type . resolvedType . shortReadableName ( ) ) } , severity , castExpression . sourceStart , castExpression . sourceEnd ) ; } public void unnecessaryElse ( ASTNode location ) { this . handle ( IProblem . UnnecessaryElse , NoArgument , NoArgument , location . sourceStart , location . sourceEnd ) ; } public void unnecessaryEnclosingInstanceSpecification ( Expression expression , ReferenceBinding targetType ) { this . handle ( IProblem . IllegalEnclosingInstanceSpecification , new String [ ] { new String ( targetType . readableName ( ) ) } , new String [ ] { new String ( targetType . shortReadableName ( ) ) } , expression . sourceStart , expression . sourceEnd ) ; } public void unnecessaryInstanceof ( InstanceOfExpression instanceofExpression , TypeBinding checkType ) { int severity = computeSeverity ( IProblem . UnnecessaryInstanceof ) ; if ( severity == ProblemSeverities . Ignore ) return ; TypeBinding expressionType = instanceofExpression . expression . resolvedType ; this . handle ( IProblem . UnnecessaryInstanceof , new String [ ] { new String ( expressionType . readableName ( ) ) , new String ( checkType . readableName ( ) ) } , new String [ ] { new String ( expressionType . shortReadableName ( ) ) , new String ( checkType . shortReadableName ( ) ) } , severity , instanceofExpression . sourceStart , instanceofExpression . sourceEnd ) ; } public void unnecessaryNLSTags ( int sourceStart , int sourceEnd ) { this . handle ( IProblem . UnnecessaryNLSTag , NoArgument , NoArgument , sourceStart , sourceEnd ) ; } public void unnecessaryTypeArgumentsForMethodInvocation ( MethodBinding method , TypeBinding [ ] genericTypeArguments , TypeReference [ ] typeArguments ) { String methodName = method . isConstructor ( ) ? new String ( method . declaringClass . shortReadableName ( ) ) : new String ( method . selector ) ; this . handle ( method . isConstructor ( ) ? IProblem . UnusedTypeArgumentsForConstructorInvocation : IProblem . UnusedTypeArgumentsForMethodInvocation , new String [ ] { methodName , typesAsString ( method , false ) , new String ( method . declaringClass . readableName ( ) ) , typesAsString ( genericTypeArguments , false ) } , new String [ ] { methodName , typesAsString ( method , true ) , new String ( method . declaringClass . shortReadableName ( ) ) , typesAsString ( genericTypeArguments , true ) } , typeArguments [ <NUM_LIT:0> ] . sourceStart , typeArguments [ typeArguments . length - <NUM_LIT:1> ] . sourceEnd ) ; } public void unqualifiedFieldAccess ( NameReference reference , FieldBinding field ) { int sourceStart = reference . sourceStart ; int sourceEnd = reference . sourceEnd ; if ( reference instanceof SingleNameReference ) { int numberOfParens = ( reference . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens != <NUM_LIT:0> ) { sourceStart = retrieveStartingPositionAfterOpeningParenthesis ( sourceStart , sourceEnd , numberOfParens ) ; sourceEnd = retrieveEndingPositionAfterOpeningParenthesis ( sourceStart , sourceEnd , numberOfParens ) ; } else { sourceStart = nodeSourceStart ( field , reference ) ; sourceEnd = nodeSourceEnd ( field , reference ) ; } } else { sourceStart = nodeSourceStart ( field , reference ) ; sourceEnd = nodeSourceEnd ( field , reference ) ; } this . handle ( IProblem . UnqualifiedFieldAccess , new String [ ] { new String ( field . declaringClass . readableName ( ) ) , new String ( field . name ) } , new String [ ] { new String ( field . declaringClass . shortReadableName ( ) ) , new String ( field . name ) } , sourceStart , sourceEnd ) ; } public void unreachableCatchBlock ( ReferenceBinding exceptionType , ASTNode location ) { this . handle ( IProblem . UnreachableCatch , new String [ ] { new String ( exceptionType . readableName ( ) ) , } , new String [ ] { new String ( exceptionType . shortReadableName ( ) ) , } , location . sourceStart , location . sourceEnd ) ; } public void unreachableCode ( Statement statement ) { int sourceStart = statement . sourceStart ; int sourceEnd = statement . sourceEnd ; if ( statement instanceof LocalDeclaration ) { LocalDeclaration declaration = ( LocalDeclaration ) statement ; sourceStart = declaration . declarationSourceStart ; sourceEnd = declaration . declarationSourceEnd ; } else if ( statement instanceof Expression ) { int statemendEnd = ( ( Expression ) statement ) . statementEnd ; if ( statemendEnd != - <NUM_LIT:1> ) sourceEnd = statemendEnd ; } this . handle ( IProblem . CodeCannotBeReached , NoArgument , NoArgument , sourceStart , sourceEnd ) ; } public void unresolvableReference ( NameReference nameRef , Binding binding ) { String [ ] arguments = new String [ ] { new String ( binding . readableName ( ) ) } ; int end = nameRef . sourceEnd ; int sourceStart = nameRef . sourceStart ; if ( nameRef instanceof QualifiedNameReference ) { QualifiedNameReference ref = ( QualifiedNameReference ) nameRef ; if ( isRecoveredName ( ref . tokens ) ) return ; if ( ref . indexOfFirstFieldBinding >= <NUM_LIT:1> ) end = ( int ) ref . sourcePositions [ ref . indexOfFirstFieldBinding - <NUM_LIT:1> ] ; } else { SingleNameReference ref = ( SingleNameReference ) nameRef ; if ( isRecoveredName ( ref . token ) ) return ; int numberOfParens = ( ref . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens != <NUM_LIT:0> ) { sourceStart = retrieveStartingPositionAfterOpeningParenthesis ( sourceStart , end , numberOfParens ) ; end = retrieveEndingPositionAfterOpeningParenthesis ( sourceStart , end , numberOfParens ) ; } } int problemId = ( nameRef . bits & Binding . VARIABLE ) != <NUM_LIT:0> && ( nameRef . bits & Binding . TYPE ) == <NUM_LIT:0> ? IProblem . UnresolvedVariable : IProblem . UndefinedName ; this . handle ( problemId , arguments , arguments , sourceStart , end ) ; } public void unsafeCast ( CastExpression castExpression , Scope scope ) { if ( this . options . sourceLevel < ClassFileConstants . JDK1_5 ) return ; int severity = computeSeverity ( IProblem . UnsafeGenericCast ) ; if ( severity == ProblemSeverities . Ignore ) return ; TypeBinding castedExpressionType = castExpression . expression . resolvedType ; TypeBinding castExpressionResolvedType = castExpression . resolvedType ; this . handle ( IProblem . UnsafeGenericCast , new String [ ] { new String ( castedExpressionType . readableName ( ) ) , new String ( castExpressionResolvedType . readableName ( ) ) } , new String [ ] { new String ( castedExpressionType . shortReadableName ( ) ) , new String ( castExpressionResolvedType . shortReadableName ( ) ) } , severity , castExpression . sourceStart , castExpression . sourceEnd ) ; } public void unsafeGenericArrayForVarargs ( TypeBinding leafComponentType , ASTNode location ) { int severity = computeSeverity ( IProblem . UnsafeGenericArrayForVarargs ) ; if ( severity == ProblemSeverities . Ignore ) return ; this . handle ( IProblem . UnsafeGenericArrayForVarargs , new String [ ] { new String ( leafComponentType . readableName ( ) ) } , new String [ ] { new String ( leafComponentType . shortReadableName ( ) ) } , severity , location . sourceStart , location . sourceEnd ) ; } public void unsafeRawFieldAssignment ( FieldBinding field , TypeBinding expressionType , ASTNode location ) { if ( this . options . sourceLevel < ClassFileConstants . JDK1_5 ) return ; int severity = computeSeverity ( IProblem . UnsafeRawFieldAssignment ) ; if ( severity == ProblemSeverities . Ignore ) return ; this . handle ( IProblem . UnsafeRawFieldAssignment , new String [ ] { new String ( expressionType . readableName ( ) ) , new String ( field . name ) , new String ( field . declaringClass . readableName ( ) ) , new String ( field . declaringClass . erasure ( ) . readableName ( ) ) } , new String [ ] { new String ( expressionType . shortReadableName ( ) ) , new String ( field . name ) , new String ( field . declaringClass . shortReadableName ( ) ) , new String ( field . declaringClass . erasure ( ) . shortReadableName ( ) ) } , severity , nodeSourceStart ( field , location ) , nodeSourceEnd ( field , location ) ) ; } public void unsafeRawGenericMethodInvocation ( ASTNode location , MethodBinding rawMethod , TypeBinding [ ] argumentTypes ) { if ( this . options . sourceLevel < ClassFileConstants . JDK1_5 ) return ; boolean isConstructor = rawMethod . isConstructor ( ) ; int severity = computeSeverity ( isConstructor ? IProblem . UnsafeRawGenericConstructorInvocation : IProblem . UnsafeRawGenericMethodInvocation ) ; if ( severity == ProblemSeverities . Ignore ) return ; if ( isConstructor ) { this . handle ( IProblem . UnsafeRawGenericConstructorInvocation , new String [ ] { new String ( rawMethod . declaringClass . sourceName ( ) ) , typesAsString ( rawMethod . original ( ) , false ) , new String ( rawMethod . declaringClass . readableName ( ) ) , typesAsString ( argumentTypes , false ) , } , new String [ ] { new String ( rawMethod . declaringClass . sourceName ( ) ) , typesAsString ( rawMethod . original ( ) , true ) , new String ( rawMethod . declaringClass . shortReadableName ( ) ) , typesAsString ( argumentTypes , true ) , } , severity , location . sourceStart , location . sourceEnd ) ; } else { this . handle ( IProblem . UnsafeRawGenericMethodInvocation , new String [ ] { new String ( rawMethod . selector ) , typesAsString ( rawMethod . original ( ) , false ) , new String ( rawMethod . declaringClass . readableName ( ) ) , typesAsString ( argumentTypes , false ) , } , new String [ ] { new String ( rawMethod . selector ) , typesAsString ( rawMethod . original ( ) , true ) , new String ( rawMethod . declaringClass . shortReadableName ( ) ) , typesAsString ( argumentTypes , true ) , } , severity , location . sourceStart , location . sourceEnd ) ; } } public void unsafeRawInvocation ( ASTNode location , MethodBinding rawMethod ) { if ( this . options . sourceLevel < ClassFileConstants . JDK1_5 ) return ; boolean isConstructor = rawMethod . isConstructor ( ) ; int severity = computeSeverity ( isConstructor ? IProblem . UnsafeRawConstructorInvocation : IProblem . UnsafeRawMethodInvocation ) ; if ( severity == ProblemSeverities . Ignore ) return ; if ( isConstructor ) { this . handle ( IProblem . UnsafeRawConstructorInvocation , new String [ ] { new String ( rawMethod . declaringClass . readableName ( ) ) , typesAsString ( rawMethod . original ( ) , rawMethod . parameters , false ) , new String ( rawMethod . declaringClass . erasure ( ) . readableName ( ) ) , } , new String [ ] { new String ( rawMethod . declaringClass . shortReadableName ( ) ) , typesAsString ( rawMethod . original ( ) , rawMethod . parameters , true ) , new String ( rawMethod . declaringClass . erasure ( ) . shortReadableName ( ) ) , } , severity , location . sourceStart , location . sourceEnd ) ; } else { this . handle ( IProblem . UnsafeRawMethodInvocation , new String [ ] { new String ( rawMethod . selector ) , typesAsString ( rawMethod . original ( ) , rawMethod . parameters , false ) , new String ( rawMethod . declaringClass . readableName ( ) ) , new String ( rawMethod . declaringClass . erasure ( ) . readableName ( ) ) , } , new String [ ] { new String ( rawMethod . selector ) , typesAsString ( rawMethod . original ( ) , rawMethod . parameters , true ) , new String ( rawMethod . declaringClass . shortReadableName ( ) ) , new String ( rawMethod . declaringClass . erasure ( ) . shortReadableName ( ) ) , } , severity , location . sourceStart , location . sourceEnd ) ; } } public void unsafeReturnTypeOverride ( MethodBinding currentMethod , MethodBinding inheritedMethod , SourceTypeBinding type ) { if ( this . options . sourceLevel < ClassFileConstants . JDK1_5 ) { return ; } int severity = computeSeverity ( IProblem . UnsafeReturnTypeOverride ) ; if ( severity == ProblemSeverities . Ignore ) return ; int start = type . sourceStart ( ) ; int end = type . sourceEnd ( ) ; if ( currentMethod . declaringClass == type ) { if ( currentMethod . sourceMethod ( ) != null ) { ASTNode location = ( ( MethodDeclaration ) currentMethod . sourceMethod ( ) ) . returnType ; start = location . sourceStart ( ) ; end = location . sourceEnd ( ) ; } } this . handle ( IProblem . UnsafeReturnTypeOverride , new String [ ] { new String ( currentMethod . returnType . readableName ( ) ) , new String ( currentMethod . selector ) , typesAsString ( currentMethod . original ( ) , false ) , new String ( currentMethod . declaringClass . readableName ( ) ) , new String ( inheritedMethod . returnType . readableName ( ) ) , new String ( inheritedMethod . declaringClass . readableName ( ) ) , } , new String [ ] { new String ( currentMethod . returnType . shortReadableName ( ) ) , new String ( currentMethod . selector ) , typesAsString ( currentMethod . original ( ) , true ) , new String ( currentMethod . declaringClass . shortReadableName ( ) ) , new String ( inheritedMethod . returnType . shortReadableName ( ) ) , new String ( inheritedMethod . declaringClass . shortReadableName ( ) ) , } , severity , start , end ) ; } public void unsafeTypeConversion ( Expression expression , TypeBinding expressionType , TypeBinding expectedType ) { if ( this . options . sourceLevel < ClassFileConstants . JDK1_5 ) return ; int severity = computeSeverity ( IProblem . UnsafeTypeConversion ) ; if ( severity == ProblemSeverities . Ignore ) return ; if ( ! this . options . reportUnavoidableGenericTypeProblems && expression . forcedToBeRaw ( this . referenceContext ) ) { return ; } this . handle ( IProblem . UnsafeTypeConversion , new String [ ] { new String ( expressionType . readableName ( ) ) , new String ( expectedType . readableName ( ) ) , new String ( expectedType . erasure ( ) . readableName ( ) ) } , new String [ ] { new String ( expressionType . shortReadableName ( ) ) , new String ( expectedType . shortReadableName ( ) ) , new String ( expectedType . erasure ( ) . shortReadableName ( ) ) } , severity , expression . sourceStart , expression . sourceEnd ) ; } public void unusedArgument ( LocalDeclaration localDecl ) { int severity = computeSeverity ( IProblem . ArgumentIsNeverUsed ) ; if ( severity == ProblemSeverities . Ignore ) return ; String [ ] arguments = new String [ ] { new String ( localDecl . name ) } ; this . handle ( IProblem . ArgumentIsNeverUsed , arguments , arguments , severity , localDecl . sourceStart , localDecl . sourceEnd ) ; } public void unusedDeclaredThrownException ( ReferenceBinding exceptionType , AbstractMethodDeclaration method , ASTNode location ) { boolean isConstructor = method . isConstructor ( ) ; int severity = computeSeverity ( isConstructor ? IProblem . UnusedConstructorDeclaredThrownException : IProblem . UnusedMethodDeclaredThrownException ) ; if ( severity == ProblemSeverities . Ignore ) return ; if ( isConstructor ) { this . handle ( IProblem . UnusedConstructorDeclaredThrownException , new String [ ] { new String ( method . binding . declaringClass . readableName ( ) ) , typesAsString ( method . binding , false ) , new String ( exceptionType . readableName ( ) ) , } , new String [ ] { new String ( method . binding . declaringClass . shortReadableName ( ) ) , typesAsString ( method . binding , true ) , new String ( exceptionType . shortReadableName ( ) ) , } , severity , location . sourceStart , location . sourceEnd ) ; } else { this . handle ( IProblem . UnusedMethodDeclaredThrownException , new String [ ] { new String ( method . binding . declaringClass . readableName ( ) ) , new String ( method . selector ) , typesAsString ( method . binding , false ) , new String ( exceptionType . readableName ( ) ) , } , new String [ ] { new String ( method . binding . declaringClass . shortReadableName ( ) ) , new String ( method . selector ) , typesAsString ( method . binding , true ) , new String ( exceptionType . shortReadableName ( ) ) , } , severity , location . sourceStart , location . sourceEnd ) ; } } public void unusedImport ( ImportReference importRef ) { int severity = computeSeverity ( IProblem . UnusedImport ) ; if ( severity == ProblemSeverities . Ignore ) return ; String [ ] arguments = new String [ ] { CharOperation . toString ( importRef . tokens ) } ; this . handle ( IProblem . UnusedImport , arguments , arguments , severity , importRef . sourceStart , importRef . sourceEnd ) ; } public void unusedLabel ( LabeledStatement statement ) { int severity = computeSeverity ( IProblem . UnusedLabel ) ; if ( severity == ProblemSeverities . Ignore ) return ; String [ ] arguments = new String [ ] { new String ( statement . label ) } ; this . handle ( IProblem . UnusedLabel , arguments , arguments , severity , statement . sourceStart , statement . labelEnd ) ; } public void unusedLocalVariable ( LocalDeclaration localDecl ) { int severity = computeSeverity ( IProblem . LocalVariableIsNeverUsed ) ; if ( severity == ProblemSeverities . Ignore ) return ; String [ ] arguments = new String [ ] { new String ( localDecl . name ) } ; this . handle ( IProblem . LocalVariableIsNeverUsed , arguments , arguments , severity , localDecl . sourceStart , localDecl . sourceEnd ) ; } public void unusedObjectAllocation ( AllocationExpression allocationExpression ) { this . handle ( IProblem . UnusedObjectAllocation , NoArgument , NoArgument , allocationExpression . sourceStart , allocationExpression . sourceEnd ) ; } public void unusedPrivateConstructor ( ConstructorDeclaration constructorDecl ) { int severity = computeSeverity ( IProblem . UnusedPrivateConstructor ) ; if ( severity == ProblemSeverities . Ignore ) return ; if ( excludeDueToAnnotation ( constructorDecl . annotations ) ) return ; MethodBinding constructor = constructorDecl . binding ; this . handle ( IProblem . UnusedPrivateConstructor , new String [ ] { new String ( constructor . declaringClass . readableName ( ) ) , typesAsString ( constructor , false ) } , new String [ ] { new String ( constructor . declaringClass . shortReadableName ( ) ) , typesAsString ( constructor , true ) } , severity , constructorDecl . sourceStart , constructorDecl . sourceEnd ) ; } public void unusedPrivateField ( FieldDeclaration fieldDecl ) { int severity = computeSeverity ( IProblem . UnusedPrivateField ) ; if ( severity == ProblemSeverities . Ignore ) return ; FieldBinding field = fieldDecl . binding ; if ( CharOperation . equals ( TypeConstants . SERIALVERSIONUID , field . name ) && field . isStatic ( ) && field . isFinal ( ) && TypeBinding . LONG == field . type ) { ReferenceBinding referenceBinding = field . declaringClass ; if ( referenceBinding != null ) { if ( referenceBinding . findSuperTypeOriginatingFrom ( TypeIds . T_JavaIoSerializable , false ) != null ) { return ; } } } if ( CharOperation . equals ( TypeConstants . SERIALPERSISTENTFIELDS , field . name ) && field . isStatic ( ) && field . isFinal ( ) && field . type . dimensions ( ) == <NUM_LIT:1> && CharOperation . equals ( TypeConstants . CharArray_JAVA_IO_OBJECTSTREAMFIELD , field . type . leafComponentType ( ) . readableName ( ) ) ) { ReferenceBinding referenceBinding = field . declaringClass ; if ( referenceBinding != null ) { if ( referenceBinding . findSuperTypeOriginatingFrom ( TypeIds . T_JavaIoSerializable , false ) != null ) { return ; } } } if ( excludeDueToAnnotation ( fieldDecl . annotations ) ) return ; this . handle ( IProblem . UnusedPrivateField , new String [ ] { new String ( field . declaringClass . readableName ( ) ) , new String ( field . name ) , } , new String [ ] { new String ( field . declaringClass . shortReadableName ( ) ) , new String ( field . name ) , } , severity , nodeSourceStart ( field , fieldDecl ) , nodeSourceEnd ( field , fieldDecl ) ) ; } public void unusedPrivateMethod ( AbstractMethodDeclaration methodDecl ) { int severity = computeSeverity ( IProblem . UnusedPrivateMethod ) ; if ( severity == ProblemSeverities . Ignore ) return ; MethodBinding method = methodDecl . binding ; if ( ! method . isStatic ( ) && TypeBinding . VOID == method . returnType && method . parameters . length == <NUM_LIT:1> && method . parameters [ <NUM_LIT:0> ] . dimensions ( ) == <NUM_LIT:0> && CharOperation . equals ( method . selector , TypeConstants . READOBJECT ) && CharOperation . equals ( TypeConstants . CharArray_JAVA_IO_OBJECTINPUTSTREAM , method . parameters [ <NUM_LIT:0> ] . readableName ( ) ) ) { return ; } if ( ! method . isStatic ( ) && TypeBinding . VOID == method . returnType && method . parameters . length == <NUM_LIT:1> && method . parameters [ <NUM_LIT:0> ] . dimensions ( ) == <NUM_LIT:0> && CharOperation . equals ( method . selector , TypeConstants . WRITEOBJECT ) && CharOperation . equals ( TypeConstants . CharArray_JAVA_IO_OBJECTOUTPUTSTREAM , method . parameters [ <NUM_LIT:0> ] . readableName ( ) ) ) { return ; } if ( ! method . isStatic ( ) && TypeIds . T_JavaLangObject == method . returnType . id && method . parameters . length == <NUM_LIT:0> && CharOperation . equals ( method . selector , TypeConstants . READRESOLVE ) ) { return ; } if ( ! method . isStatic ( ) && TypeIds . T_JavaLangObject == method . returnType . id && method . parameters . length == <NUM_LIT:0> && CharOperation . equals ( method . selector , TypeConstants . WRITEREPLACE ) ) { return ; } if ( excludeDueToAnnotation ( methodDecl . annotations ) ) return ; this . handle ( IProblem . UnusedPrivateMethod , new String [ ] { new String ( method . declaringClass . readableName ( ) ) , new String ( method . selector ) , typesAsString ( method , false ) } , new String [ ] { new String ( method . declaringClass . shortReadableName ( ) ) , new String ( method . selector ) , typesAsString ( method , true ) } , severity , methodDecl . sourceStart , methodDecl . sourceEnd ) ; } private boolean excludeDueToAnnotation ( Annotation [ ] annotations ) { int annotationsLen = <NUM_LIT:0> ; if ( annotations != null ) { annotationsLen = annotations . length ; } else { return false ; } if ( annotationsLen == <NUM_LIT:0> ) return false ; for ( int i = <NUM_LIT:0> ; i < annotationsLen ; i ++ ) { TypeBinding resolvedType = annotations [ i ] . resolvedType ; if ( resolvedType != null ) { switch ( resolvedType . id ) { case TypeIds . T_JavaLangSuppressWarnings : case TypeIds . T_JavaLangDeprecated : case TypeIds . T_JavaLangSafeVarargs : case TypeIds . T_ConfiguredAnnotationNonNull : case TypeIds . T_ConfiguredAnnotationNullable : case TypeIds . T_ConfiguredAnnotationNonNullByDefault : break ; default : return true ; } } } return false ; } public void unusedPrivateType ( TypeDeclaration typeDecl ) { int severity = computeSeverity ( IProblem . UnusedPrivateType ) ; if ( severity == ProblemSeverities . Ignore ) return ; if ( excludeDueToAnnotation ( typeDecl . annotations ) ) return ; ReferenceBinding type = typeDecl . binding ; this . handle ( IProblem . UnusedPrivateType , new String [ ] { new String ( type . readableName ( ) ) , } , new String [ ] { new String ( type . shortReadableName ( ) ) , } , severity , typeDecl . sourceStart , typeDecl . sourceEnd ) ; } public void unusedWarningToken ( Expression token ) { String [ ] arguments = new String [ ] { token . constant . stringValue ( ) } ; this . handle ( IProblem . UnusedWarningToken , arguments , arguments , token . sourceStart , token . sourceEnd ) ; } public void useAssertAsAnIdentifier ( int sourceStart , int sourceEnd ) { this . handle ( IProblem . UseAssertAsAnIdentifier , NoArgument , NoArgument , sourceStart , sourceEnd ) ; } public void useEnumAsAnIdentifier ( int sourceStart , int sourceEnd ) { this . handle ( IProblem . UseEnumAsAnIdentifier , NoArgument , NoArgument , sourceStart , sourceEnd ) ; } public void varargsArgumentNeedCast ( MethodBinding method , TypeBinding argumentType , InvocationSite location ) { int severity = this . options . getSeverity ( CompilerOptions . VarargsArgumentNeedCast ) ; if ( severity == ProblemSeverities . Ignore ) return ; ArrayBinding varargsType = ( ArrayBinding ) method . parameters [ method . parameters . length - <NUM_LIT:1> ] ; if ( method . isConstructor ( ) ) { this . handle ( IProblem . ConstructorVarargsArgumentNeedCast , new String [ ] { new String ( argumentType . readableName ( ) ) , new String ( varargsType . readableName ( ) ) , new String ( method . declaringClass . readableName ( ) ) , typesAsString ( method , false ) , new String ( varargsType . elementsType ( ) . readableName ( ) ) , } , new String [ ] { new String ( argumentType . shortReadableName ( ) ) , new String ( varargsType . shortReadableName ( ) ) , new String ( method . declaringClass . shortReadableName ( ) ) , typesAsString ( method , true ) , new String ( varargsType . elementsType ( ) . shortReadableName ( ) ) , } , severity , location . sourceStart ( ) , location . sourceEnd ( ) ) ; } else { this . handle ( IProblem . MethodVarargsArgumentNeedCast , new String [ ] { new String ( argumentType . readableName ( ) ) , new String ( varargsType . readableName ( ) ) , new String ( method . selector ) , typesAsString ( method , false ) , new String ( method . declaringClass . readableName ( ) ) , new String ( varargsType . elementsType ( ) . readableName ( ) ) , } , new String [ ] { new String ( argumentType . shortReadableName ( ) ) , new String ( varargsType . shortReadableName ( ) ) , new String ( method . selector ) , typesAsString ( method , true ) , new String ( method . declaringClass . shortReadableName ( ) ) , new String ( varargsType . elementsType ( ) . shortReadableName ( ) ) , } , severity , location . sourceStart ( ) , location . sourceEnd ( ) ) ; } } public void varargsConflict ( MethodBinding method1 , MethodBinding method2 , SourceTypeBinding type ) { ReferenceBinding rb1 = method1 . declaringClass ; ReferenceBinding rb2 = method2 . declaringClass ; if ( rb1 != null && ( rb1 instanceof SourceTypeBinding ) && ( ( SourceTypeBinding ) rb1 ) . scope != null && ! ( ( SourceTypeBinding ) rb1 ) . scope . shouldReport ( IProblem . VarargsConflict ) ) { return ; } if ( rb2 != null && ( rb2 instanceof SourceTypeBinding ) && ( ( SourceTypeBinding ) rb2 ) . scope != null && ! ( ( SourceTypeBinding ) rb2 ) . scope . shouldReport ( IProblem . VarargsConflict ) ) { return ; } this . handle ( IProblem . VarargsConflict , new String [ ] { new String ( method1 . selector ) , typesAsString ( method1 , false ) , new String ( method1 . declaringClass . readableName ( ) ) , typesAsString ( method2 , false ) , new String ( method2 . declaringClass . readableName ( ) ) } , new String [ ] { new String ( method1 . selector ) , typesAsString ( method1 , true ) , new String ( method1 . declaringClass . shortReadableName ( ) ) , typesAsString ( method2 , true ) , new String ( method2 . declaringClass . shortReadableName ( ) ) } , method1 . declaringClass == type ? method1 . sourceStart ( ) : type . sourceStart ( ) , method1 . declaringClass == type ? method1 . sourceEnd ( ) : type . sourceEnd ( ) ) ; } public void safeVarargsOnFixedArityMethod ( MethodBinding method ) { String [ ] arguments = new String [ ] { new String ( method . isConstructor ( ) ? method . declaringClass . shortReadableName ( ) : method . selector ) } ; this . handle ( IProblem . SafeVarargsOnFixedArityMethod , arguments , arguments , method . sourceStart ( ) , method . sourceEnd ( ) ) ; } public void safeVarargsOnNonFinalInstanceMethod ( MethodBinding method ) { String [ ] arguments = new String [ ] { new String ( method . isConstructor ( ) ? method . declaringClass . shortReadableName ( ) : method . selector ) } ; this . handle ( IProblem . SafeVarargsOnNonFinalInstanceMethod , arguments , arguments , method . sourceStart ( ) , method . sourceEnd ( ) ) ; } public void possibleHeapPollutionFromVararg ( AbstractVariableDeclaration vararg ) { String [ ] arguments = new String [ ] { new String ( vararg . name ) } ; this . handle ( IProblem . PotentialHeapPollutionFromVararg , arguments , arguments , vararg . sourceStart , vararg . sourceEnd ) ; } public void variableTypeCannotBeVoid ( AbstractVariableDeclaration varDecl ) { String [ ] arguments = new String [ ] { new String ( varDecl . name ) } ; this . handle ( IProblem . VariableTypeCannotBeVoid , arguments , arguments , varDecl . sourceStart , varDecl . sourceEnd ) ; } public void variableTypeCannotBeVoidArray ( AbstractVariableDeclaration varDecl ) { this . handle ( IProblem . CannotAllocateVoidArray , NoArgument , NoArgument , varDecl . type . sourceStart , varDecl . type . sourceEnd ) ; } public void visibilityConflict ( MethodBinding currentMethod , MethodBinding inheritedMethod ) { this . handle ( IProblem . MethodReducesVisibility , new String [ ] { new String ( inheritedMethod . declaringClass . readableName ( ) ) } , new String [ ] { new String ( inheritedMethod . declaringClass . shortReadableName ( ) ) } , currentMethod . sourceStart ( ) , currentMethod . sourceEnd ( ) ) ; } public void wildcardAssignment ( TypeBinding variableType , TypeBinding expressionType , ASTNode location ) { this . handle ( IProblem . WildcardFieldAssignment , new String [ ] { new String ( expressionType . readableName ( ) ) , new String ( variableType . readableName ( ) ) } , new String [ ] { new String ( expressionType . shortReadableName ( ) ) , new String ( variableType . shortReadableName ( ) ) } , location . sourceStart , location . sourceEnd ) ; } public void wildcardInvocation ( ASTNode location , TypeBinding receiverType , MethodBinding method , TypeBinding [ ] arguments ) { TypeBinding offendingArgument = null ; TypeBinding offendingParameter = null ; for ( int i = <NUM_LIT:0> , length = method . parameters . length ; i < length ; i ++ ) { TypeBinding parameter = method . parameters [ i ] ; if ( parameter . isWildcard ( ) && ( ( ( WildcardBinding ) parameter ) . boundKind != Wildcard . SUPER ) ) { offendingParameter = parameter ; offendingArgument = arguments [ i ] ; break ; } } if ( method . isConstructor ( ) ) { this . handle ( IProblem . WildcardConstructorInvocation , new String [ ] { new String ( receiverType . sourceName ( ) ) , typesAsString ( method , false ) , new String ( receiverType . readableName ( ) ) , typesAsString ( arguments , false ) , new String ( offendingArgument . readableName ( ) ) , new String ( offendingParameter . readableName ( ) ) , } , new String [ ] { new String ( receiverType . sourceName ( ) ) , typesAsString ( method , true ) , new String ( receiverType . shortReadableName ( ) ) , typesAsString ( arguments , true ) , new String ( offendingArgument . shortReadableName ( ) ) , new String ( offendingParameter . shortReadableName ( ) ) , } , location . sourceStart , location . sourceEnd ) ; } else { this . handle ( IProblem . WildcardMethodInvocation , new String [ ] { new String ( method . selector ) , typesAsString ( method , false ) , new String ( receiverType . readableName ( ) ) , typesAsString ( arguments , false ) , new String ( offendingArgument . readableName ( ) ) , new String ( offendingParameter . readableName ( ) ) , } , new String [ ] { new String ( method . selector ) , typesAsString ( method , true ) , new String ( receiverType . shortReadableName ( ) ) , typesAsString ( arguments , true ) , new String ( offendingArgument . shortReadableName ( ) ) , new String ( offendingParameter . shortReadableName ( ) ) , } , location . sourceStart , location . sourceEnd ) ; } } public void wrongSequenceOfExceptionTypesError ( TypeReference typeRef , TypeBinding exceptionType , TypeBinding hidingExceptionType ) { this . handle ( IProblem . InvalidCatchBlockSequence , new String [ ] { new String ( exceptionType . readableName ( ) ) , new String ( hidingExceptionType . readableName ( ) ) , } , new String [ ] { new String ( exceptionType . shortReadableName ( ) ) , new String ( hidingExceptionType . shortReadableName ( ) ) , } , typeRef . sourceStart , typeRef . sourceEnd ) ; } public void wrongSequenceOfExceptionTypes ( TypeReference typeRef , TypeBinding exceptionType , TypeBinding hidingExceptionType ) { this . handle ( IProblem . InvalidUnionTypeReferenceSequence , new String [ ] { new String ( exceptionType . readableName ( ) ) , new String ( hidingExceptionType . readableName ( ) ) , } , new String [ ] { new String ( exceptionType . shortReadableName ( ) ) , new String ( hidingExceptionType . shortReadableName ( ) ) , } , typeRef . sourceStart , typeRef . sourceEnd ) ; } public void autoManagedResourcesNotBelow17 ( LocalDeclaration [ ] resources ) { this . handle ( IProblem . AutoManagedResourceNotBelow17 , NoArgument , NoArgument , resources [ <NUM_LIT:0> ] . declarationSourceStart , resources [ resources . length - <NUM_LIT:1> ] . declarationSourceEnd ) ; } public void cannotInferElidedTypes ( AllocationExpression allocationExpression ) { String arguments [ ] = new String [ ] { allocationExpression . type . toString ( ) } ; this . handle ( IProblem . CannotInferElidedTypes , arguments , arguments , allocationExpression . sourceStart , allocationExpression . sourceEnd ) ; } public void diamondNotWithExplicitTypeArguments ( TypeReference [ ] typeArguments ) { this . handle ( IProblem . CannotUseDiamondWithExplicitTypeArguments , NoArgument , NoArgument , typeArguments [ <NUM_LIT:0> ] . sourceStart , typeArguments [ typeArguments . length - <NUM_LIT:1> ] . sourceEnd ) ; } public void diamondNotWithAnoymousClasses ( TypeReference type ) { this . handle ( IProblem . CannotUseDiamondWithAnonymousClasses , NoArgument , NoArgument , type . sourceStart , type . sourceEnd ) ; } public void redundantSpecificationOfTypeArguments ( ASTNode location , TypeBinding [ ] argumentTypes ) { int severity = computeSeverity ( IProblem . RedundantSpecificationOfTypeArguments ) ; if ( severity != ProblemSeverities . Ignore ) { int sourceStart = - <NUM_LIT:1> ; if ( location instanceof QualifiedTypeReference ) { QualifiedTypeReference ref = ( QualifiedTypeReference ) location ; sourceStart = ( int ) ( ref . sourcePositions [ ref . sourcePositions . length - <NUM_LIT:1> ] > > <NUM_LIT:32> ) ; } else { sourceStart = location . sourceStart ; } this . handle ( IProblem . RedundantSpecificationOfTypeArguments , new String [ ] { typesAsString ( argumentTypes , false ) } , new String [ ] { typesAsString ( argumentTypes , true ) } , severity , sourceStart , location . sourceEnd ) ; } } public void potentiallyUnclosedCloseable ( FakedTrackingVariable trackVar , ASTNode location ) { String [ ] args = { String . valueOf ( trackVar . name ) } ; if ( location == null ) { this . handle ( IProblem . PotentiallyUnclosedCloseable , args , args , trackVar . sourceStart , trackVar . sourceEnd ) ; } else { this . handle ( IProblem . PotentiallyUnclosedCloseableAtExit , args , args , location . sourceStart , location . sourceEnd ) ; } } public void unclosedCloseable ( FakedTrackingVariable trackVar , ASTNode location ) { String [ ] args = { String . valueOf ( trackVar . name ) } ; if ( location == null ) { this . handle ( IProblem . UnclosedCloseable , args , args , trackVar . sourceStart , trackVar . sourceEnd ) ; } else { this . handle ( IProblem . UnclosedCloseableAtExit , args , args , location . sourceStart , location . sourceEnd ) ; } } public void explicitlyClosedAutoCloseable ( FakedTrackingVariable trackVar ) { String [ ] args = { String . valueOf ( trackVar . name ) } ; this . handle ( IProblem . ExplicitlyClosedAutoCloseable , args , args , trackVar . sourceStart , trackVar . sourceEnd ) ; } public void nullityMismatch ( Expression expression , TypeBinding providedType , TypeBinding requiredType , int nullStatus , char [ ] [ ] annotationName ) { if ( ( nullStatus & FlowInfo . NULL ) != <NUM_LIT:0> ) { nullityMismatchIsNull ( expression , requiredType , annotationName ) ; return ; } if ( ( nullStatus & FlowInfo . POTENTIALLY_NULL ) != <NUM_LIT:0> ) { if ( expression instanceof SingleNameReference ) { SingleNameReference snr = ( SingleNameReference ) expression ; if ( snr . binding instanceof LocalVariableBinding ) { if ( ( ( LocalVariableBinding ) snr . binding ) . isNullable ( ) ) { nullityMismatchSpecdNullable ( expression , requiredType , annotationName ) ; return ; } } } nullityMismatchPotentiallyNull ( expression , requiredType , annotationName ) ; return ; } nullityMismatchIsUnknown ( expression , providedType , requiredType , annotationName ) ; } public void nullityMismatchIsNull ( Expression expression , TypeBinding requiredType , char [ ] [ ] annotationName ) { int problemId = IProblem . RequiredNonNullButProvidedNull ; String [ ] arguments = new String [ ] { String . valueOf ( CharOperation . concatWith ( annotationName , '<CHAR_LIT:.>' ) ) , String . valueOf ( requiredType . readableName ( ) ) } ; String [ ] argumentsShort = new String [ ] { String . valueOf ( annotationName [ annotationName . length - <NUM_LIT:1> ] ) , String . valueOf ( requiredType . shortReadableName ( ) ) } ; this . handle ( problemId , arguments , argumentsShort , expression . sourceStart , expression . sourceEnd ) ; } public void nullityMismatchSpecdNullable ( Expression expression , TypeBinding requiredType , char [ ] [ ] annotationName ) { int problemId = IProblem . RequiredNonNullButProvidedSpecdNullable ; char [ ] [ ] nullableName = this . options . nullableAnnotationName ; String [ ] arguments = new String [ ] { String . valueOf ( CharOperation . concatWith ( annotationName , '<CHAR_LIT:.>' ) ) , String . valueOf ( requiredType . readableName ( ) ) , String . valueOf ( CharOperation . concatWith ( nullableName , '<CHAR_LIT:.>' ) ) } ; String [ ] argumentsShort = new String [ ] { String . valueOf ( annotationName [ annotationName . length - <NUM_LIT:1> ] ) , String . valueOf ( requiredType . shortReadableName ( ) ) , String . valueOf ( nullableName [ nullableName . length - <NUM_LIT:1> ] ) } ; this . handle ( problemId , arguments , argumentsShort , expression . sourceStart , expression . sourceEnd ) ; } public void nullityMismatchPotentiallyNull ( Expression expression , TypeBinding requiredType , char [ ] [ ] annotationName ) { int problemId = IProblem . RequiredNonNullButProvidedPotentialNull ; char [ ] [ ] nullableName = this . options . nullableAnnotationName ; String [ ] arguments = new String [ ] { String . valueOf ( CharOperation . concatWith ( annotationName , '<CHAR_LIT:.>' ) ) , String . valueOf ( requiredType . readableName ( ) ) , String . valueOf ( CharOperation . concatWith ( nullableName , '<CHAR_LIT:.>' ) ) } ; String [ ] argumentsShort = new String [ ] { String . valueOf ( annotationName [ annotationName . length - <NUM_LIT:1> ] ) , String . valueOf ( requiredType . shortReadableName ( ) ) , String . valueOf ( nullableName [ nullableName . length - <NUM_LIT:1> ] ) } ; this . handle ( problemId , arguments , argumentsShort , expression . sourceStart , expression . sourceEnd ) ; } public void nullityMismatchIsUnknown ( Expression expression , TypeBinding providedType , TypeBinding requiredType , char [ ] [ ] annotationName ) { int problemId = IProblem . RequiredNonNullButProvidedUnknown ; String [ ] arguments = new String [ ] { String . valueOf ( providedType . readableName ( ) ) , String . valueOf ( CharOperation . concatWith ( annotationName , '<CHAR_LIT:.>' ) ) , String . valueOf ( requiredType . readableName ( ) ) } ; String [ ] argumentsShort = new String [ ] { String . valueOf ( providedType . shortReadableName ( ) ) , String . valueOf ( annotationName [ annotationName . length - <NUM_LIT:1> ] ) , String . valueOf ( requiredType . shortReadableName ( ) ) } ; this . handle ( problemId , arguments , argumentsShort , expression . sourceStart , expression . sourceEnd ) ; } public void illegalRedefinitionToNonNullParameter ( Argument argument , ReferenceBinding declaringClass , char [ ] [ ] inheritedAnnotationName ) { int sourceStart = argument . type . sourceStart ; if ( argument . annotations != null ) { for ( int i = <NUM_LIT:0> ; i < argument . annotations . length ; i ++ ) { Annotation annotation = argument . annotations [ i ] ; if ( annotation . resolvedType . id == TypeIds . T_ConfiguredAnnotationNullable || annotation . resolvedType . id == TypeIds . T_ConfiguredAnnotationNonNull ) { sourceStart = annotation . sourceStart ; break ; } } } if ( inheritedAnnotationName == null ) { this . handle ( IProblem . IllegalDefinitionToNonNullParameter , new String [ ] { new String ( argument . name ) , new String ( declaringClass . readableName ( ) ) } , new String [ ] { new String ( argument . name ) , new String ( declaringClass . shortReadableName ( ) ) } , sourceStart , argument . type . sourceEnd ) ; } else { this . handle ( IProblem . IllegalRedefinitionToNonNullParameter , new String [ ] { new String ( argument . name ) , new String ( declaringClass . readableName ( ) ) , CharOperation . toString ( inheritedAnnotationName ) } , new String [ ] { new String ( argument . name ) , new String ( declaringClass . shortReadableName ( ) ) , new String ( inheritedAnnotationName [ inheritedAnnotationName . length - <NUM_LIT:1> ] ) } , sourceStart , argument . type . sourceEnd ) ; } } public void parameterLackingNullAnnotation ( Argument argument , ReferenceBinding declaringClass , boolean needNonNull , char [ ] [ ] inheritedAnnotationName ) { this . handle ( needNonNull ? IProblem . ParameterLackingNonNullAnnotation : IProblem . ParameterLackingNullableAnnotation , new String [ ] { new String ( argument . name ) , new String ( declaringClass . readableName ( ) ) , CharOperation . toString ( inheritedAnnotationName ) } , new String [ ] { new String ( argument . name ) , new String ( declaringClass . shortReadableName ( ) ) , new String ( inheritedAnnotationName [ inheritedAnnotationName . length - <NUM_LIT:1> ] ) } , argument . type . sourceStart , argument . type . sourceEnd ) ; } public void illegalReturnRedefinition ( AbstractMethodDeclaration abstractMethodDecl , MethodBinding inheritedMethod , char [ ] [ ] nonNullAnnotationName ) { MethodDeclaration methodDecl = ( MethodDeclaration ) abstractMethodDecl ; StringBuffer methodSignature = new StringBuffer ( ) ; methodSignature . append ( inheritedMethod . declaringClass . readableName ( ) ) . append ( '<CHAR_LIT:.>' ) . append ( inheritedMethod . readableName ( ) ) ; StringBuffer shortSignature = new StringBuffer ( ) ; shortSignature . append ( inheritedMethod . declaringClass . shortReadableName ( ) ) . append ( '<CHAR_LIT:.>' ) . append ( inheritedMethod . shortReadableName ( ) ) ; int sourceStart = methodDecl . returnType . sourceStart ; Annotation [ ] annotations = methodDecl . annotations ; Annotation annotation = findAnnotation ( annotations , TypeIds . T_ConfiguredAnnotationNullable ) ; if ( annotation != null ) { sourceStart = annotation . sourceStart ; } this . handle ( IProblem . IllegalReturnNullityRedefinition , new String [ ] { methodSignature . toString ( ) , CharOperation . toString ( nonNullAnnotationName ) } , new String [ ] { shortSignature . toString ( ) , new String ( nonNullAnnotationName [ nonNullAnnotationName . length - <NUM_LIT:1> ] ) } , sourceStart , methodDecl . returnType . sourceEnd ) ; } public void messageSendPotentialNullReference ( MethodBinding method , ASTNode location ) { String [ ] arguments = new String [ ] { new String ( method . readableName ( ) ) } ; this . handle ( IProblem . PotentialNullMessageSendReference , arguments , arguments , location . sourceStart , location . sourceEnd ) ; } public void messageSendRedundantCheckOnNonNull ( MethodBinding method , ASTNode location ) { String [ ] arguments = new String [ ] { new String ( method . readableName ( ) ) } ; this . handle ( IProblem . RedundantNullCheckOnNonNullMessageSend , arguments , arguments , location . sourceStart , location . sourceEnd ) ; } public void cannotImplementIncompatibleNullness ( MethodBinding currentMethod , MethodBinding inheritedMethod ) { int sourceStart = <NUM_LIT:0> , sourceEnd = <NUM_LIT:0> ; if ( this . referenceContext instanceof TypeDeclaration ) { sourceStart = ( ( TypeDeclaration ) this . referenceContext ) . sourceStart ; sourceEnd = ( ( TypeDeclaration ) this . referenceContext ) . sourceEnd ; } String [ ] problemArguments = { new String ( currentMethod . readableName ( ) ) , new String ( currentMethod . declaringClass . readableName ( ) ) , new String ( inheritedMethod . declaringClass . readableName ( ) ) } ; String [ ] messageArguments = { new String ( currentMethod . shortReadableName ( ) ) , new String ( currentMethod . declaringClass . shortReadableName ( ) ) , new String ( inheritedMethod . declaringClass . shortReadableName ( ) ) } ; this . handle ( IProblem . CannotImplementIncompatibleNullness , problemArguments , messageArguments , sourceStart , sourceEnd ) ; } public void nullAnnotationIsRedundant ( AbstractMethodDeclaration sourceMethod , int i ) { int sourceStart , sourceEnd ; if ( i == - <NUM_LIT:1> ) { MethodDeclaration methodDecl = ( MethodDeclaration ) sourceMethod ; Annotation annotation = findAnnotation ( methodDecl . annotations , TypeIds . T_ConfiguredAnnotationNonNull ) ; sourceStart = annotation != null ? annotation . sourceStart : methodDecl . returnType . sourceStart ; sourceEnd = methodDecl . returnType . sourceEnd ; } else { Argument arg = sourceMethod . arguments [ i ] ; sourceStart = arg . declarationSourceStart ; sourceEnd = arg . sourceEnd ; } this . handle ( IProblem . RedundantNullAnnotation , ProblemHandler . NoArgument , ProblemHandler . NoArgument , sourceStart , sourceEnd ) ; } public void nullDefaultAnnotationIsRedundant ( ASTNode location , Annotation [ ] annotations , Binding outer ) { Annotation annotation = findAnnotation ( annotations , TypeIds . T_ConfiguredAnnotationNonNullByDefault ) ; int start = annotation != null ? annotation . sourceStart : location . sourceStart ; int end = annotation != null ? annotation . sourceEnd : location . sourceStart ; String [ ] args = NoArgument ; String [ ] shortArgs = NoArgument ; if ( outer != null ) { args = new String [ ] { new String ( outer . readableName ( ) ) } ; shortArgs = new String [ ] { new String ( outer . shortReadableName ( ) ) } ; } int problemId = IProblem . RedundantNullDefaultAnnotation ; if ( outer instanceof PackageBinding ) { problemId = IProblem . RedundantNullDefaultAnnotationPackage ; } else if ( outer instanceof ReferenceBinding ) { problemId = IProblem . RedundantNullDefaultAnnotationType ; } else if ( outer instanceof MethodBinding ) { problemId = IProblem . RedundantNullDefaultAnnotationMethod ; } this . handle ( problemId , args , shortArgs , start , end ) ; } public void contradictoryNullAnnotations ( Annotation annotation ) { char [ ] [ ] nonNullAnnotationName = this . options . nonNullAnnotationName ; char [ ] [ ] nullableAnnotationName = this . options . nullableAnnotationName ; String [ ] arguments = { new String ( CharOperation . concatWith ( nonNullAnnotationName , '<CHAR_LIT:.>' ) ) , new String ( CharOperation . concatWith ( nullableAnnotationName , '<CHAR_LIT:.>' ) ) } ; String [ ] shortArguments = { new String ( nonNullAnnotationName [ nonNullAnnotationName . length - <NUM_LIT:1> ] ) , new String ( nullableAnnotationName [ nullableAnnotationName . length - <NUM_LIT:1> ] ) } ; this . handle ( IProblem . ContradictoryNullAnnotations , arguments , shortArguments , annotation . sourceStart , annotation . sourceEnd ) ; } public void illegalAnnotationForBaseType ( TypeReference type , Annotation [ ] annotations , char [ ] annotationName , long nullAnnotationTagBit ) { int typeId = ( nullAnnotationTagBit == TagBits . AnnotationNullable ) ? TypeIds . T_ConfiguredAnnotationNullable : TypeIds . T_ConfiguredAnnotationNonNull ; String [ ] args = new String [ ] { new String ( annotationName ) , new String ( type . getLastToken ( ) ) } ; Annotation annotation = findAnnotation ( annotations , typeId ) ; int start = annotation != null ? annotation . sourceStart : type . sourceStart ; this . handle ( IProblem . IllegalAnnotationForBaseType , args , args , start , type . sourceEnd ) ; } private Annotation findAnnotation ( Annotation [ ] annotations , int typeId ) { if ( annotations != null ) { int length = annotations . length ; for ( int j = <NUM_LIT:0> ; j < length ; j ++ ) { if ( annotations [ j ] . resolvedType != null && annotations [ j ] . resolvedType . id == typeId ) { return annotations [ j ] ; } } } return null ; } public void missingNonNullByDefaultAnnotation ( TypeDeclaration type ) { int severity ; CompilationUnitDeclaration compUnitDecl = type . getCompilationUnitDeclaration ( ) ; String [ ] arguments ; if ( compUnitDecl . currentPackage == null ) { severity = computeSeverity ( IProblem . MissingNonNullByDefaultAnnotationOnType ) ; if ( severity == ProblemSeverities . Ignore ) return ; TypeBinding binding = type . binding ; this . handle ( IProblem . MissingNonNullByDefaultAnnotationOnType , new String [ ] { new String ( binding . readableName ( ) ) , } , new String [ ] { new String ( binding . shortReadableName ( ) ) , } , severity , type . sourceStart , type . sourceEnd ) ; } else { severity = computeSeverity ( IProblem . MissingNonNullByDefaultAnnotationOnPackage ) ; if ( severity == ProblemSeverities . Ignore ) return ; arguments = new String [ ] { CharOperation . toString ( compUnitDecl . currentPackage . tokens ) } ; this . handle ( IProblem . MissingNonNullByDefaultAnnotationOnPackage , arguments , arguments , severity , compUnitDecl . currentPackage . sourceStart , compUnitDecl . currentPackage . sourceEnd ) ; } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . problem ; import org . eclipse . jdt . core . compiler . CategorizedProblem ; import org . eclipse . jdt . internal . compiler . CompilationResult ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . lookup . InvocationSite ; import org . eclipse . jdt . internal . compiler . util . Util ; public class AbortCompilation extends RuntimeException { public CompilationResult compilationResult ; public Throwable exception ; public CategorizedProblem problem ; public boolean isSilent ; public RuntimeException silentException ; private static final long serialVersionUID = - <NUM_LIT> ; public AbortCompilation ( ) { } public AbortCompilation ( CompilationResult compilationResult , CategorizedProblem problem ) { this ( ) ; this . compilationResult = compilationResult ; this . problem = problem ; } public AbortCompilation ( CompilationResult compilationResult , Throwable exception ) { this ( ) ; this . compilationResult = compilationResult ; this . exception = exception ; } public AbortCompilation ( boolean isSilent , RuntimeException silentException ) { this ( ) ; this . isSilent = isSilent ; this . silentException = silentException ; } public String getMessage ( ) { String message = super . getMessage ( ) ; StringBuffer buffer = new StringBuffer ( message == null ? Util . EMPTY_STRING : message ) ; if ( this . problem != null ) { buffer . append ( this . problem ) ; } else if ( this . exception != null ) { message = this . exception . getMessage ( ) ; buffer . append ( message == null ? Util . EMPTY_STRING : message ) ; } else if ( this . silentException != null ) { message = this . silentException . getMessage ( ) ; buffer . append ( message == null ? Util . EMPTY_STRING : message ) ; } return String . valueOf ( buffer ) ; } public void updateContext ( InvocationSite invocationSite , CompilationResult unitResult ) { if ( this . problem == null ) return ; if ( this . problem . getSourceStart ( ) != <NUM_LIT:0> || this . problem . getSourceEnd ( ) != <NUM_LIT:0> ) return ; this . problem . setSourceStart ( invocationSite . sourceStart ( ) ) ; this . problem . setSourceEnd ( invocationSite . sourceEnd ( ) ) ; int [ ] lineEnds = unitResult . getLineSeparatorPositions ( ) ; this . problem . setSourceLineNumber ( Util . getLineNumber ( invocationSite . sourceStart ( ) , lineEnds , <NUM_LIT:0> , lineEnds . length - <NUM_LIT:1> ) ) ; this . compilationResult = unitResult ; } public void updateContext ( ASTNode astNode , CompilationResult unitResult ) { if ( this . problem == null ) return ; if ( this . problem . getSourceStart ( ) != <NUM_LIT:0> || this . problem . getSourceEnd ( ) != <NUM_LIT:0> ) return ; this . problem . setSourceStart ( astNode . sourceStart ( ) ) ; this . problem . setSourceEnd ( astNode . sourceEnd ( ) ) ; int [ ] lineEnds = unitResult . getLineSeparatorPositions ( ) ; this . problem . setSourceLineNumber ( Util . getLineNumber ( astNode . sourceStart ( ) , lineEnds , <NUM_LIT:0> , lineEnds . length - <NUM_LIT:1> ) ) ; this . compilationResult = unitResult ; } public String getKey ( ) { StringBuffer buffer = new StringBuffer ( ) ; if ( this . problem != null ) { buffer . append ( this . problem ) ; } return String . valueOf ( buffer ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . problem ; import org . eclipse . jdt . core . compiler . CategorizedProblem ; import org . eclipse . jdt . internal . compiler . CompilationResult ; public class AbortMethod extends AbortType { private static final long serialVersionUID = - <NUM_LIT> ; public AbortMethod ( CompilationResult compilationResult , CategorizedProblem problem ) { super ( compilationResult , problem ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . problem ; import org . eclipse . jdt . core . compiler . CategorizedProblem ; import org . eclipse . jdt . core . compiler . IProblem ; import org . eclipse . jdt . internal . compiler . util . Messages ; import org . eclipse . jdt . internal . compiler . util . Util ; public class DefaultProblem extends CategorizedProblem { private char [ ] fileName ; private int id ; private int startPosition ; private int endPosition ; private int line ; public int column ; private int severity ; private String [ ] arguments ; private String message ; private static final String MARKER_TYPE_PROBLEM = "<STR_LIT>" ; private static final String MARKER_TYPE_TASK = "<STR_LIT>" ; public static final Object [ ] EMPTY_VALUES = { } ; public DefaultProblem ( char [ ] originatingFileName , String message , int id , String [ ] stringArguments , int severity , int startPosition , int endPosition , int line , int column ) { this . fileName = originatingFileName ; this . message = message ; this . id = id ; this . arguments = stringArguments ; this . severity = severity ; this . startPosition = startPosition ; this . endPosition = endPosition ; this . line = line ; this . column = column ; } public String errorReportSource ( char [ ] unitSource ) { if ( ( this . startPosition > this . endPosition ) || ( ( this . startPosition < <NUM_LIT:0> ) && ( this . endPosition < <NUM_LIT:0> ) ) || unitSource . length == <NUM_LIT:0> ) return Messages . problem_noSourceInformation ; StringBuffer errorBuffer = new StringBuffer ( ) ; errorBuffer . append ( '<CHAR_LIT:U+0020>' ) . append ( Messages . bind ( Messages . problem_atLine , String . valueOf ( this . line ) ) ) ; errorBuffer . append ( Util . LINE_SEPARATOR ) ; errorBuffer . append ( '<STR_LIT:\t>' ) ; char c ; final char SPACE = '<CHAR_LIT:U+0020>' ; final char MARK = '<CHAR_LIT>' ; final char TAB = '<STR_LIT:\t>' ; int length = unitSource . length , begin , end ; for ( begin = this . startPosition >= length ? length - <NUM_LIT:1> : this . startPosition ; begin > <NUM_LIT:0> ; begin -- ) { if ( ( c = unitSource [ begin - <NUM_LIT:1> ] ) == '<STR_LIT:\n>' || c == '<STR_LIT>' ) break ; } for ( end = this . endPosition >= length ? length - <NUM_LIT:1> : this . endPosition ; end + <NUM_LIT:1> < length ; end ++ ) { if ( ( c = unitSource [ end + <NUM_LIT:1> ] ) == '<STR_LIT>' || c == '<STR_LIT:\n>' ) break ; } while ( ( c = unitSource [ begin ] ) == '<CHAR_LIT:U+0020>' || c == '<STR_LIT:\t>' ) begin ++ ; errorBuffer . append ( unitSource , begin , end - begin + <NUM_LIT:1> ) ; errorBuffer . append ( Util . LINE_SEPARATOR ) . append ( "<STR_LIT:t>" ) ; for ( int i = begin ; i < this . startPosition ; i ++ ) { errorBuffer . append ( ( unitSource [ i ] == TAB ) ? TAB : SPACE ) ; } for ( int i = this . startPosition ; i <= ( this . endPosition >= length ? length - <NUM_LIT:1> : this . endPosition ) ; i ++ ) { errorBuffer . append ( MARK ) ; } return errorBuffer . toString ( ) ; } public String [ ] getArguments ( ) { return this . arguments ; } public int getCategoryID ( ) { return ProblemReporter . getProblemCategory ( this . severity , this . id ) ; } public int getID ( ) { return this . id ; } public String getInternalCategoryMessage ( ) { switch ( getCategoryID ( ) ) { case CAT_UNSPECIFIED : return "<STR_LIT>" ; case CAT_BUILDPATH : return "<STR_LIT>" ; case CAT_SYNTAX : return "<STR_LIT>" ; case CAT_IMPORT : return "<STR_LIT>" ; case CAT_TYPE : return "<STR_LIT:type>" ; case CAT_MEMBER : return "<STR_LIT>" ; case CAT_INTERNAL : return "<STR_LIT>" ; case CAT_JAVADOC : return "<STR_LIT>" ; case CAT_CODE_STYLE : return "<STR_LIT>" ; case CAT_POTENTIAL_PROGRAMMING_PROBLEM : return "<STR_LIT>" ; case CAT_NAME_SHADOWING_CONFLICT : return "<STR_LIT>" ; case CAT_DEPRECATION : return "<STR_LIT:deprecation>" ; case CAT_UNNECESSARY_CODE : return "<STR_LIT>" ; case CAT_UNCHECKED_RAW : return "<STR_LIT>" ; case CAT_NLS : return "<STR_LIT>" ; case CAT_RESTRICTION : return "<STR_LIT>" ; } return null ; } public String getMarkerType ( ) { return this . id == IProblem . Task ? MARKER_TYPE_TASK : MARKER_TYPE_PROBLEM ; } public String getMessage ( ) { return this . message ; } public char [ ] getOriginatingFileName ( ) { return this . fileName ; } public int getSourceEnd ( ) { return this . endPosition ; } public int getSourceColumnNumber ( ) { return this . column ; } public int getSourceLineNumber ( ) { return this . line ; } public int getSourceStart ( ) { return this . startPosition ; } public boolean isError ( ) { return ( this . severity & ProblemSeverities . Error ) != <NUM_LIT:0> ; } public boolean isWarning ( ) { return ( this . severity & ProblemSeverities . Error ) == <NUM_LIT:0> ; } public void setOriginatingFileName ( char [ ] fileName ) { this . fileName = fileName ; } public void setSourceEnd ( int sourceEnd ) { this . endPosition = sourceEnd ; } public void setSourceLineNumber ( int lineNumber ) { this . line = lineNumber ; } public void setSourceStart ( int sourceStart ) { this . startPosition = sourceStart ; } public String toString ( ) { String s = "<STR_LIT>" + ( this . id & IProblem . IgnoreCategoriesMask ) + "<STR_LIT>" ; if ( this . message != null ) { s += this . message ; } else { if ( this . arguments != null ) for ( int i = <NUM_LIT:0> ; i < this . arguments . length ; i ++ ) s += "<STR_LIT:U+0020>" + this . arguments [ i ] ; } return s ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . problem ; import org . eclipse . jdt . core . compiler . CategorizedProblem ; import org . eclipse . jdt . internal . compiler . CompilationResult ; public class AbortType extends AbortCompilationUnit { private static final long serialVersionUID = - <NUM_LIT> ; public AbortType ( CompilationResult compilationResult , CategorizedProblem problem ) { super ( compilationResult , problem ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . problem ; public interface ProblemSeverities { final int Ignore = <NUM_LIT> ; final int Warning = <NUM_LIT:0> ; final int Error = <NUM_LIT:1> ; final int AbortCompilation = <NUM_LIT:2> ; final int AbortCompilationUnit = <NUM_LIT:4> ; final int AbortType = <NUM_LIT:8> ; final int AbortMethod = <NUM_LIT:16> ; final int Abort = <NUM_LIT:30> ; final int Optional = <NUM_LIT:32> ; final int SecondaryError = <NUM_LIT> ; final int Fatal = <NUM_LIT> ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . problem ; import java . util . Enumeration ; import java . util . Locale ; import java . util . MissingResourceException ; import java . util . ResourceBundle ; import org . eclipse . jdt . core . compiler . * ; import org . eclipse . jdt . core . compiler . IProblem ; import org . eclipse . jdt . internal . compiler . IProblemFactory ; import org . eclipse . jdt . internal . compiler . util . HashtableOfInt ; import org . eclipse . jdt . internal . compiler . util . Util ; public class DefaultProblemFactory implements IProblemFactory { public HashtableOfInt messageTemplates ; private Locale locale ; private static HashtableOfInt DEFAULT_LOCALE_TEMPLATES ; private final static char [ ] DOUBLE_QUOTES = "<STR_LIT>" . toCharArray ( ) ; private final static char [ ] SINGLE_QUOTE = "<STR_LIT:'>" . toCharArray ( ) ; private final static char [ ] FIRST_ARGUMENT = "<STR_LIT>" . toCharArray ( ) ; public DefaultProblemFactory ( ) { this ( Locale . getDefault ( ) ) ; } public DefaultProblemFactory ( Locale loc ) { setLocale ( loc ) ; } public CategorizedProblem createProblem ( char [ ] originatingFileName , int problemId , String [ ] problemArguments , String [ ] messageArguments , int severity , int startPosition , int endPosition , int lineNumber , int columnNumber ) { return new DefaultProblem ( originatingFileName , this . getLocalizedMessage ( problemId , messageArguments ) , problemId , problemArguments , severity , startPosition , endPosition , lineNumber , columnNumber ) ; } public CategorizedProblem createProblem ( char [ ] originatingFileName , int problemId , String [ ] problemArguments , int elaborationId , String [ ] messageArguments , int severity , int startPosition , int endPosition , int lineNumber , int columnNumber ) { return new DefaultProblem ( originatingFileName , this . getLocalizedMessage ( problemId , elaborationId , messageArguments ) , problemId , problemArguments , severity , startPosition , endPosition , lineNumber , columnNumber ) ; } private final static int keyFromID ( int id ) { return id + <NUM_LIT:1> ; } public Locale getLocale ( ) { return this . locale ; } public void setLocale ( Locale locale ) { if ( locale == this . locale ) return ; this . locale = locale ; if ( Locale . getDefault ( ) . equals ( locale ) ) { if ( DEFAULT_LOCALE_TEMPLATES == null ) { DEFAULT_LOCALE_TEMPLATES = loadMessageTemplates ( locale ) ; } this . messageTemplates = DEFAULT_LOCALE_TEMPLATES ; } else { this . messageTemplates = loadMessageTemplates ( locale ) ; } } public final String getLocalizedMessage ( int id , String [ ] problemArguments ) { return getLocalizedMessage ( id , <NUM_LIT:0> , problemArguments ) ; } public final String getLocalizedMessage ( int id , int elaborationId , String [ ] problemArguments ) { String rawMessage = ( String ) this . messageTemplates . get ( keyFromID ( id & IProblem . IgnoreCategoriesMask ) ) ; if ( rawMessage == null ) { return "<STR_LIT>" + ( id & IProblem . IgnoreCategoriesMask ) + "<STR_LIT>" ; } char [ ] message = rawMessage . toCharArray ( ) ; if ( elaborationId != <NUM_LIT:0> ) { String elaboration = ( String ) this . messageTemplates . get ( keyFromID ( elaborationId ) ) ; if ( elaboration == null ) { return "<STR_LIT>" + elaborationId + "<STR_LIT>" ; } message = CharOperation . replace ( message , FIRST_ARGUMENT , elaboration . toCharArray ( ) ) ; } message = CharOperation . replace ( message , DOUBLE_QUOTES , SINGLE_QUOTE ) ; if ( problemArguments == null ) { return new String ( message ) ; } int length = message . length ; int start = <NUM_LIT:0> ; int end = length ; StringBuffer output = null ; if ( ( id & IProblem . Javadoc ) != <NUM_LIT:0> ) { output = new StringBuffer ( <NUM_LIT:10> + length + problemArguments . length * <NUM_LIT:20> ) ; output . append ( ( String ) this . messageTemplates . get ( keyFromID ( IProblem . JavadocMessagePrefix & IProblem . IgnoreCategoriesMask ) ) ) ; } while ( true ) { if ( ( end = CharOperation . indexOf ( '<CHAR_LIT>' , message , start ) ) > - <NUM_LIT:1> ) { if ( output == null ) output = new StringBuffer ( length + problemArguments . length * <NUM_LIT:20> ) ; output . append ( message , start , end - start ) ; if ( ( start = CharOperation . indexOf ( '<CHAR_LIT:}>' , message , end + <NUM_LIT:1> ) ) > - <NUM_LIT:1> ) { try { output . append ( problemArguments [ CharOperation . parseInt ( message , end + <NUM_LIT:1> , start - end - <NUM_LIT:1> ) ] ) ; } catch ( NumberFormatException nfe ) { output . append ( message , end + <NUM_LIT:1> , start - end ) ; } catch ( ArrayIndexOutOfBoundsException e ) { return "<STR_LIT>" + ( id & IProblem . IgnoreCategoriesMask ) + "<STR_LIT>" + new String ( message ) + "<STR_LIT>" + Util . toString ( problemArguments ) + "<STR_LIT:}>" ; } start ++ ; } else { output . append ( message , end , length ) ; break ; } } else { if ( output == null ) { return new String ( message ) ; } output . append ( message , start , length - start ) ; break ; } } return new String ( output . toString ( ) ) ; } public final String localizedMessage ( CategorizedProblem problem ) { return getLocalizedMessage ( problem . getID ( ) , problem . getArguments ( ) ) ; } public static HashtableOfInt loadMessageTemplates ( Locale loc ) { ResourceBundle bundle = null ; String bundleName = "<STR_LIT>" ; try { bundle = ResourceBundle . getBundle ( bundleName , loc ) ; } catch ( MissingResourceException e ) { System . out . println ( "<STR_LIT>" + bundleName . replace ( '<CHAR_LIT:.>' , '<CHAR_LIT:/>' ) + "<STR_LIT>" + loc ) ; throw e ; } HashtableOfInt templates = new HashtableOfInt ( <NUM_LIT> ) ; Enumeration keys = bundle . getKeys ( ) ; while ( keys . hasMoreElements ( ) ) { String key = ( String ) keys . nextElement ( ) ; try { int messageID = Integer . parseInt ( key ) ; templates . put ( keyFromID ( messageID ) , bundle . getString ( key ) ) ; } catch ( NumberFormatException e ) { } catch ( MissingResourceException e ) { } } return templates ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . problem ; 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 . CompilationResult ; import org . eclipse . jdt . internal . compiler . IErrorHandlingPolicy ; import org . eclipse . jdt . internal . compiler . IProblemFactory ; import org . eclipse . jdt . internal . compiler . ast . CompilationUnitDeclaration ; import org . eclipse . jdt . internal . compiler . env . ICompilationUnit ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . impl . ReferenceContext ; import org . eclipse . jdt . internal . compiler . util . Util ; import org . eclipse . jdt . internal . core . builder . SourceFile ; public class ProblemHandler { public final static String [ ] NoArgument = CharOperation . NO_STRINGS ; final public IErrorHandlingPolicy policy ; public final IProblemFactory problemFactory ; public final CompilerOptions options ; public ProblemHandler ( IErrorHandlingPolicy policy , CompilerOptions options , IProblemFactory problemFactory ) { this . policy = policy ; this . problemFactory = problemFactory ; this . options = options ; } public int computeSeverity ( int problemId ) { return ProblemSeverities . Error ; } public CategorizedProblem createProblem ( char [ ] fileName , int problemId , String [ ] problemArguments , String [ ] messageArguments , int severity , int problemStartPosition , int problemEndPosition , int lineNumber , int columnNumber ) { return this . problemFactory . createProblem ( fileName , problemId , problemArguments , messageArguments , severity , problemStartPosition , problemEndPosition , lineNumber , columnNumber ) ; } public CategorizedProblem createProblem ( char [ ] fileName , int problemId , String [ ] problemArguments , int elaborationId , String [ ] messageArguments , int severity , int problemStartPosition , int problemEndPosition , int lineNumber , int columnNumber ) { return this . problemFactory . createProblem ( fileName , problemId , problemArguments , elaborationId , messageArguments , severity , problemStartPosition , problemEndPosition , lineNumber , columnNumber ) ; } public void handle ( int problemId , String [ ] problemArguments , int elaborationId , String [ ] messageArguments , int severity , int problemStartPosition , int problemEndPosition , ReferenceContext referenceContext , CompilationResult unitResult ) { if ( severity == ProblemSeverities . Ignore ) return ; if ( ( severity & ProblemSeverities . Optional ) != <NUM_LIT:0> && problemId != IProblem . Task && ! this . options . ignoreSourceFolderWarningOption ) { ICompilationUnit cu = unitResult . getCompilationUnit ( ) ; try { if ( cu != null && cu . ignoreOptionalProblems ( ) ) return ; } catch ( AbstractMethodError ex ) { } } if ( referenceContext == null ) { if ( ( severity & ProblemSeverities . Error ) != <NUM_LIT:0> ) { CategorizedProblem problem = this . createProblem ( null , problemId , problemArguments , elaborationId , messageArguments , severity , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ) ; throw new AbortCompilation ( null , problem ) ; } else { return ; } } int [ ] lineEnds ; int lineNumber = problemStartPosition >= <NUM_LIT:0> ? Util . getLineNumber ( problemStartPosition , lineEnds = unitResult . getLineSeparatorPositions ( ) , <NUM_LIT:0> , lineEnds . length - <NUM_LIT:1> ) : <NUM_LIT:0> ; int columnNumber = problemStartPosition >= <NUM_LIT:0> ? Util . searchColumnNumber ( unitResult . getLineSeparatorPositions ( ) , lineNumber , problemStartPosition ) : <NUM_LIT:0> ; CategorizedProblem problem = this . createProblem ( unitResult . getFileName ( ) , problemId , problemArguments , elaborationId , messageArguments , severity , problemStartPosition , problemEndPosition , lineNumber , columnNumber ) ; if ( problem == null ) return ; switch ( severity & ProblemSeverities . Error ) { case ProblemSeverities . Error : boolean mandatory = ( ( severity & ProblemSeverities . Optional ) == <NUM_LIT:0> ) ; record ( problem , unitResult , referenceContext , mandatory ) ; if ( ( severity & ProblemSeverities . Fatal ) != <NUM_LIT:0> ) { if ( ! referenceContext . hasErrors ( ) && ! mandatory && this . options . suppressOptionalErrors ) { CompilationUnitDeclaration unitDecl = referenceContext . getCompilationUnitDeclaration ( ) ; if ( unitDecl != null && unitDecl . isSuppressed ( problem ) ) { return ; } } referenceContext . tagAsHavingErrors ( ) ; int abortLevel ; if ( ( abortLevel = this . policy . stopOnFirstError ( ) ? ProblemSeverities . AbortCompilation : severity & ProblemSeverities . Abort ) != <NUM_LIT:0> ) { referenceContext . abort ( abortLevel , problem ) ; } } break ; case ProblemSeverities . Warning : if ( ( this . options . groovyFlags & <NUM_LIT> ) != <NUM_LIT:0> ) { if ( ( unitResult . compilationUnit instanceof SourceFile ) && ( ( SourceFile ) unitResult . compilationUnit ) . isInLinkedSourceFolder ( ) ) { return ; } } record ( problem , unitResult , referenceContext , false ) ; break ; } } public void handle ( int problemId , String [ ] problemArguments , String [ ] messageArguments , int problemStartPosition , int problemEndPosition , ReferenceContext referenceContext , CompilationResult unitResult ) { this . handle ( problemId , problemArguments , <NUM_LIT:0> , messageArguments , computeSeverity ( problemId ) , problemStartPosition , problemEndPosition , referenceContext , unitResult ) ; } public void record ( CategorizedProblem problem , CompilationResult unitResult , ReferenceContext referenceContext , boolean optionalError ) { unitResult . record ( problem , referenceContext , optionalError ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler ; public interface ICompilerRequestor { public void acceptResult ( CompilationResult result ) ; } </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 ISourceField extends IGenericField { int getDeclarationSourceEnd ( ) ; int getDeclarationSourceStart ( ) ; char [ ] getInitializationSource ( ) ; int getNameSourceEnd ( ) ; int getNameSourceStart ( ) ; char [ ] getTypeName ( ) ; } </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 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 interface ICompilationUnit extends IDependent { char [ ] getContents ( ) ; char [ ] getMainTypeName ( ) ; char [ ] [ ] getPackageName ( ) ; boolean ignoreOptionalProblems ( ) ; } </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 ; 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 ISourceImport { int getDeclarationSourceEnd ( ) ; int getDeclarationSourceStart ( ) ; int getModifiers ( ) ; } </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 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 IGenericMethod { int getModifiers ( ) ; boolean isConstructor ( ) ; char [ ] [ ] getArgumentNames ( ) ; } </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 ; 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 IBinaryMethod extends IGenericMethod { IBinaryAnnotation [ ] getAnnotations ( ) ; Object getDefaultValue ( ) ; char [ ] [ ] getExceptionTypeNames ( ) ; char [ ] getGenericSignature ( ) ; char [ ] getMethodDescriptor ( ) ; IBinaryAnnotation [ ] getParameterAnnotations ( int index ) ; int getAnnotatedParametersCount ( ) ; char [ ] getSelector ( ) ; long getTagBits ( ) ; boolean isClinit ( ) ; } </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 ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . core . compiler . IProblem ; public class AccessRule { public static final int IgnoreIfBetter = <NUM_LIT> ; public char [ ] pattern ; public int problemId ; public AccessRule ( char [ ] pattern , int problemId ) { this ( pattern , problemId , false ) ; } public AccessRule ( char [ ] pattern , int problemId , boolean keepLooking ) { this . pattern = pattern ; this . problemId = keepLooking ? problemId | IgnoreIfBetter : problemId ; } public int hashCode ( ) { return this . problemId * <NUM_LIT> + CharOperation . hashCode ( this . pattern ) ; } public boolean equals ( Object obj ) { if ( ! ( obj instanceof AccessRule ) ) return false ; AccessRule other = ( AccessRule ) obj ; if ( this . problemId != other . problemId ) return false ; return CharOperation . equals ( this . pattern , other . pattern ) ; } public int getProblemId ( ) { return this . problemId & ~ IgnoreIfBetter ; } public boolean ignoreIfBetter ( ) { return ( this . problemId & IgnoreIfBetter ) != <NUM_LIT:0> ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( "<STR_LIT>" ) ; buffer . append ( this . pattern ) ; switch ( getProblemId ( ) ) { case IProblem . ForbiddenReference : buffer . append ( "<STR_LIT>" ) ; break ; case IProblem . DiscouragedReference : buffer . append ( "<STR_LIT>" ) ; break ; default : buffer . append ( "<STR_LIT>" ) ; break ; } if ( ignoreIfBetter ( ) ) buffer . append ( "<STR_LIT>" ) ; buffer . append ( '<CHAR_LIT:)>' ) ; return buffer . toString ( ) ; } } </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 IGenericType extends IDependent { int getModifiers ( ) ; boolean isBinaryType ( ) ; } </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 ; public interface IBinaryAnnotation { char [ ] getTypeName ( ) ; IBinaryElementValuePair [ ] getElementValuePairs ( ) ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . env ; import java . util . Arrays ; import org . eclipse . jdt . core . compiler . CharOperation ; public class EnumConstantSignature { char [ ] typeName ; char [ ] constName ; public EnumConstantSignature ( char [ ] typeName , char [ ] constName ) { this . typeName = typeName ; this . constName = constName ; } public char [ ] getTypeName ( ) { return this . typeName ; } public char [ ] getEnumConstantName ( ) { return this . constName ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( this . typeName ) ; buffer . append ( '<CHAR_LIT:.>' ) ; buffer . append ( this . constName ) ; return buffer . toString ( ) ; } public int hashCode ( ) { final int prime = <NUM_LIT:31> ; int result = <NUM_LIT:1> ; result = prime * result + CharOperation . hashCode ( this . constName ) ; 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 ; } EnumConstantSignature other = ( EnumConstantSignature ) obj ; if ( ! Arrays . equals ( this . constName , other . constName ) ) { return false ; } return Arrays . equals ( this . typeName , other . typeName ) ; } } </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_OR_DEAD ) == <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 . 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 . TypeBinding ; 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 ; ASTNode [ ] 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 . getLocalParent ( ) ; while ( currentContext != null ) { currentContext . removeFinalAssignmentIfAny ( this . finalAssignments [ i ] ) ; currentContext = currentContext . getLocalParent ( ) ; } } } if ( ( this . tagBits & FlowContext . DEFER_NULL_DIAGNOSTIC ) != <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> ; i < this . nullCount ; i ++ ) { if ( ( this . nullCheckTypes [ i ] & ~ HIDE_NULL_COMPARISON_WARNING_MASK ) == ASSIGN_TO_NONNULL ) { int nullStatus = flowInfo . nullStatus ( this . nullLocals [ i ] ) ; if ( nullStatus != FlowInfo . NON_NULL ) { this . parent . recordNullityMismatch ( scope , ( Expression ) this . nullReferences [ i ] , this . providedExpectedTypes [ i ] [ <NUM_LIT:0> ] , this . providedExpectedTypes [ i ] [ <NUM_LIT:1> ] , nullStatus ) ; } } else { 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 ++ ) { ASTNode location = this . nullReferences [ i ] ; LocalVariableBinding local = this . nullLocals [ i ] ; switch ( this . nullCheckTypes [ i ] & ~ HIDE_NULL_COMPARISON_WARNING_MASK ) { 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 ] & ~ HIDE_NULL_COMPARISON_WARNING_MASK ) == ( CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL ) ) { if ( ( this . nullCheckTypes [ i ] & HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableRedundantCheckOnNonNull ( local , location ) ; } } else { scope . problemReporter ( ) . localVariableNonNullComparedToNull ( local , location ) ; } 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 : Expression expression = ( Expression ) location ; if ( flowInfo . isDefinitelyNull ( local ) ) { switch ( this . nullCheckTypes [ i ] & CONTEXT_MASK ) { case FlowContext . IN_COMPARISON_NULL : if ( ( ( this . nullCheckTypes [ i ] & CHECK_MASK & ~ HIDE_NULL_COMPARISON_WARNING_MASK ) == CAN_ONLY_NULL ) && ( expression . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullReference ( local , expression ) ; continue ; } if ( ( this . nullCheckTypes [ i ] & 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 & ~ HIDE_NULL_COMPARISON_WARNING_MASK ) == CAN_ONLY_NULL ) && ( expression . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullReference ( local , expression ) ; continue ; } 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 & ~ HIDE_NULL_COMPARISON_WARNING_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 & ~ HIDE_NULL_COMPARISON_WARNING_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 , location ) ; continue ; } if ( flowInfo . isPotentiallyNull ( local ) ) { scope . problemReporter ( ) . localVariablePotentialNullReference ( local , location ) ; } break ; case ASSIGN_TO_NONNULL : int nullStatus = flowInfo . nullStatus ( local ) ; if ( nullStatus != FlowInfo . NON_NULL ) { char [ ] [ ] annotationName = scope . environment ( ) . getNonNullAnnotationName ( ) ; scope . problemReporter ( ) . nullityMismatch ( ( Expression ) location , this . providedExpectedTypes [ i ] [ <NUM_LIT:0> ] , this . providedExpectedTypes [ i ] [ <NUM_LIT:1> ] , nullStatus , annotationName ) ; } 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 , ASTNode location , int checkType , FlowInfo flowInfo ) { if ( ( flowInfo . tagBits & FlowInfo . UNREACHABLE ) == <NUM_LIT:0> && ! flowInfo . isDefinitelyUnknown ( local ) ) { checkType |= ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) ; int checkTypeWithoutHideNullWarning = checkType & ~ FlowContext . HIDE_NULL_COMPARISON_WARNING_MASK ; if ( ( this . tagBits & FlowContext . DEFER_NULL_DIAGNOSTIC ) != <NUM_LIT:0> ) { switch ( checkTypeWithoutHideNullWarning ) { 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 : Expression reference = ( Expression ) location ; if ( flowInfo . cannotBeNull ( local ) ) { if ( checkTypeWithoutHideNullWarning == ( CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL ) ) { if ( ( checkType & HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableRedundantCheckOnNonNull ( local , reference ) ; } flowInfo . initsWhenFalse ( ) . setReachMode ( FlowInfo . UNREACHABLE_BY_NULLANALYSIS ) ; } else if ( checkTypeWithoutHideNullWarning == ( CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NULL ) ) { scope . problemReporter ( ) . localVariableNonNullComparedToNull ( local , reference ) ; flowInfo . initsWhenTrue ( ) . setReachMode ( FlowInfo . UNREACHABLE_BY_NULLANALYSIS ) ; } return ; } if ( flowInfo . canOnlyBeNull ( local ) ) { switch ( checkTypeWithoutHideNullWarning & CONTEXT_MASK ) { case FlowContext . IN_COMPARISON_NULL : if ( ( ( checkTypeWithoutHideNullWarning & CHECK_MASK ) == CAN_ONLY_NULL ) && ( reference . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullReference ( local , reference ) ; return ; } if ( ( checkType & HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableRedundantCheckOnNull ( local , reference ) ; } flowInfo . initsWhenFalse ( ) . setReachMode ( FlowInfo . UNREACHABLE_BY_NULLANALYSIS ) ; return ; case FlowContext . IN_COMPARISON_NON_NULL : if ( ( ( checkTypeWithoutHideNullWarning & CHECK_MASK ) == CAN_ONLY_NULL ) && ( reference . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullReference ( local , reference ) ; return ; } scope . problemReporter ( ) . localVariableNullComparedToNonNull ( local , reference ) ; flowInfo . initsWhenTrue ( ) . setReachMode ( FlowInfo . UNREACHABLE_BY_NULLANALYSIS ) ; 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 ( checkTypeWithoutHideNullWarning & CONTEXT_MASK ) { case FlowContext . IN_COMPARISON_NULL : if ( ( ( checkTypeWithoutHideNullWarning & 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 ( ( ( checkTypeWithoutHideNullWarning & 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 , location ) ; return ; } break ; default : } } else { switch ( checkTypeWithoutHideNullWarning ) { case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NULL : case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL : if ( flowInfo . isDefinitelyNonNull ( local ) ) { if ( checkTypeWithoutHideNullWarning == ( CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL ) ) { if ( ( checkType & HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableRedundantCheckOnNonNull ( local , location ) ; } flowInfo . initsWhenFalse ( ) . setReachMode ( FlowInfo . UNREACHABLE_BY_NULLANALYSIS ) ; } else { scope . problemReporter ( ) . localVariableNonNullComparedToNull ( local , location ) ; flowInfo . initsWhenTrue ( ) . setReachMode ( FlowInfo . UNREACHABLE_BY_NULLANALYSIS ) ; } 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 : Expression reference = ( Expression ) location ; if ( flowInfo . isDefinitelyNull ( local ) ) { switch ( checkTypeWithoutHideNullWarning & CONTEXT_MASK ) { case FlowContext . IN_COMPARISON_NULL : if ( ( ( checkTypeWithoutHideNullWarning & CHECK_MASK ) == CAN_ONLY_NULL ) && ( reference . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullReference ( local , reference ) ; return ; } if ( ( checkType & HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableRedundantCheckOnNull ( local , reference ) ; } flowInfo . initsWhenFalse ( ) . setReachMode ( FlowInfo . UNREACHABLE_BY_NULLANALYSIS ) ; return ; case FlowContext . IN_COMPARISON_NON_NULL : if ( ( ( checkTypeWithoutHideNullWarning & CHECK_MASK ) == CAN_ONLY_NULL ) && ( reference . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullReference ( local , reference ) ; return ; } scope . problemReporter ( ) . localVariableNullComparedToNonNull ( local , reference ) ; flowInfo . initsWhenTrue ( ) . setReachMode ( FlowInfo . UNREACHABLE_BY_NULLANALYSIS ) ; 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 ( checkTypeWithoutHideNullWarning & CONTEXT_MASK ) { case FlowContext . IN_COMPARISON_NULL : if ( ( ( checkTypeWithoutHideNullWarning & 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 ( ( ( checkTypeWithoutHideNullWarning & 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 , location ) ; return ; } if ( flowInfo . isPotentiallyNull ( local ) ) { scope . problemReporter ( ) . localVariablePotentialNullReference ( local , location ) ; return ; } if ( flowInfo . isDefinitelyNonNull ( local ) ) { return ; } break ; default : } } recordNullReference ( local , location , 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 , ASTNode 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 ; } protected boolean internalRecordNullityMismatch ( Expression expression , TypeBinding providedType , int nullStatus , TypeBinding expectedType , int checkType ) { if ( nullStatus == FlowInfo . UNKNOWN || ( ( this . tagBits & FlowContext . DEFER_NULL_DIAGNOSTIC ) != <NUM_LIT:0> && nullStatus != FlowInfo . NULL ) ) { recordProvidedExpectedTypes ( providedType , expectedType , this . nullCount ) ; recordNullReference ( expression . localVariableBinding ( ) , expression , checkType ) ; return true ; } return false ; } } </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 ; long x = ~ this . nullBit1 & a2 & a3 & a4 ; if ( x != <NUM_LIT:0> ) { source . nullBit1 &= ~ x ; source . nullBit2 |= x ; source . nullBit3 |= x ; source . nullBit4 |= x ; } } 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>" ; } } public void markPotentiallyUnknownBit ( LocalVariableBinding local ) { if ( this != DEAD_END ) { this . tagBits |= NULL_FLAG_MASK ; int position ; long mask ; if ( ( position = local . id + this . maxFieldCount ) < BitCacheSize ) { mask = <NUM_LIT:1L> << position ; isTrue ( ( this . nullBit1 & mask ) == <NUM_LIT:0> , "<STR_LIT>" ) ; this . nullBit4 |= mask ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { 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: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 ) ; } } } mask = <NUM_LIT:1L> << ( position % BitCacheSize ) ; isTrue ( ( this . extra [ <NUM_LIT:2> ] [ vectorIndex ] & mask ) == <NUM_LIT:0> , "<STR_LIT>" ) ; 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 markPotentiallyNullBit ( LocalVariableBinding local ) { if ( this != DEAD_END ) { this . tagBits |= NULL_FLAG_MASK ; int position ; long mask ; if ( ( position = local . id + this . maxFieldCount ) < BitCacheSize ) { mask = <NUM_LIT:1L> << position ; isTrue ( ( this . nullBit1 & mask ) == <NUM_LIT:0> , "<STR_LIT>" ) ; this . nullBit2 |= mask ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { 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: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 ) ; } } } mask = <NUM_LIT:1L> << ( position % BitCacheSize ) ; this . extra [ <NUM_LIT:3> ] [ vectorIndex ] |= mask ; isTrue ( ( this . extra [ <NUM_LIT:2> ] [ vectorIndex ] & mask ) == <NUM_LIT:0> , "<STR_LIT>" ) ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { this . extra [ <NUM_LIT:5> ] [ vectorIndex ] = ~ <NUM_LIT:0> ; } } } } } public void markPotentiallyNonNullBit ( LocalVariableBinding local ) { if ( this != DEAD_END ) { this . tagBits |= NULL_FLAG_MASK ; int position ; long mask ; if ( ( position = local . id + this . maxFieldCount ) < BitCacheSize ) { mask = <NUM_LIT:1L> << position ; isTrue ( ( this . nullBit1 & mask ) == <NUM_LIT:0> , "<STR_LIT>" ) ; this . nullBit3 |= mask ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { 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: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 ) ; } } } mask = <NUM_LIT:1L> << ( position % BitCacheSize ) ; isTrue ( ( this . extra [ <NUM_LIT:2> ] [ vectorIndex ] & mask ) == <NUM_LIT:0> , "<STR_LIT>" ) ; this . extra [ <NUM_LIT:4> ] [ vectorIndex ] |= mask ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { this . extra [ <NUM_LIT:5> ] [ vectorIndex ] = ~ <NUM_LIT:0> ; } } } } } } </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 . getLocalParent ( ) ; while ( current != null ) { char [ ] currentLabelName ; if ( ( ( currentLabelName = current . labelName ( ) ) != null ) && CharOperation . equals ( currentLabelName , this . labelName ) ) { scope . problemReporter ( ) . alreadyDefinedLabel ( this . labelName , this . associatedNode ) ; } current = current . getLocalParent ( ) ; } } 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 . 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_OR_DEAD = <NUM_LIT:1> ; public final static int UNREACHABLE_BY_NULLANALYSIS = <NUM_LIT:2> ; public final static int UNREACHABLE = UNREACHABLE_OR_DEAD | UNREACHABLE_BY_NULLANALYSIS ; public final static int NULL_FLAG_MASK = <NUM_LIT:4> ; public final static int UNKNOWN = <NUM_LIT:1> ; public final static int NULL = <NUM_LIT:2> ; public final static int NON_NULL = <NUM_LIT:4> ; public final static int POTENTIALLY_UNKNOWN = <NUM_LIT:8> ; public final static int POTENTIALLY_NULL = <NUM_LIT:16> ; public final static int POTENTIALLY_NON_NULL = <NUM_LIT:32> ; 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 resetNullInfo ( LocalVariableBinding local ) ; abstract public void markPotentiallyUnknownBit ( LocalVariableBinding local ) ; abstract public void markPotentiallyNullBit ( LocalVariableBinding local ) ; abstract public void markPotentiallyNonNullBit ( LocalVariableBinding local ) ; abstract public void markAsDefinitelyAssigned ( LocalVariableBinding local ) ; abstract public void markAsDefinitelyUnknown ( LocalVariableBinding local ) ; public void markNullStatus ( LocalVariableBinding local , int nullStatus ) { switch ( nullStatus ) { case FlowInfo . UNKNOWN : markAsDefinitelyUnknown ( local ) ; break ; case FlowInfo . NULL : markAsDefinitelyNull ( local ) ; break ; case FlowInfo . NON_NULL : markAsDefinitelyNonNull ( local ) ; break ; default : resetNullInfo ( local ) ; if ( ( nullStatus & FlowInfo . POTENTIALLY_UNKNOWN ) != <NUM_LIT:0> ) markPotentiallyUnknownBit ( local ) ; if ( ( nullStatus & FlowInfo . POTENTIALLY_NULL ) != <NUM_LIT:0> ) markPotentiallyNullBit ( local ) ; if ( ( nullStatus & FlowInfo . POTENTIALLY_NON_NULL ) != <NUM_LIT:0> ) markPotentiallyNonNullBit ( local ) ; if ( ( nullStatus & ( FlowInfo . POTENTIALLY_NULL | FlowInfo . POTENTIALLY_NON_NULL | FlowInfo . POTENTIALLY_UNKNOWN ) ) == <NUM_LIT:0> ) markAsDefinitelyUnknown ( local ) ; } } public int nullStatus ( LocalVariableBinding local ) { if ( isDefinitelyUnknown ( local ) ) return FlowInfo . UNKNOWN ; if ( isDefinitelyNull ( local ) ) return FlowInfo . NULL ; if ( isDefinitelyNonNull ( local ) ) return FlowInfo . NON_NULL ; int status = <NUM_LIT:0> ; if ( isPotentiallyUnknown ( local ) ) status |= FlowInfo . POTENTIALLY_UNKNOWN ; if ( isPotentiallyNull ( local ) ) status |= FlowInfo . POTENTIALLY_NULL ; if ( isPotentiallyNonNull ( local ) ) status |= FlowInfo . POTENTIALLY_NON_NULL ; if ( status > <NUM_LIT:0> ) return status ; return FlowInfo . UNKNOWN ; } 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_OR_DEAD ) . unconditionalInits ( ) ; } else { mergedInfo = initsWhenTrue . addPotentialInitializationsFrom ( initsWhenFalse . nullInfoLessUnconditionalCopy ( ) ) . unconditionalInits ( ) ; } } else if ( isOptimizedFalse ) { if ( initsWhenFalse == FlowInfo . DEAD_END && allowFakeDeadBranch ) { mergedInfo = initsWhenTrue . setReachMode ( FlowInfo . UNREACHABLE_OR_DEAD ) . 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 , boolean reportDeadCodeInKnownPattern ) { UnconditionalFlowInfo mergedInfo ; if ( isOptimizedTrue ) { if ( initsWhenTrue == FlowInfo . DEAD_END && allowFakeDeadBranch ) { if ( ! reportDeadCodeInKnownPattern ) { if ( ifStatement . elseStatement == null ) { mergedInfo = flowInfo . unconditionalInits ( ) ; } else { mergedInfo = initsWhenFalse . unconditionalInits ( ) ; if ( initsWhenFalse != FlowInfo . DEAD_END ) { mergedInfo . setReachMode ( flowInfo . reachMode ( ) ) ; } } } else { mergedInfo = initsWhenFalse . setReachMode ( FlowInfo . UNREACHABLE_OR_DEAD ) . unconditionalInits ( ) ; } } else { mergedInfo = initsWhenTrue . addPotentialInitializationsFrom ( initsWhenFalse . nullInfoLessUnconditionalCopy ( ) ) . unconditionalInits ( ) ; } } else if ( isOptimizedFalse ) { if ( initsWhenFalse == FlowInfo . DEAD_END && allowFakeDeadBranch ) { if ( ! reportDeadCodeInKnownPattern ) { if ( ifStatement . thenStatement == null ) { mergedInfo = flowInfo . unconditionalInits ( ) ; } else { mergedInfo = initsWhenTrue . unconditionalInits ( ) ; if ( initsWhenTrue != FlowInfo . DEAD_END ) { mergedInfo . setReachMode ( flowInfo . reachMode ( ) ) ; } } } else { mergedInfo = initsWhenTrue . setReachMode ( FlowInfo . UNREACHABLE_OR_DEAD ) . 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 resetAssignmentInfo ( 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 . FakedTrackingVariable ; 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 . TypeBinding ; 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 ; ASTNode [ ] 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 , 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 . getLocalParent ( ) ; while ( context != null ) { context . removeFinalAssignmentIfAny ( this . finalAssignments [ i ] ) ; context = context . getLocalParent ( ) ; } } } } 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 ] ; ASTNode location = this . nullReferences [ i ] ; switch ( this . nullCheckTypes [ i ] & ~ HIDE_NULL_COMPARISON_WARNING_MASK ) { 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 ] & ~ HIDE_NULL_COMPARISON_WARNING_MASK ) == ( CAN_ONLY_NON_NULL | IN_COMPARISON_NON_NULL ) ) { if ( ( this . nullCheckTypes [ i ] & HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableRedundantCheckOnNonNull ( local , location ) ; } } else { scope . problemReporter ( ) . localVariableNonNullComparedToNull ( local , location ) ; } 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 ] & ~ HIDE_NULL_COMPARISON_WARNING_MASK ) == ( CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL ) ) { if ( ( this . nullCheckTypes [ i ] & HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableRedundantCheckOnNonNull ( local , location ) ; } } else { scope . problemReporter ( ) . localVariableNonNullComparedToNull ( local , location ) ; } continue ; } if ( flowInfo . isDefinitelyNull ( local ) ) { this . nullReferences [ i ] = null ; if ( ( this . nullCheckTypes [ i ] & ~ HIDE_NULL_COMPARISON_WARNING_MASK ) == ( CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NULL ) ) { if ( ( this . nullCheckTypes [ i ] & HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableRedundantCheckOnNull ( local , location ) ; } } else { scope . problemReporter ( ) . localVariableNullComparedToNonNull ( local , location ) ; } 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 : Expression expression = ( Expression ) location ; 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 & ~ HIDE_NULL_COMPARISON_WARNING_MASK ) == CAN_ONLY_NULL ) && ( expression . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullReference ( local , expression ) ; continue ; } if ( ( this . nullCheckTypes [ i ] & 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 & ~ HIDE_NULL_COMPARISON_WARNING_MASK ) == CAN_ONLY_NULL ) && ( expression . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullReference ( local , expression ) ; continue ; } 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 & ~ HIDE_NULL_COMPARISON_WARNING_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 & ~ HIDE_NULL_COMPARISON_WARNING_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 , location ) ; continue ; } break ; case ASSIGN_TO_NONNULL : int nullStatus = flowInfo . nullStatus ( local ) ; if ( nullStatus != FlowInfo . NON_NULL ) { this . parent . recordNullityMismatch ( scope , ( Expression ) location , this . providedExpectedTypes [ i ] [ <NUM_LIT:0> ] , this . providedExpectedTypes [ i ] [ <NUM_LIT:1> ] , nullStatus ) ; } break ; case EXIT_RESOURCE : FakedTrackingVariable trackingVar = local . closeTracker ; if ( trackingVar != null ) { if ( trackingVar . hasDefinitelyNoResource ( flowInfo ) ) { continue ; } if ( trackingVar . isClosedInFinallyOfEnclosing ( scope ) ) { continue ; } if ( this . parent . recordExitAgainstResource ( scope , flowInfo , trackingVar , location ) ) { this . nullReferences [ i ] = null ; continue ; } } break ; default : } this . parent . recordUsingNullReference ( scope , local , location , this . nullCheckTypes [ i ] , flowInfo ) ; } } else { for ( int i = <NUM_LIT:0> ; i < this . nullCount ; i ++ ) { ASTNode location = this . nullReferences [ i ] ; LocalVariableBinding local = this . nullLocals [ i ] ; switch ( this . nullCheckTypes [ i ] & ~ HIDE_NULL_COMPARISON_WARNING_MASK ) { 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 ] & ~ HIDE_NULL_COMPARISON_WARNING_MASK ) == ( CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL ) ) { if ( ( this . nullCheckTypes [ i ] & HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableRedundantCheckOnNonNull ( local , location ) ; } } else { scope . problemReporter ( ) . localVariableNonNullComparedToNull ( local , location ) ; } 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 : Expression expression = ( Expression ) location ; 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 & ~ HIDE_NULL_COMPARISON_WARNING_MASK ) == CAN_ONLY_NULL ) && ( expression . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullReference ( local , expression ) ; continue ; } if ( ( this . nullCheckTypes [ i ] & 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 & ~ HIDE_NULL_COMPARISON_WARNING_MASK ) == CAN_ONLY_NULL ) && ( expression . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullReference ( local , expression ) ; continue ; } 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 & ~ HIDE_NULL_COMPARISON_WARNING_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 & ~ HIDE_NULL_COMPARISON_WARNING_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 , location ) ; continue ; } if ( flowInfo . isPotentiallyNull ( local ) ) { this . nullReferences [ i ] = null ; scope . problemReporter ( ) . localVariablePotentialNullReference ( local , location ) ; continue ; } break ; case ASSIGN_TO_NONNULL : int nullStatus = flowInfo . nullStatus ( local ) ; if ( nullStatus != FlowInfo . NON_NULL ) { char [ ] [ ] annotationName = scope . environment ( ) . getNonNullAnnotationName ( ) ; scope . problemReporter ( ) . nullityMismatch ( ( Expression ) location , this . providedExpectedTypes [ i ] [ <NUM_LIT:0> ] , this . providedExpectedTypes [ i ] [ <NUM_LIT:1> ] , nullStatus , annotationName ) ; } break ; case EXIT_RESOURCE : nullStatus = flowInfo . nullStatus ( local ) ; if ( nullStatus != FlowInfo . NON_NULL ) { FakedTrackingVariable closeTracker = local . closeTracker ; if ( closeTracker != null ) { if ( closeTracker . hasDefinitelyNoResource ( flowInfo ) ) { continue ; } if ( closeTracker . isClosedInFinallyOfEnclosing ( scope ) ) { continue ; } nullStatus = closeTracker . findMostSpecificStatus ( flowInfo , scope , null ) ; closeTracker . recordErrorLocation ( this . nullReferences [ i ] , nullStatus ) ; closeTracker . reportRecordedErrors ( scope , nullStatus ) ; this . nullReferences [ i ] = null ; 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_OR_DEAD ) == <NUM_LIT:0> ) { if ( ( this . initsOnContinue . tagBits & FlowInfo . UNREACHABLE_OR_DEAD ) == <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 , ASTNode expression , int status ) { if ( this . nullCount == <NUM_LIT:0> ) { this . nullLocals = new LocalVariableBinding [ <NUM_LIT:5> ] ; this . nullReferences = new ASTNode [ <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 ASTNode [ 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 boolean recordExitAgainstResource ( BlockScope scope , FlowInfo flowInfo , FakedTrackingVariable trackingVar , ASTNode reference ) { LocalVariableBinding local = trackingVar . binding ; if ( flowInfo . isDefinitelyNonNull ( local ) ) { return false ; } if ( flowInfo . isDefinitelyNull ( local ) ) { scope . problemReporter ( ) . unclosedCloseable ( trackingVar , reference ) ; return true ; } if ( flowInfo . isPotentiallyNull ( local ) ) { scope . problemReporter ( ) . potentiallyUnclosedCloseable ( trackingVar , reference ) ; return true ; } recordNullReference ( trackingVar . binding , reference , EXIT_RESOURCE ) ; return true ; } public void recordUsingNullReference ( Scope scope , LocalVariableBinding local , ASTNode location , int checkType , FlowInfo flowInfo ) { if ( ( flowInfo . tagBits & FlowInfo . UNREACHABLE ) != <NUM_LIT:0> || flowInfo . isDefinitelyUnknown ( local ) ) { return ; } checkType |= ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) ; int checkTypeWithoutHideNullWarning = checkType & ~ FlowContext . HIDE_NULL_COMPARISON_WARNING_MASK ; switch ( checkTypeWithoutHideNullWarning ) { case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NULL : case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL : Expression reference = ( Expression ) location ; if ( flowInfo . isDefinitelyNonNull ( local ) ) { if ( checkTypeWithoutHideNullWarning == ( 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 ) ; } flowInfo . initsWhenFalse ( ) . setReachMode ( FlowInfo . UNREACHABLE_BY_NULLANALYSIS ) ; } else { scope . problemReporter ( ) . localVariableNonNullComparedToNull ( local , reference ) ; flowInfo . initsWhenTrue ( ) . setReachMode ( FlowInfo . UNREACHABLE_BY_NULLANALYSIS ) ; } } else if ( flowInfo . isDefinitelyNull ( local ) ) { if ( checkTypeWithoutHideNullWarning == ( CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NULL ) ) { if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableRedundantCheckOnNull ( local , reference ) ; } flowInfo . initsWhenFalse ( ) . setReachMode ( FlowInfo . UNREACHABLE_BY_NULLANALYSIS ) ; } else { scope . problemReporter ( ) . localVariableNullComparedToNonNull ( local , reference ) ; flowInfo . initsWhenTrue ( ) . setReachMode ( FlowInfo . UNREACHABLE_BY_NULLANALYSIS ) ; } } else if ( this . upstreamNullFlowInfo . isDefinitelyNonNull ( local ) && ! flowInfo . isPotentiallyNull ( local ) && ! flowInfo . isPotentiallyUnknown ( local ) ) { flowInfo . markAsDefinitelyNonNull ( local ) ; recordNullReference ( local , reference , checkType ) ; } else if ( flowInfo . cannotBeDefinitelyNullOrNonNull ( local ) ) { return ; } else { if ( flowInfo . isPotentiallyNonNull ( local ) ) { recordNullReference ( local , reference , CAN_ONLY_NON_NULL | checkType & ( CONTEXT_MASK | HIDE_NULL_COMPARISON_WARNING_MASK ) ) ; } else if ( flowInfo . isPotentiallyNull ( local ) ) { recordNullReference ( local , reference , CAN_ONLY_NULL | checkType & ( CONTEXT_MASK | HIDE_NULL_COMPARISON_WARNING_MASK ) ) ; } else { 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 : reference = ( Expression ) location ; if ( flowInfo . isPotentiallyNonNull ( local ) || flowInfo . isPotentiallyUnknown ( local ) || flowInfo . isProtectedNonNull ( local ) ) { return ; } if ( flowInfo . isDefinitelyNull ( local ) ) { switch ( checkTypeWithoutHideNullWarning & CONTEXT_MASK ) { case FlowContext . IN_COMPARISON_NULL : if ( ( ( checkTypeWithoutHideNullWarning & 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 ) ; } flowInfo . initsWhenFalse ( ) . setReachMode ( FlowInfo . UNREACHABLE_BY_NULLANALYSIS ) ; return ; case FlowContext . IN_COMPARISON_NON_NULL : if ( ( ( checkTypeWithoutHideNullWarning & CHECK_MASK ) == CAN_ONLY_NULL ) && ( reference . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullReference ( local , reference ) ; return ; } scope . problemReporter ( ) . localVariableNullComparedToNonNull ( local , reference ) ; flowInfo . initsWhenTrue ( ) . setReachMode ( FlowInfo . UNREACHABLE_BY_NULLANALYSIS ) ; 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 ( checkTypeWithoutHideNullWarning & CONTEXT_MASK ) { case FlowContext . IN_COMPARISON_NULL : if ( ( ( checkTypeWithoutHideNullWarning & 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 ( ( ( checkTypeWithoutHideNullWarning & CHECK_MASK ) == CAN_ONLY_NULL ) && ( reference . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariablePotentialNullReference ( local , reference ) ; return ; } break ; } } recordNullReference ( local , reference , checkType ) ; return ; case MAY_NULL : if ( flowInfo . isDefinitelyNonNull ( local ) ) { return ; } if ( flowInfo . isDefinitelyNull ( local ) ) { scope . problemReporter ( ) . localVariableNullReference ( local , location ) ; return ; } if ( flowInfo . isPotentiallyNull ( local ) ) { scope . problemReporter ( ) . localVariablePotentialNullReference ( local , location ) ; return ; } recordNullReference ( local , location , 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 ; } protected boolean internalRecordNullityMismatch ( Expression expression , TypeBinding providedType , int nullStatus , TypeBinding expectedType , int checkType ) { recordProvidedExpectedTypes ( providedType , expectedType , this . nullCount ) ; recordNullReference ( expression . localVariableBinding ( ) , expression , checkType ) ; return true ; } } </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 , TypeBinding caughtException , 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 . 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 resetNullInfo ( LocalVariableBinding local ) { this . initsWhenTrue . resetNullInfo ( local ) ; this . initsWhenFalse . resetNullInfo ( local ) ; } public void markPotentiallyNullBit ( LocalVariableBinding local ) { this . initsWhenTrue . markPotentiallyNullBit ( local ) ; this . initsWhenFalse . markPotentiallyNullBit ( local ) ; } public void markPotentiallyNonNullBit ( LocalVariableBinding local ) { this . initsWhenTrue . markPotentiallyNonNullBit ( local ) ; this . initsWhenFalse . markPotentiallyNonNullBit ( local ) ; } public void markAsDefinitelyUnknown ( LocalVariableBinding local ) { this . initsWhenTrue . markAsDefinitelyUnknown ( local ) ; this . initsWhenFalse . markAsDefinitelyUnknown ( local ) ; } public void markPotentiallyUnknownBit ( LocalVariableBinding local ) { this . initsWhenTrue . markPotentiallyUnknownBit ( local ) ; this . initsWhenFalse . markPotentiallyUnknownBit ( local ) ; } public FlowInfo setReachMode ( int reachMode ) { if ( reachMode == REACHABLE ) { this . tagBits &= ~ UNREACHABLE ; } else { this . tagBits |= reachMode ; } 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 resetAssignmentInfo ( LocalVariableBinding local ) { this . initsWhenTrue . resetAssignmentInfo ( local ) ; this . initsWhenFalse . resetAssignmentInfo ( 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 . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . AbstractMethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . Expression ; import org . eclipse . jdt . internal . compiler . ast . FakedTrackingVariable ; import org . eclipse . jdt . internal . compiler . ast . LabeledStatement ; import org . eclipse . jdt . internal . compiler . ast . Reference ; import org . eclipse . jdt . internal . compiler . ast . SingleNameReference ; import org . eclipse . jdt . internal . compiler . ast . SubRoutineStatement ; import org . eclipse . jdt . internal . compiler . ast . ThrowStatement ; import org . eclipse . jdt . internal . compiler . ast . TryStatement ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; 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 . CatchParameterBinding ; 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 TypeBinding [ ] [ ] providedExpectedTypes = null ; 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 HIDE_NULL_COMPARISON_WARNING_MASK = <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 final static int ASSIGN_TO_NONNULL = <NUM_LIT> ; public static final int EXIT_RESOURCE = <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 & ~ HIDE_NULL_COMPARISON_WARNING_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 ) { checkExceptionHandlers ( raisedException , location , flowInfo , scope , false ) ; } public void checkExceptionHandlers ( TypeBinding raisedException , ASTNode location , FlowInfo flowInfo , BlockScope scope , boolean isExceptionOnAutoClose ) { FlowContext traversedContext = this ; ArrayList abruptlyExitedLoops = null ; if ( scope . compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_7 && location instanceof ThrowStatement ) { Expression throwExpression = ( ( ThrowStatement ) location ) . exception ; LocalVariableBinding throwArgBinding = throwExpression . localVariableBinding ( ) ; if ( throwExpression instanceof SingleNameReference && throwArgBinding instanceof CatchParameterBinding && throwArgBinding . isEffectivelyFinal ( ) ) { CatchParameterBinding parameter = ( CatchParameterBinding ) throwArgBinding ; checkExceptionHandlers ( parameter . getPreciseTypes ( ) , location , flowInfo , scope ) ; return ; } } 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 , raisedException , location , definitelyCaught ) ; definitelyCaught = true ; break ; case Scope . MORE_GENERIC : exceptionContext . recordHandlingException ( caughtException , flowInfo . unconditionalInits ( ) , raisedException , caughtException , 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 ( ! isExceptionOnAutoClose ) { if ( traversedContext instanceof InsideSubRoutineFlowContext ) { ASTNode node = traversedContext . associatedNode ; if ( node instanceof TryStatement ) { TryStatement tryStatement = ( TryStatement ) node ; flowInfo . addInitializationsFrom ( tryStatement . subRoutineInits ) ; } } } traversedContext = traversedContext . getLocalParent ( ) ; } if ( isExceptionOnAutoClose ) { scope . problemReporter ( ) . unhandledExceptionFromAutoClose ( raisedException , location ) ; } else { 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 , raisedException , location , locallyCaught [ raisedIndex ] ) ; if ( ! locallyCaught [ raisedIndex ] ) { locallyCaught [ raisedIndex ] = true ; remainingCount -- ; } break ; case Scope . MORE_GENERIC : exceptionContext . recordHandlingException ( caughtException , flowInfo . unconditionalInits ( ) , raisedException , caughtException , 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 . getLocalParent ( ) ; } 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 . getLocalParent ( ) : exceptionContext . initializationParent ; } else { current = current . getLocalParent ( ) ; } } 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 . getLocalParent ( ) ; } 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 . getLocalParent ( ) ; } 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 . getLocalParent ( ) ; } 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 . getLocalParent ( ) ; } return null ; } public FlowContext getLocalParent ( ) { if ( this . associatedNode instanceof AbstractMethodDeclaration || this . associatedNode instanceof TypeDeclaration ) return null ; return this . parent ; } 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 ) { } public boolean recordExitAgainstResource ( BlockScope scope , FlowInfo flowInfo , FakedTrackingVariable trackingVar , ASTNode reference ) { return false ; } protected void recordProvidedExpectedTypes ( TypeBinding providedType , TypeBinding expectedType , int nullCount ) { if ( nullCount == <NUM_LIT:0> ) { this . providedExpectedTypes = new TypeBinding [ <NUM_LIT:5> ] [ ] ; } else if ( this . providedExpectedTypes == null ) { int size = <NUM_LIT:5> ; while ( size <= nullCount ) size *= <NUM_LIT:2> ; this . providedExpectedTypes = new TypeBinding [ size ] [ ] ; } else if ( nullCount >= this . providedExpectedTypes . length ) { int oldLen = this . providedExpectedTypes . length ; System . arraycopy ( this . providedExpectedTypes , <NUM_LIT:0> , this . providedExpectedTypes = new TypeBinding [ nullCount * <NUM_LIT:2> ] [ ] , <NUM_LIT:0> , oldLen ) ; } this . providedExpectedTypes [ nullCount ] = new TypeBinding [ ] { providedType , expectedType } ; } protected boolean recordFinalAssignment ( VariableBinding variable , Reference finalReference ) { return true ; } protected void recordNullReference ( LocalVariableBinding local , ASTNode location , int status ) { } public void recordReturnFrom ( UnconditionalFlowInfo flowInfo ) { } public void recordSettingFinal ( VariableBinding variable , Reference finalReference , FlowInfo flowInfo ) { if ( ( flowInfo . tagBits & FlowInfo . UNREACHABLE_OR_DEAD ) == <NUM_LIT:0> ) { FlowContext context = this ; while ( context != null ) { if ( ! context . recordFinalAssignment ( variable , finalReference ) ) { break ; } context = context . getLocalParent ( ) ; } } } public void recordUsingNullReference ( Scope scope , LocalVariableBinding local , ASTNode location , int checkType , FlowInfo flowInfo ) { if ( ( flowInfo . tagBits & FlowInfo . UNREACHABLE ) != <NUM_LIT:0> || flowInfo . isDefinitelyUnknown ( local ) ) { return ; } checkType |= ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) ; int checkTypeWithoutHideNullWarning = checkType & ~ FlowContext . HIDE_NULL_COMPARISON_WARNING_MASK ; switch ( checkTypeWithoutHideNullWarning ) { case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NULL : case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL : if ( flowInfo . isDefinitelyNonNull ( local ) ) { if ( checkTypeWithoutHideNullWarning == ( CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL ) ) { if ( ( checkType & HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableRedundantCheckOnNonNull ( local , location ) ; } flowInfo . initsWhenFalse ( ) . setReachMode ( FlowInfo . UNREACHABLE_BY_NULLANALYSIS ) ; } else { scope . problemReporter ( ) . localVariableNonNullComparedToNull ( local , location ) ; flowInfo . initsWhenTrue ( ) . setReachMode ( FlowInfo . UNREACHABLE_BY_NULLANALYSIS ) ; } 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 : Expression reference = ( Expression ) location ; if ( flowInfo . isDefinitelyNull ( local ) ) { switch ( checkTypeWithoutHideNullWarning & CONTEXT_MASK ) { case FlowContext . IN_COMPARISON_NULL : if ( ( ( checkTypeWithoutHideNullWarning & CHECK_MASK ) == CAN_ONLY_NULL ) && ( reference . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullReference ( local , reference ) ; return ; } if ( ( checkType & HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableRedundantCheckOnNull ( local , reference ) ; } flowInfo . initsWhenFalse ( ) . setReachMode ( FlowInfo . UNREACHABLE_BY_NULLANALYSIS ) ; return ; case FlowContext . IN_COMPARISON_NON_NULL : if ( ( ( checkTypeWithoutHideNullWarning & CHECK_MASK ) == CAN_ONLY_NULL ) && ( reference . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullReference ( local , reference ) ; return ; } scope . problemReporter ( ) . localVariableNullComparedToNonNull ( local , reference ) ; flowInfo . initsWhenTrue ( ) . setReachMode ( FlowInfo . UNREACHABLE_BY_NULLANALYSIS ) ; 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 ( checkTypeWithoutHideNullWarning & CONTEXT_MASK ) { case FlowContext . IN_COMPARISON_NULL : if ( ( ( checkTypeWithoutHideNullWarning & 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 ( ( ( checkTypeWithoutHideNullWarning & 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 , location ) ; return ; } if ( flowInfo . isPotentiallyNull ( local ) ) { scope . problemReporter ( ) . localVariablePotentialNullReference ( local , location ) ; return ; } break ; default : } if ( this . parent != null ) { this . parent . recordUsingNullReference ( scope , local , location , 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 ( ) ; } public void recordNullityMismatch ( BlockScope currentScope , Expression expression , TypeBinding providedType , TypeBinding expectedType , int nullStatus ) { if ( providedType == null ) { return ; } if ( expression . localVariableBinding ( ) != null ) { FlowContext currentContext = this ; while ( currentContext != null ) { int isInsideAssert = <NUM_LIT> ; if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) != <NUM_LIT:0> ) { isInsideAssert = FlowContext . HIDE_NULL_COMPARISON_WARNING ; } if ( currentContext . internalRecordNullityMismatch ( expression , providedType , nullStatus , expectedType , ASSIGN_TO_NONNULL | isInsideAssert ) ) return ; currentContext = currentContext . parent ; } } char [ ] [ ] annotationName = currentScope . environment ( ) . getNonNullAnnotationName ( ) ; currentScope . problemReporter ( ) . nullityMismatch ( expression , providedType , expectedType , nullStatus , annotationName ) ; } protected boolean internalRecordNullityMismatch ( Expression expression , TypeBinding providedType , int nullStatus , TypeBinding expectedType , int checkType ) { return false ; } } </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 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> ; } } } } 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> ; } } } } 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 ] ; } } } 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_OR_DEAD ) != <NUM_LIT:0> ) { return true ; } return isDefinitelyAssigned ( field . id ) ; } final public boolean isDefinitelyAssigned ( LocalVariableBinding local ) { if ( ( this . tagBits & UNREACHABLE_OR_DEAD ) != <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:2> ] . 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:2> ] . 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:2> ] . 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:2> ] . 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:2> ] . 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:2> ] . 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> ; } protected static boolean isTrue ( boolean expression , String message ) { if ( ! expression ) throw new AssertionFailedException ( "<STR_LIT>" + message ) ; return expression ; } 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 = ( 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 ) ; } } } this . extra [ <NUM_LIT:2> ] [ vectorIndex ] |= ( 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 = ( 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 ) ; } } } this . extra [ <NUM_LIT:2> ] [ vectorIndex ] |= ( 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 = ( 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 ) ; } } } this . extra [ <NUM_LIT:2> ] [ vectorIndex ] |= ( 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 void resetNullInfo ( LocalVariableBinding local ) { if ( this != DEAD_END ) { this . tagBits |= NULL_FLAG_MASK ; int position ; long mask ; if ( ( position = local . id + this . maxFieldCount ) < BitCacheSize ) { this . nullBit1 &= ( mask = ~ ( <NUM_LIT:1L> << position ) ) ; this . nullBit2 &= mask ; this . nullBit3 &= mask ; this . nullBit4 &= mask ; } else { int vectorIndex = ( position / BitCacheSize ) - <NUM_LIT:1> ; if ( this . extra == null || vectorIndex >= this . extra [ <NUM_LIT:2> ] . length ) { return ; } this . extra [ <NUM_LIT:2> ] [ vectorIndex ] &= ( mask = ~ ( <NUM_LIT:1L> << ( position % BitCacheSize ) ) ) ; this . extra [ <NUM_LIT:3> ] [ vectorIndex ] &= mask ; this . extra [ <NUM_LIT:4> ] [ vectorIndex ] &= mask ; this . extra [ <NUM_LIT:5> ] [ vectorIndex ] &= mask ; } } } public void markPotentiallyUnknownBit ( LocalVariableBinding local ) { if ( this != DEAD_END ) { this . tagBits |= NULL_FLAG_MASK ; int position ; long mask ; if ( ( position = local . id + this . maxFieldCount ) < BitCacheSize ) { mask = <NUM_LIT:1L> << position ; isTrue ( ( this . nullBit1 & mask ) == <NUM_LIT:0> , "<STR_LIT>" ) ; this . nullBit4 |= mask ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { 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 ] ; } } 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 ) ; } } } mask = <NUM_LIT:1L> << ( position % BitCacheSize ) ; isTrue ( ( this . extra [ <NUM_LIT:2> ] [ vectorIndex ] & mask ) == <NUM_LIT:0> , "<STR_LIT>" ) ; 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 markPotentiallyNullBit ( LocalVariableBinding local ) { if ( this != DEAD_END ) { this . tagBits |= NULL_FLAG_MASK ; int position ; long mask ; if ( ( position = local . id + this . maxFieldCount ) < BitCacheSize ) { mask = <NUM_LIT:1L> << position ; isTrue ( ( this . nullBit1 & mask ) == <NUM_LIT:0> , "<STR_LIT>" ) ; this . nullBit2 |= mask ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { 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 ] ; } } 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 ) ; } } } mask = <NUM_LIT:1L> << ( position % BitCacheSize ) ; this . extra [ <NUM_LIT:3> ] [ vectorIndex ] |= mask ; isTrue ( ( this . extra [ <NUM_LIT:2> ] [ vectorIndex ] & mask ) == <NUM_LIT:0> , "<STR_LIT>" ) ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { this . extra [ <NUM_LIT:5> ] [ vectorIndex ] = ~ <NUM_LIT:0> ; } } } } } public void markPotentiallyNonNullBit ( LocalVariableBinding local ) { if ( this != DEAD_END ) { this . tagBits |= NULL_FLAG_MASK ; int position ; long mask ; if ( ( position = local . id + this . maxFieldCount ) < BitCacheSize ) { mask = <NUM_LIT:1L> << position ; isTrue ( ( this . nullBit1 & mask ) == <NUM_LIT:0> , "<STR_LIT>" ) ; this . nullBit3 |= mask ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { 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 ] ; } } 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 ) ; } } } mask = <NUM_LIT:1L> << ( position % BitCacheSize ) ; isTrue ( ( this . extra [ <NUM_LIT:2> ] [ vectorIndex ] & mask ) == <NUM_LIT:0> , "<STR_LIT>" ) ; 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_OR_DEAD ) != <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_OR_DEAD ) != <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 ( ( otherInits . tagBits & FlowInfo . UNREACHABLE_BY_NULLANALYSIS ) != <NUM_LIT:0> ) { otherHasNulls = false ; } else if ( ( this . tagBits & FlowInfo . UNREACHABLE_BY_NULLANALYSIS ) != <NUM_LIT:0> ) { this . nullBit1 = otherInits . nullBit1 ; this . nullBit2 = otherInits . nullBit2 ; this . nullBit3 = otherInits . nullBit3 ; this . nullBit4 = otherInits . nullBit4 ; thisHadNulls = false ; thisHasNulls = otherHasNulls ; this . tagBits = otherInits . tagBits ; } else 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 ) ; long ax = ~ a1 & a2 & a3 & a4 ; long bx = ~ b1 & b2 & b3 & b4 ; long x = ax | bx ; if ( x != <NUM_LIT:0> ) { this . nullBit1 &= ~ x ; this . nullBit2 |= x ; this . nullBit3 |= x ; this . nullBit4 |= x ; } 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 ) ; long ax = ~ a1 & a2 & a3 & a4 ; long bx = ~ b1 & b2 & b3 & b4 ; long x = ax | bx ; if ( x != <NUM_LIT:0> ) { this . extra [ <NUM_LIT:2> ] [ i ] &= ~ x ; this . extra [ <NUM_LIT:3> ] [ i ] |= x ; this . extra [ <NUM_LIT:4> ] [ i ] |= x ; this . extra [ <NUM_LIT:5> ] [ i ] |= x ; } 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> ; } } } } 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 ( reachMode == UNREACHABLE_BY_NULLANALYSIS ) { this . tagBits |= UNREACHABLE_BY_NULLANALYSIS ; } 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 |= reachMode ; } 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 ; } 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 resetAssignmentInfo ( LocalVariableBinding local ) { resetAssignmentInfo ( local . id + this . maxFieldCount ) ; } public void resetAssignmentInfo ( 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 || vectorIndex >= this . extra [ <NUM_LIT:0> ] . length ) return ; long mask ; this . extra [ <NUM_LIT:0> ] [ vectorIndex ] &= ( mask = ~ ( <NUM_LIT:1L> << ( position % BitCacheSize ) ) ) ; this . extra [ <NUM_LIT:1> ] [ vectorIndex ] &= mask ; } } } } </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 . Argument ; import org . eclipse . jdt . internal . compiler . ast . UnionTypeReference ; import org . eclipse . jdt . internal . compiler . ast . SubRoutineStatement ; import org . eclipse . jdt . internal . compiler . ast . TryStatement ; import org . eclipse . jdt . internal . compiler . ast . TypeReference ; import org . eclipse . jdt . internal . compiler . codegen . ObjectCache ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . CatchParameterBinding ; 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 ; private static final Argument [ ] NO_ARGUMENTS = new Argument [ <NUM_LIT:0> ] ; public Argument [ ] catchArguments ; private int [ ] exceptionToCatchBlockMap ; public ExceptionHandlingFlowContext ( FlowContext parent , ASTNode associatedNode , ReferenceBinding [ ] handledExceptions , FlowContext initializationParent , BlockScope scope , UnconditionalFlowInfo flowInfo ) { this ( parent , associatedNode , handledExceptions , null , NO_ARGUMENTS , initializationParent , scope , flowInfo ) ; } public ExceptionHandlingFlowContext ( FlowContext parent , ASTNode associatedNode , ReferenceBinding [ ] handledExceptions , int [ ] exceptionToCatchBlockMap , Argument [ ] catchArguments , FlowContext initializationParent , BlockScope scope , UnconditionalFlowInfo flowInfo ) { super ( parent , associatedNode ) ; this . isMethodContext = scope == scope . methodScope ( ) ; this . handledExceptions = handledExceptions ; this . catchArguments = catchArguments ; this . exceptionToCatchBlockMap = exceptionToCatchBlockMap ; 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 ] ; int catchBlock = this . exceptionToCatchBlockMap != null ? this . exceptionToCatchBlockMap [ i ] : 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 [ catchBlock ] = flowInfo . unconditionalCopy ( ) ; } else { this . initsOnExceptions [ catchBlock ] = 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 index = <NUM_LIT:0> , count = this . handledExceptions . length ; index < count ; index ++ ) { 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 ] , getExceptionType ( index ) ) ; } else { if ( ( this . isNeeded [ cacheIndex ] & bitMask ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . hiddenCatchBlock ( this . handledExceptions [ index ] , getExceptionType ( index ) ) ; } } } } private ASTNode getExceptionType ( int index ) { if ( this . exceptionToCatchBlockMap == null ) { return this . catchArguments [ index ] . type ; } int catchBlock = this . exceptionToCatchBlockMap [ index ] ; ASTNode node = this . catchArguments [ catchBlock ] . type ; if ( node instanceof UnionTypeReference ) { TypeReference [ ] typeRefs = ( ( UnionTypeReference ) node ) . typeReferences ; for ( int i = <NUM_LIT:0> , len = typeRefs . length ; i < len ; i ++ ) { TypeReference typeRef = typeRefs [ i ] ; if ( typeRef . resolvedType == this . handledExceptions [ index ] ) return typeRef ; } } return node ; } 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>" ) ; } int catchBlock = this . exceptionToCatchBlockMap != null ? this . exceptionToCatchBlockMap [ i ] : i ; buffer . append ( '<CHAR_LIT:->' ) . append ( this . initsOnExceptions [ catchBlock ] . toString ( ) ) . append ( '<CHAR_LIT:]>' ) ; } buffer . append ( "<STR_LIT>" ) . append ( this . initsOnReturn . toString ( ) ) . append ( '<CHAR_LIT:]>' ) ; return buffer . toString ( ) ; } public UnconditionalFlowInfo initsOnException ( int index ) { 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 , TypeBinding caughtException , 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 ; int catchBlock = this . exceptionToCatchBlockMap != null ? this . exceptionToCatchBlockMap [ index ] : index ; if ( caughtException != null && this . catchArguments != null && this . catchArguments . length > <NUM_LIT:0> && ! wasAlreadyDefinitelyCaught ) { CatchParameterBinding catchParameter = ( CatchParameterBinding ) this . catchArguments [ catchBlock ] . binding ; catchParameter . setPreciseType ( caughtException ) ; } this . initsOnExceptions [ catchBlock ] = ( this . initsOnExceptions [ catchBlock ] . tagBits & FlowInfo . UNREACHABLE ) == <NUM_LIT:0> ? this . initsOnExceptions [ catchBlock ] . mergedWith ( flowInfo ) : flowInfo . unconditionalCopy ( ) ; } public void recordReturnFrom ( UnconditionalFlowInfo flowInfo ) { if ( ( flowInfo . tagBits & FlowInfo . UNREACHABLE_OR_DEAD ) == <NUM_LIT:0> ) { if ( ( this . initsOnReturn . tagBits & FlowInfo . UNREACHABLE_OR_DEAD ) == <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 . 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_OR_DEAD ) == <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 . 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 . 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 . 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 int getAnnotatedParametersCount ( ) { return <NUM_LIT:0> ; } 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>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.