text
stringlengths
30
1.67M
<s> package org . eclipse . jdt . internal . core ; import java . util . Enumeration ; import java . util . Iterator ; import org . eclipse . jdt . internal . core . util . LRUCache ; import org . eclipse . jdt . internal . core . util . Messages ; public abstract class OverflowingLRUCache extends LRUCache { protected int overflow = <NUM_LIT:0> ; protected boolean timestampsOn = true ; protected double loadFactor = <NUM_LIT> ; public OverflowingLRUCache ( int size ) { this ( size , <NUM_LIT:0> ) ; } public OverflowingLRUCache ( int size , int overflow ) { super ( size ) ; this . overflow = overflow ; } public Object clone ( ) { OverflowingLRUCache newCache = ( OverflowingLRUCache ) newInstance ( this . spaceLimit , this . overflow ) ; LRUCacheEntry qEntry ; qEntry = this . entryQueueTail ; while ( qEntry != null ) { newCache . privateAdd ( qEntry . key , qEntry . value , qEntry . space ) ; qEntry = qEntry . previous ; } return newCache ; } protected abstract boolean close ( LRUCacheEntry entry ) ; public Enumeration elements ( ) { if ( this . entryQueue == null ) return new LRUCacheEnumerator ( null ) ; LRUCacheEnumerator . LRUEnumeratorElement head = new LRUCacheEnumerator . LRUEnumeratorElement ( this . entryQueue . value ) ; LRUCacheEntry currentEntry = this . entryQueue . next ; LRUCacheEnumerator . LRUEnumeratorElement currentElement = head ; while ( currentEntry != null ) { currentElement . next = new LRUCacheEnumerator . LRUEnumeratorElement ( currentEntry . value ) ; currentElement = currentElement . next ; currentEntry = currentEntry . next ; } return new LRUCacheEnumerator ( head ) ; } public double fillingRatio ( ) { return ( this . currentSpace + this . overflow ) * <NUM_LIT> / this . spaceLimit ; } public java . util . Hashtable getEntryTable ( ) { return this . entryTable ; } public double getLoadFactor ( ) { return this . loadFactor ; } public int getOverflow ( ) { return this . overflow ; } protected boolean makeSpace ( int space ) { int limit = this . spaceLimit ; if ( this . overflow == <NUM_LIT:0> && this . currentSpace + space <= limit ) { return true ; } int spaceNeeded = ( int ) ( ( <NUM_LIT:1> - this . loadFactor ) * limit ) ; spaceNeeded = ( spaceNeeded > space ) ? spaceNeeded : space ; LRUCacheEntry entry = this . entryQueueTail ; try { this . timestampsOn = false ; while ( this . currentSpace + spaceNeeded > limit && entry != null ) { this . privateRemoveEntry ( entry , false , false ) ; entry = entry . previous ; } } finally { this . timestampsOn = true ; } if ( this . currentSpace + space <= limit ) { this . overflow = <NUM_LIT:0> ; return true ; } this . overflow = this . currentSpace + space - limit ; return false ; } protected abstract LRUCache newInstance ( int size , int newOverflow ) ; public void printStats ( ) { int forwardListLength = <NUM_LIT:0> ; LRUCacheEntry entry = this . entryQueue ; while ( entry != null ) { forwardListLength ++ ; entry = entry . next ; } System . out . println ( "<STR_LIT>" + forwardListLength ) ; int backwardListLength = <NUM_LIT:0> ; entry = this . entryQueueTail ; while ( entry != null ) { backwardListLength ++ ; entry = entry . previous ; } System . out . println ( "<STR_LIT>" + backwardListLength ) ; Enumeration keys = this . entryTable . keys ( ) ; class Temp { public Class clazz ; public int count ; public Temp ( Class aClass ) { this . clazz = aClass ; this . count = <NUM_LIT:1> ; } public String toString ( ) { return "<STR_LIT>" + this . clazz + "<STR_LIT>" + this . count + "<STR_LIT>" ; } } java . util . HashMap h = new java . util . HashMap ( ) ; while ( keys . hasMoreElements ( ) ) { entry = ( LRUCacheEntry ) this . entryTable . get ( keys . nextElement ( ) ) ; Class key = entry . value . getClass ( ) ; Temp t = ( Temp ) h . get ( key ) ; if ( t == null ) { h . put ( key , new Temp ( key ) ) ; } else { t . count ++ ; } } for ( Iterator iter = h . values ( ) . iterator ( ) ; iter . hasNext ( ) ; ) { System . out . println ( iter . next ( ) ) ; } } protected void privateRemoveEntry ( LRUCacheEntry entry , boolean shuffle ) { privateRemoveEntry ( entry , shuffle , true ) ; } protected void privateRemoveEntry ( LRUCacheEntry entry , boolean shuffle , boolean external ) { if ( ! shuffle ) { if ( external ) { this . entryTable . remove ( entry . key ) ; this . currentSpace -= entry . space ; } else { if ( ! close ( entry ) ) return ; if ( this . entryTable . get ( entry . key ) == null ) { return ; } else { this . entryTable . remove ( entry . key ) ; this . currentSpace -= entry . space ; } } } LRUCacheEntry previous = entry . previous ; LRUCacheEntry next = entry . next ; if ( previous == null ) { this . entryQueue = next ; } else { previous . next = next ; } if ( next == null ) { this . entryQueueTail = previous ; } else { next . previous = previous ; } } public Object put ( Object key , Object value ) { if ( this . overflow > <NUM_LIT:0> ) shrink ( ) ; int newSpace = spaceFor ( value ) ; LRUCacheEntry entry = ( LRUCacheEntry ) this . entryTable . get ( key ) ; if ( entry != null ) { int oldSpace = entry . space ; int newTotal = this . currentSpace - oldSpace + newSpace ; if ( newTotal <= this . spaceLimit ) { updateTimestamp ( entry ) ; entry . value = value ; entry . space = newSpace ; this . currentSpace = newTotal ; this . overflow = <NUM_LIT:0> ; return value ; } else { privateRemoveEntry ( entry , false , false ) ; } } makeSpace ( newSpace ) ; privateAdd ( key , value , newSpace ) ; return value ; } public Object remove ( Object key ) { return removeKey ( key ) ; } public void setLoadFactor ( double newLoadFactor ) throws IllegalArgumentException { if ( newLoadFactor <= <NUM_LIT:1.0> && newLoadFactor > <NUM_LIT:0.0> ) this . loadFactor = newLoadFactor ; else throw new IllegalArgumentException ( Messages . cache_invalidLoadFactor ) ; } public void setSpaceLimit ( int limit ) { if ( limit < this . spaceLimit ) { makeSpace ( this . spaceLimit - limit ) ; } this . spaceLimit = limit ; } public boolean shrink ( ) { if ( this . overflow > <NUM_LIT:0> ) return makeSpace ( <NUM_LIT:0> ) ; return true ; } public String toString ( ) { return toStringFillingRation ( "<STR_LIT>" ) + toStringContents ( ) ; } protected void updateTimestamp ( LRUCacheEntry entry ) { if ( this . timestampsOn ) { entry . timestamp = this . timestampCounter ++ ; if ( this . entryQueue != entry ) { this . privateRemoveEntry ( entry , true ) ; privateAddEntry ( entry , true ) ; } } } } </s>
<s> package org . eclipse . jdt . internal . core ; import org . eclipse . core . resources . IResource ; import org . eclipse . core . runtime . IPath ; import org . eclipse . core . runtime . IProgressMonitor ; import org . eclipse . jdt . core . IBuffer ; import org . eclipse . jdt . core . IJavaElement ; import org . eclipse . jdt . core . IJavaModelStatusConstants ; import org . eclipse . jdt . core . JavaModelException ; import org . eclipse . jdt . core . ToolFactory ; import org . eclipse . jdt . core . WorkingCopyOwner ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . core . util . ClassFileBytesDisassembler ; import org . eclipse . jdt . core . util . IClassFileReader ; import org . eclipse . jdt . internal . core . util . Disassembler ; import org . eclipse . jdt . internal . core . util . Util ; public class ClassFileWorkingCopy extends CompilationUnit { public ClassFile classFile ; public ClassFileWorkingCopy ( ClassFile classFile , WorkingCopyOwner owner ) { super ( ( PackageFragment ) classFile . getParent ( ) , ( ( BinaryType ) classFile . getType ( ) ) . getSourceFileName ( null ) , owner ) ; this . classFile = classFile ; } public void commitWorkingCopy ( boolean force , IProgressMonitor monitor ) throws JavaModelException { throw new JavaModelException ( new JavaModelStatus ( IJavaModelStatusConstants . INVALID_ELEMENT_TYPES , this ) ) ; } public IBuffer getBuffer ( ) throws JavaModelException { if ( isWorkingCopy ( ) ) return super . getBuffer ( ) ; else return this . classFile . getBuffer ( ) ; } public char [ ] getContents ( ) { try { IBuffer buffer = getBuffer ( ) ; if ( buffer == null ) return CharOperation . NO_CHAR ; char [ ] characters = buffer . getCharacters ( ) ; if ( characters == null ) return CharOperation . NO_CHAR ; return characters ; } catch ( JavaModelException e ) { return CharOperation . NO_CHAR ; } } public IPath getPath ( ) { return this . classFile . getPath ( ) ; } public IJavaElement getPrimaryElement ( boolean checkOwner ) { if ( checkOwner && isPrimary ( ) ) return this ; return new ClassFileWorkingCopy ( this . classFile , DefaultWorkingCopyOwner . PRIMARY ) ; } public IResource resource ( PackageFragmentRoot root ) { if ( root . isArchive ( ) ) return root . resource ( root ) ; return this . classFile . resource ( root ) ; } protected IBuffer openBuffer ( IProgressMonitor pm , Object info ) throws JavaModelException { IBuffer buffer = this . owner . createBuffer ( this ) ; if ( buffer == null ) return null ; if ( buffer . getCharacters ( ) == null ) { IBuffer classFileBuffer = this . classFile . getBuffer ( ) ; if ( classFileBuffer != null ) { buffer . setContents ( classFileBuffer . getCharacters ( ) ) ; } else { IClassFileReader reader = ToolFactory . createDefaultClassFileReader ( this . classFile , IClassFileReader . ALL ) ; Disassembler disassembler = new Disassembler ( ) ; String contents = disassembler . disassemble ( reader , Util . getLineSeparator ( "<STR_LIT>" , getJavaProject ( ) ) , ClassFileBytesDisassembler . WORKING_COPY ) ; buffer . setContents ( contents ) ; } } BufferManager bufManager = getBufferManager ( ) ; bufManager . addBuffer ( buffer ) ; buffer . addBufferChangedListener ( this ) ; return buffer ; } protected void toStringName ( StringBuffer buffer ) { buffer . append ( this . classFile . getElementName ( ) ) ; } } </s>
<s> package org . eclipse . jdt . internal . core ; import java . util . * ; import org . eclipse . core . runtime . preferences . * ; import org . eclipse . jdt . core . JavaCore ; import org . eclipse . jdt . core . formatter . DefaultCodeFormatterConstants ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; public class JavaCorePreferenceInitializer extends AbstractPreferenceInitializer { public void initializeDefaultPreferences ( ) { HashSet optionNames = JavaModelManager . getJavaModelManager ( ) . optionNames ; Map defaultOptionsMap = new CompilerOptions ( ) . getMap ( ) ; defaultOptionsMap . put ( JavaCore . COMPILER_LOCAL_VARIABLE_ATTR , JavaCore . GENERATE ) ; defaultOptionsMap . put ( JavaCore . COMPILER_CODEGEN_UNUSED_LOCAL , JavaCore . PRESERVE ) ; defaultOptionsMap . put ( JavaCore . COMPILER_TASK_TAGS , JavaCore . DEFAULT_TASK_TAGS ) ; defaultOptionsMap . put ( JavaCore . COMPILER_TASK_PRIORITIES , JavaCore . DEFAULT_TASK_PRIORITIES ) ; defaultOptionsMap . put ( JavaCore . COMPILER_TASK_CASE_SENSITIVE , JavaCore . ENABLED ) ; defaultOptionsMap . put ( JavaCore . COMPILER_DOC_COMMENT_SUPPORT , JavaCore . ENABLED ) ; defaultOptionsMap . put ( JavaCore . COMPILER_PB_FORBIDDEN_REFERENCE , JavaCore . ERROR ) ; defaultOptionsMap . put ( JavaCore . CORE_JAVA_BUILD_RESOURCE_COPY_FILTER , "<STR_LIT>" ) ; defaultOptionsMap . put ( JavaCore . CORE_JAVA_BUILD_INVALID_CLASSPATH , JavaCore . ABORT ) ; defaultOptionsMap . put ( JavaCore . CORE_JAVA_BUILD_DUPLICATE_RESOURCE , JavaCore . WARNING ) ; defaultOptionsMap . put ( JavaCore . CORE_JAVA_BUILD_CLEAN_OUTPUT_FOLDER , JavaCore . CLEAN ) ; defaultOptionsMap . put ( JavaCore . CORE_JAVA_BUILD_RECREATE_MODIFIED_CLASS_FILES_IN_OUTPUT_FOLDER , JavaCore . IGNORE ) ; defaultOptionsMap . put ( JavaCore . CORE_JAVA_BUILD_ORDER , JavaCore . IGNORE ) ; defaultOptionsMap . put ( JavaCore . CORE_INCOMPLETE_CLASSPATH , JavaCore . ERROR ) ; defaultOptionsMap . put ( JavaCore . CORE_CIRCULAR_CLASSPATH , JavaCore . ERROR ) ; defaultOptionsMap . put ( JavaCore . CORE_INCOMPATIBLE_JDK_LEVEL , JavaCore . IGNORE ) ; defaultOptionsMap . put ( JavaCore . CORE_ENABLE_CLASSPATH_EXCLUSION_PATTERNS , JavaCore . ENABLED ) ; defaultOptionsMap . put ( JavaCore . CORE_ENABLE_CLASSPATH_MULTIPLE_OUTPUT_LOCATIONS , JavaCore . ENABLED ) ; optionNames . add ( JavaCore . CORE_ENCODING ) ; Map codeFormatterOptionsMap = DefaultCodeFormatterConstants . getEclipseDefaultSettings ( ) ; for ( Iterator iter = codeFormatterOptionsMap . entrySet ( ) . iterator ( ) ; iter . hasNext ( ) ; ) { Map . Entry entry = ( Map . Entry ) iter . next ( ) ; String optionName = ( String ) entry . getKey ( ) ; defaultOptionsMap . put ( optionName , entry . getValue ( ) ) ; optionNames . add ( optionName ) ; } defaultOptionsMap . put ( JavaCore . CODEASSIST_VISIBILITY_CHECK , JavaCore . DISABLED ) ; defaultOptionsMap . put ( JavaCore . CODEASSIST_DEPRECATION_CHECK , JavaCore . DISABLED ) ; defaultOptionsMap . put ( JavaCore . CODEASSIST_IMPLICIT_QUALIFICATION , JavaCore . DISABLED ) ; defaultOptionsMap . put ( JavaCore . CODEASSIST_FIELD_PREFIXES , "<STR_LIT>" ) ; defaultOptionsMap . put ( JavaCore . CODEASSIST_STATIC_FIELD_PREFIXES , "<STR_LIT>" ) ; defaultOptionsMap . put ( JavaCore . CODEASSIST_STATIC_FINAL_FIELD_PREFIXES , "<STR_LIT>" ) ; defaultOptionsMap . put ( JavaCore . CODEASSIST_LOCAL_PREFIXES , "<STR_LIT>" ) ; defaultOptionsMap . put ( JavaCore . CODEASSIST_ARGUMENT_PREFIXES , "<STR_LIT>" ) ; defaultOptionsMap . put ( JavaCore . CODEASSIST_FIELD_SUFFIXES , "<STR_LIT>" ) ; defaultOptionsMap . put ( JavaCore . CODEASSIST_STATIC_FIELD_SUFFIXES , "<STR_LIT>" ) ; defaultOptionsMap . put ( JavaCore . CODEASSIST_STATIC_FINAL_FIELD_SUFFIXES , "<STR_LIT>" ) ; defaultOptionsMap . put ( JavaCore . CODEASSIST_LOCAL_SUFFIXES , "<STR_LIT>" ) ; defaultOptionsMap . put ( JavaCore . CODEASSIST_ARGUMENT_SUFFIXES , "<STR_LIT>" ) ; defaultOptionsMap . put ( JavaCore . CODEASSIST_FORBIDDEN_REFERENCE_CHECK , JavaCore . ENABLED ) ; defaultOptionsMap . put ( JavaCore . CODEASSIST_DISCOURAGED_REFERENCE_CHECK , JavaCore . DISABLED ) ; defaultOptionsMap . put ( JavaCore . CODEASSIST_CAMEL_CASE_MATCH , JavaCore . ENABLED ) ; defaultOptionsMap . put ( JavaCore . CODEASSIST_SUGGEST_STATIC_IMPORTS , JavaCore . ENABLED ) ; defaultOptionsMap . put ( JavaCore . TIMEOUT_FOR_PARAMETER_NAME_FROM_ATTACHED_JAVADOC , "<STR_LIT>" ) ; IEclipsePreferences defaultPreferences = ( ( IScopeContext ) new DefaultScope ( ) ) . getNode ( JavaCore . PLUGIN_ID ) ; for ( Iterator iter = defaultOptionsMap . entrySet ( ) . iterator ( ) ; iter . hasNext ( ) ; ) { Map . Entry entry = ( Map . Entry ) iter . next ( ) ; String optionName = ( String ) entry . getKey ( ) ; defaultPreferences . put ( optionName , ( String ) entry . getValue ( ) ) ; optionNames . add ( optionName ) ; } } } </s>
<s> package org . eclipse . jdt . internal . core ; import org . eclipse . jdt . core . IJavaElement ; public class SourceFieldWithChildrenInfo extends SourceFieldElementInfo { protected IJavaElement [ ] children ; public SourceFieldWithChildrenInfo ( IJavaElement [ ] children ) { this . children = children ; } public IJavaElement [ ] getChildren ( ) { return this . children ; } } </s>
<s> package org . eclipse . jdt . internal . core ; import org . eclipse . core . runtime . IStatus ; import org . eclipse . jdt . core . ICompilationUnit ; import org . eclipse . jdt . core . IImportDeclaration ; import org . eclipse . jdt . core . IJavaElement ; import org . eclipse . jdt . core . IJavaModelStatus ; import org . eclipse . jdt . core . IJavaModelStatusConstants ; import org . eclipse . jdt . core . IJavaProject ; import org . eclipse . jdt . core . IType ; import org . eclipse . jdt . core . JavaConventions ; import org . eclipse . jdt . core . JavaCore ; import org . eclipse . jdt . core . JavaModelException ; import org . eclipse . jdt . core . dom . AST ; import org . eclipse . jdt . core . dom . ASTNode ; import org . eclipse . jdt . core . dom . CompilationUnit ; import org . eclipse . jdt . core . dom . Name ; import org . eclipse . jdt . core . dom . PackageDeclaration ; import org . eclipse . jdt . core . dom . StructuralPropertyDescriptor ; import org . eclipse . jdt . core . dom . rewrite . ASTRewrite ; import org . eclipse . jdt . internal . core . util . Messages ; public class CreatePackageDeclarationOperation extends CreateElementInCUOperation { protected String name = null ; public CreatePackageDeclarationOperation ( String name , ICompilationUnit parentElement ) { super ( parentElement ) ; this . name = name ; } protected StructuralPropertyDescriptor getChildPropertyDescriptor ( ASTNode parent ) { return CompilationUnit . PACKAGE_PROPERTY ; } protected ASTNode generateElementAST ( ASTRewrite rewriter , ICompilationUnit cu ) throws JavaModelException { IJavaElement [ ] children = getCompilationUnit ( ) . getChildren ( ) ; for ( int i = <NUM_LIT:0> ; i < children . length ; i ++ ) { if ( children [ i ] . getElementType ( ) == IJavaElement . PACKAGE_DECLARATION && this . name . equals ( children [ i ] . getElementName ( ) ) ) { this . creationOccurred = false ; return null ; } } AST ast = this . cuAST . getAST ( ) ; PackageDeclaration pkgDeclaration = ast . newPackageDeclaration ( ) ; Name astName = ast . newName ( this . name ) ; pkgDeclaration . setName ( astName ) ; return pkgDeclaration ; } protected IJavaElement generateResultHandle ( ) { return getCompilationUnit ( ) . getPackageDeclaration ( this . name ) ; } public String getMainTaskName ( ) { return Messages . operation_createPackageProgress ; } protected void initializeDefaultPosition ( ) { try { ICompilationUnit cu = getCompilationUnit ( ) ; IImportDeclaration [ ] imports = cu . getImports ( ) ; if ( imports . length > <NUM_LIT:0> ) { createBefore ( imports [ <NUM_LIT:0> ] ) ; return ; } IType [ ] types = cu . getTypes ( ) ; if ( types . length > <NUM_LIT:0> ) { createBefore ( types [ <NUM_LIT:0> ] ) ; return ; } } catch ( JavaModelException e ) { } } public IJavaModelStatus verify ( ) { IJavaModelStatus status = super . verify ( ) ; if ( ! status . isOK ( ) ) { return status ; } IJavaProject project = getParentElement ( ) . getJavaProject ( ) ; if ( JavaConventions . validatePackageName ( this . name , project . getOption ( JavaCore . COMPILER_SOURCE , true ) , project . getOption ( JavaCore . COMPILER_COMPLIANCE , true ) ) . getSeverity ( ) == IStatus . ERROR ) { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_NAME , this . name ) ; } return JavaModelStatus . VERIFIED_OK ; } } </s>
<s> package org . eclipse . jdt . internal . core ; import java . io . InputStream ; import java . util . ArrayList ; import java . util . HashMap ; import org . eclipse . core . runtime . Assert ; import org . eclipse . core . runtime . IProgressMonitor ; import org . eclipse . jdt . core . * ; import org . eclipse . jdt . core . compiler . * ; import org . eclipse . jdt . core . search . SearchEngine ; import org . eclipse . jdt . internal . codeassist . CompletionEngine ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; import org . eclipse . jdt . internal . compiler . lookup . Binding ; import org . eclipse . jdt . internal . core . hierarchy . TypeHierarchy ; import org . eclipse . jdt . internal . core . util . MementoTokenizer ; import org . eclipse . jdt . internal . core . util . Messages ; public class SourceType extends NamedMember implements IType { protected SourceType ( JavaElement parent , String name ) { super ( parent , name ) ; } protected void closing ( Object info ) throws JavaModelException { super . closing ( info ) ; SourceTypeElementInfo elementInfo = ( SourceTypeElementInfo ) info ; ITypeParameter [ ] typeParameters = elementInfo . typeParameters ; for ( int i = <NUM_LIT:0> , length = typeParameters . length ; i < length ; i ++ ) { ( ( TypeParameter ) typeParameters [ i ] ) . close ( ) ; } } public void codeComplete ( char [ ] snippet , int insertion , int position , char [ ] [ ] localVariableTypeNames , char [ ] [ ] localVariableNames , int [ ] localVariableModifiers , boolean isStatic , ICompletionRequestor requestor ) throws JavaModelException { codeComplete ( snippet , insertion , position , localVariableTypeNames , localVariableNames , localVariableModifiers , isStatic , requestor , DefaultWorkingCopyOwner . PRIMARY ) ; } public void codeComplete ( char [ ] snippet , int insertion , int position , char [ ] [ ] localVariableTypeNames , char [ ] [ ] localVariableNames , int [ ] localVariableModifiers , boolean isStatic , ICompletionRequestor requestor , WorkingCopyOwner owner ) throws JavaModelException { if ( requestor == null ) { throw new IllegalArgumentException ( "<STR_LIT>" ) ; } codeComplete ( snippet , insertion , position , localVariableTypeNames , localVariableNames , localVariableModifiers , isStatic , new org . eclipse . jdt . internal . codeassist . CompletionRequestorWrapper ( requestor ) , owner ) ; } public void codeComplete ( char [ ] snippet , int insertion , int position , char [ ] [ ] localVariableTypeNames , char [ ] [ ] localVariableNames , int [ ] localVariableModifiers , boolean isStatic , CompletionRequestor requestor ) throws JavaModelException { codeComplete ( snippet , insertion , position , localVariableTypeNames , localVariableNames , localVariableModifiers , isStatic , requestor , DefaultWorkingCopyOwner . PRIMARY ) ; } public void codeComplete ( char [ ] snippet , int insertion , int position , char [ ] [ ] localVariableTypeNames , char [ ] [ ] localVariableNames , int [ ] localVariableModifiers , boolean isStatic , CompletionRequestor requestor , IProgressMonitor monitor ) throws JavaModelException { codeComplete ( snippet , insertion , position , localVariableTypeNames , localVariableNames , localVariableModifiers , isStatic , requestor , DefaultWorkingCopyOwner . PRIMARY , monitor ) ; } public void codeComplete ( char [ ] snippet , int insertion , int position , char [ ] [ ] localVariableTypeNames , char [ ] [ ] localVariableNames , int [ ] localVariableModifiers , boolean isStatic , CompletionRequestor requestor , WorkingCopyOwner owner ) throws JavaModelException { codeComplete ( snippet , insertion , position , localVariableTypeNames , localVariableNames , localVariableModifiers , isStatic , requestor , owner , null ) ; } public void codeComplete ( char [ ] snippet , int insertion , int position , char [ ] [ ] localVariableTypeNames , char [ ] [ ] localVariableNames , int [ ] localVariableModifiers , boolean isStatic , CompletionRequestor requestor , WorkingCopyOwner owner , IProgressMonitor monitor ) throws JavaModelException { if ( requestor == null ) { throw new IllegalArgumentException ( "<STR_LIT>" ) ; } JavaProject project = ( JavaProject ) getJavaProject ( ) ; SearchableEnvironment environment = project . newSearchableNameEnvironment ( owner ) ; CompletionEngine engine = new CompletionEngine ( environment , requestor , project . getOptions ( true ) , project , owner , monitor ) ; String source = getCompilationUnit ( ) . getSource ( ) ; if ( source != null && insertion > - <NUM_LIT:1> && insertion < source . length ( ) ) { char [ ] prefix = CharOperation . concat ( source . substring ( <NUM_LIT:0> , insertion ) . toCharArray ( ) , new char [ ] { '<CHAR_LIT>' } ) ; char [ ] suffix = CharOperation . concat ( new char [ ] { '<CHAR_LIT:}>' } , source . substring ( insertion ) . toCharArray ( ) ) ; char [ ] fakeSource = CharOperation . concat ( prefix , snippet , suffix ) ; BasicCompilationUnit cu = new BasicCompilationUnit ( fakeSource , null , getElementName ( ) , getParent ( ) ) ; engine . complete ( cu , prefix . length + position , prefix . length , null ) ; } else { engine . complete ( this , snippet , position , localVariableTypeNames , localVariableNames , localVariableModifiers , isStatic ) ; } if ( NameLookup . VERBOSE ) { System . out . println ( Thread . currentThread ( ) + "<STR_LIT>" + environment . nameLookup . timeSpentInSeekTypesInSourcePackage + "<STR_LIT>" ) ; System . out . println ( Thread . currentThread ( ) + "<STR_LIT>" + environment . nameLookup . timeSpentInSeekTypesInBinaryPackage + "<STR_LIT>" ) ; } } public IField createField ( String contents , IJavaElement sibling , boolean force , IProgressMonitor monitor ) throws JavaModelException { CreateFieldOperation op = new CreateFieldOperation ( this , contents , force ) ; if ( sibling != null ) { op . createBefore ( sibling ) ; } op . runOperation ( monitor ) ; return ( IField ) op . getResultElements ( ) [ <NUM_LIT:0> ] ; } public IInitializer createInitializer ( String contents , IJavaElement sibling , IProgressMonitor monitor ) throws JavaModelException { CreateInitializerOperation op = new CreateInitializerOperation ( this , contents ) ; if ( sibling != null ) { op . createBefore ( sibling ) ; } op . runOperation ( monitor ) ; return ( IInitializer ) op . getResultElements ( ) [ <NUM_LIT:0> ] ; } public IMethod createMethod ( String contents , IJavaElement sibling , boolean force , IProgressMonitor monitor ) throws JavaModelException { CreateMethodOperation op = new CreateMethodOperation ( this , contents , force ) ; if ( sibling != null ) { op . createBefore ( sibling ) ; } op . runOperation ( monitor ) ; return ( IMethod ) op . getResultElements ( ) [ <NUM_LIT:0> ] ; } public IType createType ( String contents , IJavaElement sibling , boolean force , IProgressMonitor monitor ) throws JavaModelException { CreateTypeOperation op = new CreateTypeOperation ( this , contents , force ) ; if ( sibling != null ) { op . createBefore ( sibling ) ; } op . runOperation ( monitor ) ; return ( IType ) op . getResultElements ( ) [ <NUM_LIT:0> ] ; } public boolean equals ( Object o ) { if ( ! ( o instanceof SourceType ) ) return false ; return super . equals ( o ) ; } public IMethod [ ] findMethods ( IMethod method ) { try { return findMethods ( method , getMethods ( ) ) ; } catch ( JavaModelException e ) { return null ; } } public IAnnotation [ ] getAnnotations ( ) throws JavaModelException { AnnotatableInfo info = ( AnnotatableInfo ) getElementInfo ( ) ; return info . annotations ; } public IJavaElement [ ] getChildrenForCategory ( String category ) throws JavaModelException { IJavaElement [ ] children = getChildren ( ) ; int length = children . length ; if ( length == <NUM_LIT:0> ) return NO_ELEMENTS ; SourceTypeElementInfo info = ( SourceTypeElementInfo ) getElementInfo ( ) ; HashMap categories = info . getCategories ( ) ; if ( categories == null ) return NO_ELEMENTS ; IJavaElement [ ] result = new IJavaElement [ length ] ; int index = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { IJavaElement child = children [ i ] ; String [ ] elementCategories = ( String [ ] ) categories . get ( child ) ; if ( elementCategories != null ) for ( int j = <NUM_LIT:0> , length2 = elementCategories . length ; j < length2 ; j ++ ) { if ( elementCategories [ j ] . equals ( category ) ) result [ index ++ ] = child ; } } if ( index == <NUM_LIT:0> ) return NO_ELEMENTS ; if ( index < length ) System . arraycopy ( result , <NUM_LIT:0> , result = new IJavaElement [ index ] , <NUM_LIT:0> , index ) ; return result ; } public IType getDeclaringType ( ) { IJavaElement parentElement = getParent ( ) ; while ( parentElement != null ) { if ( parentElement . getElementType ( ) == IJavaElement . TYPE ) { return ( IType ) parentElement ; } else if ( parentElement instanceof IMember ) { parentElement = parentElement . getParent ( ) ; } else { return null ; } } return null ; } public int getElementType ( ) { return TYPE ; } public IField getField ( String fieldName ) { return new SourceField ( this , fieldName ) ; } public IField [ ] getFields ( ) throws JavaModelException { ArrayList list = getChildrenOfType ( FIELD ) ; IField [ ] array = new IField [ list . size ( ) ] ; list . toArray ( array ) ; return array ; } public String getFullyQualifiedName ( ) { return this . getFullyQualifiedName ( '<CHAR_LIT>' ) ; } public String getFullyQualifiedName ( char enclosingTypeSeparator ) { try { return getFullyQualifiedName ( enclosingTypeSeparator , false ) ; } catch ( JavaModelException e ) { return null ; } } public String getFullyQualifiedParameterizedName ( ) throws JavaModelException { return getFullyQualifiedName ( '<CHAR_LIT:.>' , true ) ; } public IJavaElement getHandleFromMemento ( String token , MementoTokenizer memento , WorkingCopyOwner workingCopyOwner ) { switch ( token . charAt ( <NUM_LIT:0> ) ) { case JEM_COUNT : return getHandleUpdatingCountFromMemento ( memento , workingCopyOwner ) ; case JEM_FIELD : if ( ! memento . hasMoreTokens ( ) ) return this ; String fieldName = memento . nextToken ( ) ; JavaElement field = ( JavaElement ) getField ( fieldName ) ; return field . getHandleFromMemento ( memento , workingCopyOwner ) ; case JEM_INITIALIZER : if ( ! memento . hasMoreTokens ( ) ) return this ; String count = memento . nextToken ( ) ; JavaElement initializer = ( JavaElement ) getInitializer ( Integer . parseInt ( count ) ) ; return initializer . getHandleFromMemento ( memento , workingCopyOwner ) ; case JEM_METHOD : if ( ! memento . hasMoreTokens ( ) ) return this ; String selector = memento . nextToken ( ) ; ArrayList params = new ArrayList ( ) ; nextParam : while ( memento . hasMoreTokens ( ) ) { token = memento . nextToken ( ) ; switch ( token . charAt ( <NUM_LIT:0> ) ) { case JEM_TYPE : case JEM_TYPE_PARAMETER : case JEM_ANNOTATION : break nextParam ; case JEM_METHOD : if ( ! memento . hasMoreTokens ( ) ) return this ; String param = memento . nextToken ( ) ; StringBuffer buffer = new StringBuffer ( ) ; while ( param . length ( ) == <NUM_LIT:1> && Signature . C_ARRAY == param . charAt ( <NUM_LIT:0> ) ) { buffer . append ( Signature . C_ARRAY ) ; if ( ! memento . hasMoreTokens ( ) ) return this ; param = memento . nextToken ( ) ; } params . add ( buffer . toString ( ) + param ) ; break ; default : break nextParam ; } } String [ ] parameters = new String [ params . size ( ) ] ; params . toArray ( parameters ) ; JavaElement method = ( JavaElement ) getMethod ( selector , parameters ) ; switch ( token . charAt ( <NUM_LIT:0> ) ) { case JEM_TYPE : case JEM_TYPE_PARAMETER : case JEM_LOCALVARIABLE : case JEM_ANNOTATION : return method . getHandleFromMemento ( token , memento , workingCopyOwner ) ; default : return method ; } case JEM_TYPE : String typeName ; if ( memento . hasMoreTokens ( ) ) { typeName = memento . nextToken ( ) ; char firstChar = typeName . charAt ( <NUM_LIT:0> ) ; if ( firstChar == JEM_FIELD || firstChar == JEM_INITIALIZER || firstChar == JEM_METHOD || firstChar == JEM_TYPE || firstChar == JEM_COUNT ) { token = typeName ; typeName = "<STR_LIT>" ; } else { token = null ; } } else { typeName = "<STR_LIT>" ; token = null ; } JavaElement type = ( JavaElement ) getType ( typeName ) ; if ( token == null ) { return type . getHandleFromMemento ( memento , workingCopyOwner ) ; } else { return type . getHandleFromMemento ( token , memento , workingCopyOwner ) ; } case JEM_TYPE_PARAMETER : if ( ! memento . hasMoreTokens ( ) ) return this ; String typeParameterName = memento . nextToken ( ) ; JavaElement typeParameter = new TypeParameter ( this , typeParameterName ) ; return typeParameter . getHandleFromMemento ( memento , workingCopyOwner ) ; case JEM_ANNOTATION : if ( ! memento . hasMoreTokens ( ) ) return this ; String annotationName = memento . nextToken ( ) ; JavaElement annotation = new Annotation ( this , annotationName ) ; return annotation . getHandleFromMemento ( memento , workingCopyOwner ) ; } return null ; } public IInitializer getInitializer ( int count ) { return new Initializer ( this , count ) ; } public IInitializer [ ] getInitializers ( ) throws JavaModelException { ArrayList list = getChildrenOfType ( INITIALIZER ) ; IInitializer [ ] array = new IInitializer [ list . size ( ) ] ; list . toArray ( array ) ; return array ; } public String getKey ( ) { try { return getKey ( this , false ) ; } catch ( JavaModelException e ) { return null ; } } public IMethod getMethod ( String selector , String [ ] parameterTypeSignatures ) { return new SourceMethod ( this , selector , parameterTypeSignatures ) ; } public IMethod [ ] getMethods ( ) throws JavaModelException { ArrayList list = getChildrenOfType ( METHOD ) ; IMethod [ ] array = new IMethod [ list . size ( ) ] ; list . toArray ( array ) ; return array ; } public IPackageFragment getPackageFragment ( ) { IJavaElement parentElement = this . parent ; while ( parentElement != null ) { if ( parentElement . getElementType ( ) == IJavaElement . PACKAGE_FRAGMENT ) { return ( IPackageFragment ) parentElement ; } else { parentElement = parentElement . getParent ( ) ; } } Assert . isTrue ( false ) ; return null ; } public IJavaElement getPrimaryElement ( boolean checkOwner ) { if ( checkOwner ) { CompilationUnit cu = ( CompilationUnit ) getAncestor ( COMPILATION_UNIT ) ; if ( cu . isPrimary ( ) ) return this ; } IJavaElement primaryParent = this . parent . getPrimaryElement ( false ) ; switch ( primaryParent . getElementType ( ) ) { case IJavaElement . COMPILATION_UNIT : return ( ( ICompilationUnit ) primaryParent ) . getType ( this . name ) ; case IJavaElement . TYPE : return ( ( IType ) primaryParent ) . getType ( this . name ) ; case IJavaElement . FIELD : case IJavaElement . INITIALIZER : case IJavaElement . METHOD : return ( ( IMember ) primaryParent ) . getType ( this . name , this . occurrenceCount ) ; } return this ; } public String getSuperclassName ( ) throws JavaModelException { SourceTypeElementInfo info = ( SourceTypeElementInfo ) getElementInfo ( ) ; char [ ] superclassName = info . getSuperclassName ( ) ; if ( superclassName == null ) { return null ; } return new String ( superclassName ) ; } public String getSuperclassTypeSignature ( ) throws JavaModelException { SourceTypeElementInfo info = ( SourceTypeElementInfo ) getElementInfo ( ) ; char [ ] superclassName = info . getSuperclassName ( ) ; if ( superclassName == null ) { return null ; } return new String ( Signature . createTypeSignature ( superclassName , false ) ) ; } public String [ ] getSuperInterfaceNames ( ) throws JavaModelException { SourceTypeElementInfo info = ( SourceTypeElementInfo ) getElementInfo ( ) ; char [ ] [ ] names = info . getInterfaceNames ( ) ; return CharOperation . toStrings ( names ) ; } public String [ ] getSuperInterfaceTypeSignatures ( ) throws JavaModelException { SourceTypeElementInfo info = ( SourceTypeElementInfo ) getElementInfo ( ) ; char [ ] [ ] names = info . getInterfaceNames ( ) ; if ( names == null ) { return CharOperation . NO_STRINGS ; } String [ ] strings = new String [ names . length ] ; for ( int i = <NUM_LIT:0> ; i < names . length ; i ++ ) { strings [ i ] = new String ( Signature . createTypeSignature ( names [ i ] , false ) ) ; } return strings ; } public ITypeParameter [ ] getTypeParameters ( ) throws JavaModelException { SourceTypeElementInfo info = ( SourceTypeElementInfo ) getElementInfo ( ) ; return info . typeParameters ; } public String [ ] getTypeParameterSignatures ( ) throws JavaModelException { ITypeParameter [ ] typeParameters = getTypeParameters ( ) ; int length = typeParameters . length ; String [ ] typeParameterSignatures = new String [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeParameter typeParameter = ( TypeParameter ) typeParameters [ i ] ; TypeParameterElementInfo info = ( TypeParameterElementInfo ) typeParameter . getElementInfo ( ) ; char [ ] [ ] bounds = info . bounds ; if ( bounds == null ) { typeParameterSignatures [ i ] = Signature . createTypeParameterSignature ( typeParameter . getElementName ( ) , CharOperation . NO_STRINGS ) ; } else { int boundsLength = bounds . length ; char [ ] [ ] boundSignatures = new char [ boundsLength ] [ ] ; for ( int j = <NUM_LIT:0> ; j < boundsLength ; j ++ ) { boundSignatures [ j ] = Signature . createCharArrayTypeSignature ( bounds [ j ] , false ) ; } typeParameterSignatures [ i ] = new String ( Signature . createTypeParameterSignature ( typeParameter . getElementName ( ) . toCharArray ( ) , boundSignatures ) ) ; } } return typeParameterSignatures ; } public IType getType ( String typeName ) { return new SourceType ( this , typeName ) ; } public ITypeParameter getTypeParameter ( String typeParameterName ) { return new TypeParameter ( this , typeParameterName ) ; } public String getTypeQualifiedName ( ) { return this . getTypeQualifiedName ( '<CHAR_LIT>' ) ; } public String getTypeQualifiedName ( char enclosingTypeSeparator ) { try { return getTypeQualifiedName ( enclosingTypeSeparator , false ) ; } catch ( JavaModelException e ) { return null ; } } public IType [ ] getTypes ( ) throws JavaModelException { ArrayList list = getChildrenOfType ( TYPE ) ; IType [ ] array = new IType [ list . size ( ) ] ; list . toArray ( array ) ; return array ; } public boolean isAnonymous ( ) { return this . name . length ( ) == <NUM_LIT:0> ; } public boolean isClass ( ) throws JavaModelException { SourceTypeElementInfo info = ( SourceTypeElementInfo ) getElementInfo ( ) ; return TypeDeclaration . kind ( info . getModifiers ( ) ) == TypeDeclaration . CLASS_DECL ; } public boolean isEnum ( ) throws JavaModelException { SourceTypeElementInfo info = ( SourceTypeElementInfo ) getElementInfo ( ) ; return TypeDeclaration . kind ( info . getModifiers ( ) ) == TypeDeclaration . ENUM_DECL ; } public boolean isInterface ( ) throws JavaModelException { SourceTypeElementInfo info = ( SourceTypeElementInfo ) getElementInfo ( ) ; switch ( TypeDeclaration . kind ( info . getModifiers ( ) ) ) { case TypeDeclaration . INTERFACE_DECL : case TypeDeclaration . ANNOTATION_TYPE_DECL : return true ; } return false ; } public boolean isAnnotation ( ) throws JavaModelException { SourceTypeElementInfo info = ( SourceTypeElementInfo ) getElementInfo ( ) ; return TypeDeclaration . kind ( info . getModifiers ( ) ) == TypeDeclaration . ANNOTATION_TYPE_DECL ; } public boolean isLocal ( ) { switch ( this . parent . getElementType ( ) ) { case IJavaElement . METHOD : case IJavaElement . INITIALIZER : case IJavaElement . FIELD : return true ; default : return false ; } } public boolean isMember ( ) { return getDeclaringType ( ) != null ; } public boolean isResolved ( ) { return false ; } public ITypeHierarchy loadTypeHierachy ( InputStream input , IProgressMonitor monitor ) throws JavaModelException { return loadTypeHierachy ( input , DefaultWorkingCopyOwner . PRIMARY , monitor ) ; } public ITypeHierarchy loadTypeHierachy ( InputStream input , WorkingCopyOwner owner , IProgressMonitor monitor ) throws JavaModelException { return TypeHierarchy . load ( this , input , owner ) ; } public ITypeHierarchy newSupertypeHierarchy ( IProgressMonitor monitor ) throws JavaModelException { return this . newSupertypeHierarchy ( DefaultWorkingCopyOwner . PRIMARY , monitor ) ; } public ITypeHierarchy newSupertypeHierarchy ( ICompilationUnit [ ] workingCopies , IProgressMonitor monitor ) throws JavaModelException { CreateTypeHierarchyOperation op = new CreateTypeHierarchyOperation ( this , workingCopies , SearchEngine . createWorkspaceScope ( ) , false ) ; op . runOperation ( monitor ) ; return op . getResult ( ) ; } public ITypeHierarchy newSupertypeHierarchy ( IWorkingCopy [ ] workingCopies , IProgressMonitor monitor ) throws JavaModelException { ICompilationUnit [ ] copies ; if ( workingCopies == null ) { copies = null ; } else { int length = workingCopies . length ; System . arraycopy ( workingCopies , <NUM_LIT:0> , copies = new ICompilationUnit [ length ] , <NUM_LIT:0> , length ) ; } return newSupertypeHierarchy ( copies , monitor ) ; } public ITypeHierarchy newSupertypeHierarchy ( WorkingCopyOwner owner , IProgressMonitor monitor ) throws JavaModelException { ICompilationUnit [ ] workingCopies = JavaModelManager . getJavaModelManager ( ) . getWorkingCopies ( owner , true ) ; CreateTypeHierarchyOperation op = new CreateTypeHierarchyOperation ( this , workingCopies , SearchEngine . createWorkspaceScope ( ) , false ) ; op . runOperation ( monitor ) ; return op . getResult ( ) ; } public ITypeHierarchy newTypeHierarchy ( IJavaProject project , IProgressMonitor monitor ) throws JavaModelException { return newTypeHierarchy ( project , DefaultWorkingCopyOwner . PRIMARY , monitor ) ; } public ITypeHierarchy newTypeHierarchy ( IJavaProject project , WorkingCopyOwner owner , IProgressMonitor monitor ) throws JavaModelException { if ( project == null ) { throw new IllegalArgumentException ( Messages . hierarchy_nullProject ) ; } ICompilationUnit [ ] workingCopies = JavaModelManager . getJavaModelManager ( ) . getWorkingCopies ( owner , true ) ; ICompilationUnit [ ] projectWCs = null ; if ( workingCopies != null ) { int length = workingCopies . length ; projectWCs = new ICompilationUnit [ length ] ; int index = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { ICompilationUnit wc = workingCopies [ i ] ; if ( project . equals ( wc . getJavaProject ( ) ) ) { projectWCs [ index ++ ] = wc ; } } if ( index != length ) { System . arraycopy ( projectWCs , <NUM_LIT:0> , projectWCs = new ICompilationUnit [ index ] , <NUM_LIT:0> , index ) ; } } CreateTypeHierarchyOperation op = new CreateTypeHierarchyOperation ( this , projectWCs , project , true ) ; op . runOperation ( monitor ) ; return op . getResult ( ) ; } public ITypeHierarchy newTypeHierarchy ( IProgressMonitor monitor ) throws JavaModelException { return newTypeHierarchy ( DefaultWorkingCopyOwner . PRIMARY , monitor ) ; } public ITypeHierarchy newTypeHierarchy ( ICompilationUnit [ ] workingCopies , IProgressMonitor monitor ) throws JavaModelException { CreateTypeHierarchyOperation op = new CreateTypeHierarchyOperation ( this , workingCopies , SearchEngine . createWorkspaceScope ( ) , true ) ; op . runOperation ( monitor ) ; return op . getResult ( ) ; } public ITypeHierarchy newTypeHierarchy ( IWorkingCopy [ ] workingCopies , IProgressMonitor monitor ) throws JavaModelException { ICompilationUnit [ ] copies ; if ( workingCopies == null ) { copies = null ; } else { int length = workingCopies . length ; System . arraycopy ( workingCopies , <NUM_LIT:0> , copies = new ICompilationUnit [ length ] , <NUM_LIT:0> , length ) ; } return newTypeHierarchy ( copies , monitor ) ; } public ITypeHierarchy newTypeHierarchy ( WorkingCopyOwner owner , IProgressMonitor monitor ) throws JavaModelException { ICompilationUnit [ ] workingCopies = JavaModelManager . getJavaModelManager ( ) . getWorkingCopies ( owner , true ) ; CreateTypeHierarchyOperation op = new CreateTypeHierarchyOperation ( this , workingCopies , SearchEngine . createWorkspaceScope ( ) , true ) ; op . runOperation ( monitor ) ; return op . getResult ( ) ; } public JavaElement resolved ( Binding binding ) { SourceRefElement resolvedHandle = new ResolvedSourceType ( this . parent , this . name , new String ( binding . computeUniqueKey ( ) ) ) ; resolvedHandle . occurrenceCount = this . occurrenceCount ; return resolvedHandle ; } protected void toStringInfo ( int tab , StringBuffer buffer , Object info , boolean showResolvedInfo ) { buffer . append ( tabString ( tab ) ) ; if ( info == null ) { String elementName = getElementName ( ) ; if ( elementName . length ( ) == <NUM_LIT:0> ) { buffer . append ( "<STR_LIT>" ) ; buffer . append ( this . occurrenceCount ) ; buffer . append ( "<STR_LIT:>>" ) ; } else { toStringName ( buffer ) ; } buffer . append ( "<STR_LIT>" ) ; } else if ( info == NO_INFO ) { String elementName = getElementName ( ) ; if ( elementName . length ( ) == <NUM_LIT:0> ) { buffer . append ( "<STR_LIT>" ) ; buffer . append ( this . occurrenceCount ) ; buffer . append ( "<STR_LIT:>>" ) ; } else { toStringName ( buffer ) ; } } else { try { if ( isEnum ( ) ) { buffer . append ( "<STR_LIT>" ) ; } else if ( isAnnotation ( ) ) { buffer . append ( "<STR_LIT>" ) ; } else if ( isInterface ( ) ) { buffer . append ( "<STR_LIT>" ) ; } else { buffer . append ( "<STR_LIT>" ) ; } String elementName = getElementName ( ) ; if ( elementName . length ( ) == <NUM_LIT:0> ) { buffer . append ( "<STR_LIT>" ) ; buffer . append ( this . occurrenceCount ) ; buffer . append ( "<STR_LIT:>>" ) ; } else { toStringName ( buffer ) ; } } catch ( JavaModelException e ) { buffer . append ( "<STR_LIT>" + getElementName ( ) ) ; } } } } </s>
<s> package org . eclipse . jdt . internal . core ; import java . util . HashSet ; import java . util . Iterator ; import org . eclipse . core . resources . IProject ; import org . eclipse . core . resources . IProjectDescription ; import org . eclipse . core . resources . IResource ; import org . eclipse . core . resources . IWorkspace ; import org . eclipse . core . resources . IWorkspaceRoot ; import org . eclipse . core . resources . IWorkspaceRunnable ; import org . eclipse . core . runtime . CoreException ; import org . eclipse . core . runtime . IProgressMonitor ; import org . eclipse . core . runtime . jobs . ISchedulingRule ; import org . eclipse . jdt . core . IClasspathEntry ; import org . eclipse . jdt . core . JavaModelException ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . core . util . Util ; public class ProjectReferenceChange { private JavaProject project ; private IClasspathEntry [ ] oldResolvedClasspath ; public ProjectReferenceChange ( JavaProject project , IClasspathEntry [ ] oldResolvedClasspath ) { this . project = project ; this . oldResolvedClasspath = oldResolvedClasspath ; } public void updateProjectReferencesIfNecessary ( ) throws JavaModelException { String [ ] oldRequired = this . oldResolvedClasspath == null ? CharOperation . NO_STRINGS : this . project . projectPrerequisites ( this . oldResolvedClasspath ) ; IClasspathEntry [ ] newResolvedClasspath = this . project . getResolvedClasspath ( ) ; String [ ] newRequired = this . project . projectPrerequisites ( newResolvedClasspath ) ; final IProject projectResource = this . project . getProject ( ) ; try { IProject [ ] projectReferences = projectResource . getDescription ( ) . getDynamicReferences ( ) ; HashSet oldReferences = new HashSet ( projectReferences . length ) ; for ( int i = <NUM_LIT:0> ; i < projectReferences . length ; i ++ ) { String projectName = projectReferences [ i ] . getName ( ) ; oldReferences . add ( projectName ) ; } HashSet newReferences = ( HashSet ) oldReferences . clone ( ) ; for ( int i = <NUM_LIT:0> ; i < oldRequired . length ; i ++ ) { String projectName = oldRequired [ i ] ; newReferences . remove ( projectName ) ; } for ( int i = <NUM_LIT:0> ; i < newRequired . length ; i ++ ) { String projectName = newRequired [ i ] ; newReferences . add ( projectName ) ; } Iterator iter ; int newSize = newReferences . size ( ) ; checkIdentity : { if ( oldReferences . size ( ) == newSize ) { iter = newReferences . iterator ( ) ; while ( iter . hasNext ( ) ) { if ( ! oldReferences . contains ( iter . next ( ) ) ) { break checkIdentity ; } } return ; } } String [ ] requiredProjectNames = new String [ newSize ] ; int index = <NUM_LIT:0> ; iter = newReferences . iterator ( ) ; while ( iter . hasNext ( ) ) { requiredProjectNames [ index ++ ] = ( String ) iter . next ( ) ; } Util . sort ( requiredProjectNames ) ; final IProject [ ] requiredProjectArray = new IProject [ newSize ] ; IWorkspaceRoot wksRoot = projectResource . getWorkspace ( ) . getRoot ( ) ; for ( int i = <NUM_LIT:0> ; i < newSize ; i ++ ) { requiredProjectArray [ i ] = wksRoot . getProject ( requiredProjectNames [ i ] ) ; } IWorkspace workspace = projectResource . getWorkspace ( ) ; ISchedulingRule rule = workspace . getRuleFactory ( ) . modifyRule ( projectResource ) ; IWorkspaceRunnable runnable = new IWorkspaceRunnable ( ) { public void run ( IProgressMonitor monitor ) throws CoreException { IProjectDescription description = projectResource . getDescription ( ) ; description . setDynamicReferences ( requiredProjectArray ) ; projectResource . setDescription ( description , IResource . AVOID_NATURE_CONFIG , null ) ; } } ; workspace . run ( runnable , rule , IWorkspace . AVOID_UPDATE , null ) ; } catch ( CoreException e ) { if ( ! ExternalJavaProject . EXTERNAL_PROJECT_NAME . equals ( this . project . getElementName ( ) ) ) throw new JavaModelException ( e ) ; } } public String toString ( ) { return "<STR_LIT>" + this . project . getElementName ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . core ; import java . util . ArrayList ; import java . util . HashMap ; import java . util . Iterator ; import java . util . Map ; import org . codehaus . jdt . groovy . integration . LanguageSupportFactory ; import org . eclipse . core . resources . IResource ; import org . eclipse . core . runtime . IPath ; import org . eclipse . core . runtime . IProgressMonitor ; import org . eclipse . core . runtime . Path ; import org . eclipse . jdt . core . IClassFile ; import org . eclipse . jdt . core . ICompilationUnit ; import org . eclipse . jdt . core . IJarEntryResource ; import org . eclipse . jdt . core . IJavaElement ; import org . eclipse . jdt . core . IJavaModelStatusConstants ; import org . eclipse . jdt . core . JavaModelException ; import org . eclipse . jdt . internal . core . util . Util ; class JarPackageFragment extends PackageFragment { protected JarPackageFragment ( PackageFragmentRoot root , String [ ] names ) { super ( root , names ) ; } protected boolean buildStructure ( OpenableElementInfo info , IProgressMonitor pm , Map newElements , IResource underlyingResource ) throws JavaModelException { JarPackageFragmentRoot root = ( JarPackageFragmentRoot ) getParent ( ) ; JarPackageFragmentRootInfo parentInfo = ( JarPackageFragmentRootInfo ) root . getElementInfo ( ) ; ArrayList [ ] entries = ( ArrayList [ ] ) parentInfo . rawPackageInfo . get ( this . names ) ; if ( entries == null ) throw newNotPresentException ( ) ; JarPackageFragmentInfo fragInfo = ( JarPackageFragmentInfo ) info ; fragInfo . setChildren ( computeChildren ( entries [ <NUM_LIT:0> ] ) ) ; fragInfo . setNonJavaResources ( computeNonJavaResources ( entries [ <NUM_LIT:1> ] ) ) ; newElements . put ( this , fragInfo ) ; return true ; } private IJavaElement [ ] computeChildren ( ArrayList namesWithoutExtension ) { int size = namesWithoutExtension . size ( ) ; if ( size == <NUM_LIT:0> ) return NO_ELEMENTS ; IJavaElement [ ] children = new IJavaElement [ size ] ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) { String nameWithoutExtension = ( String ) namesWithoutExtension . get ( i ) ; children [ i ] = new ClassFile ( this , nameWithoutExtension ) ; } return children ; } private Object [ ] computeNonJavaResources ( ArrayList entryNames ) { int length = entryNames . size ( ) ; if ( length == <NUM_LIT:0> ) return JavaElementInfo . NO_NON_JAVA_RESOURCES ; HashMap jarEntries = new HashMap ( ) ; HashMap childrenMap = new HashMap ( ) ; boolean isInteresting = LanguageSupportFactory . isInterestingProject ( this . getJavaProject ( ) . getProject ( ) ) ; ArrayList topJarEntries = new ArrayList ( ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { String resName = ( String ) entryNames . get ( i ) ; if ( ( ! Util . isJavaLikeFileName ( resName ) || ( isInteresting && LanguageSupportFactory . isInterestingSourceFile ( resName ) ) ) ) { IPath filePath = new Path ( resName ) ; IPath childPath = filePath . removeFirstSegments ( this . names . length ) ; if ( jarEntries . containsKey ( childPath ) ) { continue ; } JarEntryFile file = new JarEntryFile ( filePath . lastSegment ( ) ) ; jarEntries . put ( childPath , file ) ; if ( childPath . segmentCount ( ) == <NUM_LIT:1> ) { file . setParent ( this ) ; topJarEntries . add ( file ) ; } else { IPath parentPath = childPath . removeLastSegments ( <NUM_LIT:1> ) ; while ( parentPath . segmentCount ( ) > <NUM_LIT:0> ) { ArrayList parentChildren = ( ArrayList ) childrenMap . get ( parentPath ) ; if ( parentChildren == null ) { Object dir = new JarEntryDirectory ( parentPath . lastSegment ( ) ) ; jarEntries . put ( parentPath , dir ) ; childrenMap . put ( parentPath , parentChildren = new ArrayList ( ) ) ; parentChildren . add ( childPath ) ; if ( parentPath . segmentCount ( ) == <NUM_LIT:1> ) { topJarEntries . add ( dir ) ; break ; } childPath = parentPath ; parentPath = childPath . removeLastSegments ( <NUM_LIT:1> ) ; } else { parentChildren . add ( childPath ) ; break ; } } } } } Iterator entries = childrenMap . entrySet ( ) . iterator ( ) ; while ( entries . hasNext ( ) ) { Map . Entry entry = ( Map . Entry ) entries . next ( ) ; IPath entryPath = ( IPath ) entry . getKey ( ) ; ArrayList entryValue = ( ArrayList ) entry . getValue ( ) ; JarEntryDirectory jarEntryDirectory = ( JarEntryDirectory ) jarEntries . get ( entryPath ) ; int size = entryValue . size ( ) ; IJarEntryResource [ ] children = new IJarEntryResource [ size ] ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) { JarEntryResource child = ( JarEntryResource ) jarEntries . get ( entryValue . get ( i ) ) ; child . setParent ( jarEntryDirectory ) ; children [ i ] = child ; } jarEntryDirectory . setChildren ( children ) ; if ( entryPath . segmentCount ( ) == <NUM_LIT:1> ) { jarEntryDirectory . setParent ( this ) ; } } return topJarEntries . toArray ( new Object [ topJarEntries . size ( ) ] ) ; } public boolean containsJavaResources ( ) throws JavaModelException { return ( ( JarPackageFragmentInfo ) getElementInfo ( ) ) . containsJavaResources ( ) ; } public ICompilationUnit createCompilationUnit ( String cuName , String contents , boolean force , IProgressMonitor monitor ) throws JavaModelException { throw new JavaModelException ( new JavaModelStatus ( IJavaModelStatusConstants . READ_ONLY , this ) ) ; } protected Object createElementInfo ( ) { return new JarPackageFragmentInfo ( ) ; } public IClassFile [ ] getClassFiles ( ) throws JavaModelException { ArrayList list = getChildrenOfType ( CLASS_FILE ) ; IClassFile [ ] array = new IClassFile [ list . size ( ) ] ; list . toArray ( array ) ; return array ; } public ICompilationUnit [ ] getCompilationUnits ( ) { return NO_COMPILATION_UNITS ; } public IResource getCorrespondingResource ( ) { return null ; } public Object [ ] getNonJavaResources ( ) throws JavaModelException { if ( isDefaultPackage ( ) ) { return JavaElementInfo . NO_NON_JAVA_RESOURCES ; } else { return storedNonJavaResources ( ) ; } } public boolean isReadOnly ( ) { return true ; } protected Object [ ] storedNonJavaResources ( ) throws JavaModelException { return ( ( JarPackageFragmentInfo ) getElementInfo ( ) ) . getNonJavaResources ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . core ; import java . io . ByteArrayInputStream ; import java . io . IOException ; import java . util . ArrayList ; import org . eclipse . core . resources . IFile ; import org . eclipse . core . resources . IResource ; import org . eclipse . core . resources . IResourceStatus ; import org . eclipse . core . runtime . CoreException ; import org . eclipse . core . runtime . IProgressMonitor ; import org . eclipse . core . runtime . ISafeRunnable ; import org . eclipse . core . runtime . SafeRunner ; import org . eclipse . core . runtime . content . IContentDescription ; import org . eclipse . jdt . core . * ; import org . eclipse . jdt . internal . core . util . Util ; public class Buffer implements IBuffer { protected IFile file ; protected int flags ; protected char [ ] contents ; protected ArrayList changeListeners ; protected IOpenable owner ; protected int gapStart = - <NUM_LIT:1> ; protected int gapEnd = - <NUM_LIT:1> ; protected Object lock = new Object ( ) ; protected static final int F_HAS_UNSAVED_CHANGES = <NUM_LIT:1> ; protected static final int F_IS_READ_ONLY = <NUM_LIT:2> ; protected static final int F_IS_CLOSED = <NUM_LIT:4> ; protected Buffer ( IFile file , IOpenable owner , boolean readOnly ) { this . file = file ; this . owner = owner ; if ( file == null ) { setReadOnly ( readOnly ) ; } } public synchronized void addBufferChangedListener ( IBufferChangedListener listener ) { if ( this . changeListeners == null ) { this . changeListeners = new ArrayList ( <NUM_LIT:5> ) ; } if ( ! this . changeListeners . contains ( listener ) ) { this . changeListeners . add ( listener ) ; } } public void append ( char [ ] text ) { if ( ! isReadOnly ( ) ) { if ( text == null || text . length == <NUM_LIT:0> ) { return ; } int length = getLength ( ) ; synchronized ( this . lock ) { if ( this . contents == null ) return ; moveAndResizeGap ( length , text . length ) ; System . arraycopy ( text , <NUM_LIT:0> , this . contents , length , text . length ) ; this . gapStart += text . length ; this . flags |= F_HAS_UNSAVED_CHANGES ; } notifyChanged ( new BufferChangedEvent ( this , length , <NUM_LIT:0> , new String ( text ) ) ) ; } } public void append ( String text ) { if ( text == null ) { return ; } this . append ( text . toCharArray ( ) ) ; } public void close ( ) { BufferChangedEvent event = null ; synchronized ( this . lock ) { if ( isClosed ( ) ) return ; event = new BufferChangedEvent ( this , <NUM_LIT:0> , <NUM_LIT:0> , null ) ; this . contents = null ; this . flags |= F_IS_CLOSED ; } notifyChanged ( event ) ; synchronized ( this ) { this . changeListeners = null ; } } public char getChar ( int position ) { synchronized ( this . lock ) { if ( this . contents == null ) return Character . MIN_VALUE ; if ( position < this . gapStart ) { return this . contents [ position ] ; } int gapLength = this . gapEnd - this . gapStart ; return this . contents [ position + gapLength ] ; } } public char [ ] getCharacters ( ) { synchronized ( this . lock ) { if ( this . contents == null ) return null ; if ( this . gapStart < <NUM_LIT:0> ) { return this . contents ; } int length = this . contents . length ; char [ ] newContents = new char [ length - this . gapEnd + this . gapStart ] ; System . arraycopy ( this . contents , <NUM_LIT:0> , newContents , <NUM_LIT:0> , this . gapStart ) ; System . arraycopy ( this . contents , this . gapEnd , newContents , this . gapStart , length - this . gapEnd ) ; return newContents ; } } public String getContents ( ) { char [ ] chars = getCharacters ( ) ; if ( chars == null ) return null ; return new String ( chars ) ; } public int getLength ( ) { synchronized ( this . lock ) { if ( this . contents == null ) return - <NUM_LIT:1> ; int length = this . gapEnd - this . gapStart ; return ( this . contents . length - length ) ; } } public IOpenable getOwner ( ) { return this . owner ; } public String getText ( int offset , int length ) { synchronized ( this . lock ) { if ( this . contents == null ) return "<STR_LIT>" ; if ( offset + length < this . gapStart ) return new String ( this . contents , offset , length ) ; if ( this . gapStart < offset ) { int gapLength = this . gapEnd - this . gapStart ; return new String ( this . contents , offset + gapLength , length ) ; } StringBuffer buf = new StringBuffer ( ) ; buf . append ( this . contents , offset , this . gapStart - offset ) ; buf . append ( this . contents , this . gapEnd , offset + length - this . gapStart ) ; return buf . toString ( ) ; } } public IResource getUnderlyingResource ( ) { return this . file ; } public boolean hasUnsavedChanges ( ) { return ( this . flags & F_HAS_UNSAVED_CHANGES ) != <NUM_LIT:0> ; } public boolean isClosed ( ) { return ( this . flags & F_IS_CLOSED ) != <NUM_LIT:0> ; } public boolean isReadOnly ( ) { return ( this . flags & F_IS_READ_ONLY ) != <NUM_LIT:0> ; } protected void moveAndResizeGap ( int position , int size ) { char [ ] content = null ; int oldSize = this . gapEnd - this . gapStart ; if ( size < <NUM_LIT:0> ) { if ( oldSize > <NUM_LIT:0> ) { content = new char [ this . contents . length - oldSize ] ; System . arraycopy ( this . contents , <NUM_LIT:0> , content , <NUM_LIT:0> , this . gapStart ) ; System . arraycopy ( this . contents , this . gapEnd , content , this . gapStart , content . length - this . gapStart ) ; this . contents = content ; } this . gapStart = this . gapEnd = position ; return ; } content = new char [ this . contents . length + ( size - oldSize ) ] ; int newGapStart = position ; int newGapEnd = newGapStart + size ; if ( oldSize == <NUM_LIT:0> ) { System . arraycopy ( this . contents , <NUM_LIT:0> , content , <NUM_LIT:0> , newGapStart ) ; System . arraycopy ( this . contents , newGapStart , content , newGapEnd , content . length - newGapEnd ) ; } else if ( newGapStart < this . gapStart ) { int delta = this . gapStart - newGapStart ; System . arraycopy ( this . contents , <NUM_LIT:0> , content , <NUM_LIT:0> , newGapStart ) ; System . arraycopy ( this . contents , newGapStart , content , newGapEnd , delta ) ; System . arraycopy ( this . contents , this . gapEnd , content , newGapEnd + delta , this . contents . length - this . gapEnd ) ; } else { int delta = newGapStart - this . gapStart ; System . arraycopy ( this . contents , <NUM_LIT:0> , content , <NUM_LIT:0> , this . gapStart ) ; System . arraycopy ( this . contents , this . gapEnd , content , this . gapStart , delta ) ; System . arraycopy ( this . contents , this . gapEnd + delta , content , newGapEnd , content . length - newGapEnd ) ; } this . contents = content ; this . gapStart = newGapStart ; this . gapEnd = newGapEnd ; } protected void notifyChanged ( final BufferChangedEvent event ) { ArrayList listeners = this . changeListeners ; if ( listeners != null ) { for ( int i = <NUM_LIT:0> , size = listeners . size ( ) ; i < size ; ++ i ) { final IBufferChangedListener listener = ( IBufferChangedListener ) listeners . get ( i ) ; SafeRunner . run ( new ISafeRunnable ( ) { public void handleException ( Throwable exception ) { Util . log ( exception , "<STR_LIT>" ) ; } public void run ( ) throws Exception { listener . bufferChanged ( event ) ; } } ) ; } } } public synchronized void removeBufferChangedListener ( IBufferChangedListener listener ) { if ( this . changeListeners != null ) { this . changeListeners . remove ( listener ) ; if ( this . changeListeners . size ( ) == <NUM_LIT:0> ) { this . changeListeners = null ; } } } public void replace ( int position , int length , char [ ] text ) { if ( ! isReadOnly ( ) ) { int textLength = text == null ? <NUM_LIT:0> : text . length ; synchronized ( this . lock ) { if ( this . contents == null ) return ; moveAndResizeGap ( position + length , textLength - length ) ; int min = Math . min ( textLength , length ) ; if ( min > <NUM_LIT:0> ) { System . arraycopy ( text , <NUM_LIT:0> , this . contents , position , min ) ; } if ( length > textLength ) { this . gapStart -= length - textLength ; } else if ( textLength > length ) { this . gapStart += textLength - length ; System . arraycopy ( text , <NUM_LIT:0> , this . contents , position , textLength ) ; } this . flags |= F_HAS_UNSAVED_CHANGES ; } String string = null ; if ( textLength > <NUM_LIT:0> ) { string = new String ( text ) ; } notifyChanged ( new BufferChangedEvent ( this , position , length , string ) ) ; } } public void replace ( int position , int length , String text ) { this . replace ( position , length , text == null ? null : text . toCharArray ( ) ) ; } public void save ( IProgressMonitor progress , boolean force ) throws JavaModelException { if ( isReadOnly ( ) || this . file == null ) { return ; } if ( ! hasUnsavedChanges ( ) ) return ; try { String stringContents = getContents ( ) ; if ( stringContents == null ) return ; String encoding = null ; try { encoding = this . file . getCharset ( ) ; } catch ( CoreException ce ) { } byte [ ] bytes = encoding == null ? stringContents . getBytes ( ) : stringContents . getBytes ( encoding ) ; if ( encoding != null && encoding . equals ( org . eclipse . jdt . internal . compiler . util . Util . UTF_8 ) ) { IContentDescription description ; try { description = this . file . getContentDescription ( ) ; } catch ( CoreException e ) { if ( e . getStatus ( ) . getCode ( ) != IResourceStatus . RESOURCE_NOT_FOUND ) throw e ; description = null ; } if ( description != null && description . getProperty ( IContentDescription . BYTE_ORDER_MARK ) != null ) { int bomLength = IContentDescription . BOM_UTF_8 . length ; byte [ ] bytesWithBOM = new byte [ bytes . length + bomLength ] ; System . arraycopy ( IContentDescription . BOM_UTF_8 , <NUM_LIT:0> , bytesWithBOM , <NUM_LIT:0> , bomLength ) ; System . arraycopy ( bytes , <NUM_LIT:0> , bytesWithBOM , bomLength , bytes . length ) ; bytes = bytesWithBOM ; } } ByteArrayInputStream stream = new ByteArrayInputStream ( bytes ) ; if ( this . file . exists ( ) ) { this . file . setContents ( stream , force ? IResource . FORCE | IResource . KEEP_HISTORY : IResource . KEEP_HISTORY , null ) ; } else { this . file . create ( stream , force , null ) ; } } catch ( IOException e ) { throw new JavaModelException ( e , IJavaModelStatusConstants . IO_EXCEPTION ) ; } catch ( CoreException e ) { throw new JavaModelException ( e ) ; } this . flags &= ~ ( F_HAS_UNSAVED_CHANGES ) ; } public void setContents ( char [ ] newContents ) { if ( this . contents == null ) { synchronized ( this . lock ) { this . contents = newContents ; this . flags &= ~ ( F_HAS_UNSAVED_CHANGES ) ; } return ; } if ( ! isReadOnly ( ) ) { String string = null ; if ( newContents != null ) { string = new String ( newContents ) ; } synchronized ( this . lock ) { if ( this . contents == null ) return ; this . contents = newContents ; this . flags |= F_HAS_UNSAVED_CHANGES ; this . gapStart = - <NUM_LIT:1> ; this . gapEnd = - <NUM_LIT:1> ; } BufferChangedEvent event = new BufferChangedEvent ( this , <NUM_LIT:0> , getLength ( ) , string ) ; notifyChanged ( event ) ; } } public void setContents ( String newContents ) { this . setContents ( newContents . toCharArray ( ) ) ; } protected void setReadOnly ( boolean readOnly ) { if ( readOnly ) { this . flags |= F_IS_READ_ONLY ; } else { this . flags &= ~ ( F_IS_READ_ONLY ) ; } } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( "<STR_LIT>" + ( ( JavaElement ) this . owner ) . toStringWithAncestors ( ) ) ; buffer . append ( "<STR_LIT>" + hasUnsavedChanges ( ) ) ; buffer . append ( "<STR_LIT>" + isReadOnly ( ) ) ; buffer . append ( "<STR_LIT>" + isClosed ( ) ) ; buffer . append ( "<STR_LIT>" ) ; char [ ] charContents = getCharacters ( ) ; if ( charContents == null ) { buffer . append ( "<STR_LIT>" ) ; } else { int length = charContents . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { char c = charContents [ i ] ; switch ( c ) { case '<STR_LIT:\n>' : buffer . append ( "<STR_LIT>" ) ; break ; case '<STR_LIT>' : if ( i < length - <NUM_LIT:1> && this . contents [ i + <NUM_LIT:1> ] == '<STR_LIT:\n>' ) { buffer . append ( "<STR_LIT>" ) ; i ++ ; } else { buffer . append ( "<STR_LIT>" ) ; } break ; default : buffer . append ( c ) ; break ; } } } return buffer . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . core ; import java . util . HashMap ; import java . util . Iterator ; import java . util . Map ; import org . eclipse . core . runtime . ISafeRunnable ; import org . eclipse . core . runtime . OperationCanceledException ; import org . eclipse . core . runtime . SafeRunner ; import org . eclipse . jdt . core . * ; import org . eclipse . jdt . core . compiler . CategorizedProblem ; import org . eclipse . jdt . core . compiler . CompilationParticipant ; import org . eclipse . jdt . core . compiler . ReconcileContext ; import org . eclipse . jdt . core . dom . AST ; import org . eclipse . jdt . internal . compiler . ast . CompilationUnitDeclaration ; import org . eclipse . jdt . internal . core . util . Messages ; import org . eclipse . jdt . internal . core . util . Util ; public class ReconcileWorkingCopyOperation extends JavaModelOperation { public static boolean PERF = false ; public int astLevel ; public boolean resolveBindings ; public HashMap problems ; public int reconcileFlags ; WorkingCopyOwner workingCopyOwner ; public org . eclipse . jdt . core . dom . CompilationUnit ast ; public JavaElementDeltaBuilder deltaBuilder ; public boolean requestorIsActive ; public ReconcileWorkingCopyOperation ( IJavaElement workingCopy , int astLevel , int reconcileFlags , WorkingCopyOwner workingCopyOwner ) { super ( new IJavaElement [ ] { workingCopy } ) ; this . astLevel = astLevel ; this . reconcileFlags = reconcileFlags ; this . workingCopyOwner = workingCopyOwner ; } protected void executeOperation ( ) throws JavaModelException { checkCanceled ( ) ; try { beginTask ( Messages . element_reconciling , <NUM_LIT:2> ) ; CompilationUnit workingCopy = getWorkingCopy ( ) ; boolean wasConsistent = workingCopy . isConsistent ( ) ; IProblemRequestor problemRequestor = workingCopy . getPerWorkingCopyInfo ( ) ; if ( problemRequestor != null ) problemRequestor = ( ( JavaModelManager . PerWorkingCopyInfo ) problemRequestor ) . getProblemRequestor ( ) ; boolean defaultRequestorIsActive = problemRequestor != null && problemRequestor . isActive ( ) ; IProblemRequestor ownerProblemRequestor = this . workingCopyOwner . getProblemRequestor ( workingCopy ) ; boolean ownerRequestorIsActive = ownerProblemRequestor != null && ownerProblemRequestor != problemRequestor && ownerProblemRequestor . isActive ( ) ; this . requestorIsActive = defaultRequestorIsActive || ownerRequestorIsActive ; this . deltaBuilder = new JavaElementDeltaBuilder ( workingCopy ) ; makeConsistent ( workingCopy ) ; if ( ! wasConsistent || ( ( this . reconcileFlags & ICompilationUnit . FORCE_PROBLEM_DETECTION ) != <NUM_LIT:0> ) ) { notifyParticipants ( workingCopy ) ; if ( this . ast == null ) makeConsistent ( workingCopy ) ; } if ( this . problems != null && ( ( ( this . reconcileFlags & ICompilationUnit . FORCE_PROBLEM_DETECTION ) != <NUM_LIT:0> ) || ! wasConsistent ) ) { if ( defaultRequestorIsActive ) { reportProblems ( workingCopy , problemRequestor ) ; } if ( ownerRequestorIsActive ) { reportProblems ( workingCopy , ownerProblemRequestor ) ; } } JavaElementDelta delta = this . deltaBuilder . delta ; if ( delta != null ) { addReconcileDelta ( workingCopy , delta ) ; } } finally { done ( ) ; } } private void reportProblems ( CompilationUnit workingCopy , IProblemRequestor problemRequestor ) { try { problemRequestor . beginReporting ( ) ; for ( Iterator iteraror = this . problems . values ( ) . iterator ( ) ; iteraror . hasNext ( ) ; ) { CategorizedProblem [ ] categorizedProblems = ( CategorizedProblem [ ] ) iteraror . next ( ) ; if ( categorizedProblems == null ) continue ; for ( int i = <NUM_LIT:0> , length = categorizedProblems . length ; i < length ; i ++ ) { CategorizedProblem problem = categorizedProblems [ i ] ; if ( JavaModelManager . VERBOSE ) { System . out . println ( "<STR_LIT>" + problem . getMessage ( ) ) ; } if ( this . progressMonitor != null && this . progressMonitor . isCanceled ( ) ) break ; problemRequestor . acceptProblem ( problem ) ; } } } finally { problemRequestor . endReporting ( ) ; } } protected CompilationUnit getWorkingCopy ( ) { return ( CompilationUnit ) getElementToProcess ( ) ; } public boolean isReadOnly ( ) { return true ; } public org . eclipse . jdt . core . dom . CompilationUnit makeConsistent ( CompilationUnit workingCopy ) throws JavaModelException { if ( ! workingCopy . isConsistent ( ) ) { if ( this . problems == null ) this . problems = new HashMap ( ) ; this . resolveBindings = this . requestorIsActive ; this . ast = workingCopy . makeConsistent ( this . astLevel , this . resolveBindings , this . reconcileFlags , this . problems , this . progressMonitor ) ; this . deltaBuilder . buildDeltas ( ) ; if ( this . ast != null && this . deltaBuilder . delta != null ) this . deltaBuilder . delta . changedAST ( this . ast ) ; return this . ast ; } if ( this . ast != null ) return this . ast ; CompilationUnitDeclaration unit = null ; try { JavaModelManager . getJavaModelManager ( ) . abortOnMissingSource . set ( Boolean . TRUE ) ; CompilationUnit source = workingCopy . cloneCachingContents ( ) ; if ( JavaProject . hasJavaNature ( workingCopy . getJavaProject ( ) . getProject ( ) ) && ( this . reconcileFlags & ICompilationUnit . FORCE_PROBLEM_DETECTION ) != <NUM_LIT:0> ) { this . resolveBindings = this . requestorIsActive ; if ( this . problems == null ) this . problems = new HashMap ( ) ; unit = CompilationUnitProblemFinder . process ( source , this . workingCopyOwner , this . problems , this . astLevel != ICompilationUnit . NO_AST , this . reconcileFlags , this . progressMonitor ) ; if ( this . progressMonitor != null ) this . progressMonitor . worked ( <NUM_LIT:1> ) ; } if ( this . astLevel != ICompilationUnit . NO_AST && unit != null ) { Map options = workingCopy . getJavaProject ( ) . getOptions ( true ) ; this . ast = AST . convertCompilationUnit ( this . astLevel , unit , options , this . resolveBindings , source , this . reconcileFlags , this . progressMonitor ) ; if ( this . ast != null ) { if ( this . deltaBuilder . delta == null ) { this . deltaBuilder . delta = new JavaElementDelta ( workingCopy ) ; } this . deltaBuilder . delta . changedAST ( this . ast ) ; } if ( this . progressMonitor != null ) this . progressMonitor . worked ( <NUM_LIT:1> ) ; } } catch ( JavaModelException e ) { if ( JavaProject . hasJavaNature ( workingCopy . getJavaProject ( ) . getProject ( ) ) ) throw e ; } finally { JavaModelManager . getJavaModelManager ( ) . abortOnMissingSource . set ( null ) ; if ( unit != null ) { unit . cleanUp ( ) ; } } return this . ast ; } private void notifyParticipants ( final CompilationUnit workingCopy ) { IJavaProject javaProject = getWorkingCopy ( ) . getJavaProject ( ) ; CompilationParticipant [ ] participants = JavaModelManager . getJavaModelManager ( ) . compilationParticipants . getCompilationParticipants ( javaProject ) ; if ( participants == null ) return ; final ReconcileContext context = new ReconcileContext ( this , workingCopy ) ; for ( int i = <NUM_LIT:0> , length = participants . length ; i < length ; i ++ ) { final CompilationParticipant participant = participants [ i ] ; SafeRunner . run ( new ISafeRunnable ( ) { public void handleException ( Throwable exception ) { if ( exception instanceof Error ) { throw ( Error ) exception ; } else if ( exception instanceof OperationCanceledException ) throw ( OperationCanceledException ) exception ; else if ( exception instanceof UnsupportedOperationException ) { Util . log ( exception , "<STR_LIT>" ) ; } else Util . log ( exception , "<STR_LIT>" ) ; } public void run ( ) throws Exception { participant . reconcile ( context ) ; } } ) ; } } protected IJavaModelStatus verify ( ) { IJavaModelStatus status = super . verify ( ) ; if ( ! status . isOK ( ) ) { return status ; } CompilationUnit workingCopy = getWorkingCopy ( ) ; if ( ! workingCopy . isWorkingCopy ( ) ) { return new JavaModelStatus ( IJavaModelStatusConstants . ELEMENT_DOES_NOT_EXIST , workingCopy ) ; } return status ; } } </s>
<s> package org . eclipse . jdt . internal . core ; import org . eclipse . jdt . core . * ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . lookup . Binding ; import org . eclipse . jdt . internal . core . util . Util ; public class SourceMethod extends NamedMember implements IMethod { protected String [ ] parameterTypes ; protected SourceMethod ( JavaElement parent , String name , String [ ] parameterTypes ) { super ( parent , name ) ; if ( parameterTypes == null ) { this . parameterTypes = CharOperation . NO_STRINGS ; } else { this . parameterTypes = parameterTypes ; } } protected void closing ( Object info ) throws JavaModelException { super . closing ( info ) ; SourceMethodElementInfo elementInfo = ( SourceMethodElementInfo ) info ; ITypeParameter [ ] typeParameters = elementInfo . typeParameters ; for ( int i = <NUM_LIT:0> , length = typeParameters . length ; i < length ; i ++ ) { ( ( TypeParameter ) typeParameters [ i ] ) . close ( ) ; } } public boolean equals ( Object o ) { if ( ! ( o instanceof SourceMethod ) ) return false ; return super . equals ( o ) && Util . equalArraysOrNull ( this . parameterTypes , ( ( SourceMethod ) o ) . parameterTypes ) ; } public IMemberValuePair getDefaultValue ( ) throws JavaModelException { SourceMethodElementInfo sourceMethodInfo = ( SourceMethodElementInfo ) getElementInfo ( ) ; if ( sourceMethodInfo . isAnnotationMethod ( ) ) { return ( ( SourceAnnotationMethodInfo ) sourceMethodInfo ) . defaultValue ; } return null ; } public int getElementType ( ) { return METHOD ; } public String [ ] getExceptionTypes ( ) throws JavaModelException { SourceMethodElementInfo info = ( SourceMethodElementInfo ) getElementInfo ( ) ; char [ ] [ ] exs = info . getExceptionTypeNames ( ) ; return CompilationUnitStructureRequestor . convertTypeNamesToSigs ( exs ) ; } protected void getHandleMemento ( StringBuffer buff ) { ( ( JavaElement ) getParent ( ) ) . getHandleMemento ( buff ) ; char delimiter = getHandleMementoDelimiter ( ) ; buff . append ( delimiter ) ; escapeMementoName ( buff , getElementName ( ) ) ; for ( int i = <NUM_LIT:0> ; i < this . parameterTypes . length ; i ++ ) { buff . append ( delimiter ) ; escapeMementoName ( buff , this . parameterTypes [ i ] ) ; } if ( this . occurrenceCount > <NUM_LIT:1> ) { buff . append ( JEM_COUNT ) ; buff . append ( this . occurrenceCount ) ; } } protected char getHandleMementoDelimiter ( ) { return JavaElement . JEM_METHOD ; } public String getKey ( ) { try { return getKey ( this , false ) ; } catch ( JavaModelException e ) { return null ; } } public int getNumberOfParameters ( ) { return this . parameterTypes == null ? <NUM_LIT:0> : this . parameterTypes . length ; } public String [ ] getParameterNames ( ) throws JavaModelException { SourceMethodElementInfo info = ( SourceMethodElementInfo ) getElementInfo ( ) ; char [ ] [ ] names = info . getArgumentNames ( ) ; return CharOperation . toStrings ( names ) ; } public String [ ] getParameterTypes ( ) { return this . parameterTypes ; } public ITypeParameter getTypeParameter ( String typeParameterName ) { return new TypeParameter ( this , typeParameterName ) ; } public ITypeParameter [ ] getTypeParameters ( ) throws JavaModelException { SourceMethodElementInfo info = ( SourceMethodElementInfo ) getElementInfo ( ) ; return info . typeParameters ; } public String [ ] getTypeParameterSignatures ( ) throws JavaModelException { ITypeParameter [ ] typeParameters = getTypeParameters ( ) ; int length = typeParameters . length ; String [ ] typeParameterSignatures = new String [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeParameter typeParameter = ( TypeParameter ) typeParameters [ i ] ; TypeParameterElementInfo info = ( TypeParameterElementInfo ) typeParameter . getElementInfo ( ) ; char [ ] [ ] bounds = info . bounds ; if ( bounds == null ) { typeParameterSignatures [ i ] = Signature . createTypeParameterSignature ( typeParameter . getElementName ( ) , CharOperation . NO_STRINGS ) ; } else { int boundsLength = bounds . length ; char [ ] [ ] boundSignatures = new char [ boundsLength ] [ ] ; for ( int j = <NUM_LIT:0> ; j < boundsLength ; j ++ ) { boundSignatures [ j ] = Signature . createCharArrayTypeSignature ( bounds [ j ] , false ) ; } typeParameterSignatures [ i ] = new String ( Signature . createTypeParameterSignature ( typeParameter . getElementName ( ) . toCharArray ( ) , boundSignatures ) ) ; } } return typeParameterSignatures ; } public IJavaElement getPrimaryElement ( boolean checkOwner ) { if ( checkOwner ) { CompilationUnit cu = ( CompilationUnit ) getAncestor ( COMPILATION_UNIT ) ; if ( cu . isPrimary ( ) ) return this ; } IJavaElement primaryParent = this . parent . getPrimaryElement ( false ) ; return ( ( IType ) primaryParent ) . getMethod ( this . name , this . parameterTypes ) ; } public String [ ] getRawParameterNames ( ) throws JavaModelException { return getParameterNames ( ) ; } public String getReturnType ( ) throws JavaModelException { SourceMethodElementInfo info = ( SourceMethodElementInfo ) getElementInfo ( ) ; return Signature . createTypeSignature ( info . getReturnTypeName ( ) , false ) ; } public String getSignature ( ) throws JavaModelException { SourceMethodElementInfo info = ( SourceMethodElementInfo ) getElementInfo ( ) ; return Signature . createMethodSignature ( this . parameterTypes , Signature . createTypeSignature ( info . getReturnTypeName ( ) , false ) ) ; } public int hashCode ( ) { int hash = super . hashCode ( ) ; for ( int i = <NUM_LIT:0> , length = this . parameterTypes . length ; i < length ; i ++ ) { hash = Util . combineHashCodes ( hash , this . parameterTypes [ i ] . hashCode ( ) ) ; } return hash ; } public boolean isConstructor ( ) throws JavaModelException { if ( ! getElementName ( ) . equals ( this . parent . getElementName ( ) ) ) { return false ; } SourceMethodElementInfo info = ( SourceMethodElementInfo ) getElementInfo ( ) ; return info . isConstructor ( ) ; } public boolean isMainMethod ( ) throws JavaModelException { return this . isMainMethod ( this ) ; } public boolean isResolved ( ) { return false ; } public boolean isSimilar ( IMethod method ) { return areSimilarMethods ( getElementName ( ) , getParameterTypes ( ) , method . getElementName ( ) , method . getParameterTypes ( ) , null ) ; } public String readableName ( ) { StringBuffer buffer = new StringBuffer ( super . readableName ( ) ) ; buffer . append ( '<CHAR_LIT:(>' ) ; int length ; if ( this . parameterTypes != null && ( length = this . parameterTypes . length ) > <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { buffer . append ( Signature . toString ( this . parameterTypes [ i ] ) ) ; if ( i < length - <NUM_LIT:1> ) { buffer . append ( "<STR_LIT:U+002CU+0020>" ) ; } } } buffer . append ( '<CHAR_LIT:)>' ) ; return buffer . toString ( ) ; } public JavaElement resolved ( Binding binding ) { SourceRefElement resolvedHandle = new ResolvedSourceMethod ( this . parent , this . name , this . parameterTypes , new String ( binding . computeUniqueKey ( ) ) ) ; resolvedHandle . occurrenceCount = this . occurrenceCount ; return resolvedHandle ; } protected void toStringInfo ( int tab , StringBuffer buffer , Object info , boolean showResolvedInfo ) { buffer . append ( tabString ( tab ) ) ; if ( info == null ) { toStringName ( buffer ) ; buffer . append ( "<STR_LIT>" ) ; } else if ( info == NO_INFO ) { toStringName ( buffer ) ; } else { SourceMethodElementInfo methodInfo = ( SourceMethodElementInfo ) info ; int flags = methodInfo . getModifiers ( ) ; if ( Flags . isStatic ( flags ) ) { buffer . append ( "<STR_LIT>" ) ; } if ( ! methodInfo . isConstructor ( ) ) { buffer . append ( methodInfo . getReturnTypeName ( ) ) ; buffer . append ( '<CHAR_LIT:U+0020>' ) ; } toStringName ( buffer , flags ) ; } } protected void toStringName ( StringBuffer buffer ) { toStringName ( buffer , <NUM_LIT:0> ) ; } protected void toStringName ( StringBuffer buffer , int flags ) { buffer . append ( getElementName ( ) ) ; buffer . append ( '<CHAR_LIT:(>' ) ; String [ ] parameters = getParameterTypes ( ) ; int length ; if ( parameters != null && ( length = parameters . length ) > <NUM_LIT:0> ) { boolean isVarargs = Flags . isVarargs ( flags ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { try { if ( i < length - <NUM_LIT:1> ) { buffer . append ( Signature . toString ( parameters [ i ] ) ) ; buffer . append ( "<STR_LIT:U+002CU+0020>" ) ; } else if ( isVarargs ) { String parameter = parameters [ i ] . substring ( <NUM_LIT:1> ) ; buffer . append ( Signature . toString ( parameter ) ) ; buffer . append ( "<STR_LIT>" ) ; } else { buffer . append ( Signature . toString ( parameters [ i ] ) ) ; } } catch ( IllegalArgumentException e ) { buffer . append ( "<STR_LIT>" ) ; buffer . append ( parameters [ i ] ) ; } } } buffer . append ( '<CHAR_LIT:)>' ) ; if ( this . occurrenceCount > <NUM_LIT:1> ) { buffer . append ( "<STR_LIT:#>" ) ; buffer . append ( this . occurrenceCount ) ; } } } </s>
<s> package org . eclipse . jdt . internal . core ; import java . io . ByteArrayInputStream ; import java . io . IOException ; import java . io . InputStream ; import org . eclipse . core . resources . * ; import org . eclipse . core . runtime . CoreException ; import org . eclipse . core . runtime . IStatus ; import org . eclipse . core . runtime . NullProgressMonitor ; import org . eclipse . core . runtime . Path ; import org . eclipse . core . runtime . jobs . ISchedulingRule ; import org . eclipse . jdt . core . IBuffer ; import org . eclipse . jdt . core . ICompilationUnit ; import org . eclipse . jdt . core . IJavaElement ; import org . eclipse . jdt . core . IJavaElementDelta ; import org . eclipse . jdt . core . IJavaModelStatus ; import org . eclipse . jdt . core . IJavaModelStatusConstants ; import org . eclipse . jdt . core . IJavaProject ; import org . eclipse . jdt . core . IPackageFragment ; import org . eclipse . jdt . core . JavaConventions ; import org . eclipse . jdt . core . JavaCore ; import org . eclipse . jdt . core . JavaModelException ; import org . eclipse . jdt . internal . core . util . Messages ; import org . eclipse . jdt . internal . core . util . Util ; public class CreateCompilationUnitOperation extends JavaModelOperation { protected String name ; protected String source = null ; public CreateCompilationUnitOperation ( IPackageFragment parentElement , String name , String source , boolean force ) { super ( null , new IJavaElement [ ] { parentElement } , force ) ; this . name = name ; this . source = source ; } protected void executeOperation ( ) throws JavaModelException { try { beginTask ( Messages . operation_createUnitProgress , <NUM_LIT:2> ) ; JavaElementDelta delta = newJavaElementDelta ( ) ; ICompilationUnit unit = getCompilationUnit ( ) ; IPackageFragment pkg = ( IPackageFragment ) getParentElement ( ) ; IContainer folder = ( IContainer ) pkg . getResource ( ) ; worked ( <NUM_LIT:1> ) ; IFile compilationUnitFile = folder . getFile ( new Path ( this . name ) ) ; if ( compilationUnitFile . exists ( ) ) { if ( this . force ) { IBuffer buffer = unit . getBuffer ( ) ; if ( buffer == null ) return ; buffer . setContents ( this . source ) ; unit . save ( new NullProgressMonitor ( ) , false ) ; this . resultElements = new IJavaElement [ ] { unit } ; if ( ! Util . isExcluded ( unit ) && unit . getParent ( ) . exists ( ) ) { for ( int i = <NUM_LIT:0> ; i < this . resultElements . length ; i ++ ) { delta . changed ( this . resultElements [ i ] , IJavaElementDelta . F_CONTENT ) ; } addDelta ( delta ) ; } } else { throw new JavaModelException ( new JavaModelStatus ( IJavaModelStatusConstants . NAME_COLLISION , Messages . bind ( Messages . status_nameCollision , compilationUnitFile . getFullPath ( ) . toString ( ) ) ) ) ; } } else { try { String encoding = null ; try { encoding = folder . getDefaultCharset ( ) ; } catch ( CoreException ce ) { } InputStream stream = new ByteArrayInputStream ( encoding == null ? this . source . getBytes ( ) : this . source . getBytes ( encoding ) ) ; createFile ( folder , unit . getElementName ( ) , stream , this . force ) ; this . resultElements = new IJavaElement [ ] { unit } ; if ( ! Util . isExcluded ( unit ) && unit . getParent ( ) . exists ( ) ) { for ( int i = <NUM_LIT:0> ; i < this . resultElements . length ; i ++ ) { delta . added ( this . resultElements [ i ] ) ; } addDelta ( delta ) ; } } catch ( IOException e ) { throw new JavaModelException ( e , IJavaModelStatusConstants . IO_EXCEPTION ) ; } } worked ( <NUM_LIT:1> ) ; } finally { done ( ) ; } } protected ICompilationUnit getCompilationUnit ( ) { return ( ( IPackageFragment ) getParentElement ( ) ) . getCompilationUnit ( this . name ) ; } protected ISchedulingRule getSchedulingRule ( ) { IResource resource = getCompilationUnit ( ) . getResource ( ) ; IWorkspace workspace = resource . getWorkspace ( ) ; if ( resource . exists ( ) ) { return workspace . getRuleFactory ( ) . modifyRule ( resource ) ; } else { return workspace . getRuleFactory ( ) . createRule ( resource ) ; } } public IJavaModelStatus verify ( ) { if ( getParentElement ( ) == null ) { return new JavaModelStatus ( IJavaModelStatusConstants . NO_ELEMENTS_TO_PROCESS ) ; } IJavaProject project = getParentElement ( ) . getJavaProject ( ) ; if ( JavaConventions . validateCompilationUnitName ( this . name , project . getOption ( JavaCore . COMPILER_SOURCE , true ) , project . getOption ( JavaCore . COMPILER_COMPLIANCE , true ) ) . getSeverity ( ) == IStatus . ERROR ) { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_NAME , this . name ) ; } if ( this . source == null ) { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_CONTENTS ) ; } return JavaModelStatus . VERIFIED_OK ; } } </s>
<s> package org . eclipse . jdt . internal . core ; import java . io . ByteArrayInputStream ; import java . io . UnsupportedEncodingException ; import org . eclipse . core . resources . IFile ; import org . eclipse . core . resources . IResource ; import org . eclipse . core . resources . IWorkspace ; import org . eclipse . core . runtime . CoreException ; import org . eclipse . core . runtime . jobs . ISchedulingRule ; import org . eclipse . jdt . core . IBuffer ; import org . eclipse . jdt . core . ICompilationUnit ; import org . eclipse . jdt . core . IJavaElement ; import org . eclipse . jdt . core . IJavaModelStatus ; import org . eclipse . jdt . core . IJavaModelStatusConstants ; import org . eclipse . jdt . core . IJavaProject ; import org . eclipse . jdt . core . JavaCore ; import org . eclipse . jdt . core . JavaModelException ; import org . eclipse . jdt . internal . core . util . Messages ; import org . eclipse . jdt . internal . core . util . Util ; public class CommitWorkingCopyOperation extends JavaModelOperation { public CommitWorkingCopyOperation ( ICompilationUnit element , boolean force ) { super ( new IJavaElement [ ] { element } , force ) ; } protected void executeOperation ( ) throws JavaModelException { try { beginTask ( Messages . workingCopy_commit , <NUM_LIT:2> ) ; CompilationUnit workingCopy = getCompilationUnit ( ) ; if ( ExternalJavaProject . EXTERNAL_PROJECT_NAME . equals ( workingCopy . getJavaProject ( ) . getElementName ( ) ) ) { workingCopy . getBuffer ( ) . save ( this . progressMonitor , this . force ) ; return ; } ICompilationUnit primary = workingCopy . getPrimary ( ) ; boolean isPrimary = workingCopy . isPrimary ( ) ; JavaElementDeltaBuilder deltaBuilder = null ; PackageFragmentRoot root = ( PackageFragmentRoot ) workingCopy . getAncestor ( IJavaElement . PACKAGE_FRAGMENT_ROOT ) ; boolean isIncluded = ! Util . isExcluded ( workingCopy ) ; IFile resource = ( IFile ) workingCopy . getResource ( ) ; IJavaProject project = root . getJavaProject ( ) ; if ( isPrimary || ( root . validateOnClasspath ( ) . isOK ( ) && isIncluded && resource . isAccessible ( ) && Util . isValidCompilationUnitName ( workingCopy . getElementName ( ) , project . getOption ( JavaCore . COMPILER_SOURCE , true ) , project . getOption ( JavaCore . COMPILER_COMPLIANCE , true ) ) ) ) { if ( ! isPrimary && ! primary . isOpen ( ) ) { primary . open ( null ) ; } if ( isIncluded && ( ! isPrimary || ! workingCopy . isConsistent ( ) ) ) { deltaBuilder = new JavaElementDeltaBuilder ( primary ) ; } IBuffer primaryBuffer = primary . getBuffer ( ) ; if ( ! isPrimary ) { if ( primaryBuffer == null ) return ; char [ ] primaryContents = primaryBuffer . getCharacters ( ) ; boolean hasSaved = false ; try { IBuffer workingCopyBuffer = workingCopy . getBuffer ( ) ; if ( workingCopyBuffer == null ) return ; primaryBuffer . setContents ( workingCopyBuffer . getCharacters ( ) ) ; primaryBuffer . save ( this . progressMonitor , this . force ) ; primary . makeConsistent ( this ) ; hasSaved = true ; } finally { if ( ! hasSaved ) { primaryBuffer . setContents ( primaryContents ) ; } } } else { primaryBuffer . save ( this . progressMonitor , this . force ) ; primary . makeConsistent ( this ) ; } } else { String encoding = null ; try { encoding = resource . getCharset ( ) ; } catch ( CoreException ce ) { } String contents = workingCopy . getSource ( ) ; if ( contents == null ) return ; try { byte [ ] bytes = encoding == null ? contents . getBytes ( ) : contents . getBytes ( encoding ) ; ByteArrayInputStream stream = new ByteArrayInputStream ( bytes ) ; if ( resource . exists ( ) ) { resource . setContents ( stream , this . force ? IResource . FORCE | IResource . KEEP_HISTORY : IResource . KEEP_HISTORY , null ) ; } else { resource . create ( stream , this . force , this . progressMonitor ) ; } } catch ( CoreException e ) { throw new JavaModelException ( e ) ; } catch ( UnsupportedEncodingException e ) { throw new JavaModelException ( e , IJavaModelStatusConstants . IO_EXCEPTION ) ; } } setAttribute ( HAS_MODIFIED_RESOURCE_ATTR , TRUE ) ; workingCopy . updateTimeStamp ( ( CompilationUnit ) primary ) ; workingCopy . makeConsistent ( this ) ; worked ( <NUM_LIT:1> ) ; if ( deltaBuilder != null ) { deltaBuilder . buildDeltas ( ) ; if ( deltaBuilder . delta != null ) { addDelta ( deltaBuilder . delta ) ; } } worked ( <NUM_LIT:1> ) ; } finally { done ( ) ; } } protected CompilationUnit getCompilationUnit ( ) { return ( CompilationUnit ) getElementToProcess ( ) ; } protected ISchedulingRule getSchedulingRule ( ) { IResource resource = getElementToProcess ( ) . getResource ( ) ; if ( resource == null ) return null ; IWorkspace workspace = resource . getWorkspace ( ) ; if ( resource . exists ( ) ) { return workspace . getRuleFactory ( ) . modifyRule ( resource ) ; } else { return workspace . getRuleFactory ( ) . createRule ( resource ) ; } } public IJavaModelStatus verify ( ) { CompilationUnit cu = getCompilationUnit ( ) ; if ( ! cu . isWorkingCopy ( ) ) { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_ELEMENT_TYPES , cu ) ; } if ( cu . hasResourceChanged ( ) && ! this . force ) { return new JavaModelStatus ( IJavaModelStatusConstants . UPDATE_CONFLICT ) ; } return JavaModelStatus . VERIFIED_OK ; } } </s>
<s> package org . eclipse . jdt . internal . core ; import org . eclipse . core . resources . IProject ; import org . eclipse . core . runtime . IPath ; import org . eclipse . jdt . core . IClasspathEntry ; import org . eclipse . jdt . core . IJavaModelStatus ; import org . eclipse . jdt . core . JavaModelException ; import org . eclipse . jdt . internal . core . builder . JavaBuilder ; public class ClasspathValidation { private JavaProject project ; public ClasspathValidation ( JavaProject project ) { this . project = project ; } public void validate ( ) { JavaModelManager . PerProjectInfo perProjectInfo ; try { perProjectInfo = this . project . getPerProjectInfo ( ) ; } catch ( JavaModelException e ) { IProject resource = this . project . getProject ( ) ; if ( resource . isAccessible ( ) ) { this . project . flushClasspathProblemMarkers ( true , true ) ; JavaBuilder . removeProblemsAndTasksFor ( resource ) ; } return ; } IClasspathEntry [ ] rawClasspath ; IPath outputLocation ; IJavaModelStatus status ; synchronized ( perProjectInfo ) { rawClasspath = perProjectInfo . rawClasspath ; outputLocation = perProjectInfo . outputLocation ; status = perProjectInfo . rawClasspathStatus ; } this . project . flushClasspathProblemMarkers ( false , true ) ; if ( ! status . isOK ( ) ) this . project . createClasspathProblemMarker ( status ) ; this . project . flushClasspathProblemMarkers ( false , false ) ; if ( rawClasspath != JavaProject . INVALID_CLASSPATH && outputLocation != null ) { for ( int i = <NUM_LIT:0> ; i < rawClasspath . length ; i ++ ) { status = ClasspathEntry . validateClasspathEntry ( this . project , rawClasspath [ i ] , false , false ) ; if ( ! status . isOK ( ) ) { this . project . createClasspathProblemMarker ( status ) ; } } status = ClasspathEntry . validateClasspath ( this . project , rawClasspath , outputLocation ) ; if ( ! status . isOK ( ) ) this . project . createClasspathProblemMarker ( status ) ; } } } </s>
<s> package org . eclipse . jdt . internal . core ; import java . io . IOException ; import java . util . HashMap ; import java . util . Map ; import java . util . zip . ZipEntry ; import java . util . zip . ZipFile ; import org . eclipse . core . resources . IContainer ; import org . eclipse . core . resources . IFile ; import org . eclipse . core . resources . IFolder ; import org . eclipse . core . resources . IResource ; import org . eclipse . core . runtime . CoreException ; import org . eclipse . core . runtime . IPath ; import org . eclipse . core . runtime . IProgressMonitor ; import org . eclipse . core . runtime . IStatus ; import org . eclipse . core . runtime . Path ; import org . eclipse . jdt . core . * ; import org . eclipse . jdt . core . compiler . IProblem ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileReader ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFormatException ; import org . eclipse . jdt . internal . compiler . env . IBinaryType ; import org . eclipse . jdt . internal . compiler . env . IDependent ; import org . eclipse . jdt . internal . compiler . util . SuffixConstants ; import org . eclipse . jdt . internal . core . util . MementoTokenizer ; import org . eclipse . jdt . internal . core . util . Util ; public class ClassFile extends Openable implements IClassFile , SuffixConstants { protected String name ; protected BinaryType binaryType = null ; protected ClassFile ( PackageFragment parent , String nameWithoutExtension ) { super ( parent ) ; this . name = nameWithoutExtension ; } public ICompilationUnit becomeWorkingCopy ( IProblemRequestor problemRequestor , WorkingCopyOwner owner , IProgressMonitor monitor ) throws JavaModelException { JavaModelManager manager = JavaModelManager . getJavaModelManager ( ) ; CompilationUnit workingCopy = new ClassFileWorkingCopy ( this , owner == null ? DefaultWorkingCopyOwner . PRIMARY : owner ) ; JavaModelManager . PerWorkingCopyInfo perWorkingCopyInfo = manager . getPerWorkingCopyInfo ( workingCopy , false , true , null ) ; if ( perWorkingCopyInfo == null ) { close ( ) ; BecomeWorkingCopyOperation operation = new BecomeWorkingCopyOperation ( workingCopy , problemRequestor ) ; operation . runOperation ( monitor ) ; return workingCopy ; } return perWorkingCopyInfo . workingCopy ; } protected boolean buildStructure ( OpenableElementInfo info , IProgressMonitor pm , Map newElements , IResource underlyingResource ) throws JavaModelException { IBinaryType typeInfo = getBinaryTypeInfo ( ( IFile ) underlyingResource ) ; if ( typeInfo == null ) { info . setChildren ( new IJavaElement [ ] { } ) ; return false ; } IType type = getType ( ) ; info . setChildren ( new IJavaElement [ ] { type } ) ; newElements . put ( type , typeInfo ) ; ( ( ClassFileInfo ) info ) . readBinaryChildren ( this , ( HashMap ) newElements , typeInfo ) ; return true ; } public void codeComplete ( int offset , ICompletionRequestor requestor ) throws JavaModelException { codeComplete ( offset , requestor , DefaultWorkingCopyOwner . PRIMARY ) ; } public void codeComplete ( int offset , ICompletionRequestor requestor , WorkingCopyOwner owner ) throws JavaModelException { if ( requestor == null ) { throw new IllegalArgumentException ( "<STR_LIT>" ) ; } codeComplete ( offset , new org . eclipse . jdt . internal . codeassist . CompletionRequestorWrapper ( requestor ) , owner ) ; } public void codeComplete ( int offset , CompletionRequestor requestor ) throws JavaModelException { codeComplete ( offset , requestor , DefaultWorkingCopyOwner . PRIMARY ) ; } public void codeComplete ( int offset , CompletionRequestor requestor , IProgressMonitor monitor ) throws JavaModelException { codeComplete ( offset , requestor , DefaultWorkingCopyOwner . PRIMARY , monitor ) ; } public void codeComplete ( int offset , CompletionRequestor requestor , WorkingCopyOwner owner ) throws JavaModelException { codeComplete ( offset , requestor , owner , null ) ; } public void codeComplete ( int offset , CompletionRequestor requestor , WorkingCopyOwner owner , IProgressMonitor monitor ) throws JavaModelException { String source = getSource ( ) ; if ( source != null ) { BinaryType type = ( BinaryType ) getType ( ) ; BasicCompilationUnit cu = new BasicCompilationUnit ( getSource ( ) . toCharArray ( ) , null , type . sourceFileName ( ( IBinaryType ) type . getElementInfo ( ) ) , getJavaProject ( ) ) ; codeComplete ( cu , cu , offset , requestor , owner , null , monitor ) ; } } public IJavaElement [ ] codeSelect ( int offset , int length ) throws JavaModelException { return codeSelect ( offset , length , DefaultWorkingCopyOwner . PRIMARY ) ; } public IJavaElement [ ] codeSelect ( int offset , int length , WorkingCopyOwner owner ) throws JavaModelException { IBuffer buffer = getBuffer ( ) ; char [ ] contents ; if ( buffer != null && ( contents = buffer . getCharacters ( ) ) != null ) { BinaryType type = ( BinaryType ) getType ( ) ; BasicCompilationUnit cu = new BasicCompilationUnit ( contents , null , type . sourceFileName ( ( IBinaryType ) type . getElementInfo ( ) ) ) ; return super . codeSelect ( cu , offset , length , owner ) ; } else { return new IJavaElement [ ] { } ; } } protected Object createElementInfo ( ) { return new ClassFileInfo ( ) ; } public boolean equals ( Object o ) { if ( ! ( o instanceof ClassFile ) ) return false ; ClassFile other = ( ClassFile ) o ; return this . name . equals ( other . name ) && this . parent . equals ( other . parent ) ; } public boolean existsUsingJarTypeCache ( ) { if ( getPackageFragmentRoot ( ) . isArchive ( ) ) { JavaModelManager manager = JavaModelManager . getJavaModelManager ( ) ; IType type = getType ( ) ; Object info = manager . getInfo ( type ) ; if ( info == JavaModelCache . NON_EXISTING_JAR_TYPE_INFO ) return false ; else if ( info != null ) return true ; JavaElementInfo parentInfo = ( JavaElementInfo ) manager . getInfo ( getParent ( ) ) ; if ( parentInfo != null ) { IJavaElement [ ] children = parentInfo . getChildren ( ) ; for ( int i = <NUM_LIT:0> , length = children . length ; i < length ; i ++ ) { if ( this . name . equals ( ( ( ClassFile ) children [ i ] ) . name ) ) return true ; } return false ; } try { info = getJarBinaryTypeInfo ( ( PackageFragment ) getParent ( ) , true ) ; } catch ( CoreException e ) { } catch ( IOException e ) { } catch ( ClassFormatException e ) { } manager . putJarTypeInfo ( type , info == null ? JavaModelCache . NON_EXISTING_JAR_TYPE_INFO : info ) ; return info != null ; } else return exists ( ) ; } protected IJavaElement findElement ( IJavaElement elt , int position , SourceMapper mapper ) { SourceRange range = mapper . getSourceRange ( elt ) ; if ( range == null || position < range . getOffset ( ) || range . getOffset ( ) + range . getLength ( ) - <NUM_LIT:1> < position ) { return null ; } if ( elt instanceof IParent ) { try { IJavaElement [ ] children = ( ( IParent ) elt ) . getChildren ( ) ; for ( int i = <NUM_LIT:0> ; i < children . length ; i ++ ) { IJavaElement match = findElement ( children [ i ] , position , mapper ) ; if ( match != null ) { return match ; } } } catch ( JavaModelException npe ) { } } return elt ; } public IType findPrimaryType ( ) { IType primaryType = getType ( ) ; if ( primaryType . exists ( ) ) { return primaryType ; } return null ; } public String getAttachedJavadoc ( IProgressMonitor monitor ) throws JavaModelException { return getType ( ) . getAttachedJavadoc ( monitor ) ; } public IBinaryType getBinaryTypeInfo ( IFile file ) throws JavaModelException { return getBinaryTypeInfo ( file , true ) ; } public IBinaryType getBinaryTypeInfo ( IFile file , boolean fullyInitialize ) throws JavaModelException { JavaElement pkg = ( JavaElement ) getParent ( ) ; if ( pkg instanceof JarPackageFragment ) { try { IBinaryType info = getJarBinaryTypeInfo ( ( PackageFragment ) pkg , fullyInitialize ) ; if ( info == null ) { throw newNotPresentException ( ) ; } return info ; } catch ( ClassFormatException cfe ) { if ( JavaCore . getPlugin ( ) . isDebugging ( ) ) { cfe . printStackTrace ( System . err ) ; } return null ; } catch ( IOException ioe ) { throw new JavaModelException ( ioe , IJavaModelStatusConstants . IO_EXCEPTION ) ; } catch ( CoreException e ) { if ( e instanceof JavaModelException ) { throw ( JavaModelException ) e ; } else { throw new JavaModelException ( e ) ; } } } else { byte [ ] contents = Util . getResourceContentsAsByteArray ( file ) ; try { return new ClassFileReader ( contents , file . getFullPath ( ) . toString ( ) . toCharArray ( ) , fullyInitialize ) ; } catch ( ClassFormatException cfe ) { return null ; } } } public byte [ ] getBytes ( ) throws JavaModelException { JavaElement pkg = ( JavaElement ) getParent ( ) ; if ( pkg instanceof JarPackageFragment ) { JarPackageFragmentRoot root = ( JarPackageFragmentRoot ) pkg . getParent ( ) ; ZipFile zip = null ; try { zip = root . getJar ( ) ; String entryName = Util . concatWith ( ( ( PackageFragment ) pkg ) . names , getElementName ( ) , '<CHAR_LIT:/>' ) ; ZipEntry ze = zip . getEntry ( entryName ) ; if ( ze != null ) { return org . eclipse . jdt . internal . compiler . util . Util . getZipEntryByteContent ( ze , zip ) ; } throw new JavaModelException ( new JavaModelStatus ( IJavaModelStatusConstants . ELEMENT_DOES_NOT_EXIST , this ) ) ; } catch ( IOException ioe ) { throw new JavaModelException ( ioe , IJavaModelStatusConstants . IO_EXCEPTION ) ; } catch ( CoreException e ) { if ( e instanceof JavaModelException ) { throw ( JavaModelException ) e ; } else { throw new JavaModelException ( e ) ; } } finally { JavaModelManager . getJavaModelManager ( ) . closeZipFile ( zip ) ; } } else { IFile file = ( IFile ) resource ( ) ; return Util . getResourceContentsAsByteArray ( file ) ; } } private IBinaryType getJarBinaryTypeInfo ( PackageFragment pkg , boolean fullyInitialize ) throws CoreException , IOException , ClassFormatException { JarPackageFragmentRoot root = ( JarPackageFragmentRoot ) pkg . getParent ( ) ; ZipFile zip = null ; try { zip = root . getJar ( ) ; String entryName = Util . concatWith ( pkg . names , getElementName ( ) , '<CHAR_LIT:/>' ) ; ZipEntry ze = zip . getEntry ( entryName ) ; if ( ze != null ) { byte contents [ ] = org . eclipse . jdt . internal . compiler . util . Util . getZipEntryByteContent ( ze , zip ) ; String fileName = root . getHandleIdentifier ( ) + IDependent . JAR_FILE_ENTRY_SEPARATOR + entryName ; return new ClassFileReader ( contents , fileName . toCharArray ( ) , fullyInitialize ) ; } } finally { JavaModelManager . getJavaModelManager ( ) . closeZipFile ( zip ) ; } return null ; } public IBuffer getBuffer ( ) throws JavaModelException { IStatus status = validateClassFile ( ) ; if ( status . isOK ( ) ) { return super . getBuffer ( ) ; } else { Object info = ( ( ClassFile ) getClassFile ( ) ) . getBinaryTypeInfo ( ( IFile ) resource ( ) ) ; IBuffer buffer = openBuffer ( null , info ) ; if ( buffer != null && ! ( buffer instanceof NullBuffer ) ) return buffer ; switch ( status . getCode ( ) ) { case IJavaModelStatusConstants . ELEMENT_NOT_ON_CLASSPATH : case IJavaModelStatusConstants . INVALID_ELEMENT_TYPES : return null ; default : throw new JavaModelException ( ( IJavaModelStatus ) status ) ; } } } public IClassFile getClassFile ( ) { return this ; } public ITypeRoot getTypeRoot ( ) { return this ; } public IResource getCorrespondingResource ( ) throws JavaModelException { IPackageFragmentRoot root = ( IPackageFragmentRoot ) getParent ( ) . getParent ( ) ; if ( root . isArchive ( ) ) { return null ; } else { return getUnderlyingResource ( ) ; } } public IJavaElement getElementAt ( int position ) throws JavaModelException { IJavaElement parentElement = getParent ( ) ; while ( parentElement . getElementType ( ) != IJavaElement . PACKAGE_FRAGMENT_ROOT ) { parentElement = parentElement . getParent ( ) ; } PackageFragmentRoot root = ( PackageFragmentRoot ) parentElement ; SourceMapper mapper = root . getSourceMapper ( ) ; if ( mapper == null ) { return null ; } else { getBuffer ( ) ; IType type = getType ( ) ; return findElement ( type , position , mapper ) ; } } public IJavaElement getElementAtConsideringSibling ( int position ) throws JavaModelException { IPackageFragment fragment = ( IPackageFragment ) getParent ( ) ; PackageFragmentRoot root = ( PackageFragmentRoot ) fragment . getAncestor ( IJavaElement . PACKAGE_FRAGMENT_ROOT ) ; SourceMapper mapper = root . getSourceMapper ( ) ; if ( mapper == null ) { return null ; } else { int index = this . name . indexOf ( '<CHAR_LIT>' ) ; int prefixLength = index < <NUM_LIT:0> ? this . name . length ( ) : index ; IType type = null ; int start = - <NUM_LIT:1> ; int end = Integer . MAX_VALUE ; IJavaElement [ ] children = fragment . getChildren ( ) ; for ( int i = <NUM_LIT:0> ; i < children . length ; i ++ ) { String childName = children [ i ] . getElementName ( ) ; int childIndex = childName . indexOf ( '<CHAR_LIT>' ) ; int childPrefixLength = childIndex < <NUM_LIT:0> ? childName . indexOf ( '<CHAR_LIT:.>' ) : childIndex ; if ( prefixLength == childPrefixLength && this . name . regionMatches ( <NUM_LIT:0> , childName , <NUM_LIT:0> , prefixLength ) ) { IClassFile classFile = ( IClassFile ) children [ i ] ; classFile . getBuffer ( ) ; SourceRange range = mapper . getSourceRange ( classFile . getType ( ) ) ; if ( range == SourceMapper . UNKNOWN_RANGE ) continue ; int newStart = range . getOffset ( ) ; int newEnd = newStart + range . getLength ( ) - <NUM_LIT:1> ; if ( newStart > start && newEnd < end && newStart <= position && newEnd >= position ) { type = classFile . getType ( ) ; start = newStart ; end = newEnd ; } } } if ( type != null ) { return findElement ( type , position , mapper ) ; } return null ; } } public String getElementName ( ) { return this . name + SuffixConstants . SUFFIX_STRING_class ; } public int getElementType ( ) { return CLASS_FILE ; } public IJavaElement getHandleFromMemento ( String token , MementoTokenizer memento , WorkingCopyOwner owner ) { switch ( token . charAt ( <NUM_LIT:0> ) ) { case JEM_TYPE : if ( ! memento . hasMoreTokens ( ) ) return this ; String typeName = memento . nextToken ( ) ; JavaElement type = new BinaryType ( this , typeName ) ; return type . getHandleFromMemento ( memento , owner ) ; } return null ; } protected char getHandleMementoDelimiter ( ) { return JavaElement . JEM_CLASSFILE ; } public IPath getPath ( ) { PackageFragmentRoot root = getPackageFragmentRoot ( ) ; if ( root . isArchive ( ) ) { return root . getPath ( ) ; } else { return getParent ( ) . getPath ( ) . append ( getElementName ( ) ) ; } } public IResource resource ( PackageFragmentRoot root ) { return ( ( IContainer ) ( ( Openable ) this . parent ) . resource ( root ) ) . getFile ( new Path ( getElementName ( ) ) ) ; } public String getSource ( ) throws JavaModelException { IBuffer buffer = getBuffer ( ) ; if ( buffer == null ) { return null ; } return buffer . getContents ( ) ; } public ISourceRange getSourceRange ( ) throws JavaModelException { IBuffer buffer = getBuffer ( ) ; if ( buffer != null ) { String contents = buffer . getContents ( ) ; if ( contents == null ) return null ; return new SourceRange ( <NUM_LIT:0> , contents . length ( ) ) ; } else { return null ; } } public String getTopLevelTypeName ( ) { String topLevelTypeName = getElementName ( ) ; int firstDollar = topLevelTypeName . indexOf ( '<CHAR_LIT>' ) ; if ( firstDollar != - <NUM_LIT:1> ) { topLevelTypeName = topLevelTypeName . substring ( <NUM_LIT:0> , firstDollar ) ; } else { topLevelTypeName = topLevelTypeName . substring ( <NUM_LIT:0> , topLevelTypeName . length ( ) - SUFFIX_CLASS . length ) ; } return topLevelTypeName ; } public IType getType ( ) { if ( this . binaryType == null ) { this . binaryType = new BinaryType ( this , getTypeName ( ) ) ; } return this . binaryType ; } public String getTypeName ( ) { int lastDollar = this . name . lastIndexOf ( '<CHAR_LIT>' ) ; return lastDollar > - <NUM_LIT:1> ? Util . localTypeName ( this . name , lastDollar , this . name . length ( ) ) : this . name ; } public ICompilationUnit getWorkingCopy ( WorkingCopyOwner owner , IProgressMonitor monitor ) throws JavaModelException { CompilationUnit workingCopy = new ClassFileWorkingCopy ( this , owner == null ? DefaultWorkingCopyOwner . PRIMARY : owner ) ; JavaModelManager manager = JavaModelManager . getJavaModelManager ( ) ; JavaModelManager . PerWorkingCopyInfo perWorkingCopyInfo = manager . getPerWorkingCopyInfo ( workingCopy , false , true , null ) ; if ( perWorkingCopyInfo != null ) { return perWorkingCopyInfo . getWorkingCopy ( ) ; } BecomeWorkingCopyOperation op = new BecomeWorkingCopyOperation ( workingCopy , null ) ; op . runOperation ( monitor ) ; return workingCopy ; } public IJavaElement getWorkingCopy ( IProgressMonitor monitor , org . eclipse . jdt . core . IBufferFactory factory ) throws JavaModelException { return getWorkingCopy ( BufferFactoryWrapper . create ( factory ) , monitor ) ; } protected boolean hasBuffer ( ) { return true ; } public int hashCode ( ) { return Util . combineHashCodes ( this . name . hashCode ( ) , this . parent . hashCode ( ) ) ; } public boolean isClass ( ) throws JavaModelException { return getType ( ) . isClass ( ) ; } public boolean isInterface ( ) throws JavaModelException { return getType ( ) . isInterface ( ) ; } public boolean isReadOnly ( ) { return true ; } private IStatus validateClassFile ( ) { IPackageFragmentRoot root = getPackageFragmentRoot ( ) ; try { if ( root . getKind ( ) != IPackageFragmentRoot . K_BINARY ) return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_ELEMENT_TYPES , root ) ; } catch ( JavaModelException e ) { return e . getJavaModelStatus ( ) ; } IJavaProject project = getJavaProject ( ) ; return JavaConventions . validateClassFileName ( getElementName ( ) , project . getOption ( JavaCore . COMPILER_SOURCE , true ) , project . getOption ( JavaCore . COMPILER_COMPLIANCE , true ) ) ; } protected IBuffer openBuffer ( IProgressMonitor pm , Object info ) throws JavaModelException { IType outerMostEnclosingType = getOuterMostEnclosingType ( ) ; IBuffer buffer = getBufferManager ( ) . getBuffer ( outerMostEnclosingType . getClassFile ( ) ) ; if ( buffer == null ) { SourceMapper mapper = getSourceMapper ( ) ; IBinaryType typeInfo = info instanceof IBinaryType ? ( IBinaryType ) info : null ; if ( mapper != null ) { buffer = mapSource ( mapper , typeInfo , outerMostEnclosingType . getClassFile ( ) ) ; } } return buffer ; } private IBuffer mapSource ( SourceMapper mapper , IBinaryType info , IClassFile bufferOwner ) { char [ ] contents = mapper . findSource ( getType ( ) , info ) ; if ( contents != null ) { IBuffer buffer = BufferManager . createBuffer ( bufferOwner ) ; if ( buffer == null ) return null ; BufferManager bufManager = getBufferManager ( ) ; bufManager . addBuffer ( buffer ) ; if ( buffer . getCharacters ( ) == null ) { buffer . setContents ( contents ) ; } buffer . addBufferChangedListener ( this ) ; mapper . mapSource ( getOuterMostEnclosingType ( ) , contents , info ) ; return buffer ; } else { IBuffer buffer = BufferManager . createNullBuffer ( bufferOwner ) ; if ( buffer == null ) return null ; BufferManager bufManager = getBufferManager ( ) ; bufManager . addBuffer ( buffer ) ; buffer . addBufferChangedListener ( this ) ; return buffer ; } } static String simpleName ( char [ ] className ) { if ( className == null ) return null ; String simpleName = new String ( unqualifiedName ( className ) ) ; int lastDollar = simpleName . lastIndexOf ( '<CHAR_LIT>' ) ; if ( lastDollar != - <NUM_LIT:1> ) return Util . localTypeName ( simpleName , lastDollar , simpleName . length ( ) ) ; else return simpleName ; } private IType getOuterMostEnclosingType ( ) { IType type = getType ( ) ; IType enclosingType = type . getDeclaringType ( ) ; while ( enclosingType != null ) { type = enclosingType ; enclosingType = type . getDeclaringType ( ) ; } return type ; } public static char [ ] translatedName ( char [ ] name ) { if ( name == null ) return null ; int nameLength = name . length ; char [ ] newName = new char [ nameLength ] ; for ( int i = <NUM_LIT:0> ; i < nameLength ; i ++ ) { if ( name [ i ] == '<CHAR_LIT:/>' ) { newName [ i ] = '<CHAR_LIT:.>' ; } else { newName [ i ] = name [ i ] ; } } return newName ; } static char [ ] [ ] translatedNames ( char [ ] [ ] names ) { if ( names == null ) return null ; int length = names . length ; char [ ] [ ] newNames = new char [ length ] [ ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { newNames [ i ] = translatedName ( names [ i ] ) ; } return newNames ; } static char [ ] unqualifiedName ( char [ ] className ) { if ( className == null ) return null ; int count = <NUM_LIT:0> ; for ( int i = className . length - <NUM_LIT:1> ; i > - <NUM_LIT:1> ; i -- ) { if ( className [ i ] == '<CHAR_LIT:/>' ) { char [ ] name = new char [ count ] ; System . arraycopy ( className , i + <NUM_LIT:1> , name , <NUM_LIT:0> , count ) ; return name ; } count ++ ; } return className ; } public void codeComplete ( int offset , final org . eclipse . jdt . core . ICodeCompletionRequestor requestor ) throws JavaModelException { if ( requestor == null ) { codeComplete ( offset , ( ICompletionRequestor ) null ) ; return ; } codeComplete ( offset , new ICompletionRequestor ( ) { public void acceptAnonymousType ( char [ ] superTypePackageName , char [ ] superTypeName , char [ ] [ ] parameterPackageNames , char [ ] [ ] parameterTypeNames , char [ ] [ ] parameterNames , char [ ] completionName , int modifiers , int completionStart , int completionEnd , int relevance ) { } public void acceptClass ( char [ ] packageName , char [ ] className , char [ ] completionName , int modifiers , int completionStart , int completionEnd , int relevance ) { requestor . acceptClass ( packageName , className , completionName , modifiers , completionStart , completionEnd ) ; } public void acceptError ( IProblem error ) { } public void acceptField ( char [ ] declaringTypePackageName , char [ ] declaringTypeName , char [ ] fieldName , char [ ] typePackageName , char [ ] typeName , char [ ] completionName , int modifiers , int completionStart , int completionEnd , int relevance ) { requestor . acceptField ( declaringTypePackageName , declaringTypeName , fieldName , typePackageName , typeName , completionName , modifiers , completionStart , completionEnd ) ; } public void acceptInterface ( char [ ] packageName , char [ ] interfaceName , char [ ] completionName , int modifiers , int completionStart , int completionEnd , int relevance ) { requestor . acceptInterface ( packageName , interfaceName , completionName , modifiers , completionStart , completionEnd ) ; } public void acceptKeyword ( char [ ] keywordName , int completionStart , int completionEnd , int relevance ) { requestor . acceptKeyword ( keywordName , completionStart , completionEnd ) ; } public void acceptLabel ( char [ ] labelName , int completionStart , int completionEnd , int relevance ) { requestor . acceptLabel ( labelName , completionStart , completionEnd ) ; } public void acceptLocalVariable ( char [ ] localVarName , char [ ] typePackageName , char [ ] typeName , int modifiers , int completionStart , int completionEnd , int relevance ) { } public void acceptMethod ( char [ ] declaringTypePackageName , char [ ] declaringTypeName , char [ ] selector , char [ ] [ ] parameterPackageNames , char [ ] [ ] parameterTypeNames , char [ ] [ ] parameterNames , char [ ] returnTypePackageName , char [ ] returnTypeName , char [ ] completionName , int modifiers , int completionStart , int completionEnd , int relevance ) { requestor . acceptMethod ( declaringTypePackageName , declaringTypeName , selector , parameterPackageNames , parameterTypeNames , returnTypePackageName , returnTypeName , completionName , modifiers , completionStart , completionEnd ) ; } public void acceptMethodDeclaration ( char [ ] declaringTypePackageName , char [ ] declaringTypeName , char [ ] selector , char [ ] [ ] parameterPackageNames , char [ ] [ ] parameterTypeNames , char [ ] [ ] parameterNames , char [ ] returnTypePackageName , char [ ] returnTypeName , char [ ] completionName , int modifiers , int completionStart , int completionEnd , int relevance ) { } public void acceptModifier ( char [ ] modifierName , int completionStart , int completionEnd , int relevance ) { requestor . acceptModifier ( modifierName , completionStart , completionEnd ) ; } public void acceptPackage ( char [ ] packageName , char [ ] completionName , int completionStart , int completionEnd , int relevance ) { requestor . acceptPackage ( packageName , completionName , completionStart , completionEnd ) ; } public void acceptType ( char [ ] packageName , char [ ] typeName , char [ ] completionName , int completionStart , int completionEnd , int relevance ) { requestor . acceptType ( packageName , typeName , completionName , completionStart , completionEnd ) ; } public void acceptVariableName ( char [ ] typePackageName , char [ ] typeName , char [ ] varName , char [ ] completionName , int completionStart , int completionEnd , int relevance ) { } } ) ; } protected IStatus validateExistence ( IResource underlyingResource ) { IStatus status = validateClassFile ( ) ; if ( ! status . isOK ( ) ) return status ; if ( underlyingResource != null ) { if ( ! underlyingResource . isAccessible ( ) ) return newDoesNotExistStatus ( ) ; PackageFragmentRoot root ; if ( ( underlyingResource instanceof IFolder ) && ( root = getPackageFragmentRoot ( ) ) . isArchive ( ) ) { return root . newDoesNotExistStatus ( ) ; } } return JavaModelStatus . VERIFIED_OK ; } } </s>
<s> package org . eclipse . jdt . internal . core ; import org . eclipse . core . runtime . IProgressMonitor ; public class BatchInitializationMonitor implements IProgressMonitor { public ThreadLocal initializeAfterLoadMonitor = new ThreadLocal ( ) ; public String subTaskName = "<STR_LIT>" ; public int worked = <NUM_LIT:0> ; private IProgressMonitor getMonitor ( ) { return ( IProgressMonitor ) this . initializeAfterLoadMonitor . get ( ) ; } public void beginTask ( String name , int totalWork ) { IProgressMonitor monitor = getMonitor ( ) ; if ( monitor != null ) monitor . beginTask ( name , totalWork ) ; } public void done ( ) { IProgressMonitor monitor = getMonitor ( ) ; if ( monitor != null ) monitor . done ( ) ; this . worked = <NUM_LIT:0> ; this . subTaskName = "<STR_LIT>" ; } public void internalWorked ( double work ) { IProgressMonitor monitor = getMonitor ( ) ; if ( monitor != null ) monitor . internalWorked ( work ) ; } public boolean isCanceled ( ) { IProgressMonitor monitor = getMonitor ( ) ; if ( monitor != null ) return monitor . isCanceled ( ) ; return false ; } public void setCanceled ( boolean value ) { IProgressMonitor monitor = getMonitor ( ) ; if ( monitor != null ) monitor . setCanceled ( value ) ; } public void setTaskName ( String name ) { IProgressMonitor monitor = getMonitor ( ) ; if ( monitor != null ) monitor . setTaskName ( name ) ; } public void subTask ( String name ) { IProgressMonitor monitor = getMonitor ( ) ; if ( monitor != null ) monitor . subTask ( name ) ; this . subTaskName = name ; } public void worked ( int work ) { IProgressMonitor monitor = getMonitor ( ) ; if ( monitor != null ) monitor . worked ( work ) ; synchronized ( this ) { this . worked += work ; } } public synchronized int getWorked ( ) { int result = this . worked ; this . worked = <NUM_LIT:0> ; return result ; } } </s>
<s> package org . eclipse . jdt . internal . core ; import java . util . ArrayList ; import java . util . HashMap ; import org . eclipse . jdt . core . * ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . core . compiler . IScanner ; import org . eclipse . jdt . core . compiler . ITerminalSymbols ; import org . eclipse . jdt . core . compiler . InvalidInputException ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; import org . eclipse . jdt . internal . core . util . MementoTokenizer ; public abstract class Member extends SourceRefElement implements IMember { protected Member ( JavaElement parent ) { super ( parent ) ; } protected static boolean areSimilarMethods ( String name1 , String [ ] params1 , String name2 , String [ ] params2 , String [ ] simpleNames1 ) { if ( name1 . equals ( name2 ) ) { int params1Length = params1 . length ; if ( params1Length == params2 . length ) { for ( int i = <NUM_LIT:0> ; i < params1Length ; i ++ ) { String simpleName1 = simpleNames1 == null ? Signature . getSimpleName ( Signature . toString ( Signature . getTypeErasure ( params1 [ i ] ) ) ) : simpleNames1 [ i ] ; String simpleName2 = Signature . getSimpleName ( Signature . toString ( Signature . getTypeErasure ( params2 [ i ] ) ) ) ; if ( ! simpleName1 . equals ( simpleName2 ) ) { return false ; } } return true ; } } return false ; } protected static Object convertConstant ( Constant constant ) { if ( constant == null ) return null ; if ( constant == Constant . NotAConstant ) { return null ; } switch ( constant . typeID ( ) ) { case TypeIds . T_boolean : return constant . booleanValue ( ) ? Boolean . TRUE : Boolean . FALSE ; case TypeIds . T_byte : return new Byte ( constant . byteValue ( ) ) ; case TypeIds . T_char : return new Character ( constant . charValue ( ) ) ; case TypeIds . T_double : return new Double ( constant . doubleValue ( ) ) ; case TypeIds . T_float : return new Float ( constant . floatValue ( ) ) ; case TypeIds . T_int : return new Integer ( constant . intValue ( ) ) ; case TypeIds . T_long : return new Long ( constant . longValue ( ) ) ; case TypeIds . T_short : return new Short ( constant . shortValue ( ) ) ; case TypeIds . T_JavaLangString : return constant . stringValue ( ) ; default : return null ; } } public static IMethod [ ] findMethods ( IMethod method , IMethod [ ] methods ) { String elementName = method . getElementName ( ) ; String [ ] parameters = method . getParameterTypes ( ) ; int paramLength = parameters . length ; String [ ] simpleNames = new String [ paramLength ] ; for ( int i = <NUM_LIT:0> ; i < paramLength ; i ++ ) { String erasure = Signature . getTypeErasure ( parameters [ i ] ) ; simpleNames [ i ] = Signature . getSimpleName ( Signature . toString ( erasure ) ) ; } ArrayList list = new ArrayList ( ) ; for ( int i = <NUM_LIT:0> , length = methods . length ; i < length ; i ++ ) { IMethod existingMethod = methods [ i ] ; if ( areSimilarMethods ( elementName , parameters , existingMethod . getElementName ( ) , existingMethod . getParameterTypes ( ) , simpleNames ) ) { list . add ( existingMethod ) ; } } int size = list . size ( ) ; if ( size == <NUM_LIT:0> ) { return null ; } else { IMethod [ ] result = new IMethod [ size ] ; list . toArray ( result ) ; return result ; } } public String [ ] getCategories ( ) throws JavaModelException { IType type = ( IType ) getAncestor ( IJavaElement . TYPE ) ; if ( type == null ) return CharOperation . NO_STRINGS ; if ( type . isBinary ( ) ) { return CharOperation . NO_STRINGS ; } else { SourceTypeElementInfo info = ( SourceTypeElementInfo ) ( ( SourceType ) type ) . getElementInfo ( ) ; HashMap map = info . getCategories ( ) ; if ( map == null ) return CharOperation . NO_STRINGS ; String [ ] categories = ( String [ ] ) map . get ( this ) ; if ( categories == null ) return CharOperation . NO_STRINGS ; return categories ; } } public IClassFile getClassFile ( ) { IJavaElement element = getParent ( ) ; while ( element instanceof IMember ) { element = element . getParent ( ) ; } if ( element instanceof IClassFile ) { return ( IClassFile ) element ; } return null ; } public IType getDeclaringType ( ) { JavaElement parentElement = ( JavaElement ) getParent ( ) ; if ( parentElement . getElementType ( ) == TYPE ) { return ( IType ) parentElement ; } return null ; } public int getFlags ( ) throws JavaModelException { MemberElementInfo info = ( MemberElementInfo ) getElementInfo ( ) ; return info . getModifiers ( ) ; } public IJavaElement getHandleFromMemento ( String token , MementoTokenizer memento , WorkingCopyOwner workingCopyOwner ) { switch ( token . charAt ( <NUM_LIT:0> ) ) { case JEM_COUNT : return getHandleUpdatingCountFromMemento ( memento , workingCopyOwner ) ; case JEM_TYPE : String typeName ; if ( memento . hasMoreTokens ( ) ) { typeName = memento . nextToken ( ) ; char firstChar = typeName . charAt ( <NUM_LIT:0> ) ; if ( firstChar == JEM_FIELD || firstChar == JEM_INITIALIZER || firstChar == JEM_METHOD || firstChar == JEM_TYPE || firstChar == JEM_COUNT ) { token = typeName ; typeName = "<STR_LIT>" ; } else { token = null ; } } else { typeName = "<STR_LIT>" ; token = null ; } JavaElement type = ( JavaElement ) getType ( typeName , <NUM_LIT:1> ) ; if ( token == null ) { return type . getHandleFromMemento ( memento , workingCopyOwner ) ; } else { return type . getHandleFromMemento ( token , memento , workingCopyOwner ) ; } case JEM_LOCALVARIABLE : if ( ! memento . hasMoreTokens ( ) ) return this ; String varName = memento . nextToken ( ) ; if ( ! memento . hasMoreTokens ( ) ) return this ; memento . nextToken ( ) ; if ( ! memento . hasMoreTokens ( ) ) return this ; int declarationStart = Integer . parseInt ( memento . nextToken ( ) ) ; if ( ! memento . hasMoreTokens ( ) ) return this ; memento . nextToken ( ) ; if ( ! memento . hasMoreTokens ( ) ) return this ; int declarationEnd = Integer . parseInt ( memento . nextToken ( ) ) ; if ( ! memento . hasMoreTokens ( ) ) return this ; memento . nextToken ( ) ; if ( ! memento . hasMoreTokens ( ) ) return this ; int nameStart = Integer . parseInt ( memento . nextToken ( ) ) ; if ( ! memento . hasMoreTokens ( ) ) return this ; memento . nextToken ( ) ; if ( ! memento . hasMoreTokens ( ) ) return this ; int nameEnd = Integer . parseInt ( memento . nextToken ( ) ) ; if ( ! memento . hasMoreTokens ( ) ) return this ; memento . nextToken ( ) ; if ( ! memento . hasMoreTokens ( ) ) return this ; String typeSignature = memento . nextToken ( ) ; return new LocalVariable ( this , varName , declarationStart , declarationEnd , nameStart , nameEnd , typeSignature , null ) ; case JEM_TYPE_PARAMETER : if ( ! memento . hasMoreTokens ( ) ) return this ; String typeParameterName = memento . nextToken ( ) ; JavaElement typeParameter = new TypeParameter ( this , typeParameterName ) ; return typeParameter . getHandleFromMemento ( memento , workingCopyOwner ) ; case JEM_ANNOTATION : if ( ! memento . hasMoreTokens ( ) ) return this ; String annotationName = memento . nextToken ( ) ; JavaElement annotation = new Annotation ( this , annotationName ) ; return annotation . getHandleFromMemento ( memento , workingCopyOwner ) ; } return null ; } protected char getHandleMementoDelimiter ( ) { return JavaElement . JEM_TYPE ; } public Member getOuterMostLocalContext ( ) { IJavaElement current = this ; Member lastLocalContext = null ; parentLoop : while ( true ) { switch ( current . getElementType ( ) ) { case CLASS_FILE : case COMPILATION_UNIT : break parentLoop ; case TYPE : break ; case INITIALIZER : case FIELD : case METHOD : lastLocalContext = ( Member ) current ; break ; } current = current . getParent ( ) ; } return lastLocalContext ; } public ISourceRange getJavadocRange ( ) throws JavaModelException { ISourceRange range = getSourceRange ( ) ; if ( range == null ) return null ; IBuffer buf = null ; if ( isBinary ( ) ) { buf = getClassFile ( ) . getBuffer ( ) ; } else { ICompilationUnit compilationUnit = getCompilationUnit ( ) ; if ( ! compilationUnit . isConsistent ( ) ) { return null ; } buf = compilationUnit . getBuffer ( ) ; } final int start = range . getOffset ( ) ; final int length = range . getLength ( ) ; if ( length > <NUM_LIT:0> && buf . getChar ( start ) == '<CHAR_LIT:/>' ) { IScanner scanner = ToolFactory . createScanner ( true , false , false , false ) ; try { scanner . setSource ( buf . getText ( start , length ) . toCharArray ( ) ) ; int docOffset = - <NUM_LIT:1> ; int docEnd = - <NUM_LIT:1> ; int terminal = scanner . getNextToken ( ) ; loop : while ( true ) { switch ( terminal ) { case ITerminalSymbols . TokenNameCOMMENT_JAVADOC : docOffset = scanner . getCurrentTokenStartPosition ( ) ; docEnd = scanner . getCurrentTokenEndPosition ( ) + <NUM_LIT:1> ; terminal = scanner . getNextToken ( ) ; break ; case ITerminalSymbols . TokenNameCOMMENT_LINE : case ITerminalSymbols . TokenNameCOMMENT_BLOCK : terminal = scanner . getNextToken ( ) ; continue loop ; default : break loop ; } } if ( docOffset != - <NUM_LIT:1> ) { return new SourceRange ( docOffset + start , docEnd - docOffset ) ; } } catch ( InvalidInputException ex ) { } catch ( IndexOutOfBoundsException e ) { } } return null ; } public ISourceRange getNameRange ( ) throws JavaModelException { MemberElementInfo info = ( MemberElementInfo ) getElementInfo ( ) ; return new SourceRange ( info . getNameSourceStart ( ) , info . getNameSourceEnd ( ) - info . getNameSourceStart ( ) + <NUM_LIT:1> ) ; } public IType getType ( String typeName , int count ) { if ( isBinary ( ) ) { throw new IllegalArgumentException ( "<STR_LIT>" + toStringWithAncestors ( ) ) ; } else { SourceType type = new SourceType ( this , typeName ) ; type . occurrenceCount = count ; return type ; } } public ITypeRoot getTypeRoot ( ) { IJavaElement element = getParent ( ) ; while ( element instanceof IMember ) { element = element . getParent ( ) ; } return ( ITypeRoot ) element ; } public boolean isBinary ( ) { return false ; } protected boolean isMainMethod ( IMethod method ) throws JavaModelException { if ( "<STR_LIT>" . equals ( method . getElementName ( ) ) && Signature . SIG_VOID . equals ( method . getReturnType ( ) ) ) { int flags = method . getFlags ( ) ; if ( Flags . isStatic ( flags ) && Flags . isPublic ( flags ) ) { String [ ] paramTypes = method . getParameterTypes ( ) ; if ( paramTypes . length == <NUM_LIT:1> ) { String typeSignature = Signature . toString ( paramTypes [ <NUM_LIT:0> ] ) ; return "<STR_LIT>" . equals ( Signature . getSimpleName ( typeSignature ) ) ; } } } return false ; } public boolean isReadOnly ( ) { return getClassFile ( ) != null ; } public String readableName ( ) { IJavaElement declaringType = getDeclaringType ( ) ; if ( declaringType != null ) { String declaringName = ( ( JavaElement ) getDeclaringType ( ) ) . readableName ( ) ; StringBuffer buffer = new StringBuffer ( declaringName ) ; buffer . append ( '<CHAR_LIT:.>' ) ; buffer . append ( getElementName ( ) ) ; return buffer . toString ( ) ; } else { return super . readableName ( ) ; } } } </s>
<s> package org . eclipse . jdt . internal . core ; import java . util . ArrayList ; import org . eclipse . jdt . core . IJavaElement ; import org . eclipse . jdt . core . IParent ; import org . eclipse . jdt . core . IRegion ; public class Region implements IRegion { protected ArrayList rootElements ; public Region ( ) { this . rootElements = new ArrayList ( <NUM_LIT:1> ) ; } public void add ( IJavaElement element ) { if ( ! contains ( element ) ) { removeAllChildren ( element ) ; this . rootElements . add ( element ) ; this . rootElements . trimToSize ( ) ; } } public boolean contains ( IJavaElement element ) { int size = this . rootElements . size ( ) ; ArrayList parents = getAncestors ( element ) ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) { IJavaElement aTop = ( IJavaElement ) this . rootElements . get ( i ) ; if ( aTop . equals ( element ) ) { return true ; } for ( int j = <NUM_LIT:0> , pSize = parents . size ( ) ; j < pSize ; j ++ ) { if ( aTop . equals ( parents . get ( j ) ) ) { return true ; } } } return false ; } private ArrayList getAncestors ( IJavaElement element ) { ArrayList parents = new ArrayList ( ) ; IJavaElement parent = element . getParent ( ) ; while ( parent != null ) { parents . add ( parent ) ; parent = parent . getParent ( ) ; } parents . trimToSize ( ) ; return parents ; } public IJavaElement [ ] getElements ( ) { int size = this . rootElements . size ( ) ; IJavaElement [ ] roots = new IJavaElement [ size ] ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) { roots [ i ] = ( IJavaElement ) this . rootElements . get ( i ) ; } return roots ; } public boolean remove ( IJavaElement element ) { removeAllChildren ( element ) ; return this . rootElements . remove ( element ) ; } protected void removeAllChildren ( IJavaElement element ) { if ( element instanceof IParent ) { ArrayList newRootElements = new ArrayList ( ) ; for ( int i = <NUM_LIT:0> , size = this . rootElements . size ( ) ; i < size ; i ++ ) { IJavaElement currentRoot = ( IJavaElement ) this . rootElements . get ( i ) ; IJavaElement parent = currentRoot . getParent ( ) ; boolean isChild = false ; while ( parent != null ) { if ( parent . equals ( element ) ) { isChild = true ; break ; } parent = parent . getParent ( ) ; } if ( ! isChild ) { newRootElements . add ( currentRoot ) ; } } this . rootElements = newRootElements ; } } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; IJavaElement [ ] roots = getElements ( ) ; buffer . append ( '<CHAR_LIT:[>' ) ; for ( int i = <NUM_LIT:0> ; i < roots . length ; i ++ ) { buffer . append ( roots [ i ] . getElementName ( ) ) ; if ( i < ( roots . length - <NUM_LIT:1> ) ) { buffer . append ( "<STR_LIT:U+002CU+0020>" ) ; } } buffer . append ( '<CHAR_LIT:]>' ) ; return buffer . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . core ; import java . io . File ; import org . eclipse . core . resources . IResource ; import org . eclipse . core . runtime . IPath ; import org . eclipse . jdt . core . IJavaElement ; import org . eclipse . jdt . core . IPackageFragmentRoot ; import org . eclipse . jdt . core . JavaModelException ; public class ExternalPackageFragmentRoot extends PackageFragmentRoot { protected final IPath externalPath ; protected ExternalPackageFragmentRoot ( IPath externalPath , JavaProject project ) { super ( null , project ) ; this . externalPath = externalPath ; } protected ExternalPackageFragmentRoot ( IResource linkedFolder , IPath externalPath , JavaProject project ) { super ( linkedFolder , project ) ; this . externalPath = externalPath == null ? linkedFolder . getLocation ( ) : externalPath ; } protected int determineKind ( IResource underlyingResource ) { return IPackageFragmentRoot . K_BINARY ; } public boolean equals ( Object o ) { if ( this == o ) return true ; if ( o instanceof ExternalPackageFragmentRoot ) { ExternalPackageFragmentRoot other = ( ExternalPackageFragmentRoot ) o ; return this . externalPath . equals ( other . externalPath ) ; } return false ; } public String getElementName ( ) { return this . externalPath . lastSegment ( ) ; } public int getKind ( ) { return IPackageFragmentRoot . K_BINARY ; } int internalKind ( ) throws JavaModelException { return IPackageFragmentRoot . K_BINARY ; } public IPath getPath ( ) { return this . externalPath ; } public IResource getUnderlyingResource ( ) throws JavaModelException { return null ; } public int hashCode ( ) { return this . externalPath . hashCode ( ) ; } public boolean isExternal ( ) { return true ; } public IResource resource ( PackageFragmentRoot root ) { if ( this . resource == null ) return this . resource = JavaModelManager . getExternalManager ( ) . getFolder ( this . externalPath ) ; return super . resource ( root ) ; } protected boolean resourceExists ( IResource underlyingResource ) { if ( underlyingResource == null ) return false ; IPath location = underlyingResource . getLocation ( ) ; if ( location == null ) return false ; File file = location . toFile ( ) ; if ( file == null ) return false ; return file . exists ( ) ; } protected void toStringAncestors ( StringBuffer buffer ) { } } </s>
<s> package org . eclipse . jdt . internal . core ; import java . io . File ; import java . io . IOException ; import org . eclipse . core . resources . IFile ; import org . eclipse . core . resources . IProject ; import org . eclipse . core . runtime . CoreException ; import org . eclipse . jdt . core . IJavaElement ; import org . eclipse . jdt . core . IJavaProject ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . env . ICompilationUnit ; import org . eclipse . jdt . internal . compiler . util . Util ; public class BasicCompilationUnit implements ICompilationUnit { protected char [ ] contents ; protected char [ ] fileName ; protected char [ ] [ ] packageName ; protected char [ ] mainTypeName ; protected String encoding ; public BasicCompilationUnit ( char [ ] contents , char [ ] [ ] packageName , String fileName ) { this . contents = contents ; this . fileName = fileName . toCharArray ( ) ; this . packageName = packageName ; } public BasicCompilationUnit ( char [ ] contents , char [ ] [ ] packageName , String fileName , String encoding ) { this ( contents , packageName , fileName ) ; this . encoding = encoding ; } public BasicCompilationUnit ( char [ ] contents , char [ ] [ ] packageName , String fileName , IJavaElement javaElement ) { this ( contents , packageName , fileName ) ; initEncoding ( javaElement ) ; } private void initEncoding ( IJavaElement javaElement ) { if ( javaElement != null ) { try { IJavaProject javaProject = javaElement . getJavaProject ( ) ; switch ( javaElement . getElementType ( ) ) { case IJavaElement . COMPILATION_UNIT : IFile file = ( IFile ) javaElement . getResource ( ) ; if ( file != null ) { this . encoding = file . getCharset ( ) ; break ; } default : IProject project = ( IProject ) javaProject . getResource ( ) ; if ( project != null ) { this . encoding = project . getDefaultCharset ( ) ; } break ; } } catch ( CoreException e1 ) { this . encoding = null ; } } else { this . encoding = null ; } } public char [ ] getContents ( ) { if ( this . contents != null ) return this . contents ; try { return Util . getFileCharContent ( new File ( new String ( this . fileName ) ) , this . encoding ) ; } catch ( IOException e ) { } return CharOperation . NO_CHAR ; } public char [ ] getFileName ( ) { return this . fileName ; } public char [ ] getMainTypeName ( ) { if ( this . mainTypeName == null ) { int start = CharOperation . lastIndexOf ( '<CHAR_LIT:/>' , this . fileName ) + <NUM_LIT:1> ; if ( start == <NUM_LIT:0> || start < CharOperation . lastIndexOf ( '<STR_LIT:\\>' , this . fileName ) ) start = CharOperation . lastIndexOf ( '<STR_LIT:\\>' , this . fileName ) + <NUM_LIT:1> ; int separator = CharOperation . indexOf ( '<CHAR_LIT>' , this . fileName ) + <NUM_LIT:1> ; if ( separator > start ) start = separator ; int end = CharOperation . lastIndexOf ( '<CHAR_LIT>' , this . fileName ) ; if ( end == - <NUM_LIT:1> || ! Util . isClassFileName ( this . fileName ) ) { end = CharOperation . lastIndexOf ( '<CHAR_LIT:.>' , this . fileName ) ; if ( end == - <NUM_LIT:1> ) end = this . fileName . length ; } this . mainTypeName = CharOperation . subarray ( this . fileName , start , end ) ; } return this . mainTypeName ; } public char [ ] [ ] getPackageName ( ) { return this . packageName ; } public String toString ( ) { return "<STR_LIT>" + new String ( this . fileName ) ; } } </s>
<s> package org . eclipse . jdt . internal . core ; import org . eclipse . core . runtime . CoreException ; import org . eclipse . core . runtime . IPath ; import org . eclipse . core . runtime . IStatus ; import org . eclipse . core . runtime . Status ; import org . eclipse . jdt . core . ClasspathContainerInitializer ; import org . eclipse . jdt . core . IClasspathContainer ; import org . eclipse . jdt . core . IJavaElement ; import org . eclipse . jdt . core . IJavaModelStatus ; import org . eclipse . jdt . core . IJavaModelStatusConstants ; import org . eclipse . jdt . core . IJavaProject ; import org . eclipse . jdt . core . IPackageFragment ; import org . eclipse . jdt . core . JavaCore ; import org . eclipse . jdt . core . JavaModelException ; import org . eclipse . jdt . internal . core . util . Messages ; public class JavaModelStatus extends Status implements IJavaModelStatus , IJavaModelStatusConstants { protected IJavaElement [ ] elements = new IJavaElement [ <NUM_LIT:0> ] ; protected IPath path ; protected String string ; protected final static IStatus [ ] NO_CHILDREN = new IStatus [ ] { } ; protected IStatus [ ] children = NO_CHILDREN ; public static final IJavaModelStatus VERIFIED_OK = new JavaModelStatus ( OK , OK , Messages . status_OK ) ; public JavaModelStatus ( ) { super ( ERROR , JavaCore . PLUGIN_ID , <NUM_LIT:0> , "<STR_LIT>" , null ) ; } public JavaModelStatus ( int code ) { super ( ERROR , JavaCore . PLUGIN_ID , code , "<STR_LIT>" , null ) ; this . elements = JavaElement . NO_ELEMENTS ; } public JavaModelStatus ( int code , IJavaElement [ ] elements ) { super ( ERROR , JavaCore . PLUGIN_ID , code , "<STR_LIT>" , null ) ; this . elements = elements ; this . path = null ; } public JavaModelStatus ( int code , String string ) { this ( ERROR , code , string ) ; } public JavaModelStatus ( int severity , int code , String string ) { super ( severity , JavaCore . PLUGIN_ID , code , "<STR_LIT>" , null ) ; this . elements = JavaElement . NO_ELEMENTS ; this . path = null ; this . string = string ; } public JavaModelStatus ( int code , Throwable throwable ) { super ( ERROR , JavaCore . PLUGIN_ID , code , "<STR_LIT>" , throwable ) ; this . elements = JavaElement . NO_ELEMENTS ; } public JavaModelStatus ( int code , IPath path ) { super ( ERROR , JavaCore . PLUGIN_ID , code , "<STR_LIT>" , null ) ; this . elements = JavaElement . NO_ELEMENTS ; this . path = path ; } public JavaModelStatus ( int code , IJavaElement element ) { this ( code , new IJavaElement [ ] { element } ) ; } public JavaModelStatus ( int code , IJavaElement element , String string ) { this ( code , new IJavaElement [ ] { element } ) ; this . string = string ; } public JavaModelStatus ( int code , IJavaElement element , IPath path ) { this ( code , new IJavaElement [ ] { element } ) ; this . path = path ; } public JavaModelStatus ( int code , IJavaElement element , IPath path , String string ) { this ( code , new IJavaElement [ ] { element } ) ; this . path = path ; this . string = string ; } public JavaModelStatus ( int severity , int code , IJavaElement element , IPath path , String msg ) { super ( severity , JavaCore . PLUGIN_ID , code , "<STR_LIT>" , null ) ; this . elements = new IJavaElement [ ] { element } ; this . path = path ; this . string = msg ; } public JavaModelStatus ( CoreException coreException ) { super ( ERROR , JavaCore . PLUGIN_ID , CORE_EXCEPTION , "<STR_LIT>" , coreException ) ; this . elements = JavaElement . NO_ELEMENTS ; } protected int getBits ( ) { int severity = <NUM_LIT:1> << ( getCode ( ) % <NUM_LIT:100> / <NUM_LIT> ) ; int category = <NUM_LIT:1> << ( ( getCode ( ) / <NUM_LIT:100> ) + <NUM_LIT:3> ) ; return severity | category ; } public IStatus [ ] getChildren ( ) { return this . children ; } public IJavaElement [ ] getElements ( ) { return this . elements ; } public String getMessage ( ) { Throwable exception = getException ( ) ; if ( exception == null ) { switch ( getCode ( ) ) { case CORE_EXCEPTION : return Messages . status_coreException ; case BUILDER_INITIALIZATION_ERROR : return Messages . build_initializationError ; case BUILDER_SERIALIZATION_ERROR : return Messages . build_serializationError ; case DEVICE_PATH : return Messages . bind ( Messages . status_cannotUseDeviceOnPath , getPath ( ) . toString ( ) ) ; case DOM_EXCEPTION : return Messages . status_JDOMError ; case ELEMENT_DOES_NOT_EXIST : return Messages . bind ( Messages . element_doesNotExist , ( ( JavaElement ) this . elements [ <NUM_LIT:0> ] ) . toStringWithAncestors ( ) ) ; case ELEMENT_NOT_ON_CLASSPATH : return Messages . bind ( Messages . element_notOnClasspath , ( ( JavaElement ) this . elements [ <NUM_LIT:0> ] ) . toStringWithAncestors ( ) ) ; case EVALUATION_ERROR : return Messages . bind ( Messages . status_evaluationError , this . string ) ; case INDEX_OUT_OF_BOUNDS : return Messages . status_indexOutOfBounds ; case INVALID_CONTENTS : return Messages . status_invalidContents ; case INVALID_DESTINATION : return Messages . bind ( Messages . status_invalidDestination , ( ( JavaElement ) this . elements [ <NUM_LIT:0> ] ) . toStringWithAncestors ( ) ) ; case INVALID_ELEMENT_TYPES : StringBuffer buff = new StringBuffer ( Messages . operation_notSupported ) ; for ( int i = <NUM_LIT:0> ; i < this . elements . length ; i ++ ) { if ( i > <NUM_LIT:0> ) { buff . append ( "<STR_LIT:U+002CU+0020>" ) ; } buff . append ( ( ( JavaElement ) this . elements [ i ] ) . toStringWithAncestors ( ) ) ; } return buff . toString ( ) ; case INVALID_NAME : return Messages . bind ( Messages . status_invalidName , this . string ) ; case INVALID_PACKAGE : return Messages . bind ( Messages . status_invalidPackage , this . string ) ; case INVALID_PATH : if ( this . string != null ) { return this . string ; } else { return Messages . bind ( Messages . status_invalidPath , new String [ ] { getPath ( ) == null ? "<STR_LIT:null>" : getPath ( ) . toString ( ) } ) ; } case INVALID_PROJECT : return Messages . bind ( Messages . status_invalidProject , this . string ) ; case INVALID_RESOURCE : return Messages . bind ( Messages . status_invalidResource , this . string ) ; case INVALID_RESOURCE_TYPE : return Messages . bind ( Messages . status_invalidResourceType , this . string ) ; case INVALID_SIBLING : if ( this . string != null ) { return Messages . bind ( Messages . status_invalidSibling , this . string ) ; } else { return Messages . bind ( Messages . status_invalidSibling , ( ( JavaElement ) this . elements [ <NUM_LIT:0> ] ) . toStringWithAncestors ( ) ) ; } case IO_EXCEPTION : return Messages . status_IOException ; case NAME_COLLISION : if ( this . elements != null && this . elements . length > <NUM_LIT:0> ) { IJavaElement element = this . elements [ <NUM_LIT:0> ] ; if ( element instanceof PackageFragment && ( ( PackageFragment ) element ) . isDefaultPackage ( ) ) { return Messages . operation_cannotRenameDefaultPackage ; } } if ( this . string != null ) { return this . string ; } else { return Messages . bind ( Messages . status_nameCollision , "<STR_LIT>" ) ; } case NO_ELEMENTS_TO_PROCESS : return Messages . operation_needElements ; case NULL_NAME : return Messages . operation_needName ; case NULL_PATH : return Messages . operation_needPath ; case NULL_STRING : return Messages . operation_needString ; case PATH_OUTSIDE_PROJECT : return Messages . bind ( Messages . operation_pathOutsideProject , new String [ ] { this . string , ( ( JavaElement ) this . elements [ <NUM_LIT:0> ] ) . toStringWithAncestors ( ) } ) ; case READ_ONLY : IJavaElement element = this . elements [ <NUM_LIT:0> ] ; String name = element . getElementName ( ) ; if ( element instanceof IPackageFragment && name . equals ( IPackageFragment . DEFAULT_PACKAGE_NAME ) ) { return Messages . status_defaultPackageReadOnly ; } return Messages . bind ( Messages . status_readOnly , name ) ; case RELATIVE_PATH : return Messages . bind ( Messages . operation_needAbsolutePath , getPath ( ) . toString ( ) ) ; case TARGET_EXCEPTION : return Messages . status_targetException ; case UPDATE_CONFLICT : return Messages . status_updateConflict ; case NO_LOCAL_CONTENTS : return Messages . bind ( Messages . status_noLocalContents , getPath ( ) . toString ( ) ) ; case CP_CONTAINER_PATH_UNBOUND : IJavaProject javaProject = ( IJavaProject ) this . elements [ <NUM_LIT:0> ] ; ClasspathContainerInitializer initializer = JavaCore . getClasspathContainerInitializer ( this . path . segment ( <NUM_LIT:0> ) ) ; String description = null ; if ( initializer != null ) description = initializer . getDescription ( this . path , javaProject ) ; if ( description == null ) description = this . path . makeRelative ( ) . toString ( ) ; return Messages . bind ( Messages . classpath_unboundContainerPath , new String [ ] { description , javaProject . getElementName ( ) } ) ; case INVALID_CP_CONTAINER_ENTRY : javaProject = ( IJavaProject ) this . elements [ <NUM_LIT:0> ] ; IClasspathContainer container = null ; description = null ; try { container = JavaCore . getClasspathContainer ( this . path , javaProject ) ; } catch ( JavaModelException e ) { } if ( container == null ) { initializer = JavaCore . getClasspathContainerInitializer ( this . path . segment ( <NUM_LIT:0> ) ) ; if ( initializer != null ) description = initializer . getDescription ( this . path , javaProject ) ; } else { description = container . getDescription ( ) ; } if ( description == null ) description = this . path . makeRelative ( ) . toString ( ) ; return Messages . bind ( Messages . classpath_invalidContainer , new String [ ] { description , javaProject . getElementName ( ) } ) ; case CP_VARIABLE_PATH_UNBOUND : javaProject = ( IJavaProject ) this . elements [ <NUM_LIT:0> ] ; return Messages . bind ( Messages . classpath_unboundVariablePath , new String [ ] { this . path . makeRelative ( ) . toString ( ) , javaProject . getElementName ( ) } ) ; case CLASSPATH_CYCLE : javaProject = ( IJavaProject ) this . elements [ <NUM_LIT:0> ] ; return Messages . bind ( Messages . classpath_cycle , javaProject . getElementName ( ) ) ; case DISABLED_CP_EXCLUSION_PATTERNS : javaProject = ( IJavaProject ) this . elements [ <NUM_LIT:0> ] ; String projectName = javaProject . getElementName ( ) ; IPath newPath = this . path ; if ( this . path . segment ( <NUM_LIT:0> ) . toString ( ) . equals ( projectName ) ) { newPath = this . path . removeFirstSegments ( <NUM_LIT:1> ) ; } return Messages . bind ( Messages . classpath_disabledInclusionExclusionPatterns , new String [ ] { newPath . makeRelative ( ) . toString ( ) , projectName } ) ; case DISABLED_CP_MULTIPLE_OUTPUT_LOCATIONS : javaProject = ( IJavaProject ) this . elements [ <NUM_LIT:0> ] ; projectName = javaProject . getElementName ( ) ; newPath = this . path ; if ( this . path . segment ( <NUM_LIT:0> ) . toString ( ) . equals ( projectName ) ) { newPath = this . path . removeFirstSegments ( <NUM_LIT:1> ) ; } return Messages . bind ( Messages . classpath_disabledMultipleOutputLocations , new String [ ] { newPath . makeRelative ( ) . toString ( ) , projectName } ) ; case CANNOT_RETRIEVE_ATTACHED_JAVADOC : if ( this . elements != null && this . elements . length == <NUM_LIT:1> ) { if ( this . string != null ) { return Messages . bind ( Messages . status_cannot_retrieve_attached_javadoc , ( ( JavaElement ) this . elements [ <NUM_LIT:0> ] ) . toStringWithAncestors ( ) , this . string ) ; } return Messages . bind ( Messages . status_cannot_retrieve_attached_javadoc , ( ( JavaElement ) this . elements [ <NUM_LIT:0> ] ) . toStringWithAncestors ( ) , "<STR_LIT>" ) ; } if ( this . string != null ) { return Messages . bind ( Messages . status_cannot_retrieve_attached_javadoc , this . string , "<STR_LIT>" ) ; } break ; case UNKNOWN_JAVADOC_FORMAT : return Messages . bind ( Messages . status_unknown_javadoc_format , ( ( JavaElement ) this . elements [ <NUM_LIT:0> ] ) . toStringWithAncestors ( ) ) ; case DEPRECATED_VARIABLE : javaProject = ( IJavaProject ) this . elements [ <NUM_LIT:0> ] ; return Messages . bind ( Messages . classpath_deprecated_variable , new String [ ] { this . path . segment ( <NUM_LIT:0> ) . toString ( ) , javaProject . getElementName ( ) , this . string } ) ; } if ( this . string != null ) { return this . string ; } else { return "<STR_LIT>" ; } } else { String message = exception . getMessage ( ) ; if ( message != null ) { return message ; } else { return exception . toString ( ) ; } } } public IPath getPath ( ) { return this . path ; } public int getSeverity ( ) { if ( this . children == NO_CHILDREN ) return super . getSeverity ( ) ; int severity = - <NUM_LIT:1> ; for ( int i = <NUM_LIT:0> , max = this . children . length ; i < max ; i ++ ) { int childrenSeverity = this . children [ i ] . getSeverity ( ) ; if ( childrenSeverity > severity ) { severity = childrenSeverity ; } } return severity ; } public String getString ( ) { return this . string ; } public boolean isDoesNotExist ( ) { int code = getCode ( ) ; return code == ELEMENT_DOES_NOT_EXIST || code == ELEMENT_NOT_ON_CLASSPATH ; } public boolean isMultiStatus ( ) { return this . children != NO_CHILDREN ; } public boolean isOK ( ) { return getCode ( ) == OK ; } public boolean matches ( int mask ) { if ( ! isMultiStatus ( ) ) { return matches ( this , mask ) ; } else { for ( int i = <NUM_LIT:0> , max = this . children . length ; i < max ; i ++ ) { if ( matches ( ( JavaModelStatus ) this . children [ i ] , mask ) ) return true ; } return false ; } } protected boolean matches ( JavaModelStatus status , int mask ) { int severityMask = mask & <NUM_LIT> ; int categoryMask = mask & ~ <NUM_LIT> ; int bits = status . getBits ( ) ; return ( ( severityMask == <NUM_LIT:0> ) || ( bits & severityMask ) != <NUM_LIT:0> ) && ( ( categoryMask == <NUM_LIT:0> ) || ( bits & categoryMask ) != <NUM_LIT:0> ) ; } public static IJavaModelStatus newMultiStatus ( IJavaModelStatus [ ] children ) { JavaModelStatus jms = new JavaModelStatus ( ) ; jms . children = children ; return jms ; } public String toString ( ) { if ( this == VERIFIED_OK ) { return "<STR_LIT>" ; } StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( "<STR_LIT>" ) ; buffer . append ( getMessage ( ) ) ; buffer . append ( "<STR_LIT:]>" ) ; return buffer . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . core ; import org . eclipse . jdt . core . IBuffer ; import org . eclipse . jdt . core . ICompilationUnit ; import org . eclipse . jdt . core . WorkingCopyOwner ; public class BufferFactoryWrapper extends WorkingCopyOwner { public org . eclipse . jdt . core . IBufferFactory factory ; private BufferFactoryWrapper ( org . eclipse . jdt . core . IBufferFactory factory ) { this . factory = factory ; } public static WorkingCopyOwner create ( org . eclipse . jdt . core . IBufferFactory factory ) { return new BufferFactoryWrapper ( factory ) ; } public IBuffer createBuffer ( ICompilationUnit workingCopy ) { if ( this . factory == null ) return super . createBuffer ( workingCopy ) ; return this . factory . createBuffer ( workingCopy ) ; } public boolean equals ( Object obj ) { if ( ! ( obj instanceof BufferFactoryWrapper ) ) return false ; BufferFactoryWrapper other = ( BufferFactoryWrapper ) obj ; if ( this . factory == null ) return other . factory == null ; return this . factory . equals ( other . factory ) ; } public int hashCode ( ) { if ( this . factory == null ) return <NUM_LIT:0> ; return this . factory . hashCode ( ) ; } public String toString ( ) { return "<STR_LIT>" + this . factory ; } } </s>
<s> package org . eclipse . jdt . internal . core ; import java . io . ByteArrayOutputStream ; import java . io . File ; import java . io . IOException ; import java . io . InputStream ; import java . io . OutputStreamWriter ; import java . io . UnsupportedEncodingException ; import java . util . ArrayList ; import java . util . HashMap ; import java . util . HashSet ; import java . util . Iterator ; import java . util . List ; import java . util . Map ; import java . util . zip . ZipEntry ; import java . util . zip . ZipFile ; import org . eclipse . core . resources . IContainer ; import org . eclipse . core . resources . IFile ; import org . eclipse . core . resources . IProject ; import org . eclipse . core . resources . IResource ; import org . eclipse . core . resources . IWorkspaceRoot ; import org . eclipse . core . resources . ResourcesPlugin ; import org . eclipse . core . runtime . CoreException ; import org . eclipse . core . runtime . IPath ; import org . eclipse . core . runtime . IStatus ; import org . eclipse . core . runtime . Path ; import org . eclipse . jdt . core . IAccessRule ; import org . eclipse . jdt . core . IClasspathAttribute ; import org . eclipse . jdt . core . IClasspathContainer ; import org . eclipse . jdt . core . IClasspathEntry ; import org . eclipse . jdt . core . IJavaModelStatus ; import org . eclipse . jdt . core . IJavaModelStatusConstants ; import org . eclipse . jdt . core . IJavaProject ; import org . eclipse . jdt . core . IPackageFragmentRoot ; import org . eclipse . jdt . core . JavaCore ; import org . eclipse . jdt . core . JavaModelException ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . core . compiler . IProblem ; import org . eclipse . jdt . internal . compiler . env . AccessRestriction ; import org . eclipse . jdt . internal . compiler . env . AccessRule ; import org . eclipse . jdt . internal . compiler . env . AccessRuleSet ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . util . ManifestAnalyzer ; import org . eclipse . jdt . internal . core . util . Messages ; import org . eclipse . jdt . internal . core . util . Util ; import org . w3c . dom . DOMException ; import org . w3c . dom . Element ; import org . w3c . dom . NamedNodeMap ; import org . w3c . dom . Node ; import org . w3c . dom . NodeList ; import org . w3c . dom . Text ; public class ClasspathEntry implements IClasspathEntry { public static class AssertionFailedException extends RuntimeException { private static final long serialVersionUID = - <NUM_LIT> ; public AssertionFailedException ( String message ) { super ( message ) ; } } public static final String TAG_CLASSPATH = "<STR_LIT>" ; public static final String TAG_CLASSPATHENTRY = "<STR_LIT>" ; public static final String TAG_REFERENCED_ENTRY = "<STR_LIT>" ; public static final String TAG_OUTPUT = "<STR_LIT>" ; public static final String TAG_KIND = "<STR_LIT>" ; public static final String TAG_PATH = "<STR_LIT:path>" ; public static final String TAG_SOURCEPATH = "<STR_LIT>" ; public static final String TAG_ROOTPATH = "<STR_LIT>" ; public static final String TAG_EXPORTED = "<STR_LIT>" ; public static final String TAG_INCLUDING = "<STR_LIT>" ; public static final String TAG_EXCLUDING = "<STR_LIT>" ; public static final String TAG_ATTRIBUTES = "<STR_LIT>" ; public static final String TAG_ATTRIBUTE = "<STR_LIT>" ; public static final String TAG_ATTRIBUTE_NAME = "<STR_LIT:name>" ; public static final String TAG_ATTRIBUTE_VALUE = "<STR_LIT:value>" ; public static final String TAG_COMBINE_ACCESS_RULES = "<STR_LIT>" ; public static final String TAG_ACCESS_RULES = "<STR_LIT>" ; public static final String TAG_ACCESS_RULE = "<STR_LIT>" ; public static final String TAG_PATTERN = "<STR_LIT>" ; public static final String TAG_ACCESSIBLE = "<STR_LIT>" ; public static final String TAG_NON_ACCESSIBLE = "<STR_LIT>" ; public static final String TAG_DISCOURAGED = "<STR_LIT>" ; public static final String TAG_IGNORE_IF_BETTER = "<STR_LIT>" ; public int entryKind ; public int contentKind ; public IPath path ; private IPath [ ] inclusionPatterns ; private char [ ] [ ] fullInclusionPatternChars ; private IPath [ ] exclusionPatterns ; private char [ ] [ ] fullExclusionPatternChars ; private final static char [ ] [ ] UNINIT_PATTERNS = new char [ ] [ ] { "<STR_LIT>" . toCharArray ( ) } ; public final static ClasspathEntry [ ] NO_ENTRIES = new ClasspathEntry [ <NUM_LIT:0> ] ; private final static IPath [ ] NO_PATHS = new IPath [ <NUM_LIT:0> ] ; private final static IWorkspaceRoot workspaceRoot = ResourcesPlugin . getWorkspace ( ) . getRoot ( ) ; private boolean combineAccessRules ; private String rootID ; private AccessRuleSet accessRuleSet ; static class UnknownXmlElements { String [ ] attributes ; ArrayList children ; } public final static IPath [ ] INCLUDE_ALL = { } ; public final static IPath [ ] EXCLUDE_NONE = { } ; public final static IClasspathAttribute [ ] NO_EXTRA_ATTRIBUTES = { } ; public final static IAccessRule [ ] NO_ACCESS_RULES = { } ; public IPath sourceAttachmentPath ; public IPath sourceAttachmentRootPath ; public IClasspathEntry referencingEntry ; public IPath specificOutputLocation ; public static final int K_OUTPUT = <NUM_LIT:10> ; public static final String DOT_DOT = "<STR_LIT>" ; public boolean isExported ; public IClasspathAttribute [ ] extraAttributes ; public ClasspathEntry ( int contentKind , int entryKind , IPath path , IPath [ ] inclusionPatterns , IPath [ ] exclusionPatterns , IPath sourceAttachmentPath , IPath sourceAttachmentRootPath , IPath specificOutputLocation , boolean isExported , IAccessRule [ ] accessRules , boolean combineAccessRules , IClasspathAttribute [ ] extraAttributes ) { this ( contentKind , entryKind , path , inclusionPatterns , exclusionPatterns , sourceAttachmentPath , sourceAttachmentRootPath , specificOutputLocation , null , isExported , accessRules , combineAccessRules , extraAttributes ) ; } public ClasspathEntry ( int contentKind , int entryKind , IPath path , IPath [ ] inclusionPatterns , IPath [ ] exclusionPatterns , IPath sourceAttachmentPath , IPath sourceAttachmentRootPath , IPath specificOutputLocation , IClasspathEntry referencingEntry , boolean isExported , IAccessRule [ ] accessRules , boolean combineAccessRules , IClasspathAttribute [ ] extraAttributes ) { this . contentKind = contentKind ; this . entryKind = entryKind ; this . path = path ; this . inclusionPatterns = inclusionPatterns ; this . exclusionPatterns = exclusionPatterns ; this . referencingEntry = referencingEntry ; int length ; if ( accessRules != null && ( length = accessRules . length ) > <NUM_LIT:0> ) { AccessRule [ ] rules = new AccessRule [ length ] ; System . arraycopy ( accessRules , <NUM_LIT:0> , rules , <NUM_LIT:0> , length ) ; byte classpathEntryType ; String classpathEntryName ; JavaModelManager manager = JavaModelManager . getJavaModelManager ( ) ; if ( this . entryKind == CPE_PROJECT || this . entryKind == CPE_SOURCE ) { classpathEntryType = AccessRestriction . PROJECT ; classpathEntryName = manager . intern ( getPath ( ) . segment ( <NUM_LIT:0> ) ) ; } else { classpathEntryType = AccessRestriction . LIBRARY ; Object target = JavaModel . getWorkspaceTarget ( path ) ; if ( target == null ) { classpathEntryName = manager . intern ( path . toOSString ( ) ) ; } else { classpathEntryName = manager . intern ( path . makeRelative ( ) . toString ( ) ) ; } } this . accessRuleSet = new AccessRuleSet ( rules , classpathEntryType , classpathEntryName ) ; } this . combineAccessRules = combineAccessRules ; this . extraAttributes = extraAttributes ; if ( inclusionPatterns != INCLUDE_ALL && inclusionPatterns . length > <NUM_LIT:0> ) { this . fullInclusionPatternChars = UNINIT_PATTERNS ; } if ( exclusionPatterns . length > <NUM_LIT:0> ) { this . fullExclusionPatternChars = UNINIT_PATTERNS ; } this . sourceAttachmentPath = sourceAttachmentPath ; this . sourceAttachmentRootPath = sourceAttachmentRootPath ; this . specificOutputLocation = specificOutputLocation ; this . isExported = isExported ; } public boolean combineAccessRules ( ) { return this . combineAccessRules ; } public ClasspathEntry combineWith ( ClasspathEntry referringEntry ) { if ( referringEntry == null ) return this ; if ( referringEntry . isExported ( ) || referringEntry . getAccessRuleSet ( ) != null ) { boolean combine = this . entryKind == CPE_SOURCE || referringEntry . combineAccessRules ( ) ; return new ClasspathEntry ( getContentKind ( ) , getEntryKind ( ) , getPath ( ) , this . inclusionPatterns , this . exclusionPatterns , getSourceAttachmentPath ( ) , getSourceAttachmentRootPath ( ) , getOutputLocation ( ) , referringEntry . isExported ( ) || this . isExported , combine ( referringEntry . getAccessRules ( ) , getAccessRules ( ) , combine ) , this . combineAccessRules , this . extraAttributes ) ; } return this ; } private IAccessRule [ ] combine ( IAccessRule [ ] referringRules , IAccessRule [ ] rules , boolean combine ) { if ( ! combine ) return rules ; if ( rules == null || rules . length == <NUM_LIT:0> ) return referringRules ; int referringRulesLength = referringRules . length ; int accessRulesLength = rules . length ; int rulesLength = referringRulesLength + accessRulesLength ; IAccessRule [ ] result = new IAccessRule [ rulesLength ] ; System . arraycopy ( referringRules , <NUM_LIT:0> , result , <NUM_LIT:0> , referringRulesLength ) ; System . arraycopy ( rules , <NUM_LIT:0> , result , referringRulesLength , accessRulesLength ) ; return result ; } static IClasspathAttribute [ ] decodeExtraAttributes ( NodeList attributes ) { if ( attributes == null ) return NO_EXTRA_ATTRIBUTES ; int length = attributes . getLength ( ) ; if ( length == <NUM_LIT:0> ) return NO_EXTRA_ATTRIBUTES ; IClasspathAttribute [ ] result = new IClasspathAttribute [ length ] ; int index = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < length ; ++ i ) { Node node = attributes . item ( i ) ; if ( node . getNodeType ( ) == Node . ELEMENT_NODE ) { Element attribute = ( Element ) node ; String name = attribute . getAttribute ( TAG_ATTRIBUTE_NAME ) ; if ( name == null ) continue ; String value = attribute . getAttribute ( TAG_ATTRIBUTE_VALUE ) ; if ( value == null ) continue ; result [ index ++ ] = new ClasspathAttribute ( name , value ) ; } } if ( index != length ) System . arraycopy ( result , <NUM_LIT:0> , result = new IClasspathAttribute [ index ] , <NUM_LIT:0> , index ) ; return result ; } static IAccessRule [ ] decodeAccessRules ( NodeList list ) { if ( list == null ) return null ; int length = list . getLength ( ) ; if ( length == <NUM_LIT:0> ) return null ; IAccessRule [ ] result = new IAccessRule [ length ] ; int index = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { Node accessRule = list . item ( i ) ; if ( accessRule . getNodeType ( ) == Node . ELEMENT_NODE ) { Element elementAccessRule = ( Element ) accessRule ; String pattern = elementAccessRule . getAttribute ( TAG_PATTERN ) ; if ( pattern == null ) continue ; String tagKind = elementAccessRule . getAttribute ( TAG_KIND ) ; int kind ; if ( TAG_ACCESSIBLE . equals ( tagKind ) ) kind = IAccessRule . K_ACCESSIBLE ; else if ( TAG_NON_ACCESSIBLE . equals ( tagKind ) ) kind = IAccessRule . K_NON_ACCESSIBLE ; else if ( TAG_DISCOURAGED . equals ( tagKind ) ) kind = IAccessRule . K_DISCOURAGED ; else continue ; boolean ignoreIfBetter = "<STR_LIT:true>" . equals ( elementAccessRule . getAttribute ( TAG_IGNORE_IF_BETTER ) ) ; result [ index ++ ] = new ClasspathAccessRule ( new Path ( pattern ) , ignoreIfBetter ? kind | IAccessRule . IGNORE_IF_BETTER : kind ) ; } } if ( index != length ) System . arraycopy ( result , <NUM_LIT:0> , result = new IAccessRule [ index ] , <NUM_LIT:0> , index ) ; return result ; } private static IPath [ ] decodePatterns ( NamedNodeMap nodeMap , String tag ) { String sequence = removeAttribute ( tag , nodeMap ) ; if ( ! sequence . equals ( "<STR_LIT>" ) ) { char [ ] [ ] patterns = CharOperation . splitOn ( '<CHAR_LIT>' , sequence . toCharArray ( ) ) ; int patternCount ; if ( ( patternCount = patterns . length ) > <NUM_LIT:0> ) { IPath [ ] paths = new IPath [ patternCount ] ; int index = <NUM_LIT:0> ; for ( int j = <NUM_LIT:0> ; j < patternCount ; j ++ ) { char [ ] pattern = patterns [ j ] ; if ( pattern . length == <NUM_LIT:0> ) continue ; paths [ index ++ ] = new Path ( new String ( pattern ) ) ; } if ( index < patternCount ) System . arraycopy ( paths , <NUM_LIT:0> , paths = new IPath [ index ] , <NUM_LIT:0> , index ) ; return paths ; } } return null ; } private static void decodeUnknownNode ( Node node , StringBuffer buffer , IJavaProject project ) { ByteArrayOutputStream s = new ByteArrayOutputStream ( ) ; OutputStreamWriter writer ; try { writer = new OutputStreamWriter ( s , "<STR_LIT>" ) ; XMLWriter xmlWriter = new XMLWriter ( writer , project , false ) ; decodeUnknownNode ( node , xmlWriter , true ) ; xmlWriter . flush ( ) ; xmlWriter . close ( ) ; buffer . append ( s . toString ( "<STR_LIT>" ) ) ; } catch ( UnsupportedEncodingException e ) { } } private static void decodeUnknownNode ( Node node , XMLWriter xmlWriter , boolean insertNewLine ) { switch ( node . getNodeType ( ) ) { case Node . ELEMENT_NODE : NamedNodeMap attributes ; HashMap parameters = null ; if ( ( attributes = node . getAttributes ( ) ) != null ) { int length = attributes . getLength ( ) ; if ( length > <NUM_LIT:0> ) { parameters = new HashMap ( ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { Node attribute = attributes . item ( i ) ; parameters . put ( attribute . getNodeName ( ) , attribute . getNodeValue ( ) ) ; } } } NodeList children = node . getChildNodes ( ) ; int childrenLength = children . getLength ( ) ; String nodeName = node . getNodeName ( ) ; xmlWriter . printTag ( nodeName , parameters , false , false , childrenLength == <NUM_LIT:0> ) ; if ( childrenLength > <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> ; i < childrenLength ; i ++ ) { decodeUnknownNode ( children . item ( i ) , xmlWriter , false ) ; } xmlWriter . endTag ( nodeName , false , insertNewLine ) ; } break ; case Node . TEXT_NODE : String data = ( ( Text ) node ) . getData ( ) ; xmlWriter . printString ( data , false , false ) ; break ; } } public char [ ] [ ] fullExclusionPatternChars ( ) { if ( this . fullExclusionPatternChars == UNINIT_PATTERNS ) { int length = this . exclusionPatterns . length ; this . fullExclusionPatternChars = new char [ length ] [ ] ; IPath prefixPath = this . path . removeTrailingSeparator ( ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { this . fullExclusionPatternChars [ i ] = prefixPath . append ( this . exclusionPatterns [ i ] ) . toString ( ) . toCharArray ( ) ; } } return this . fullExclusionPatternChars ; } public char [ ] [ ] fullInclusionPatternChars ( ) { if ( this . fullInclusionPatternChars == UNINIT_PATTERNS ) { int length = this . inclusionPatterns . length ; this . fullInclusionPatternChars = new char [ length ] [ ] ; IPath prefixPath = this . path . removeTrailingSeparator ( ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { this . fullInclusionPatternChars [ i ] = prefixPath . append ( this . inclusionPatterns [ i ] ) . toString ( ) . toCharArray ( ) ; } } return this . fullInclusionPatternChars ; } public void elementEncode ( XMLWriter writer , IPath projectPath , boolean indent , boolean newLine , Map unknownElements , boolean isReferencedEntry ) { HashMap parameters = new HashMap ( ) ; parameters . put ( TAG_KIND , ClasspathEntry . kindToString ( this . entryKind ) ) ; IPath xmlPath = this . path ; if ( this . entryKind != IClasspathEntry . CPE_VARIABLE && this . entryKind != IClasspathEntry . CPE_CONTAINER ) { if ( xmlPath . isAbsolute ( ) ) { if ( projectPath != null && projectPath . isPrefixOf ( xmlPath ) ) { if ( xmlPath . segment ( <NUM_LIT:0> ) . equals ( projectPath . segment ( <NUM_LIT:0> ) ) ) { xmlPath = xmlPath . removeFirstSegments ( <NUM_LIT:1> ) ; xmlPath = xmlPath . makeRelative ( ) ; } else { xmlPath = xmlPath . makeAbsolute ( ) ; } } } } parameters . put ( TAG_PATH , String . valueOf ( xmlPath ) ) ; if ( this . sourceAttachmentPath != null ) { xmlPath = this . sourceAttachmentPath ; if ( this . entryKind != IClasspathEntry . CPE_VARIABLE && projectPath != null && projectPath . isPrefixOf ( xmlPath ) ) { if ( xmlPath . segment ( <NUM_LIT:0> ) . equals ( projectPath . segment ( <NUM_LIT:0> ) ) ) { xmlPath = xmlPath . removeFirstSegments ( <NUM_LIT:1> ) ; xmlPath = xmlPath . makeRelative ( ) ; } } parameters . put ( TAG_SOURCEPATH , String . valueOf ( xmlPath ) ) ; } if ( this . sourceAttachmentRootPath != null ) { parameters . put ( TAG_ROOTPATH , String . valueOf ( this . sourceAttachmentRootPath ) ) ; } if ( this . isExported ) { parameters . put ( TAG_EXPORTED , "<STR_LIT:true>" ) ; } encodePatterns ( this . inclusionPatterns , TAG_INCLUDING , parameters ) ; encodePatterns ( this . exclusionPatterns , TAG_EXCLUDING , parameters ) ; if ( this . entryKind == CPE_PROJECT && ! this . combineAccessRules ) parameters . put ( TAG_COMBINE_ACCESS_RULES , "<STR_LIT:false>" ) ; UnknownXmlElements unknownXmlElements = unknownElements == null ? null : ( UnknownXmlElements ) unknownElements . get ( this . path ) ; String [ ] unknownAttributes ; if ( unknownXmlElements != null && ( unknownAttributes = unknownXmlElements . attributes ) != null ) for ( int i = <NUM_LIT:0> , length = unknownAttributes . length ; i < length ; i += <NUM_LIT:2> ) { String tagName = unknownAttributes [ i ] ; String tagValue = unknownAttributes [ i + <NUM_LIT:1> ] ; parameters . put ( tagName , tagValue ) ; } if ( this . specificOutputLocation != null ) { IPath outputLocation = this . specificOutputLocation . removeFirstSegments ( <NUM_LIT:1> ) ; outputLocation = outputLocation . makeRelative ( ) ; parameters . put ( TAG_OUTPUT , String . valueOf ( outputLocation ) ) ; } boolean hasExtraAttributes = this . extraAttributes . length != <NUM_LIT:0> ; boolean hasRestrictions = getAccessRuleSet ( ) != null ; ArrayList unknownChildren = unknownXmlElements != null ? unknownXmlElements . children : null ; boolean hasUnknownChildren = unknownChildren != null ; String tagName = isReferencedEntry ? TAG_REFERENCED_ENTRY : TAG_CLASSPATHENTRY ; writer . printTag ( tagName , parameters , indent , newLine , ! hasExtraAttributes && ! hasRestrictions && ! hasUnknownChildren ) ; if ( hasExtraAttributes ) encodeExtraAttributes ( writer , indent , newLine ) ; if ( hasRestrictions ) encodeAccessRules ( writer , indent , newLine ) ; if ( hasUnknownChildren ) encodeUnknownChildren ( writer , indent , newLine , unknownChildren ) ; if ( hasExtraAttributes || hasRestrictions || hasUnknownChildren ) writer . endTag ( tagName , indent , true ) ; } void encodeExtraAttributes ( XMLWriter writer , boolean indent , boolean newLine ) { writer . startTag ( TAG_ATTRIBUTES , indent ) ; for ( int i = <NUM_LIT:0> ; i < this . extraAttributes . length ; i ++ ) { IClasspathAttribute attribute = this . extraAttributes [ i ] ; HashMap parameters = new HashMap ( ) ; parameters . put ( TAG_ATTRIBUTE_NAME , attribute . getName ( ) ) ; parameters . put ( TAG_ATTRIBUTE_VALUE , attribute . getValue ( ) ) ; writer . printTag ( TAG_ATTRIBUTE , parameters , indent , newLine , true ) ; } writer . endTag ( TAG_ATTRIBUTES , indent , true ) ; } void encodeAccessRules ( XMLWriter writer , boolean indent , boolean newLine ) { writer . startTag ( TAG_ACCESS_RULES , indent ) ; AccessRule [ ] rules = getAccessRuleSet ( ) . getAccessRules ( ) ; for ( int i = <NUM_LIT:0> , length = rules . length ; i < length ; i ++ ) { encodeAccessRule ( rules [ i ] , writer , indent , newLine ) ; } writer . endTag ( TAG_ACCESS_RULES , indent , true ) ; } private void encodeAccessRule ( AccessRule accessRule , XMLWriter writer , boolean indent , boolean newLine ) { HashMap parameters = new HashMap ( ) ; parameters . put ( TAG_PATTERN , new String ( accessRule . pattern ) ) ; switch ( accessRule . getProblemId ( ) ) { case IProblem . ForbiddenReference : parameters . put ( TAG_KIND , TAG_NON_ACCESSIBLE ) ; break ; case IProblem . DiscouragedReference : parameters . put ( TAG_KIND , TAG_DISCOURAGED ) ; break ; default : parameters . put ( TAG_KIND , TAG_ACCESSIBLE ) ; break ; } if ( accessRule . ignoreIfBetter ( ) ) parameters . put ( TAG_IGNORE_IF_BETTER , "<STR_LIT:true>" ) ; writer . printTag ( TAG_ACCESS_RULE , parameters , indent , newLine , true ) ; } private void encodeUnknownChildren ( XMLWriter writer , boolean indent , boolean newLine , ArrayList unknownChildren ) { for ( int i = <NUM_LIT:0> , length = unknownChildren . size ( ) ; i < length ; i ++ ) { String child = ( String ) unknownChildren . get ( i ) ; writer . printString ( child , indent , false ) ; } } public static IClasspathEntry elementDecode ( Element element , IJavaProject project , Map unknownElements ) { IPath projectPath = project . getProject ( ) . getFullPath ( ) ; NamedNodeMap attributes = element . getAttributes ( ) ; NodeList children = element . getChildNodes ( ) ; boolean [ ] foundChildren = new boolean [ children . getLength ( ) ] ; String kindAttr = removeAttribute ( TAG_KIND , attributes ) ; String pathAttr = removeAttribute ( TAG_PATH , attributes ) ; IPath path = new Path ( pathAttr ) ; int kind = kindFromString ( kindAttr ) ; if ( kind != IClasspathEntry . CPE_VARIABLE && kind != IClasspathEntry . CPE_CONTAINER && ! path . isAbsolute ( ) ) { if ( ! ( path . segmentCount ( ) > <NUM_LIT:0> && path . segment ( <NUM_LIT:0> ) . equals ( ClasspathEntry . DOT_DOT ) ) ) { path = projectPath . append ( path ) ; } } IPath sourceAttachmentPath = element . hasAttribute ( TAG_SOURCEPATH ) ? new Path ( removeAttribute ( TAG_SOURCEPATH , attributes ) ) : null ; if ( kind != IClasspathEntry . CPE_VARIABLE && sourceAttachmentPath != null && ! sourceAttachmentPath . isAbsolute ( ) ) { sourceAttachmentPath = projectPath . append ( sourceAttachmentPath ) ; } IPath sourceAttachmentRootPath = element . hasAttribute ( TAG_ROOTPATH ) ? new Path ( removeAttribute ( TAG_ROOTPATH , attributes ) ) : null ; boolean isExported = removeAttribute ( TAG_EXPORTED , attributes ) . equals ( "<STR_LIT:true>" ) ; IPath [ ] inclusionPatterns = decodePatterns ( attributes , TAG_INCLUDING ) ; if ( inclusionPatterns == null ) inclusionPatterns = INCLUDE_ALL ; IPath [ ] exclusionPatterns = decodePatterns ( attributes , TAG_EXCLUDING ) ; if ( exclusionPatterns == null ) exclusionPatterns = EXCLUDE_NONE ; NodeList attributeList = getChildAttributes ( TAG_ACCESS_RULES , children , foundChildren ) ; IAccessRule [ ] accessRules = decodeAccessRules ( attributeList ) ; if ( accessRules == null ) { accessRules = getAccessRules ( inclusionPatterns , exclusionPatterns ) ; } boolean combineAccessRestrictions = ! removeAttribute ( TAG_COMBINE_ACCESS_RULES , attributes ) . equals ( "<STR_LIT:false>" ) ; attributeList = getChildAttributes ( TAG_ATTRIBUTES , children , foundChildren ) ; IClasspathAttribute [ ] extraAttributes = decodeExtraAttributes ( attributeList ) ; IPath outputLocation = element . hasAttribute ( TAG_OUTPUT ) ? projectPath . append ( removeAttribute ( TAG_OUTPUT , attributes ) ) : null ; String [ ] unknownAttributes = null ; ArrayList unknownChildren = null ; if ( unknownElements != null ) { int unknownAttributeLength = attributes . getLength ( ) ; if ( unknownAttributeLength != <NUM_LIT:0> ) { unknownAttributes = new String [ unknownAttributeLength * <NUM_LIT:2> ] ; for ( int i = <NUM_LIT:0> ; i < unknownAttributeLength ; i ++ ) { Node attribute = attributes . item ( i ) ; unknownAttributes [ i * <NUM_LIT:2> ] = attribute . getNodeName ( ) ; unknownAttributes [ i * <NUM_LIT:2> + <NUM_LIT:1> ] = attribute . getNodeValue ( ) ; } } for ( int i = <NUM_LIT:0> , length = foundChildren . length ; i < length ; i ++ ) { if ( ! foundChildren [ i ] ) { Node node = children . item ( i ) ; if ( node . getNodeType ( ) != Node . ELEMENT_NODE ) continue ; if ( unknownChildren == null ) unknownChildren = new ArrayList ( ) ; StringBuffer buffer = new StringBuffer ( ) ; decodeUnknownNode ( node , buffer , project ) ; unknownChildren . add ( buffer . toString ( ) ) ; } } } IClasspathEntry entry = null ; switch ( kind ) { case IClasspathEntry . CPE_PROJECT : entry = new ClasspathEntry ( IPackageFragmentRoot . K_SOURCE , IClasspathEntry . CPE_PROJECT , path , ClasspathEntry . INCLUDE_ALL , ClasspathEntry . EXCLUDE_NONE , null , null , null , isExported , accessRules , combineAccessRestrictions , extraAttributes ) ; break ; case IClasspathEntry . CPE_LIBRARY : entry = JavaCore . newLibraryEntry ( path , sourceAttachmentPath , sourceAttachmentRootPath , accessRules , extraAttributes , isExported ) ; break ; case IClasspathEntry . CPE_SOURCE : String projSegment = path . segment ( <NUM_LIT:0> ) ; if ( projSegment != null && projSegment . equals ( project . getElementName ( ) ) ) { entry = JavaCore . newSourceEntry ( path , inclusionPatterns , exclusionPatterns , outputLocation , extraAttributes ) ; } else { if ( path . segmentCount ( ) == <NUM_LIT:1> ) { entry = JavaCore . newProjectEntry ( path , accessRules , combineAccessRestrictions , extraAttributes , isExported ) ; } else { entry = JavaCore . newSourceEntry ( path , inclusionPatterns , exclusionPatterns , outputLocation , extraAttributes ) ; } } break ; case IClasspathEntry . CPE_VARIABLE : entry = JavaCore . newVariableEntry ( path , sourceAttachmentPath , sourceAttachmentRootPath , accessRules , extraAttributes , isExported ) ; break ; case IClasspathEntry . CPE_CONTAINER : entry = JavaCore . newContainerEntry ( path , accessRules , extraAttributes , isExported ) ; break ; case ClasspathEntry . K_OUTPUT : if ( ! path . isAbsolute ( ) ) return null ; entry = new ClasspathEntry ( ClasspathEntry . K_OUTPUT , IClasspathEntry . CPE_LIBRARY , path , INCLUDE_ALL , EXCLUDE_NONE , null , null , null , false , null , false , NO_EXTRA_ATTRIBUTES ) ; break ; default : throw new AssertionFailedException ( Messages . bind ( Messages . classpath_unknownKind , kindAttr ) ) ; } if ( unknownAttributes != null || unknownChildren != null ) { UnknownXmlElements unknownXmlElements = new UnknownXmlElements ( ) ; unknownXmlElements . attributes = unknownAttributes ; unknownXmlElements . children = unknownChildren ; unknownElements . put ( path , unknownXmlElements ) ; } return entry ; } public static boolean hasDotDot ( IPath path ) { for ( int i = <NUM_LIT:0> , length = path . segmentCount ( ) ; i < length ; i ++ ) { if ( DOT_DOT . equals ( path . segment ( i ) ) ) return true ; } return false ; } public static NodeList getChildAttributes ( String childName , NodeList children , boolean [ ] foundChildren ) { for ( int i = <NUM_LIT:0> , length = foundChildren . length ; i < length ; i ++ ) { Node node = children . item ( i ) ; if ( childName . equals ( node . getNodeName ( ) ) ) { foundChildren [ i ] = true ; return node . getChildNodes ( ) ; } } return null ; } private static String removeAttribute ( String nodeName , NamedNodeMap nodeMap ) { Node node = removeNode ( nodeName , nodeMap ) ; if ( node == null ) return "<STR_LIT>" ; return node . getNodeValue ( ) ; } private static Node removeNode ( String nodeName , NamedNodeMap nodeMap ) { try { return nodeMap . removeNamedItem ( nodeName ) ; } catch ( DOMException e ) { if ( e . code != DOMException . NOT_FOUND_ERR ) throw e ; return null ; } } public static IPath [ ] resolvedChainedLibraries ( IPath jarPath ) { ArrayList result = new ArrayList ( ) ; resolvedChainedLibraries ( jarPath , new HashSet ( ) , result ) ; if ( result . size ( ) == <NUM_LIT:0> ) return NO_PATHS ; return ( IPath [ ] ) result . toArray ( new IPath [ result . size ( ) ] ) ; } private static void resolvedChainedLibraries ( IPath jarPath , HashSet visited , ArrayList result ) { if ( visited . contains ( jarPath ) ) return ; visited . add ( jarPath ) ; JavaModelManager manager = JavaModelManager . getJavaModelManager ( ) ; if ( manager . isNonChainingJar ( jarPath ) ) return ; List calledFileNames = getCalledFileNames ( jarPath ) ; if ( calledFileNames == null ) { manager . addNonChainingJar ( jarPath ) ; } else { Iterator calledFilesIterator = calledFileNames . iterator ( ) ; IPath directoryPath = jarPath . removeLastSegments ( <NUM_LIT:1> ) ; while ( calledFilesIterator . hasNext ( ) ) { String calledFileName = ( String ) calledFilesIterator . next ( ) ; if ( ! directoryPath . isValidPath ( calledFileName ) ) { if ( JavaModelManager . CP_RESOLVE_VERBOSE_FAILURE ) { Util . verbose ( "<STR_LIT>" + calledFileName + "<STR_LIT>" + jarPath . toOSString ( ) ) ; } } else { IPath calledJar = directoryPath . append ( new Path ( calledFileName ) ) ; if ( calledJar . segmentCount ( ) == <NUM_LIT:0> ) { if ( JavaModelManager . CP_RESOLVE_VERBOSE_FAILURE ) { Util . verbose ( "<STR_LIT>" + calledFileName + "<STR_LIT>" + jarPath . toOSString ( ) ) ; } continue ; } resolvedChainedLibraries ( calledJar , visited , result ) ; result . add ( calledJar ) ; } } } } private static List getCalledFileNames ( IPath jarPath ) { Object target = JavaModel . getTarget ( jarPath , true ) ; if ( ! ( target instanceof IFile || target instanceof File ) ) return null ; JavaModelManager manager = JavaModelManager . getJavaModelManager ( ) ; ZipFile zip = null ; InputStream inputStream = null ; List calledFileNames = null ; try { zip = manager . getZipFile ( jarPath ) ; ZipEntry manifest = zip . getEntry ( "<STR_LIT>" ) ; if ( manifest == null ) return null ; ManifestAnalyzer analyzer = new ManifestAnalyzer ( ) ; inputStream = zip . getInputStream ( manifest ) ; boolean success = analyzer . analyzeManifestContents ( inputStream ) ; calledFileNames = analyzer . getCalledFileNames ( ) ; if ( ! success || analyzer . getClasspathSectionsCount ( ) == <NUM_LIT:1> && calledFileNames == null ) { if ( JavaModelManager . CP_RESOLVE_VERBOSE_FAILURE ) { Util . verbose ( "<STR_LIT>" + jarPath . toOSString ( ) ) ; } return null ; } else if ( analyzer . getClasspathSectionsCount ( ) > <NUM_LIT:1> ) { if ( JavaModelManager . CP_RESOLVE_VERBOSE_FAILURE ) { Util . verbose ( "<STR_LIT>" + jarPath . toOSString ( ) ) ; } return null ; } } catch ( CoreException e ) { if ( JavaModelManager . CP_RESOLVE_VERBOSE_FAILURE ) { Util . verbose ( "<STR_LIT>" + jarPath . toOSString ( ) ) ; e . printStackTrace ( ) ; } } catch ( IOException e ) { if ( JavaModelManager . CP_RESOLVE_VERBOSE_FAILURE ) { Util . verbose ( "<STR_LIT>" + jarPath . toOSString ( ) ) ; e . printStackTrace ( ) ; } } finally { if ( inputStream != null ) { try { inputStream . close ( ) ; } catch ( IOException e ) { } } manager . closeZipFile ( zip ) ; } return calledFileNames ; } public static IPath resolveDotDot ( IPath path ) { IPath newPath = null ; IPath workspaceLocation = null ; for ( int i = <NUM_LIT:0> , length = path . segmentCount ( ) ; i < length ; i ++ ) { String segment = path . segment ( i ) ; if ( DOT_DOT . equals ( segment ) ) { if ( newPath == null ) { if ( i == <NUM_LIT:0> ) { workspaceLocation = workspaceRoot . getLocation ( ) ; newPath = workspaceLocation ; } else { newPath = path . removeFirstSegments ( i ) ; } } else { if ( newPath . segmentCount ( ) > <NUM_LIT:0> ) { newPath = newPath . removeLastSegments ( <NUM_LIT:1> ) ; } else { workspaceLocation = workspaceRoot . getLocation ( ) ; newPath = workspaceLocation ; } } } else if ( newPath != null ) { if ( newPath . equals ( workspaceLocation ) && workspaceRoot . getProject ( segment ) . isAccessible ( ) ) { newPath = new Path ( segment ) . makeAbsolute ( ) ; } else { newPath = newPath . append ( segment ) ; } } } if ( newPath == null ) return path ; return newPath ; } private static void encodePatterns ( IPath [ ] patterns , String tag , Map parameters ) { if ( patterns != null && patterns . length > <NUM_LIT:0> ) { StringBuffer rule = new StringBuffer ( <NUM_LIT:10> ) ; for ( int i = <NUM_LIT:0> , max = patterns . length ; i < max ; i ++ ) { if ( i > <NUM_LIT:0> ) rule . append ( '<CHAR_LIT>' ) ; rule . append ( patterns [ i ] ) ; } parameters . put ( tag , String . valueOf ( rule ) ) ; } } public boolean equals ( Object object ) { if ( this == object ) return true ; if ( object instanceof ClasspathEntry ) { ClasspathEntry otherEntry = ( ClasspathEntry ) object ; if ( this . contentKind != otherEntry . getContentKind ( ) ) return false ; if ( this . entryKind != otherEntry . getEntryKind ( ) ) return false ; if ( this . isExported != otherEntry . isExported ( ) ) return false ; if ( ! this . path . equals ( otherEntry . getPath ( ) ) ) return false ; IPath otherPath = otherEntry . getSourceAttachmentPath ( ) ; if ( this . sourceAttachmentPath == null ) { if ( otherPath != null ) return false ; } else { if ( ! this . sourceAttachmentPath . equals ( otherPath ) ) return false ; } otherPath = otherEntry . getSourceAttachmentRootPath ( ) ; if ( this . sourceAttachmentRootPath == null ) { if ( otherPath != null ) return false ; } else { if ( ! this . sourceAttachmentRootPath . equals ( otherPath ) ) return false ; } if ( ! equalPatterns ( this . inclusionPatterns , otherEntry . getInclusionPatterns ( ) ) ) return false ; if ( ! equalPatterns ( this . exclusionPatterns , otherEntry . getExclusionPatterns ( ) ) ) return false ; AccessRuleSet otherRuleSet = otherEntry . getAccessRuleSet ( ) ; if ( getAccessRuleSet ( ) != null ) { if ( ! getAccessRuleSet ( ) . equals ( otherRuleSet ) ) return false ; } else if ( otherRuleSet != null ) return false ; if ( this . combineAccessRules != otherEntry . combineAccessRules ( ) ) return false ; otherPath = otherEntry . getOutputLocation ( ) ; if ( this . specificOutputLocation == null ) { if ( otherPath != null ) return false ; } else { if ( ! this . specificOutputLocation . equals ( otherPath ) ) return false ; } if ( ! equalAttributes ( this . extraAttributes , otherEntry . getExtraAttributes ( ) ) ) return false ; return true ; } else { return false ; } } private static boolean equalAttributes ( IClasspathAttribute [ ] firstAttributes , IClasspathAttribute [ ] secondAttributes ) { if ( firstAttributes != secondAttributes ) { if ( firstAttributes == null ) return false ; int length = firstAttributes . length ; if ( secondAttributes == null || secondAttributes . length != length ) return false ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( ! firstAttributes [ i ] . equals ( secondAttributes [ i ] ) ) return false ; } } return true ; } private static boolean equalPatterns ( IPath [ ] firstPatterns , IPath [ ] secondPatterns ) { if ( firstPatterns != secondPatterns ) { if ( firstPatterns == null ) return false ; int length = firstPatterns . length ; if ( secondPatterns == null || secondPatterns . length != length ) return false ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( ! firstPatterns [ i ] . toString ( ) . equals ( secondPatterns [ i ] . toString ( ) ) ) return false ; } } return true ; } public IAccessRule [ ] getAccessRules ( ) { if ( this . accessRuleSet == null ) return NO_ACCESS_RULES ; AccessRule [ ] rules = this . accessRuleSet . getAccessRules ( ) ; int length = rules . length ; if ( length == <NUM_LIT:0> ) return NO_ACCESS_RULES ; IAccessRule [ ] result = new IAccessRule [ length ] ; System . arraycopy ( rules , <NUM_LIT:0> , result , <NUM_LIT:0> , length ) ; return result ; } public AccessRuleSet getAccessRuleSet ( ) { return this . accessRuleSet ; } public int getContentKind ( ) { return this . contentKind ; } public int getEntryKind ( ) { return this . entryKind ; } public IPath [ ] getExclusionPatterns ( ) { return this . exclusionPatterns ; } public IClasspathAttribute [ ] getExtraAttributes ( ) { return this . extraAttributes ; } public IPath [ ] getInclusionPatterns ( ) { return this . inclusionPatterns ; } public IPath getOutputLocation ( ) { return this . specificOutputLocation ; } public IPath getPath ( ) { return this . path ; } public IPath getSourceAttachmentPath ( ) { return this . sourceAttachmentPath ; } public IPath getSourceAttachmentRootPath ( ) { return this . sourceAttachmentRootPath ; } public IClasspathEntry getReferencingEntry ( ) { return this . referencingEntry ; } public int hashCode ( ) { return this . path . hashCode ( ) ; } public boolean isExported ( ) { return this . isExported ; } public boolean isOptional ( ) { for ( int i = <NUM_LIT:0> , length = this . extraAttributes . length ; i < length ; i ++ ) { IClasspathAttribute attribute = this . extraAttributes [ i ] ; if ( IClasspathAttribute . OPTIONAL . equals ( attribute . getName ( ) ) && "<STR_LIT:true>" . equals ( attribute . getValue ( ) ) ) return true ; } return false ; } static int kindFromString ( String kindStr ) { if ( kindStr . equalsIgnoreCase ( "<STR_LIT>" ) ) return IClasspathEntry . CPE_PROJECT ; if ( kindStr . equalsIgnoreCase ( "<STR_LIT>" ) ) return IClasspathEntry . CPE_VARIABLE ; if ( kindStr . equalsIgnoreCase ( "<STR_LIT>" ) ) return IClasspathEntry . CPE_CONTAINER ; if ( kindStr . equalsIgnoreCase ( "<STR_LIT:src>" ) ) return IClasspathEntry . CPE_SOURCE ; if ( kindStr . equalsIgnoreCase ( "<STR_LIT>" ) ) return IClasspathEntry . CPE_LIBRARY ; if ( kindStr . equalsIgnoreCase ( "<STR_LIT>" ) ) return ClasspathEntry . K_OUTPUT ; return - <NUM_LIT:1> ; } static String kindToString ( int kind ) { switch ( kind ) { case IClasspathEntry . CPE_PROJECT : return "<STR_LIT:src>" ; case IClasspathEntry . CPE_SOURCE : return "<STR_LIT:src>" ; case IClasspathEntry . CPE_LIBRARY : return "<STR_LIT>" ; case IClasspathEntry . CPE_VARIABLE : return "<STR_LIT>" ; case IClasspathEntry . CPE_CONTAINER : return "<STR_LIT>" ; case ClasspathEntry . K_OUTPUT : return "<STR_LIT>" ; default : return "<STR_LIT:unknown>" ; } } public static IAccessRule [ ] getAccessRules ( IPath [ ] accessibleFiles , IPath [ ] nonAccessibleFiles ) { int accessibleFilesLength = accessibleFiles == null ? <NUM_LIT:0> : accessibleFiles . length ; int nonAccessibleFilesLength = nonAccessibleFiles == null ? <NUM_LIT:0> : nonAccessibleFiles . length ; int length = accessibleFilesLength + nonAccessibleFilesLength ; if ( length == <NUM_LIT:0> ) return null ; IAccessRule [ ] accessRules = new IAccessRule [ length ] ; for ( int i = <NUM_LIT:0> ; i < accessibleFilesLength ; i ++ ) { accessRules [ i ] = JavaCore . newAccessRule ( accessibleFiles [ i ] , IAccessRule . K_ACCESSIBLE ) ; } for ( int i = <NUM_LIT:0> ; i < nonAccessibleFilesLength ; i ++ ) { accessRules [ accessibleFilesLength + i ] = JavaCore . newAccessRule ( nonAccessibleFiles [ i ] , IAccessRule . K_NON_ACCESSIBLE ) ; } return accessRules ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; Object target = JavaModel . getTarget ( getPath ( ) , true ) ; if ( target instanceof File ) buffer . append ( getPath ( ) . toOSString ( ) ) ; else buffer . append ( String . valueOf ( getPath ( ) ) ) ; buffer . append ( '<CHAR_LIT:[>' ) ; switch ( getEntryKind ( ) ) { case IClasspathEntry . CPE_LIBRARY : buffer . append ( "<STR_LIT>" ) ; break ; case IClasspathEntry . CPE_PROJECT : buffer . append ( "<STR_LIT>" ) ; break ; case IClasspathEntry . CPE_SOURCE : buffer . append ( "<STR_LIT>" ) ; break ; case IClasspathEntry . CPE_VARIABLE : buffer . append ( "<STR_LIT>" ) ; break ; case IClasspathEntry . CPE_CONTAINER : buffer . append ( "<STR_LIT>" ) ; break ; } buffer . append ( "<STR_LIT>" ) ; switch ( getContentKind ( ) ) { case IPackageFragmentRoot . K_BINARY : buffer . append ( "<STR_LIT>" ) ; break ; case IPackageFragmentRoot . K_SOURCE : buffer . append ( "<STR_LIT>" ) ; break ; case ClasspathEntry . K_OUTPUT : buffer . append ( "<STR_LIT>" ) ; break ; } buffer . append ( '<CHAR_LIT:]>' ) ; if ( getSourceAttachmentPath ( ) != null ) { buffer . append ( "<STR_LIT>" ) ; buffer . append ( getSourceAttachmentPath ( ) ) ; buffer . append ( '<CHAR_LIT:]>' ) ; } if ( getSourceAttachmentRootPath ( ) != null ) { buffer . append ( "<STR_LIT>" ) ; buffer . append ( getSourceAttachmentRootPath ( ) ) ; buffer . append ( '<CHAR_LIT:]>' ) ; } buffer . append ( "<STR_LIT>" ) ; buffer . append ( this . isExported ) ; buffer . append ( '<CHAR_LIT:]>' ) ; IPath [ ] patterns = this . inclusionPatterns ; int length ; if ( ( length = patterns == null ? <NUM_LIT:0> : patterns . length ) > <NUM_LIT:0> ) { buffer . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { buffer . append ( patterns [ i ] ) ; if ( i != length - <NUM_LIT:1> ) { buffer . append ( '<CHAR_LIT>' ) ; } } buffer . append ( '<CHAR_LIT:]>' ) ; } patterns = this . exclusionPatterns ; if ( ( length = patterns == null ? <NUM_LIT:0> : patterns . length ) > <NUM_LIT:0> ) { buffer . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { buffer . append ( patterns [ i ] ) ; if ( i != length - <NUM_LIT:1> ) { buffer . append ( '<CHAR_LIT>' ) ; } } buffer . append ( '<CHAR_LIT:]>' ) ; } if ( this . accessRuleSet != null ) { buffer . append ( '<CHAR_LIT:[>' ) ; buffer . append ( this . accessRuleSet . toString ( false ) ) ; buffer . append ( '<CHAR_LIT:]>' ) ; } if ( this . entryKind == CPE_PROJECT ) { buffer . append ( "<STR_LIT>" ) ; buffer . append ( this . combineAccessRules ) ; buffer . append ( '<CHAR_LIT:]>' ) ; } if ( getOutputLocation ( ) != null ) { buffer . append ( "<STR_LIT>" ) ; buffer . append ( getOutputLocation ( ) ) ; buffer . append ( '<CHAR_LIT:]>' ) ; } if ( ( length = this . extraAttributes == null ? <NUM_LIT:0> : this . extraAttributes . length ) > <NUM_LIT:0> ) { buffer . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { buffer . append ( this . extraAttributes [ i ] ) ; if ( i != length - <NUM_LIT:1> ) { buffer . append ( '<CHAR_LIT:U+002C>' ) ; } } buffer . append ( '<CHAR_LIT:]>' ) ; } return buffer . toString ( ) ; } public ClasspathEntry resolvedDotDot ( ) { IPath resolvedPath = resolveDotDot ( this . path ) ; if ( resolvedPath == this . path ) return this ; return new ClasspathEntry ( getContentKind ( ) , getEntryKind ( ) , resolvedPath , this . inclusionPatterns , this . exclusionPatterns , getSourceAttachmentPath ( ) , getSourceAttachmentRootPath ( ) , getOutputLocation ( ) , this . getReferencingEntry ( ) , this . isExported , getAccessRules ( ) , this . combineAccessRules , this . extraAttributes ) ; } public ClasspathEntry [ ] resolvedChainedLibraries ( ) { IPath [ ] paths = resolvedChainedLibraries ( getPath ( ) ) ; int length = paths . length ; if ( length == <NUM_LIT:0> ) return NO_ENTRIES ; ClasspathEntry [ ] result = new ClasspathEntry [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { result [ i ] = new ClasspathEntry ( getContentKind ( ) , getEntryKind ( ) , paths [ i ] , this . inclusionPatterns , this . exclusionPatterns , null , null , getOutputLocation ( ) , this , this . isExported , getAccessRules ( ) , this . combineAccessRules , NO_EXTRA_ATTRIBUTES ) ; } return result ; } public String rootID ( ) { if ( this . rootID == null ) { switch ( this . entryKind ) { case IClasspathEntry . CPE_LIBRARY : this . rootID = "<STR_LIT>" + this . path ; break ; case IClasspathEntry . CPE_PROJECT : this . rootID = "<STR_LIT>" + this . path ; break ; case IClasspathEntry . CPE_SOURCE : this . rootID = "<STR_LIT>" + this . path ; break ; case IClasspathEntry . CPE_VARIABLE : this . rootID = "<STR_LIT>" + this . path ; break ; case IClasspathEntry . CPE_CONTAINER : this . rootID = "<STR_LIT>" + this . path ; break ; default : this . rootID = "<STR_LIT>" ; break ; } } return this . rootID ; } public IClasspathEntry getResolvedEntry ( ) { return JavaCore . getResolvedClasspathEntry ( this ) ; } public static IJavaModelStatus validateClasspath ( IJavaProject javaProject , IClasspathEntry [ ] rawClasspath , IPath projectOutputLocation ) { IProject project = javaProject . getProject ( ) ; IPath projectPath = project . getFullPath ( ) ; String projectName = javaProject . getElementName ( ) ; if ( projectOutputLocation == null ) { return new JavaModelStatus ( IJavaModelStatusConstants . NULL_PATH ) ; } if ( projectOutputLocation . isAbsolute ( ) ) { if ( ! projectPath . isPrefixOf ( projectOutputLocation ) ) { return new JavaModelStatus ( IJavaModelStatusConstants . PATH_OUTSIDE_PROJECT , javaProject , projectOutputLocation . toString ( ) ) ; } } else { return new JavaModelStatus ( IJavaModelStatusConstants . RELATIVE_PATH , projectOutputLocation ) ; } boolean hasSource = false ; boolean hasLibFolder = false ; if ( rawClasspath == null ) return JavaModelStatus . VERIFIED_OK ; int rawLength = rawClasspath . length ; HashSet pathes = new HashSet ( rawLength ) ; for ( int i = <NUM_LIT:0> ; i < rawLength ; i ++ ) { IPath entryPath = rawClasspath [ i ] . getPath ( ) ; if ( ! pathes . add ( entryPath ) ) { String entryPathMsg = projectName . equals ( entryPath . segment ( <NUM_LIT:0> ) ) ? entryPath . removeFirstSegments ( <NUM_LIT:1> ) . toString ( ) : entryPath . makeRelative ( ) . toString ( ) ; return new JavaModelStatus ( IJavaModelStatusConstants . NAME_COLLISION , Messages . bind ( Messages . classpath_duplicateEntryPath , new String [ ] { entryPathMsg , projectName } ) ) ; } } IClasspathEntry [ ] classpath ; try { classpath = ( ( JavaProject ) javaProject ) . resolveClasspath ( rawClasspath , false , false ) . resolvedClasspath ; } catch ( JavaModelException e ) { return e . getJavaModelStatus ( ) ; } int length = classpath . length ; int outputCount = <NUM_LIT:1> ; IPath [ ] outputLocations = new IPath [ length + <NUM_LIT:1> ] ; boolean [ ] allowNestingInOutputLocations = new boolean [ length + <NUM_LIT:1> ] ; outputLocations [ <NUM_LIT:0> ] = projectOutputLocation ; IPath potentialNestedOutput = null ; int sourceEntryCount = <NUM_LIT:0> ; boolean disableExclusionPatterns = JavaCore . DISABLED . equals ( javaProject . getOption ( JavaCore . CORE_ENABLE_CLASSPATH_EXCLUSION_PATTERNS , true ) ) ; boolean disableCustomOutputLocations = JavaCore . DISABLED . equals ( javaProject . getOption ( JavaCore . CORE_ENABLE_CLASSPATH_MULTIPLE_OUTPUT_LOCATIONS , true ) ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { IClasspathEntry resolvedEntry = classpath [ i ] ; if ( disableExclusionPatterns && ( ( resolvedEntry . getInclusionPatterns ( ) != null && resolvedEntry . getInclusionPatterns ( ) . length > <NUM_LIT:0> ) || ( resolvedEntry . getExclusionPatterns ( ) != null && resolvedEntry . getExclusionPatterns ( ) . length > <NUM_LIT:0> ) ) ) { return new JavaModelStatus ( IJavaModelStatusConstants . DISABLED_CP_EXCLUSION_PATTERNS , javaProject , resolvedEntry . getPath ( ) ) ; } switch ( resolvedEntry . getEntryKind ( ) ) { case IClasspathEntry . CPE_SOURCE : sourceEntryCount ++ ; IPath customOutput ; if ( ( customOutput = resolvedEntry . getOutputLocation ( ) ) != null ) { if ( disableCustomOutputLocations ) { return new JavaModelStatus ( IJavaModelStatusConstants . DISABLED_CP_MULTIPLE_OUTPUT_LOCATIONS , javaProject , resolvedEntry . getPath ( ) ) ; } if ( customOutput . isAbsolute ( ) ) { if ( ! javaProject . getPath ( ) . isPrefixOf ( customOutput ) ) { return new JavaModelStatus ( IJavaModelStatusConstants . PATH_OUTSIDE_PROJECT , javaProject , customOutput . toString ( ) ) ; } } else { return new JavaModelStatus ( IJavaModelStatusConstants . RELATIVE_PATH , customOutput ) ; } if ( Util . indexOfMatchingPath ( customOutput , outputLocations , outputCount ) != - <NUM_LIT:1> ) { continue ; } outputLocations [ outputCount ++ ] = customOutput ; } } } for ( int i = <NUM_LIT:1> ; i < outputCount ; i ++ ) { IPath customOutput = outputLocations [ i ] ; int index ; if ( ( index = Util . indexOfEnclosingPath ( customOutput , outputLocations , outputCount ) ) != - <NUM_LIT:1> && index != i ) { if ( index == <NUM_LIT:0> ) { if ( potentialNestedOutput == null ) potentialNestedOutput = customOutput ; } else { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_CLASSPATH , Messages . bind ( Messages . classpath_cannotNestOutputInOutput , new String [ ] { customOutput . makeRelative ( ) . toString ( ) , outputLocations [ index ] . makeRelative ( ) . toString ( ) } ) ) ; } } } if ( sourceEntryCount <= outputCount - <NUM_LIT:1> ) { allowNestingInOutputLocations [ <NUM_LIT:0> ] = true ; } else if ( potentialNestedOutput != null ) { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_CLASSPATH , Messages . bind ( Messages . classpath_cannotNestOutputInOutput , new String [ ] { potentialNestedOutput . makeRelative ( ) . toString ( ) , outputLocations [ <NUM_LIT:0> ] . makeRelative ( ) . toString ( ) } ) ) ; } for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { IClasspathEntry resolvedEntry = classpath [ i ] ; IPath path = resolvedEntry . getPath ( ) ; int index ; switch ( resolvedEntry . getEntryKind ( ) ) { case IClasspathEntry . CPE_SOURCE : hasSource = true ; if ( ( index = Util . indexOfMatchingPath ( path , outputLocations , outputCount ) ) != - <NUM_LIT:1> ) { allowNestingInOutputLocations [ index ] = true ; } break ; case IClasspathEntry . CPE_LIBRARY : Object target = JavaModel . getTarget ( path , false ) ; hasLibFolder |= target instanceof IContainer ; if ( ( index = Util . indexOfMatchingPath ( path , outputLocations , outputCount ) ) != - <NUM_LIT:1> ) { allowNestingInOutputLocations [ index ] = true ; } break ; } } if ( ! hasSource && ! hasLibFolder ) { for ( int i = <NUM_LIT:0> ; i < outputCount ; i ++ ) allowNestingInOutputLocations [ i ] = true ; } for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { IClasspathEntry entry = classpath [ i ] ; if ( entry == null ) continue ; IPath entryPath = entry . getPath ( ) ; int kind = entry . getEntryKind ( ) ; if ( entryPath . equals ( projectPath ) ) { if ( kind == IClasspathEntry . CPE_PROJECT ) { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_PATH , Messages . bind ( Messages . classpath_cannotReferToItself , entryPath . makeRelative ( ) . toString ( ) ) ) ; } continue ; } if ( kind == IClasspathEntry . CPE_SOURCE || ( kind == IClasspathEntry . CPE_LIBRARY && ( JavaModel . getTarget ( entryPath , false ) instanceof IContainer ) ) ) { for ( int j = <NUM_LIT:0> ; j < classpath . length ; j ++ ) { IClasspathEntry otherEntry = classpath [ j ] ; if ( otherEntry == null ) continue ; int otherKind = otherEntry . getEntryKind ( ) ; IPath otherPath = otherEntry . getPath ( ) ; if ( entry != otherEntry && ( otherKind == IClasspathEntry . CPE_SOURCE || ( otherKind == IClasspathEntry . CPE_LIBRARY && ( JavaModel . getTarget ( otherPath , false ) instanceof IContainer ) ) ) ) { char [ ] [ ] inclusionPatterns , exclusionPatterns ; if ( otherPath . isPrefixOf ( entryPath ) && ! otherPath . equals ( entryPath ) && ! Util . isExcluded ( entryPath . append ( "<STR_LIT:*>" ) , inclusionPatterns = ( ( ClasspathEntry ) otherEntry ) . fullInclusionPatternChars ( ) , exclusionPatterns = ( ( ClasspathEntry ) otherEntry ) . fullExclusionPatternChars ( ) , false ) ) { String exclusionPattern = entryPath . removeFirstSegments ( otherPath . segmentCount ( ) ) . segment ( <NUM_LIT:0> ) ; if ( Util . isExcluded ( entryPath , inclusionPatterns , exclusionPatterns , false ) ) { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_CLASSPATH , Messages . bind ( Messages . classpath_mustEndWithSlash , new String [ ] { exclusionPattern , entryPath . makeRelative ( ) . toString ( ) } ) ) ; } else { if ( otherKind == IClasspathEntry . CPE_SOURCE ) { exclusionPattern += '<CHAR_LIT:/>' ; if ( ! disableExclusionPatterns ) { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_CLASSPATH , Messages . bind ( Messages . classpath_cannotNestEntryInEntry , new String [ ] { entryPath . makeRelative ( ) . toString ( ) , otherEntry . getPath ( ) . makeRelative ( ) . toString ( ) , exclusionPattern } ) ) ; } else { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_CLASSPATH , Messages . bind ( Messages . classpath_cannotNestEntryInEntryNoExclusion , new String [ ] { entryPath . makeRelative ( ) . toString ( ) , otherEntry . getPath ( ) . makeRelative ( ) . toString ( ) , exclusionPattern } ) ) ; } } else { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_CLASSPATH , Messages . bind ( Messages . classpath_cannotNestEntryInLibrary , new String [ ] { entryPath . makeRelative ( ) . toString ( ) , otherEntry . getPath ( ) . makeRelative ( ) . toString ( ) } ) ) ; } } } } } } char [ ] [ ] inclusionPatterns = ( ( ClasspathEntry ) entry ) . fullInclusionPatternChars ( ) ; char [ ] [ ] exclusionPatterns = ( ( ClasspathEntry ) entry ) . fullExclusionPatternChars ( ) ; for ( int j = <NUM_LIT:0> ; j < outputCount ; j ++ ) { IPath currentOutput = outputLocations [ j ] ; if ( entryPath . equals ( currentOutput ) ) continue ; if ( entryPath . isPrefixOf ( currentOutput ) ) { if ( kind != IClasspathEntry . CPE_SOURCE || ! Util . isExcluded ( currentOutput , inclusionPatterns , exclusionPatterns , true ) ) { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_CLASSPATH , Messages . bind ( Messages . classpath_cannotNestOutputInEntry , new String [ ] { currentOutput . makeRelative ( ) . toString ( ) , entryPath . makeRelative ( ) . toString ( ) } ) ) ; } } } for ( int j = <NUM_LIT:0> ; j < outputCount ; j ++ ) { if ( allowNestingInOutputLocations [ j ] ) continue ; IPath currentOutput = outputLocations [ j ] ; if ( currentOutput . isPrefixOf ( entryPath ) ) { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_CLASSPATH , Messages . bind ( Messages . classpath_cannotNestEntryInOutput , new String [ ] { entryPath . makeRelative ( ) . toString ( ) , currentOutput . makeRelative ( ) . toString ( ) } ) ) ; } } } for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { IClasspathEntry entry = classpath [ i ] ; if ( entry == null ) continue ; IPath entryPath = entry . getPath ( ) ; int kind = entry . getEntryKind ( ) ; boolean isProjectRelative = projectName . equals ( entryPath . segment ( <NUM_LIT:0> ) ) ; String entryPathMsg = isProjectRelative ? entryPath . removeFirstSegments ( <NUM_LIT:1> ) . toString ( ) : entryPath . makeRelative ( ) . toString ( ) ; if ( kind == IClasspathEntry . CPE_SOURCE ) { IPath output = entry . getOutputLocation ( ) ; if ( output == null ) continue ; for ( int j = <NUM_LIT:0> ; j < length ; j ++ ) { IClasspathEntry otherEntry = classpath [ j ] ; if ( otherEntry == entry ) continue ; boolean opStartsWithProject = projectName . equals ( otherEntry . getPath ( ) . segment ( <NUM_LIT:0> ) ) ; String otherPathMsg = opStartsWithProject ? otherEntry . getPath ( ) . removeFirstSegments ( <NUM_LIT:1> ) . toString ( ) : otherEntry . getPath ( ) . makeRelative ( ) . toString ( ) ; switch ( otherEntry . getEntryKind ( ) ) { case IClasspathEntry . CPE_SOURCE : if ( otherEntry . getPath ( ) . equals ( output ) ) { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_CLASSPATH , Messages . bind ( Messages . classpath_cannotUseDistinctSourceFolderAsOutput , new String [ ] { entryPathMsg , otherPathMsg , projectName } ) ) ; } break ; case IClasspathEntry . CPE_LIBRARY : if ( otherEntry . getPath ( ) . equals ( output ) ) { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_CLASSPATH , Messages . bind ( Messages . classpath_cannotUseLibraryAsOutput , new String [ ] { entryPathMsg , otherPathMsg , projectName } ) ) ; } } } } } return JavaModelStatus . VERIFIED_OK ; } public static IJavaModelStatus validateClasspathEntry ( IJavaProject project , IClasspathEntry entry , boolean checkSourceAttachment , boolean referredByContainer ) { IJavaModelStatus status = validateClasspathEntry ( project , entry , null , checkSourceAttachment , referredByContainer ) ; int statusCode = status . getCode ( ) ; if ( ( statusCode == IJavaModelStatusConstants . INVALID_CLASSPATH || statusCode == IJavaModelStatusConstants . CP_CONTAINER_PATH_UNBOUND || statusCode == IJavaModelStatusConstants . CP_VARIABLE_PATH_UNBOUND || statusCode == IJavaModelStatusConstants . INVALID_PATH ) && ( ( ClasspathEntry ) entry ) . isOptional ( ) ) return JavaModelStatus . VERIFIED_OK ; return status ; } private static IJavaModelStatus validateClasspathEntry ( IJavaProject project , IClasspathEntry entry , IClasspathContainer entryContainer , boolean checkSourceAttachment , boolean referredByContainer ) { IPath path = entry . getPath ( ) ; String projectName = project . getElementName ( ) ; String entryPathMsg = projectName . equals ( path . segment ( <NUM_LIT:0> ) ) ? path . removeFirstSegments ( <NUM_LIT:1> ) . makeRelative ( ) . toString ( ) : path . toString ( ) ; switch ( entry . getEntryKind ( ) ) { case IClasspathEntry . CPE_CONTAINER : if ( path . segmentCount ( ) >= <NUM_LIT:1> ) { try { IJavaModelStatus status = null ; IClasspathAttribute [ ] extraAttributes = entry . getExtraAttributes ( ) ; if ( extraAttributes != null ) { int length = extraAttributes . length ; HashSet set = new HashSet ( length ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { String attName = extraAttributes [ i ] . getName ( ) ; if ( ! set . add ( attName ) ) { status = new JavaModelStatus ( IJavaModelStatusConstants . NAME_COLLISION , Messages . bind ( Messages . classpath_duplicateEntryExtraAttribute , new String [ ] { attName , entryPathMsg , projectName } ) ) ; break ; } } } IClasspathContainer container = JavaModelManager . getJavaModelManager ( ) . getClasspathContainer ( path , project ) ; if ( container == null ) { if ( status != null ) return status ; return new JavaModelStatus ( IJavaModelStatusConstants . CP_CONTAINER_PATH_UNBOUND , project , path ) ; } else if ( container == JavaModelManager . CONTAINER_INITIALIZATION_IN_PROGRESS ) { return JavaModelStatus . VERIFIED_OK ; } IClasspathEntry [ ] containerEntries = container . getClasspathEntries ( ) ; if ( containerEntries != null ) { for ( int i = <NUM_LIT:0> , length = containerEntries . length ; i < length ; i ++ ) { IClasspathEntry containerEntry = containerEntries [ i ] ; int kind = containerEntry == null ? <NUM_LIT:0> : containerEntry . getEntryKind ( ) ; if ( containerEntry == null || kind == IClasspathEntry . CPE_SOURCE || kind == IClasspathEntry . CPE_VARIABLE || kind == IClasspathEntry . CPE_CONTAINER ) { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_CP_CONTAINER_ENTRY , project , path ) ; } IJavaModelStatus containerEntryStatus = validateClasspathEntry ( project , containerEntry , container , checkSourceAttachment , true ) ; if ( ! containerEntryStatus . isOK ( ) ) { return containerEntryStatus ; } } } } catch ( JavaModelException e ) { return new JavaModelStatus ( e ) ; } } else { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_CLASSPATH , Messages . bind ( Messages . classpath_illegalContainerPath , new String [ ] { entryPathMsg , projectName } ) ) ; } break ; case IClasspathEntry . CPE_VARIABLE : if ( path . segmentCount ( ) >= <NUM_LIT:1> ) { try { entry = JavaCore . getResolvedClasspathEntry ( entry ) ; } catch ( AssertionFailedException e ) { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_PATH , e . getMessage ( ) ) ; } if ( entry == null ) { return new JavaModelStatus ( IJavaModelStatusConstants . CP_VARIABLE_PATH_UNBOUND , project , path ) ; } IJavaModelStatus status = validateClasspathEntry ( project , entry , null , checkSourceAttachment , false ) ; if ( ! status . isOK ( ) ) return status ; String variableName = path . segment ( <NUM_LIT:0> ) ; String deprecatedMessage = JavaCore . getClasspathVariableDeprecationMessage ( variableName ) ; if ( deprecatedMessage != null ) { return new JavaModelStatus ( IStatus . WARNING , IJavaModelStatusConstants . DEPRECATED_VARIABLE , project , path , deprecatedMessage ) ; } return status ; } else { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_CLASSPATH , Messages . bind ( Messages . classpath_illegalVariablePath , new String [ ] { entryPathMsg , projectName } ) ) ; } case IClasspathEntry . CPE_LIBRARY : path = ClasspathEntry . resolveDotDot ( path ) ; String containerInfo = null ; if ( entryContainer != null ) { if ( entryContainer instanceof UserLibraryClasspathContainer ) { containerInfo = Messages . bind ( Messages . classpath_userLibraryInfo , new String [ ] { entryContainer . getDescription ( ) } ) ; } else { containerInfo = Messages . bind ( Messages . classpath_containerInfo , new String [ ] { entryContainer . getDescription ( ) } ) ; } } IJavaModelStatus status = validateLibraryEntry ( path , project , containerInfo , checkSourceAttachment ? entry . getSourceAttachmentPath ( ) : null , entryPathMsg ) ; if ( status . getCode ( ) == IJavaModelStatusConstants . INVALID_CLASSPATH && ( ( ClasspathEntry ) entry ) . isOptional ( ) ) status = JavaModelStatus . VERIFIED_OK ; if ( ! status . isOK ( ) ) return status ; break ; case IClasspathEntry . CPE_PROJECT : if ( path . isAbsolute ( ) && path . segmentCount ( ) == <NUM_LIT:1> ) { IProject prereqProjectRsc = workspaceRoot . getProject ( path . segment ( <NUM_LIT:0> ) ) ; IJavaProject prereqProject = JavaCore . create ( prereqProjectRsc ) ; try { if ( ! prereqProjectRsc . exists ( ) || ! prereqProjectRsc . hasNature ( JavaCore . NATURE_ID ) ) { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_CLASSPATH , Messages . bind ( Messages . classpath_unboundProject , new String [ ] { path . segment ( <NUM_LIT:0> ) , projectName } ) ) ; } if ( ! prereqProjectRsc . isOpen ( ) ) { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_CLASSPATH , Messages . bind ( Messages . classpath_closedProject , new String [ ] { path . segment ( <NUM_LIT:0> ) } ) ) ; } if ( ! JavaCore . IGNORE . equals ( project . getOption ( JavaCore . CORE_INCOMPATIBLE_JDK_LEVEL , true ) ) ) { long projectTargetJDK = CompilerOptions . versionToJdkLevel ( project . getOption ( JavaCore . COMPILER_CODEGEN_TARGET_PLATFORM , true ) ) ; long prereqProjectTargetJDK = CompilerOptions . versionToJdkLevel ( prereqProject . getOption ( JavaCore . COMPILER_CODEGEN_TARGET_PLATFORM , true ) ) ; if ( prereqProjectTargetJDK > projectTargetJDK ) { return new JavaModelStatus ( IJavaModelStatusConstants . INCOMPATIBLE_JDK_LEVEL , project , path , Messages . bind ( Messages . classpath_incompatibleLibraryJDKLevel , new String [ ] { project . getElementName ( ) , CompilerOptions . versionFromJdkLevel ( projectTargetJDK ) , path . makeRelative ( ) . toString ( ) , CompilerOptions . versionFromJdkLevel ( prereqProjectTargetJDK ) } ) ) ; } } } catch ( CoreException e ) { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_CLASSPATH , Messages . bind ( Messages . classpath_unboundProject , new String [ ] { path . segment ( <NUM_LIT:0> ) , projectName } ) ) ; } } else { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_CLASSPATH , Messages . bind ( Messages . classpath_illegalProjectPath , new String [ ] { path . toString ( ) , projectName } ) ) ; } break ; case IClasspathEntry . CPE_SOURCE : if ( ( ( entry . getInclusionPatterns ( ) != null && entry . getInclusionPatterns ( ) . length > <NUM_LIT:0> ) || ( entry . getExclusionPatterns ( ) != null && entry . getExclusionPatterns ( ) . length > <NUM_LIT:0> ) ) && JavaCore . DISABLED . equals ( project . getOption ( JavaCore . CORE_ENABLE_CLASSPATH_EXCLUSION_PATTERNS , true ) ) ) { return new JavaModelStatus ( IJavaModelStatusConstants . DISABLED_CP_EXCLUSION_PATTERNS , project , path ) ; } if ( entry . getOutputLocation ( ) != null && JavaCore . DISABLED . equals ( project . getOption ( JavaCore . CORE_ENABLE_CLASSPATH_MULTIPLE_OUTPUT_LOCATIONS , true ) ) ) { return new JavaModelStatus ( IJavaModelStatusConstants . DISABLED_CP_MULTIPLE_OUTPUT_LOCATIONS , project , path ) ; } if ( path . isAbsolute ( ) && ! path . isEmpty ( ) ) { IPath projectPath = project . getProject ( ) . getFullPath ( ) ; if ( ! projectPath . isPrefixOf ( path ) || JavaModel . getTarget ( path , true ) == null ) { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_CLASSPATH , Messages . bind ( Messages . classpath_unboundSourceFolder , new String [ ] { entryPathMsg , projectName } ) ) ; } } else { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_CLASSPATH , Messages . bind ( Messages . classpath_illegalSourceFolderPath , new String [ ] { entryPathMsg , projectName } ) ) ; } break ; } IClasspathAttribute [ ] extraAttributes = entry . getExtraAttributes ( ) ; if ( extraAttributes != null ) { int length = extraAttributes . length ; HashSet set = new HashSet ( length ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { String attName = extraAttributes [ i ] . getName ( ) ; if ( ! set . add ( attName ) ) { return new JavaModelStatus ( IJavaModelStatusConstants . NAME_COLLISION , Messages . bind ( Messages . classpath_duplicateEntryExtraAttribute , new String [ ] { attName , entryPathMsg , projectName } ) ) ; } } } return JavaModelStatus . VERIFIED_OK ; } private static IJavaModelStatus validateLibraryEntry ( IPath path , IJavaProject project , String container , IPath sourceAttachment , String entryPathMsg ) { if ( path . isAbsolute ( ) && ! path . isEmpty ( ) ) { Object target = JavaModel . getTarget ( path , true ) ; if ( target == null ) { IPath workspaceLocation = workspaceRoot . getLocation ( ) ; if ( workspaceLocation . isPrefixOf ( path ) ) { target = JavaModel . getTarget ( path . makeRelativeTo ( workspaceLocation ) . makeAbsolute ( ) , true ) ; } } if ( target != null && ! JavaCore . IGNORE . equals ( project . getOption ( JavaCore . CORE_INCOMPATIBLE_JDK_LEVEL , true ) ) ) { long projectTargetJDK = CompilerOptions . versionToJdkLevel ( project . getOption ( JavaCore . COMPILER_CODEGEN_TARGET_PLATFORM , true ) ) ; long libraryJDK = Util . getJdkLevel ( target ) ; if ( libraryJDK != <NUM_LIT:0> && libraryJDK > projectTargetJDK ) { if ( container != null ) { return new JavaModelStatus ( IJavaModelStatusConstants . INCOMPATIBLE_JDK_LEVEL , project , path , Messages . bind ( Messages . classpath_incompatibleLibraryJDKLevelInContainer , new String [ ] { project . getElementName ( ) , CompilerOptions . versionFromJdkLevel ( projectTargetJDK ) , path . makeRelative ( ) . toString ( ) , container , CompilerOptions . versionFromJdkLevel ( libraryJDK ) } ) ) ; } else { return new JavaModelStatus ( IJavaModelStatusConstants . INCOMPATIBLE_JDK_LEVEL , project , path , Messages . bind ( Messages . classpath_incompatibleLibraryJDKLevel , new String [ ] { project . getElementName ( ) , CompilerOptions . versionFromJdkLevel ( projectTargetJDK ) , path . makeRelative ( ) . toString ( ) , CompilerOptions . versionFromJdkLevel ( libraryJDK ) } ) ) ; } } } if ( target instanceof IResource ) { IResource resolvedResource = ( IResource ) target ; switch ( resolvedResource . getType ( ) ) { case IResource . FILE : if ( sourceAttachment != null && ! sourceAttachment . isEmpty ( ) && JavaModel . getTarget ( sourceAttachment , true ) == null ) { if ( container != null ) { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_CLASSPATH , Messages . bind ( Messages . classpath_unboundSourceAttachmentInContainedLibrary , new String [ ] { sourceAttachment . toString ( ) , path . toString ( ) , container } ) ) ; } else { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_CLASSPATH , Messages . bind ( Messages . classpath_unboundSourceAttachment , new String [ ] { sourceAttachment . toString ( ) , path . toString ( ) , project . getElementName ( ) } ) ) ; } } break ; case IResource . FOLDER : if ( sourceAttachment != null && ! sourceAttachment . isEmpty ( ) && JavaModel . getTarget ( sourceAttachment , true ) == null ) { if ( container != null ) { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_CLASSPATH , Messages . bind ( Messages . classpath_unboundSourceAttachmentInContainedLibrary , new String [ ] { sourceAttachment . toString ( ) , path . toString ( ) , container } ) ) ; } else { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_CLASSPATH , Messages . bind ( Messages . classpath_unboundSourceAttachment , new String [ ] { sourceAttachment . toString ( ) , path . toString ( ) , project . getElementName ( ) } ) ) ; } } } } else if ( target instanceof File ) { File file = JavaModel . getFile ( target ) ; if ( file == null ) { if ( container != null ) { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_CLASSPATH , Messages . bind ( Messages . classpath_illegalExternalFolderInContainer , new String [ ] { path . toOSString ( ) , container } ) ) ; } else { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_CLASSPATH , Messages . bind ( Messages . classpath_illegalExternalFolder , new String [ ] { path . toOSString ( ) , project . getElementName ( ) } ) ) ; } } else if ( sourceAttachment != null && ! sourceAttachment . isEmpty ( ) && JavaModel . getTarget ( sourceAttachment , true ) == null ) { if ( container != null ) { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_CLASSPATH , Messages . bind ( Messages . classpath_unboundSourceAttachmentInContainedLibrary , new String [ ] { sourceAttachment . toString ( ) , path . toOSString ( ) , container } ) ) ; } else { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_CLASSPATH , Messages . bind ( Messages . classpath_unboundSourceAttachment , new String [ ] { sourceAttachment . toString ( ) , path . toOSString ( ) , project . getElementName ( ) } ) ) ; } } } else { boolean isExternal = path . getDevice ( ) != null || ! ResourcesPlugin . getWorkspace ( ) . getRoot ( ) . getProject ( path . segment ( <NUM_LIT:0> ) ) . exists ( ) ; if ( isExternal ) { if ( container != null ) { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_CLASSPATH , Messages . bind ( Messages . classpath_unboundLibraryInContainer , new String [ ] { path . toOSString ( ) , container } ) ) ; } else { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_CLASSPATH , Messages . bind ( Messages . classpath_unboundLibrary , new String [ ] { path . toOSString ( ) , project . getElementName ( ) } ) ) ; } } else { if ( entryPathMsg == null ) entryPathMsg = project . getElementName ( ) . equals ( path . segment ( <NUM_LIT:0> ) ) ? path . removeFirstSegments ( <NUM_LIT:1> ) . makeRelative ( ) . toString ( ) : path . toString ( ) ; if ( container != null ) { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_CLASSPATH , Messages . bind ( Messages . classpath_unboundLibraryInContainer , new String [ ] { entryPathMsg , container } ) ) ; } else { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_CLASSPATH , Messages . bind ( Messages . classpath_unboundLibrary , new String [ ] { entryPathMsg , project . getElementName ( ) } ) ) ; } } } } else { if ( entryPathMsg == null ) entryPathMsg = project . getElementName ( ) . equals ( path . segment ( <NUM_LIT:0> ) ) ? path . removeFirstSegments ( <NUM_LIT:1> ) . makeRelative ( ) . toString ( ) : path . toString ( ) ; if ( container != null ) { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_CLASSPATH , Messages . bind ( Messages . classpath_illegalLibraryPathInContainer , new String [ ] { entryPathMsg , container } ) ) ; } else { return new JavaModelStatus ( IJavaModelStatusConstants . INVALID_CLASSPATH , Messages . bind ( Messages . classpath_illegalLibraryPath , new String [ ] { entryPathMsg , project . getElementName ( ) } ) ) ; } } return JavaModelStatus . VERIFIED_OK ; } } </s>
<s> package org . eclipse . jdt . internal . core ; import org . eclipse . core . runtime . IPath ; import org . eclipse . core . runtime . Path ; import org . eclipse . jdt . core . IAccessRule ; import org . eclipse . jdt . core . compiler . IProblem ; import org . eclipse . jdt . internal . compiler . env . AccessRule ; public class ClasspathAccessRule extends AccessRule implements IAccessRule { public ClasspathAccessRule ( IPath pattern , int kind ) { this ( pattern . toString ( ) . toCharArray ( ) , toProblemId ( kind ) ) ; } public ClasspathAccessRule ( char [ ] pattern , int problemId ) { super ( pattern , problemId ) ; } private static int toProblemId ( int kind ) { boolean ignoreIfBetter = ( kind & IAccessRule . IGNORE_IF_BETTER ) != <NUM_LIT:0> ; switch ( kind & ~ IAccessRule . IGNORE_IF_BETTER ) { case K_NON_ACCESSIBLE : return ignoreIfBetter ? IProblem . ForbiddenReference | AccessRule . IgnoreIfBetter : IProblem . ForbiddenReference ; case K_DISCOURAGED : return ignoreIfBetter ? IProblem . DiscouragedReference | AccessRule . IgnoreIfBetter : IProblem . DiscouragedReference ; default : return ignoreIfBetter ? AccessRule . IgnoreIfBetter : <NUM_LIT:0> ; } } public IPath getPattern ( ) { return new Path ( new String ( this . pattern ) ) ; } public int getKind ( ) { switch ( getProblemId ( ) ) { case IProblem . ForbiddenReference : return K_NON_ACCESSIBLE ; case IProblem . DiscouragedReference : return K_DISCOURAGED ; default : return K_ACCESSIBLE ; } } } </s>
<s> package org . eclipse . jdt . internal . core ; import org . eclipse . jdt . core . * ; import org . eclipse . jdt . core . IJavaElement ; import org . eclipse . jdt . core . IJavaModelStatus ; import org . eclipse . jdt . core . IJavaModelStatusConstants ; import org . eclipse . jdt . core . IJavaProject ; import org . eclipse . jdt . core . IRegion ; import org . eclipse . jdt . core . IType ; import org . eclipse . jdt . core . ITypeHierarchy ; import org . eclipse . jdt . core . JavaModelException ; import org . eclipse . jdt . core . search . IJavaSearchScope ; import org . eclipse . jdt . internal . core . hierarchy . RegionBasedTypeHierarchy ; import org . eclipse . jdt . internal . core . hierarchy . TypeHierarchy ; public class CreateTypeHierarchyOperation extends JavaModelOperation { protected TypeHierarchy typeHierarchy ; public CreateTypeHierarchyOperation ( IRegion region , ICompilationUnit [ ] workingCopies , IType element , boolean computeSubtypes ) { super ( element ) ; this . typeHierarchy = new RegionBasedTypeHierarchy ( region , workingCopies , element , computeSubtypes ) ; } public CreateTypeHierarchyOperation ( IType element , ICompilationUnit [ ] workingCopies , IJavaSearchScope scope , boolean computeSubtypes ) { super ( element ) ; ICompilationUnit [ ] copies ; if ( workingCopies != null ) { int length = workingCopies . length ; copies = new ICompilationUnit [ length ] ; System . arraycopy ( workingCopies , <NUM_LIT:0> , copies , <NUM_LIT:0> , length ) ; } else { copies = null ; } this . typeHierarchy = new TypeHierarchy ( element , copies , scope , computeSubtypes ) ; } public CreateTypeHierarchyOperation ( IType element , ICompilationUnit [ ] workingCopies , IJavaProject project , boolean computeSubtypes ) { super ( element ) ; ICompilationUnit [ ] copies ; if ( workingCopies != null ) { int length = workingCopies . length ; copies = new ICompilationUnit [ length ] ; System . arraycopy ( workingCopies , <NUM_LIT:0> , copies , <NUM_LIT:0> , length ) ; } else { copies = null ; } this . typeHierarchy = new TypeHierarchy ( element , copies , project , computeSubtypes ) ; } protected void executeOperation ( ) throws JavaModelException { this . typeHierarchy . refresh ( this ) ; } public ITypeHierarchy getResult ( ) { return this . typeHierarchy ; } public boolean isReadOnly ( ) { return true ; } public IJavaModelStatus verify ( ) { IJavaElement elementToProcess = getElementToProcess ( ) ; if ( elementToProcess == null && ! ( this . typeHierarchy instanceof RegionBasedTypeHierarchy ) ) { return new JavaModelStatus ( IJavaModelStatusConstants . NO_ELEMENTS_TO_PROCESS ) ; } if ( elementToProcess != null && ! elementToProcess . exists ( ) ) { return new JavaModelStatus ( IJavaModelStatusConstants . ELEMENT_DOES_NOT_EXIST , elementToProcess ) ; } IJavaProject project = this . typeHierarchy . javaProject ( ) ; if ( project != null && ! project . exists ( ) ) { return new JavaModelStatus ( IJavaModelStatusConstants . ELEMENT_DOES_NOT_EXIST , project ) ; } return JavaModelStatus . VERIFIED_OK ; } } </s>
<s> package org . eclipse . jdt . internal . core ; import java . util . zip . ZipFile ; import org . eclipse . core . runtime . CoreException ; import org . eclipse . core . runtime . IPath ; import org . eclipse . core . runtime . Path ; import org . eclipse . core . runtime . PlatformObject ; import org . eclipse . jdt . core . IJarEntryResource ; import org . eclipse . jdt . core . IPackageFragment ; import org . eclipse . jdt . core . IPackageFragmentRoot ; import org . eclipse . jdt . internal . core . util . Util ; public abstract class JarEntryResource extends PlatformObject implements IJarEntryResource { protected Object parent ; protected String simpleName ; public JarEntryResource ( String simpleName ) { this . simpleName = simpleName ; } public abstract JarEntryResource clone ( Object newParent ) ; public boolean equals ( Object obj ) { if ( ! ( obj instanceof JarEntryResource ) ) return false ; JarEntryResource other = ( JarEntryResource ) obj ; return this . parent . equals ( other . parent ) && this . simpleName . equals ( other . simpleName ) ; } protected String getEntryName ( ) { String parentEntryName ; if ( this . parent instanceof IPackageFragment ) { String elementName = ( ( IPackageFragment ) this . parent ) . getElementName ( ) ; parentEntryName = elementName . length ( ) == <NUM_LIT:0> ? "<STR_LIT>" : elementName . replace ( '<CHAR_LIT:.>' , '<CHAR_LIT:/>' ) + '<CHAR_LIT:/>' ; } else if ( this . parent instanceof IPackageFragmentRoot ) { parentEntryName = "<STR_LIT>" ; } else { parentEntryName = ( ( JarEntryDirectory ) this . parent ) . getEntryName ( ) + '<CHAR_LIT:/>' ; } return parentEntryName + this . simpleName ; } public IPath getFullPath ( ) { return new Path ( getEntryName ( ) ) . makeAbsolute ( ) ; } public String getName ( ) { return this . simpleName ; } public Object getParent ( ) { return this . parent ; } public IPackageFragmentRoot getPackageFragmentRoot ( ) { if ( this . parent instanceof IPackageFragment ) { return ( IPackageFragmentRoot ) ( ( IPackageFragment ) this . parent ) . getParent ( ) ; } else if ( this . parent instanceof IPackageFragmentRoot ) { return ( IPackageFragmentRoot ) this . parent ; } else { return ( ( JarEntryDirectory ) this . parent ) . getPackageFragmentRoot ( ) ; } } protected ZipFile getZipFile ( ) throws CoreException { if ( this . parent instanceof IPackageFragment ) { JarPackageFragmentRoot root = ( JarPackageFragmentRoot ) ( ( IPackageFragment ) this . parent ) . getParent ( ) ; return root . getJar ( ) ; } else if ( this . parent instanceof JarPackageFragmentRoot ) { return ( ( JarPackageFragmentRoot ) this . parent ) . getJar ( ) ; } else return ( ( JarEntryDirectory ) this . parent ) . getZipFile ( ) ; } public int hashCode ( ) { return Util . combineHashCodes ( this . simpleName . hashCode ( ) , this . parent . hashCode ( ) ) ; } public boolean isReadOnly ( ) { return true ; } public void setParent ( Object parent ) { this . parent = parent ; } } </s>
<s> package org . eclipse . jdt . internal . core ; public class SourceMethodInfo extends SourceMethodElementInfo { protected char [ ] returnType ; public boolean isAnnotationMethod ( ) { return false ; } public boolean isConstructor ( ) { return false ; } public char [ ] getReturnTypeName ( ) { return this . returnType ; } protected void setReturnType ( char [ ] type ) { this . returnType = type ; } } </s>
<s> package org . eclipse . jdt . internal . core ; import java . io . BufferedInputStream ; import java . io . BufferedOutputStream ; import java . io . DataInputStream ; import java . io . DataOutputStream ; import java . io . File ; import java . io . FileInputStream ; import java . io . FileOutputStream ; import java . io . IOException ; import java . util . * ; import org . eclipse . core . resources . * ; import org . eclipse . core . runtime . * ; import org . eclipse . jdt . core . * ; import org . eclipse . jdt . internal . core . JavaModelManager . PerProjectInfo ; import org . eclipse . jdt . internal . core . util . Util ; public class DeltaProcessingState implements IResourceChangeListener { public IElementChangedListener [ ] elementChangedListeners = new IElementChangedListener [ <NUM_LIT:5> ] ; public int [ ] elementChangedListenerMasks = new int [ <NUM_LIT:5> ] ; public int elementChangedListenerCount = <NUM_LIT:0> ; public IResourceChangeListener [ ] preResourceChangeListeners = new IResourceChangeListener [ <NUM_LIT:1> ] ; public int [ ] preResourceChangeEventMasks = new int [ <NUM_LIT:1> ] ; public int preResourceChangeListenerCount = <NUM_LIT:0> ; private ThreadLocal deltaProcessors = new ThreadLocal ( ) ; public void doNotUse ( ) { this . deltaProcessors . set ( null ) ; } public HashMap roots = new HashMap ( ) ; public HashMap otherRoots = new HashMap ( ) ; public HashMap oldRoots = new HashMap ( ) ; public HashMap oldOtherRoots = new HashMap ( ) ; public HashMap sourceAttachments = new HashMap ( ) ; public HashMap projectDependencies = new HashMap ( ) ; public boolean rootsAreStale = true ; private Set initializingThreads = Collections . synchronizedSet ( new HashSet ( ) ) ; public Hashtable externalTimeStamps ; private HashMap classpathChanges = new HashMap ( ) ; private HashMap classpathValidations = new HashMap ( ) ; private HashMap projectReferenceChanges = new HashMap ( ) ; private HashMap externalFolderChanges = new HashMap ( ) ; private HashSet javaProjectNamesCache ; private HashSet externalElementsToRefresh ; public synchronized void addElementChangedListener ( IElementChangedListener listener , int eventMask ) { for ( int i = <NUM_LIT:0> ; i < this . elementChangedListenerCount ; i ++ ) { if ( this . elementChangedListeners [ i ] == listener ) { int cloneLength = this . elementChangedListenerMasks . length ; System . arraycopy ( this . elementChangedListenerMasks , <NUM_LIT:0> , this . elementChangedListenerMasks = new int [ cloneLength ] , <NUM_LIT:0> , cloneLength ) ; this . elementChangedListenerMasks [ i ] |= eventMask ; return ; } } int length ; if ( ( length = this . elementChangedListeners . length ) == this . elementChangedListenerCount ) { System . arraycopy ( this . elementChangedListeners , <NUM_LIT:0> , this . elementChangedListeners = new IElementChangedListener [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; System . arraycopy ( this . elementChangedListenerMasks , <NUM_LIT:0> , this . elementChangedListenerMasks = new int [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; } this . elementChangedListeners [ this . elementChangedListenerCount ] = listener ; this . elementChangedListenerMasks [ this . elementChangedListenerCount ] = eventMask ; this . elementChangedListenerCount ++ ; } public synchronized void addForRefresh ( IJavaElement externalElement ) { if ( this . externalElementsToRefresh == null ) { this . externalElementsToRefresh = new HashSet ( ) ; } this . externalElementsToRefresh . add ( externalElement ) ; } public synchronized void addPreResourceChangedListener ( IResourceChangeListener listener , int eventMask ) { for ( int i = <NUM_LIT:0> ; i < this . preResourceChangeListenerCount ; i ++ ) { if ( this . preResourceChangeListeners [ i ] == listener ) { this . preResourceChangeEventMasks [ i ] |= eventMask ; return ; } } int length ; if ( ( length = this . preResourceChangeListeners . length ) == this . preResourceChangeListenerCount ) { System . arraycopy ( this . preResourceChangeListeners , <NUM_LIT:0> , this . preResourceChangeListeners = new IResourceChangeListener [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; System . arraycopy ( this . preResourceChangeEventMasks , <NUM_LIT:0> , this . preResourceChangeEventMasks = new int [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; } this . preResourceChangeListeners [ this . preResourceChangeListenerCount ] = listener ; this . preResourceChangeEventMasks [ this . preResourceChangeListenerCount ] = eventMask ; this . preResourceChangeListenerCount ++ ; } public DeltaProcessor getDeltaProcessor ( ) { DeltaProcessor deltaProcessor = ( DeltaProcessor ) this . deltaProcessors . get ( ) ; if ( deltaProcessor != null ) return deltaProcessor ; deltaProcessor = new DeltaProcessor ( this , JavaModelManager . getJavaModelManager ( ) ) ; this . deltaProcessors . set ( deltaProcessor ) ; return deltaProcessor ; } public synchronized ClasspathChange addClasspathChange ( IProject project , IClasspathEntry [ ] oldRawClasspath , IPath oldOutputLocation , IClasspathEntry [ ] oldResolvedClasspath ) { ClasspathChange change = ( ClasspathChange ) this . classpathChanges . get ( project ) ; if ( change == null ) { change = new ClasspathChange ( ( JavaProject ) JavaModelManager . getJavaModelManager ( ) . getJavaModel ( ) . getJavaProject ( project ) , oldRawClasspath , oldOutputLocation , oldResolvedClasspath ) ; this . classpathChanges . put ( project , change ) ; } else { if ( change . oldRawClasspath == null ) change . oldRawClasspath = oldRawClasspath ; if ( change . oldOutputLocation == null ) change . oldOutputLocation = oldOutputLocation ; if ( change . oldResolvedClasspath == null ) change . oldResolvedClasspath = oldResolvedClasspath ; } return change ; } public synchronized ClasspathChange getClasspathChange ( IProject project ) { return ( ClasspathChange ) this . classpathChanges . get ( project ) ; } public synchronized HashMap removeAllClasspathChanges ( ) { HashMap result = this . classpathChanges ; this . classpathChanges = new HashMap ( result . size ( ) ) ; return result ; } public synchronized ClasspathValidation addClasspathValidation ( JavaProject project ) { ClasspathValidation validation = ( ClasspathValidation ) this . classpathValidations . get ( project ) ; if ( validation == null ) { validation = new ClasspathValidation ( project ) ; this . classpathValidations . put ( project , validation ) ; } return validation ; } public synchronized void addExternalFolderChange ( JavaProject project , IClasspathEntry [ ] oldResolvedClasspath ) { ExternalFolderChange change = ( ExternalFolderChange ) this . externalFolderChanges . get ( project ) ; if ( change == null ) { change = new ExternalFolderChange ( project , oldResolvedClasspath ) ; this . externalFolderChanges . put ( project , change ) ; } } public synchronized void addProjectReferenceChange ( JavaProject project , IClasspathEntry [ ] oldResolvedClasspath ) { ProjectReferenceChange change = ( ProjectReferenceChange ) this . projectReferenceChanges . get ( project ) ; if ( change == null ) { change = new ProjectReferenceChange ( project , oldResolvedClasspath ) ; this . projectReferenceChanges . put ( project , change ) ; } } public void initializeRoots ( boolean initAfterLoad ) { HashMap [ ] rootInfos = null ; if ( this . rootsAreStale ) { Thread currentThread = Thread . currentThread ( ) ; boolean addedCurrentThread = false ; try { if ( ! this . initializingThreads . add ( currentThread ) ) return ; addedCurrentThread = true ; JavaModelManager . getJavaModelManager ( ) . forceBatchInitializations ( initAfterLoad ) ; rootInfos = getRootInfos ( false ) ; } finally { if ( addedCurrentThread ) { this . initializingThreads . remove ( currentThread ) ; } } } synchronized ( this ) { this . oldRoots = this . roots ; this . oldOtherRoots = this . otherRoots ; if ( this . rootsAreStale && rootInfos != null ) { this . roots = rootInfos [ <NUM_LIT:0> ] ; this . otherRoots = rootInfos [ <NUM_LIT:1> ] ; this . sourceAttachments = rootInfos [ <NUM_LIT:2> ] ; this . projectDependencies = rootInfos [ <NUM_LIT:3> ] ; this . rootsAreStale = false ; } } } synchronized void initializeRootsWithPreviousSession ( ) { HashMap [ ] rootInfos = getRootInfos ( true ) ; if ( rootInfos != null ) { this . roots = rootInfos [ <NUM_LIT:0> ] ; this . otherRoots = rootInfos [ <NUM_LIT:1> ] ; this . sourceAttachments = rootInfos [ <NUM_LIT:2> ] ; this . projectDependencies = rootInfos [ <NUM_LIT:3> ] ; this . rootsAreStale = false ; } } private HashMap [ ] getRootInfos ( boolean usePreviousSession ) { HashMap newRoots = new HashMap ( ) ; HashMap newOtherRoots = new HashMap ( ) ; HashMap newSourceAttachments = new HashMap ( ) ; HashMap newProjectDependencies = new HashMap ( ) ; IJavaModel model = JavaModelManager . getJavaModelManager ( ) . getJavaModel ( ) ; IJavaProject [ ] projects ; try { projects = model . getJavaProjects ( ) ; } catch ( JavaModelException e ) { return null ; } for ( int i = <NUM_LIT:0> , length = projects . length ; i < length ; i ++ ) { JavaProject project = ( JavaProject ) projects [ i ] ; IClasspathEntry [ ] classpath ; try { if ( usePreviousSession ) { PerProjectInfo perProjectInfo = project . getPerProjectInfo ( ) ; project . resolveClasspath ( perProjectInfo , true , false ) ; classpath = perProjectInfo . resolvedClasspath ; } else { classpath = project . getResolvedClasspath ( ) ; } } catch ( JavaModelException e ) { continue ; } for ( int j = <NUM_LIT:0> , classpathLength = classpath . length ; j < classpathLength ; j ++ ) { IClasspathEntry entry = classpath [ j ] ; if ( entry . getEntryKind ( ) == IClasspathEntry . CPE_PROJECT ) { IJavaProject key = model . getJavaProject ( entry . getPath ( ) . segment ( <NUM_LIT:0> ) ) ; IJavaProject [ ] dependents = ( IJavaProject [ ] ) newProjectDependencies . get ( key ) ; if ( dependents == null ) { dependents = new IJavaProject [ ] { project } ; } else { int dependentsLength = dependents . length ; System . arraycopy ( dependents , <NUM_LIT:0> , dependents = new IJavaProject [ dependentsLength + <NUM_LIT:1> ] , <NUM_LIT:0> , dependentsLength ) ; dependents [ dependentsLength ] = project ; } newProjectDependencies . put ( key , dependents ) ; continue ; } IPath path = entry . getPath ( ) ; if ( newRoots . get ( path ) == null ) { newRoots . put ( path , new DeltaProcessor . RootInfo ( project , path , ( ( ClasspathEntry ) entry ) . fullInclusionPatternChars ( ) , ( ( ClasspathEntry ) entry ) . fullExclusionPatternChars ( ) , entry . getEntryKind ( ) ) ) ; } else { ArrayList rootList = ( ArrayList ) newOtherRoots . get ( path ) ; if ( rootList == null ) { rootList = new ArrayList ( ) ; newOtherRoots . put ( path , rootList ) ; } rootList . add ( new DeltaProcessor . RootInfo ( project , path , ( ( ClasspathEntry ) entry ) . fullInclusionPatternChars ( ) , ( ( ClasspathEntry ) entry ) . fullExclusionPatternChars ( ) , entry . getEntryKind ( ) ) ) ; } if ( entry . getEntryKind ( ) != IClasspathEntry . CPE_LIBRARY ) continue ; String propertyString = null ; try { propertyString = Util . getSourceAttachmentProperty ( path ) ; } catch ( JavaModelException e ) { e . printStackTrace ( ) ; } IPath sourceAttachmentPath ; if ( propertyString != null ) { int index = propertyString . lastIndexOf ( PackageFragmentRoot . ATTACHMENT_PROPERTY_DELIMITER ) ; sourceAttachmentPath = ( index < <NUM_LIT:0> ) ? new Path ( propertyString ) : new Path ( propertyString . substring ( <NUM_LIT:0> , index ) ) ; } else { sourceAttachmentPath = entry . getSourceAttachmentPath ( ) ; } if ( sourceAttachmentPath != null ) { newSourceAttachments . put ( sourceAttachmentPath , path ) ; } } } return new HashMap [ ] { newRoots , newOtherRoots , newSourceAttachments , newProjectDependencies } ; } public synchronized ClasspathValidation [ ] removeClasspathValidations ( ) { int length = this . classpathValidations . size ( ) ; if ( length == <NUM_LIT:0> ) return null ; ClasspathValidation [ ] validations = new ClasspathValidation [ length ] ; this . classpathValidations . values ( ) . toArray ( validations ) ; this . classpathValidations . clear ( ) ; return validations ; } public synchronized ExternalFolderChange [ ] removeExternalFolderChanges ( ) { int length = this . externalFolderChanges . size ( ) ; if ( length == <NUM_LIT:0> ) return null ; ExternalFolderChange [ ] updates = new ExternalFolderChange [ length ] ; this . externalFolderChanges . values ( ) . toArray ( updates ) ; this . externalFolderChanges . clear ( ) ; return updates ; } public synchronized ProjectReferenceChange [ ] removeProjectReferenceChanges ( ) { int length = this . projectReferenceChanges . size ( ) ; if ( length == <NUM_LIT:0> ) return null ; ProjectReferenceChange [ ] updates = new ProjectReferenceChange [ length ] ; this . projectReferenceChanges . values ( ) . toArray ( updates ) ; this . projectReferenceChanges . clear ( ) ; return updates ; } public synchronized HashSet removeExternalElementsToRefresh ( ) { HashSet result = this . externalElementsToRefresh ; this . externalElementsToRefresh = null ; return result ; } public synchronized void removeElementChangedListener ( IElementChangedListener listener ) { for ( int i = <NUM_LIT:0> ; i < this . elementChangedListenerCount ; i ++ ) { if ( this . elementChangedListeners [ i ] == listener ) { int length = this . elementChangedListeners . length ; IElementChangedListener [ ] newListeners = new IElementChangedListener [ length ] ; System . arraycopy ( this . elementChangedListeners , <NUM_LIT:0> , newListeners , <NUM_LIT:0> , i ) ; int [ ] newMasks = new int [ length ] ; System . arraycopy ( this . elementChangedListenerMasks , <NUM_LIT:0> , newMasks , <NUM_LIT:0> , i ) ; int trailingLength = this . elementChangedListenerCount - i - <NUM_LIT:1> ; if ( trailingLength > <NUM_LIT:0> ) { System . arraycopy ( this . elementChangedListeners , i + <NUM_LIT:1> , newListeners , i , trailingLength ) ; System . arraycopy ( this . elementChangedListenerMasks , i + <NUM_LIT:1> , newMasks , i , trailingLength ) ; } this . elementChangedListeners = newListeners ; this . elementChangedListenerMasks = newMasks ; this . elementChangedListenerCount -- ; return ; } } } public synchronized void removePreResourceChangedListener ( IResourceChangeListener listener ) { for ( int i = <NUM_LIT:0> ; i < this . preResourceChangeListenerCount ; i ++ ) { if ( this . preResourceChangeListeners [ i ] == listener ) { int length = this . preResourceChangeListeners . length ; IResourceChangeListener [ ] newListeners = new IResourceChangeListener [ length ] ; int [ ] newEventMasks = new int [ length ] ; System . arraycopy ( this . preResourceChangeListeners , <NUM_LIT:0> , newListeners , <NUM_LIT:0> , i ) ; System . arraycopy ( this . preResourceChangeEventMasks , <NUM_LIT:0> , newEventMasks , <NUM_LIT:0> , i ) ; int trailingLength = this . preResourceChangeListenerCount - i - <NUM_LIT:1> ; if ( trailingLength > <NUM_LIT:0> ) { System . arraycopy ( this . preResourceChangeListeners , i + <NUM_LIT:1> , newListeners , i , trailingLength ) ; System . arraycopy ( this . preResourceChangeEventMasks , i + <NUM_LIT:1> , newEventMasks , i , trailingLength ) ; } this . preResourceChangeListeners = newListeners ; this . preResourceChangeEventMasks = newEventMasks ; this . preResourceChangeListenerCount -- ; return ; } } } public void resourceChanged ( final IResourceChangeEvent event ) { for ( int i = <NUM_LIT:0> ; i < this . preResourceChangeListenerCount ; i ++ ) { final IResourceChangeListener listener = this . preResourceChangeListeners [ i ] ; if ( ( this . preResourceChangeEventMasks [ i ] & event . getType ( ) ) != <NUM_LIT:0> ) SafeRunner . run ( new ISafeRunnable ( ) { public void handleException ( Throwable exception ) { Util . log ( exception , "<STR_LIT>" ) ; } public void run ( ) throws Exception { listener . resourceChanged ( event ) ; } } ) ; } try { getDeltaProcessor ( ) . resourceChanged ( event ) ; } finally { if ( event . getType ( ) == IResourceChangeEvent . POST_CHANGE ) { this . deltaProcessors . set ( null ) ; } else { getDeltaProcessor ( ) . overridenEventType = - <NUM_LIT:1> ; } } } public Hashtable getExternalLibTimeStamps ( ) { if ( this . externalTimeStamps == null ) { Hashtable timeStamps = new Hashtable ( ) ; File timestampsFile = getTimeStampsFile ( ) ; DataInputStream in = null ; try { in = new DataInputStream ( new BufferedInputStream ( new FileInputStream ( timestampsFile ) ) ) ; int size = in . readInt ( ) ; while ( size -- > <NUM_LIT:0> ) { String key = in . readUTF ( ) ; long timestamp = in . readLong ( ) ; timeStamps . put ( Path . fromPortableString ( key ) , new Long ( timestamp ) ) ; } } catch ( IOException e ) { if ( timestampsFile . exists ( ) ) Util . log ( e , "<STR_LIT>" ) ; } finally { if ( in != null ) { try { in . close ( ) ; } catch ( IOException e ) { } } } this . externalTimeStamps = timeStamps ; } return this . externalTimeStamps ; } public IJavaProject findJavaProject ( String name ) { if ( getOldJavaProjecNames ( ) . contains ( name ) ) return JavaModelManager . getJavaModelManager ( ) . getJavaModel ( ) . getJavaProject ( name ) ; return null ; } public synchronized HashSet getOldJavaProjecNames ( ) { if ( this . javaProjectNamesCache == null ) { HashSet result = new HashSet ( ) ; IJavaProject [ ] projects ; try { projects = JavaModelManager . getJavaModelManager ( ) . getJavaModel ( ) . getJavaProjects ( ) ; } catch ( JavaModelException e ) { return this . javaProjectNamesCache ; } for ( int i = <NUM_LIT:0> , length = projects . length ; i < length ; i ++ ) { IJavaProject project = projects [ i ] ; result . add ( project . getElementName ( ) ) ; } return this . javaProjectNamesCache = result ; } return this . javaProjectNamesCache ; } public synchronized void resetOldJavaProjectNames ( ) { this . javaProjectNamesCache = null ; } private File getTimeStampsFile ( ) { return JavaCore . getPlugin ( ) . getStateLocation ( ) . append ( "<STR_LIT>" ) . toFile ( ) ; } public void saveExternalLibTimeStamps ( ) throws CoreException { if ( this . externalTimeStamps == null ) return ; HashSet toRemove = new HashSet ( ) ; if ( this . roots != null ) { Enumeration keys = this . externalTimeStamps . keys ( ) ; while ( keys . hasMoreElements ( ) ) { Object key = keys . nextElement ( ) ; if ( this . roots . get ( key ) == null ) { toRemove . add ( key ) ; } } } File timestamps = getTimeStampsFile ( ) ; DataOutputStream out = null ; try { out = new DataOutputStream ( new BufferedOutputStream ( new FileOutputStream ( timestamps ) ) ) ; out . writeInt ( this . externalTimeStamps . size ( ) - toRemove . size ( ) ) ; Iterator entries = this . externalTimeStamps . entrySet ( ) . iterator ( ) ; while ( entries . hasNext ( ) ) { Map . Entry entry = ( Map . Entry ) entries . next ( ) ; IPath key = ( IPath ) entry . getKey ( ) ; if ( ! toRemove . contains ( key ) ) { out . writeUTF ( key . toPortableString ( ) ) ; Long timestamp = ( Long ) entry . getValue ( ) ; out . writeLong ( timestamp . longValue ( ) ) ; } } } catch ( IOException e ) { IStatus status = new Status ( IStatus . ERROR , JavaCore . PLUGIN_ID , IStatus . ERROR , "<STR_LIT>" , e ) ; throw new CoreException ( status ) ; } finally { if ( out != null ) { try { out . close ( ) ; } catch ( IOException e ) { } } } } public synchronized void updateRoots ( IPath containerPath , IResourceDelta containerDelta , DeltaProcessor deltaProcessor ) { Map updatedRoots ; Map otherUpdatedRoots ; if ( containerDelta . getKind ( ) == IResourceDelta . REMOVED ) { updatedRoots = this . oldRoots ; otherUpdatedRoots = this . oldOtherRoots ; } else { updatedRoots = this . roots ; otherUpdatedRoots = this . otherRoots ; } int containerSegmentCount = containerPath . segmentCount ( ) ; boolean containerIsProject = containerSegmentCount == <NUM_LIT:1> ; Iterator iterator = updatedRoots . entrySet ( ) . iterator ( ) ; while ( iterator . hasNext ( ) ) { Map . Entry entry = ( Map . Entry ) iterator . next ( ) ; IPath path = ( IPath ) entry . getKey ( ) ; if ( containerPath . isPrefixOf ( path ) && ! containerPath . equals ( path ) ) { IResourceDelta rootDelta = containerDelta . findMember ( path . removeFirstSegments ( containerSegmentCount ) ) ; if ( rootDelta == null ) continue ; DeltaProcessor . RootInfo rootInfo = ( DeltaProcessor . RootInfo ) entry . getValue ( ) ; if ( ! containerIsProject || ! rootInfo . project . getPath ( ) . isPrefixOf ( path ) ) { deltaProcessor . updateCurrentDeltaAndIndex ( rootDelta , IJavaElement . PACKAGE_FRAGMENT_ROOT , rootInfo ) ; } ArrayList rootList = ( ArrayList ) otherUpdatedRoots . get ( path ) ; if ( rootList != null ) { Iterator otherProjects = rootList . iterator ( ) ; while ( otherProjects . hasNext ( ) ) { rootInfo = ( DeltaProcessor . RootInfo ) otherProjects . next ( ) ; if ( ! containerIsProject || ! rootInfo . project . getPath ( ) . isPrefixOf ( path ) ) { deltaProcessor . updateCurrentDeltaAndIndex ( rootDelta , IJavaElement . PACKAGE_FRAGMENT_ROOT , rootInfo ) ; } } } } } } } </s>
<s> package org . eclipse . jdt . internal . core ; import org . eclipse . core . resources . IResourceRuleFactory ; import org . eclipse . core . resources . ResourcesPlugin ; import org . eclipse . core . runtime . IPath ; import org . eclipse . core . runtime . jobs . ISchedulingRule ; import org . eclipse . core . runtime . jobs . MultiRule ; import org . eclipse . jdt . core . IClasspathEntry ; import org . eclipse . jdt . core . IJavaElement ; import org . eclipse . jdt . core . IJavaModelStatus ; import org . eclipse . jdt . core . IJavaProject ; import org . eclipse . jdt . core . JavaModelException ; import org . eclipse . jdt . internal . core . JavaModelManager . PerProjectInfo ; public class SetClasspathOperation extends ChangeClasspathOperation { IClasspathEntry [ ] newRawClasspath ; IClasspathEntry [ ] referencedEntries ; IPath newOutputLocation ; JavaProject project ; public SetClasspathOperation ( JavaProject project , IClasspathEntry [ ] newRawClasspath , IPath newOutputLocation , boolean canChangeResource ) { this ( project , newRawClasspath , null , newOutputLocation , canChangeResource ) ; } public SetClasspathOperation ( JavaProject project , IClasspathEntry [ ] newRawClasspath , IClasspathEntry [ ] referencedEntries , IPath newOutputLocation , boolean canChangeResource ) { super ( new IJavaElement [ ] { project } , canChangeResource ) ; this . project = project ; this . newRawClasspath = newRawClasspath ; this . referencedEntries = referencedEntries ; this . newOutputLocation = newOutputLocation ; } protected void executeOperation ( ) throws JavaModelException { checkCanceled ( ) ; try { PerProjectInfo perProjectInfo = this . project . getPerProjectInfo ( ) ; ClasspathChange classpathChange = perProjectInfo . setRawClasspath ( this . newRawClasspath , this . referencedEntries , this . newOutputLocation , JavaModelStatus . VERIFIED_OK ) ; classpathChanged ( classpathChange , true ) ; if ( this . canChangeResources && perProjectInfo . writeAndCacheClasspath ( this . project , this . newRawClasspath , this . newOutputLocation ) ) setAttribute ( HAS_MODIFIED_RESOURCE_ATTR , TRUE ) ; } finally { done ( ) ; } } protected ISchedulingRule getSchedulingRule ( ) { if ( this . canChangeResources ) { IResourceRuleFactory ruleFactory = ResourcesPlugin . getWorkspace ( ) . getRuleFactory ( ) ; return new MultiRule ( new ISchedulingRule [ ] { ruleFactory . modifyRule ( this . project . getProject ( ) ) , ruleFactory . modifyRule ( JavaModelManager . getExternalManager ( ) . getExternalFoldersProject ( ) ) } ) ; } return super . getSchedulingRule ( ) ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( <NUM_LIT:20> ) ; buffer . append ( "<STR_LIT>" ) ; buffer . append ( "<STR_LIT>" ) ; buffer . append ( "<STR_LIT:{>" ) ; for ( int i = <NUM_LIT:0> ; i < this . newRawClasspath . length ; i ++ ) { if ( i > <NUM_LIT:0> ) buffer . append ( "<STR_LIT:U+002C>" ) ; IClasspathEntry element = this . newRawClasspath [ i ] ; buffer . append ( "<STR_LIT:U+0020>" ) . append ( element . toString ( ) ) ; } buffer . append ( "<STR_LIT>" ) ; buffer . append ( this . newOutputLocation . toString ( ) ) ; return buffer . toString ( ) ; } public IJavaModelStatus verify ( ) { IJavaModelStatus status = super . verify ( ) ; if ( ! status . isOK ( ) ) return status ; return ClasspathEntry . validateClasspath ( this . project , this . newRawClasspath , this . newOutputLocation ) ; } } </s>
<s> package org . eclipse . jdt . internal . core ; import org . eclipse . jdt . internal . compiler . env . ISourceImport ; public class ImportDeclarationElementInfo extends MemberElementInfo implements ISourceImport { } </s>
<s> package org . eclipse . jdt . internal . core ; import java . util . Map ; import org . eclipse . jdt . core . IJavaProject ; import org . eclipse . jdt . core . JavaCore ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . core . compiler . InvalidInputException ; import org . eclipse . jdt . internal . codeassist . impl . AssistOptions ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . parser . Scanner ; import org . eclipse . jdt . internal . compiler . parser . ScannerHelper ; import org . eclipse . jdt . internal . compiler . parser . TerminalTokens ; import org . eclipse . jdt . internal . compiler . util . SimpleSetOfCharArray ; public class InternalNamingConventions { private static final char [ ] DEFAULT_NAME = "<STR_LIT:name>" . toCharArray ( ) ; private static Scanner getNameScanner ( CompilerOptions compilerOptions ) { return new Scanner ( false , false , false , compilerOptions . sourceLevel , null , null , true ) ; } private static void acceptName ( char [ ] name , char [ ] prefix , char [ ] suffix , boolean isFirstPrefix , boolean isFirstSuffix , int reusedCharacters , INamingRequestor requestor ) { if ( prefix . length > <NUM_LIT:0> && suffix . length > <NUM_LIT:0> ) { requestor . acceptNameWithPrefixAndSuffix ( name , isFirstPrefix , isFirstSuffix , reusedCharacters ) ; } else if ( prefix . length > <NUM_LIT:0> ) { requestor . acceptNameWithPrefix ( name , isFirstPrefix , reusedCharacters ) ; } else if ( suffix . length > <NUM_LIT:0> ) { requestor . acceptNameWithSuffix ( name , isFirstSuffix , reusedCharacters ) ; } else { requestor . acceptNameWithoutPrefixAndSuffix ( name , reusedCharacters ) ; } } private static char [ ] [ ] computeBaseTypeNames ( char [ ] typeName , boolean isConstantField , char [ ] [ ] excludedNames ) { if ( isConstantField ) { return computeNonBaseTypeNames ( typeName , isConstantField , false ) ; } else { char [ ] name = computeBaseTypeNames ( typeName [ <NUM_LIT:0> ] , excludedNames ) ; if ( name != null ) { return new char [ ] [ ] { name } ; } else { return computeNonBaseTypeNames ( typeName , isConstantField , false ) ; } } } private static char [ ] computeBaseTypeNames ( char firstName , char [ ] [ ] excludedNames ) { char [ ] name = new char [ ] { firstName } ; for ( int i = <NUM_LIT:0> ; i < excludedNames . length ; i ++ ) { if ( CharOperation . equals ( name , excludedNames [ i ] , false ) ) { name [ <NUM_LIT:0> ] ++ ; if ( name [ <NUM_LIT:0> ] > '<CHAR_LIT>' ) name [ <NUM_LIT:0> ] = '<CHAR_LIT:a>' ; if ( name [ <NUM_LIT:0> ] == firstName ) return null ; i = <NUM_LIT:0> ; } } return name ; } private static char [ ] [ ] computeNonBaseTypeNames ( char [ ] sourceName , boolean isConstantField , boolean onlyLongest ) { int length = sourceName . length ; if ( length == <NUM_LIT:0> ) { return CharOperation . NO_CHAR_CHAR ; } if ( length == <NUM_LIT:1> ) { if ( isConstantField ) { return generateConstantName ( new char [ ] [ ] { CharOperation . toLowerCase ( sourceName ) } , <NUM_LIT:0> , onlyLongest ) ; } else { return generateNonConstantName ( new char [ ] [ ] { CharOperation . toLowerCase ( sourceName ) } , <NUM_LIT:0> , onlyLongest ) ; } } char [ ] [ ] nameParts = new char [ length ] [ ] ; int namePartsPtr = - <NUM_LIT:1> ; int endIndex = length ; char c = sourceName [ length - <NUM_LIT:1> ] ; final int IS_LOWER_CASE = <NUM_LIT:1> ; final int IS_UPPER_CASE = <NUM_LIT:2> ; final int IS_UNDERSCORE = <NUM_LIT:3> ; final int IS_OTHER = <NUM_LIT:4> ; int previousCharKind = ScannerHelper . isLowerCase ( c ) ? IS_LOWER_CASE : ScannerHelper . isUpperCase ( c ) ? IS_UPPER_CASE : c == '<CHAR_LIT:_>' ? IS_UNDERSCORE : IS_OTHER ; for ( int i = length - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) { c = sourceName [ i ] ; int charKind = ScannerHelper . isLowerCase ( c ) ? IS_LOWER_CASE : ScannerHelper . isUpperCase ( c ) ? IS_UPPER_CASE : c == '<CHAR_LIT:_>' ? IS_UNDERSCORE : IS_OTHER ; switch ( charKind ) { case IS_LOWER_CASE : if ( previousCharKind == IS_UPPER_CASE ) { nameParts [ ++ namePartsPtr ] = CharOperation . subarray ( sourceName , i + <NUM_LIT:1> , endIndex ) ; endIndex = i + <NUM_LIT:1> ; } previousCharKind = IS_LOWER_CASE ; break ; case IS_UPPER_CASE : if ( previousCharKind == IS_LOWER_CASE ) { nameParts [ ++ namePartsPtr ] = CharOperation . subarray ( sourceName , i , endIndex ) ; if ( i > <NUM_LIT:0> ) { char pc = sourceName [ i - <NUM_LIT:1> ] ; previousCharKind = ScannerHelper . isLowerCase ( pc ) ? IS_LOWER_CASE : ScannerHelper . isUpperCase ( pc ) ? IS_UPPER_CASE : pc == '<CHAR_LIT:_>' ? IS_UNDERSCORE : IS_OTHER ; } endIndex = i ; } else { previousCharKind = IS_UPPER_CASE ; } break ; case IS_UNDERSCORE : switch ( previousCharKind ) { case IS_UNDERSCORE : if ( isConstantField ) { if ( i > <NUM_LIT:0> ) { char pc = sourceName [ i - <NUM_LIT:1> ] ; previousCharKind = ScannerHelper . isLowerCase ( pc ) ? IS_LOWER_CASE : ScannerHelper . isUpperCase ( pc ) ? IS_UPPER_CASE : pc == '<CHAR_LIT:_>' ? IS_UNDERSCORE : IS_OTHER ; } endIndex = i ; } break ; case IS_LOWER_CASE : case IS_UPPER_CASE : nameParts [ ++ namePartsPtr ] = CharOperation . subarray ( sourceName , i + <NUM_LIT:1> , endIndex ) ; if ( i > <NUM_LIT:0> ) { char pc = sourceName [ i - <NUM_LIT:1> ] ; previousCharKind = ScannerHelper . isLowerCase ( pc ) ? IS_LOWER_CASE : ScannerHelper . isUpperCase ( pc ) ? IS_UPPER_CASE : pc == '<CHAR_LIT:_>' ? IS_UNDERSCORE : IS_OTHER ; } endIndex = i + <NUM_LIT:1> ; break ; default : previousCharKind = IS_UNDERSCORE ; break ; } break ; default : previousCharKind = IS_OTHER ; break ; } } if ( endIndex > <NUM_LIT:0> ) { nameParts [ ++ namePartsPtr ] = CharOperation . subarray ( sourceName , <NUM_LIT:0> , endIndex ) ; } if ( namePartsPtr == - <NUM_LIT:1> ) { return new char [ ] [ ] { sourceName } ; } if ( isConstantField ) { return generateConstantName ( nameParts , namePartsPtr , onlyLongest ) ; } else { return generateNonConstantName ( nameParts , namePartsPtr , onlyLongest ) ; } } private static char [ ] excludeNames ( char [ ] suffixName , char [ ] prefixName , char [ ] suffix , char [ ] [ ] excludedNames ) { int count = <NUM_LIT:2> ; int m = <NUM_LIT:0> ; while ( m < excludedNames . length ) { if ( CharOperation . equals ( suffixName , excludedNames [ m ] , false ) ) { suffixName = CharOperation . concat ( prefixName , String . valueOf ( count ++ ) . toCharArray ( ) , suffix ) ; m = <NUM_LIT:0> ; } else { m ++ ; } } return suffixName ; } private static char [ ] [ ] generateNonConstantName ( char [ ] [ ] nameParts , int namePartsPtr , boolean onlyLongest ) { char [ ] [ ] names ; if ( onlyLongest ) { names = new char [ <NUM_LIT:1> ] [ ] ; } else { names = new char [ namePartsPtr + <NUM_LIT:1> ] [ ] ; } char [ ] namePart = nameParts [ <NUM_LIT:0> ] ; char [ ] name = CharOperation . toLowerCase ( namePart ) ; if ( ! onlyLongest ) { names [ namePartsPtr ] = name ; } char [ ] nameSuffix = namePart ; for ( int i = <NUM_LIT:1> ; i <= namePartsPtr ; i ++ ) { namePart = nameParts [ i ] ; name = CharOperation . concat ( CharOperation . toLowerCase ( namePart ) , nameSuffix ) ; if ( ! onlyLongest ) { names [ namePartsPtr - i ] = name ; } nameSuffix = CharOperation . concat ( namePart , nameSuffix ) ; } if ( onlyLongest ) { names [ <NUM_LIT:0> ] = name ; } return names ; } private static char [ ] [ ] generateConstantName ( char [ ] [ ] nameParts , int namePartsPtr , boolean onlyLongest ) { char [ ] [ ] names ; if ( onlyLongest ) { names = new char [ <NUM_LIT:1> ] [ ] ; } else { names = new char [ namePartsPtr + <NUM_LIT:1> ] [ ] ; } char [ ] namePart = CharOperation . toUpperCase ( nameParts [ <NUM_LIT:0> ] ) ; int namePartLength = namePart . length ; System . arraycopy ( namePart , <NUM_LIT:0> , namePart , <NUM_LIT:0> , namePartLength ) ; char [ ] name = namePart ; if ( ! onlyLongest ) { names [ namePartsPtr ] = name ; } for ( int i = <NUM_LIT:1> ; i <= namePartsPtr ; i ++ ) { namePart = CharOperation . toUpperCase ( nameParts [ i ] ) ; namePartLength = namePart . length ; if ( namePart [ namePartLength - <NUM_LIT:1> ] != '<CHAR_LIT:_>' ) { name = CharOperation . concat ( namePart , name , '<CHAR_LIT:_>' ) ; } else { name = CharOperation . concat ( namePart , name ) ; } if ( ! onlyLongest ) { names [ namePartsPtr - i ] = name ; } } if ( onlyLongest ) { names [ <NUM_LIT:0> ] = name ; } return names ; } public static char [ ] getBaseName ( int variableKind , IJavaProject javaProject , char [ ] name , boolean updateFirstCharacter ) { AssistOptions assistOptions ; if ( javaProject != null ) { assistOptions = new AssistOptions ( javaProject . getOptions ( true ) ) ; } else { assistOptions = new AssistOptions ( JavaCore . getOptions ( ) ) ; } char [ ] [ ] prefixes = null ; char [ ] [ ] suffixes = null ; switch ( variableKind ) { case VK_INSTANCE_FIELD : prefixes = assistOptions . fieldPrefixes ; suffixes = assistOptions . fieldSuffixes ; break ; case VK_STATIC_FIELD : prefixes = assistOptions . staticFieldPrefixes ; suffixes = assistOptions . staticFieldSuffixes ; break ; case VK_STATIC_FINAL_FIELD : prefixes = assistOptions . staticFinalFieldPrefixes ; suffixes = assistOptions . staticFinalFieldSuffixes ; break ; case VK_LOCAL : prefixes = assistOptions . localPrefixes ; suffixes = assistOptions . localSuffixes ; break ; case VK_PARAMETER : prefixes = assistOptions . argumentPrefixes ; suffixes = assistOptions . argumentSuffixes ; break ; } return getBaseName ( name , prefixes , suffixes , variableKind == VK_STATIC_FINAL_FIELD , updateFirstCharacter ) ; } private static char [ ] getBaseName ( char [ ] name , char [ ] [ ] prefixes , char [ ] [ ] suffixes , boolean isConstant , boolean updateFirstCharacter ) { char [ ] nameWithoutPrefixAndSiffix = removeVariablePrefixAndSuffix ( name , prefixes , suffixes , updateFirstCharacter ) ; char [ ] baseName ; if ( isConstant ) { int length = nameWithoutPrefixAndSiffix . length ; baseName = new char [ length ] ; int baseNamePtr = - <NUM_LIT:1> ; boolean previousIsUnderscore = false ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { char c = nameWithoutPrefixAndSiffix [ i ] ; if ( c != '<CHAR_LIT:_>' ) { if ( previousIsUnderscore ) { baseName [ ++ baseNamePtr ] = ScannerHelper . toUpperCase ( c ) ; previousIsUnderscore = false ; } else { baseName [ ++ baseNamePtr ] = ScannerHelper . toLowerCase ( c ) ; } } else { previousIsUnderscore = true ; } } System . arraycopy ( baseName , <NUM_LIT:0> , baseName = new char [ baseNamePtr + <NUM_LIT:1> ] , <NUM_LIT:0> , baseNamePtr + <NUM_LIT:1> ) ; } else { baseName = nameWithoutPrefixAndSiffix ; } return baseName ; } public static char [ ] removeVariablePrefixAndSuffix ( int variableKind , IJavaProject javaProject , char [ ] name ) { AssistOptions assistOptions ; if ( javaProject != null ) { assistOptions = new AssistOptions ( javaProject . getOptions ( true ) ) ; } else { assistOptions = new AssistOptions ( JavaCore . getOptions ( ) ) ; } char [ ] [ ] prefixes = null ; char [ ] [ ] suffixes = null ; switch ( variableKind ) { case VK_INSTANCE_FIELD : prefixes = assistOptions . fieldPrefixes ; suffixes = assistOptions . fieldSuffixes ; break ; case VK_STATIC_FIELD : prefixes = assistOptions . staticFieldPrefixes ; suffixes = assistOptions . staticFieldSuffixes ; break ; case VK_STATIC_FINAL_FIELD : prefixes = assistOptions . staticFinalFieldPrefixes ; suffixes = assistOptions . staticFinalFieldSuffixes ; break ; case VK_LOCAL : prefixes = assistOptions . localPrefixes ; suffixes = assistOptions . localSuffixes ; break ; case VK_PARAMETER : prefixes = assistOptions . argumentPrefixes ; suffixes = assistOptions . argumentSuffixes ; break ; } return InternalNamingConventions . removeVariablePrefixAndSuffix ( name , prefixes , suffixes , true ) ; } private static char [ ] removeVariablePrefixAndSuffix ( char [ ] name , char [ ] [ ] prefixes , char [ ] [ ] suffixes , boolean updateFirstCharacter ) { char [ ] withoutPrefixName = name ; if ( prefixes != null ) { int bestLength = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < prefixes . length ; i ++ ) { char [ ] prefix = prefixes [ i ] ; if ( CharOperation . prefixEquals ( prefix , name ) ) { int currLen = prefix . length ; boolean lastCharIsLetter = ScannerHelper . isLetter ( prefix [ currLen - <NUM_LIT:1> ] ) ; if ( ! lastCharIsLetter || ( lastCharIsLetter && name . length > currLen && ScannerHelper . isUpperCase ( name [ currLen ] ) ) ) { if ( bestLength < currLen && name . length != currLen ) { withoutPrefixName = CharOperation . subarray ( name , currLen , name . length ) ; bestLength = currLen ; } } } } } char [ ] withoutSuffixName = withoutPrefixName ; if ( suffixes != null ) { int bestLength = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < suffixes . length ; i ++ ) { char [ ] suffix = suffixes [ i ] ; if ( CharOperation . endsWith ( withoutPrefixName , suffix ) ) { int currLen = suffix . length ; if ( bestLength < currLen && withoutPrefixName . length != currLen ) { withoutSuffixName = CharOperation . subarray ( withoutPrefixName , <NUM_LIT:0> , withoutPrefixName . length - currLen ) ; bestLength = currLen ; } } } } if ( updateFirstCharacter ) withoutSuffixName [ <NUM_LIT:0> ] = ScannerHelper . toLowerCase ( withoutSuffixName [ <NUM_LIT:0> ] ) ; return withoutSuffixName ; } private static char [ ] removePrefix ( char [ ] name , char [ ] [ ] prefixes ) { char [ ] withoutPrefixName = name ; if ( prefixes != null ) { int bestLength = <NUM_LIT:0> ; int nameLength = name . length ; for ( int i = <NUM_LIT:0> ; i < prefixes . length ; i ++ ) { char [ ] prefix = prefixes [ i ] ; int prefixLength = prefix . length ; if ( prefixLength <= nameLength ) { if ( CharOperation . prefixEquals ( prefix , name , false ) ) { if ( prefixLength > bestLength ) { bestLength = prefixLength ; } } } else { int currLen = <NUM_LIT:0> ; for ( ; currLen < nameLength ; currLen ++ ) { if ( ScannerHelper . toLowerCase ( prefix [ currLen ] ) != ScannerHelper . toLowerCase ( name [ currLen ] ) ) { if ( currLen > bestLength ) { bestLength = currLen ; } break ; } } if ( currLen == nameLength && currLen > bestLength ) { bestLength = currLen ; } } } if ( bestLength > <NUM_LIT:0> ) { if ( bestLength == nameLength ) { withoutPrefixName = CharOperation . NO_CHAR ; } else { withoutPrefixName = CharOperation . subarray ( name , bestLength , nameLength ) ; } } } return withoutPrefixName ; } public static final int VK_STATIC_FIELD = <NUM_LIT:1> ; public static final int VK_INSTANCE_FIELD = <NUM_LIT:2> ; public static final int VK_STATIC_FINAL_FIELD = <NUM_LIT:3> ; public static final int VK_PARAMETER = <NUM_LIT:4> ; public static final int VK_LOCAL = <NUM_LIT:5> ; public static final int BK_SIMPLE_NAME = <NUM_LIT:1> ; public static final int BK_SIMPLE_TYPE_NAME = <NUM_LIT:2> ; public static void suggestVariableNames ( int variableKind , int baseNameKind , char [ ] baseName , IJavaProject javaProject , int dim , char [ ] internalPrefix , char [ ] [ ] excluded , boolean evaluateDefault , INamingRequestor requestor ) { if ( baseName == null || baseName . length == <NUM_LIT:0> ) return ; Map options ; if ( javaProject != null ) { options = javaProject . getOptions ( true ) ; } else { options = JavaCore . getOptions ( ) ; } CompilerOptions compilerOptions = new CompilerOptions ( options ) ; AssistOptions assistOptions = new AssistOptions ( options ) ; boolean isConstantField = false ; char [ ] [ ] prefixes = null ; char [ ] [ ] suffixes = null ; switch ( variableKind ) { case VK_INSTANCE_FIELD : prefixes = assistOptions . fieldPrefixes ; suffixes = assistOptions . fieldSuffixes ; break ; case VK_STATIC_FIELD : prefixes = assistOptions . staticFieldPrefixes ; suffixes = assistOptions . staticFieldSuffixes ; break ; case VK_STATIC_FINAL_FIELD : isConstantField = true ; prefixes = assistOptions . staticFinalFieldPrefixes ; suffixes = assistOptions . staticFinalFieldSuffixes ; break ; case VK_LOCAL : prefixes = assistOptions . localPrefixes ; suffixes = assistOptions . localSuffixes ; break ; case VK_PARAMETER : prefixes = assistOptions . argumentPrefixes ; suffixes = assistOptions . argumentSuffixes ; break ; } if ( prefixes == null || prefixes . length == <NUM_LIT:0> ) { prefixes = new char [ <NUM_LIT:1> ] [ <NUM_LIT:0> ] ; } else { int length = prefixes . length ; System . arraycopy ( prefixes , <NUM_LIT:0> , prefixes = new char [ length + <NUM_LIT:1> ] [ ] , <NUM_LIT:0> , length ) ; prefixes [ length ] = CharOperation . NO_CHAR ; } if ( suffixes == null || suffixes . length == <NUM_LIT:0> ) { suffixes = new char [ <NUM_LIT:1> ] [ <NUM_LIT:0> ] ; } else { int length = suffixes . length ; System . arraycopy ( suffixes , <NUM_LIT:0> , suffixes = new char [ length + <NUM_LIT:1> ] [ ] , <NUM_LIT:0> , length ) ; suffixes [ length ] = CharOperation . NO_CHAR ; } if ( internalPrefix == null ) { internalPrefix = CharOperation . NO_CHAR ; } else { internalPrefix = removePrefix ( internalPrefix , prefixes ) ; } char [ ] [ ] tempNames = null ; Scanner nameScanner = getNameScanner ( compilerOptions ) ; if ( baseNameKind == BK_SIMPLE_TYPE_NAME ) { boolean isBaseType = false ; try { nameScanner . setSource ( baseName ) ; switch ( nameScanner . getNextToken ( ) ) { case TerminalTokens . TokenNameint : case TerminalTokens . TokenNamebyte : case TerminalTokens . TokenNameshort : case TerminalTokens . TokenNamechar : case TerminalTokens . TokenNamelong : case TerminalTokens . TokenNamefloat : case TerminalTokens . TokenNamedouble : case TerminalTokens . TokenNameboolean : isBaseType = true ; break ; } } catch ( InvalidInputException e ) { } if ( isBaseType ) { if ( internalPrefix . length > <NUM_LIT:0> ) return ; tempNames = computeBaseTypeNames ( baseName , isConstantField , excluded ) ; } else { tempNames = computeNonBaseTypeNames ( baseName , isConstantField , false ) ; } } else { tempNames = computeNonBaseTypeNames ( baseName , isConstantField , true ) ; } boolean acceptDefaultName = true ; SimpleSetOfCharArray foundNames = new SimpleSetOfCharArray ( ) ; for ( int i = <NUM_LIT:0> ; i < tempNames . length ; i ++ ) { char [ ] tempName = tempNames [ i ] ; if ( dim > <NUM_LIT:0> ) { int length = tempName . length ; if ( isConstantField ) { if ( tempName [ length - <NUM_LIT:1> ] == '<CHAR_LIT>' ) { if ( tempName . length > <NUM_LIT:1> && tempName [ length - <NUM_LIT:2> ] == '<CHAR_LIT>' ) { System . arraycopy ( tempName , <NUM_LIT:0> , tempName = new char [ length + <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; tempName [ length ] = '<CHAR_LIT>' ; tempName [ length + <NUM_LIT:1> ] = '<CHAR_LIT>' ; } } else if ( tempName [ length - <NUM_LIT:1> ] == '<CHAR_LIT>' ) { boolean precededByAVowel = false ; if ( tempName . length > <NUM_LIT:1> ) { switch ( tempName [ length - <NUM_LIT:2> ] ) { case '<CHAR_LIT:A>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : precededByAVowel = true ; break ; } } if ( precededByAVowel ) { System . arraycopy ( tempName , <NUM_LIT:0> , tempName = new char [ length + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; tempName [ length ] = '<CHAR_LIT>' ; } else { System . arraycopy ( tempName , <NUM_LIT:0> , tempName = new char [ length + <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; tempName [ length - <NUM_LIT:1> ] = '<CHAR_LIT>' ; tempName [ length ] = '<CHAR_LIT>' ; tempName [ length + <NUM_LIT:1> ] = '<CHAR_LIT>' ; } } else { System . arraycopy ( tempName , <NUM_LIT:0> , tempName = new char [ length + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; tempName [ length ] = '<CHAR_LIT>' ; } } else { if ( tempName [ length - <NUM_LIT:1> ] == '<CHAR_LIT>' ) { if ( tempName . length > <NUM_LIT:1> && tempName [ length - <NUM_LIT:2> ] == '<CHAR_LIT>' ) { System . arraycopy ( tempName , <NUM_LIT:0> , tempName = new char [ length + <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; tempName [ length ] = '<CHAR_LIT:e>' ; tempName [ length + <NUM_LIT:1> ] = '<CHAR_LIT>' ; } } else if ( tempName [ length - <NUM_LIT:1> ] == '<CHAR_LIT>' ) { boolean precededByAVowel = false ; if ( tempName . length > <NUM_LIT:1> ) { switch ( tempName [ length - <NUM_LIT:2> ] ) { case '<CHAR_LIT:a>' : case '<CHAR_LIT:e>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : precededByAVowel = true ; break ; } } if ( precededByAVowel ) { System . arraycopy ( tempName , <NUM_LIT:0> , tempName = new char [ length + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; tempName [ length ] = '<CHAR_LIT>' ; } else { System . arraycopy ( tempName , <NUM_LIT:0> , tempName = new char [ length + <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; tempName [ length - <NUM_LIT:1> ] = '<CHAR_LIT>' ; tempName [ length ] = '<CHAR_LIT:e>' ; tempName [ length + <NUM_LIT:1> ] = '<CHAR_LIT>' ; } } else { System . arraycopy ( tempName , <NUM_LIT:0> , tempName = new char [ length + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; tempName [ length ] = '<CHAR_LIT>' ; } } } char [ ] unprefixedName = tempName ; int matchingIndex = - <NUM_LIT:1> ; if ( ! isConstantField ) { unprefixedName [ <NUM_LIT:0> ] = ScannerHelper . toUpperCase ( unprefixedName [ <NUM_LIT:0> ] ) ; done : for ( int j = <NUM_LIT:0> ; j <= internalPrefix . length ; j ++ ) { if ( j == internalPrefix . length || CharOperation . prefixEquals ( CharOperation . subarray ( internalPrefix , j , - <NUM_LIT:1> ) , unprefixedName , j != <NUM_LIT:0> ) ) { matchingIndex = j ; break done ; } } } else { done : for ( int j = <NUM_LIT:0> ; j <= internalPrefix . length ; j ++ ) { if ( j == internalPrefix . length ) { matchingIndex = j ; break done ; } else if ( CharOperation . prefixEquals ( CharOperation . subarray ( internalPrefix , j , - <NUM_LIT:1> ) , unprefixedName , j != <NUM_LIT:0> ) ) { if ( j == <NUM_LIT:0> || internalPrefix [ j - <NUM_LIT:1> ] == '<CHAR_LIT:_>' ) { matchingIndex = j ; break done ; } } } } if ( matchingIndex > - <NUM_LIT:1> ) { if ( ! isConstantField ) { tempName = CharOperation . concat ( CharOperation . subarray ( internalPrefix , <NUM_LIT:0> , matchingIndex ) , unprefixedName ) ; if ( matchingIndex == <NUM_LIT:0> ) tempName [ <NUM_LIT:0> ] = ScannerHelper . toLowerCase ( tempName [ <NUM_LIT:0> ] ) ; } else { if ( matchingIndex != <NUM_LIT:0> && tempName [ <NUM_LIT:0> ] != '<CHAR_LIT:_>' && internalPrefix [ matchingIndex - <NUM_LIT:1> ] != '<CHAR_LIT:_>' ) { tempName = CharOperation . concat ( CharOperation . subarray ( CharOperation . toUpperCase ( internalPrefix ) , <NUM_LIT:0> , matchingIndex ) , unprefixedName , '<CHAR_LIT:_>' ) ; } else { tempName = CharOperation . concat ( CharOperation . subarray ( CharOperation . toUpperCase ( internalPrefix ) , <NUM_LIT:0> , matchingIndex ) , unprefixedName ) ; } } for ( int k = <NUM_LIT:0> ; k < prefixes . length ; k ++ ) { if ( ! isConstantField ) { if ( prefixes [ k ] . length > <NUM_LIT:0> && ScannerHelper . isLetterOrDigit ( prefixes [ k ] [ prefixes [ k ] . length - <NUM_LIT:1> ] ) ) { tempName [ <NUM_LIT:0> ] = ScannerHelper . toUpperCase ( tempName [ <NUM_LIT:0> ] ) ; } else { tempName [ <NUM_LIT:0> ] = ScannerHelper . toLowerCase ( tempName [ <NUM_LIT:0> ] ) ; } } char [ ] prefixName = CharOperation . concat ( prefixes [ k ] , tempName ) ; for ( int l = <NUM_LIT:0> ; l < suffixes . length ; l ++ ) { char [ ] suffixName = CharOperation . concat ( prefixName , suffixes [ l ] ) ; suffixName = excludeNames ( suffixName , prefixName , suffixes [ l ] , excluded ) ; try { nameScanner . setSource ( suffixName ) ; switch ( nameScanner . getNextToken ( ) ) { case TerminalTokens . TokenNameIdentifier : int token = nameScanner . getNextToken ( ) ; if ( token == TerminalTokens . TokenNameEOF && nameScanner . startPosition == suffixName . length ) { if ( ! foundNames . includes ( suffixName ) ) { acceptName ( suffixName , prefixes [ k ] , suffixes [ l ] , k == <NUM_LIT:0> , l == <NUM_LIT:0> , internalPrefix . length - matchingIndex , requestor ) ; foundNames . add ( suffixName ) ; acceptDefaultName = false ; } } break ; default : suffixName = CharOperation . concat ( prefixName , String . valueOf ( <NUM_LIT:1> ) . toCharArray ( ) , suffixes [ l ] ) ; suffixName = excludeNames ( suffixName , prefixName , suffixes [ l ] , excluded ) ; nameScanner . setSource ( suffixName ) ; switch ( nameScanner . getNextToken ( ) ) { case TerminalTokens . TokenNameIdentifier : token = nameScanner . getNextToken ( ) ; if ( token == TerminalTokens . TokenNameEOF && nameScanner . startPosition == suffixName . length ) { if ( ! foundNames . includes ( suffixName ) ) { acceptName ( suffixName , prefixes [ k ] , suffixes [ l ] , k == <NUM_LIT:0> , l == <NUM_LIT:0> , internalPrefix . length - matchingIndex , requestor ) ; foundNames . add ( suffixName ) ; acceptDefaultName = false ; } } } } } catch ( InvalidInputException e ) { } } } } } if ( evaluateDefault && acceptDefaultName ) { char [ ] name = excludeNames ( DEFAULT_NAME , DEFAULT_NAME , CharOperation . NO_CHAR , excluded ) ; requestor . acceptNameWithoutPrefixAndSuffix ( name , <NUM_LIT:0> ) ; } } } </s>
<s> package org . eclipse . jdt . internal . core ; import org . eclipse . core . resources . * ; import org . eclipse . core . runtime . CoreException ; import org . eclipse . jdt . core . IJavaElement ; import org . eclipse . jdt . core . IJavaModelStatusConstants ; import org . eclipse . jdt . core . IOpenable ; import org . eclipse . jdt . core . IPackageFragment ; import org . eclipse . jdt . core . JavaModelException ; import org . eclipse . jdt . internal . core . util . Messages ; public class DeleteResourceElementsOperation extends MultiOperation { protected DeleteResourceElementsOperation ( IJavaElement [ ] elementsToProcess , boolean force ) { super ( elementsToProcess , force ) ; } private void deletePackageFragment ( IPackageFragment frag ) throws JavaModelException { IResource res = ( ( JavaElement ) frag ) . resource ( ) ; if ( res != null ) { IJavaElement [ ] childrenOfInterest = frag . getChildren ( ) ; if ( childrenOfInterest . length > <NUM_LIT:0> ) { IResource [ ] resources = new IResource [ childrenOfInterest . length ] ; for ( int i = <NUM_LIT:0> ; i < childrenOfInterest . length ; i ++ ) { resources [ i ] = ( ( JavaElement ) childrenOfInterest [ i ] ) . resource ( ) ; } deleteResources ( resources , this . force ) ; } Object [ ] nonJavaResources = frag . getNonJavaResources ( ) ; int actualResourceCount = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> , max = nonJavaResources . length ; i < max ; i ++ ) { if ( nonJavaResources [ i ] instanceof IResource ) actualResourceCount ++ ; } IResource [ ] actualNonJavaResources = new IResource [ actualResourceCount ] ; for ( int i = <NUM_LIT:0> , max = nonJavaResources . length , index = <NUM_LIT:0> ; i < max ; i ++ ) { if ( nonJavaResources [ i ] instanceof IResource ) actualNonJavaResources [ index ++ ] = ( IResource ) nonJavaResources [ i ] ; } deleteResources ( actualNonJavaResources , this . force ) ; IResource [ ] remainingFiles ; try { remainingFiles = ( ( IContainer ) res ) . members ( ) ; } catch ( CoreException ce ) { throw new JavaModelException ( ce ) ; } boolean isEmpty = true ; for ( int i = <NUM_LIT:0> , length = remainingFiles . length ; i < length ; i ++ ) { IResource file = remainingFiles [ i ] ; if ( file instanceof IFile && org . eclipse . jdt . internal . compiler . util . Util . isClassFileName ( file . getName ( ) ) ) { deleteResource ( file , IResource . FORCE | IResource . KEEP_HISTORY ) ; } else { isEmpty = false ; } } if ( isEmpty && ! frag . isDefaultPackage ( ) ) { IResource fragResource = ( ( JavaElement ) frag ) . resource ( ) ; if ( fragResource != null ) { deleteEmptyPackageFragment ( frag , false , fragResource . getParent ( ) ) ; } } } } protected String getMainTaskName ( ) { return Messages . operation_deleteResourceProgress ; } protected void processElement ( IJavaElement element ) throws JavaModelException { switch ( element . getElementType ( ) ) { case IJavaElement . CLASS_FILE : case IJavaElement . COMPILATION_UNIT : deleteResource ( element . getResource ( ) , this . force ? IResource . FORCE | IResource . KEEP_HISTORY : IResource . KEEP_HISTORY ) ; break ; case IJavaElement . PACKAGE_FRAGMENT : deletePackageFragment ( ( IPackageFragment ) element ) ; break ; default : throw new JavaModelException ( new JavaModelStatus ( IJavaModelStatusConstants . INVALID_ELEMENT_TYPES , element ) ) ; } if ( element instanceof IOpenable ) { ( ( IOpenable ) element ) . close ( ) ; } } protected void verify ( IJavaElement element ) throws JavaModelException { if ( element == null || ! element . exists ( ) ) error ( IJavaModelStatusConstants . ELEMENT_DOES_NOT_EXIST , element ) ; int type = element . getElementType ( ) ; if ( type <= IJavaElement . PACKAGE_FRAGMENT_ROOT || type > IJavaElement . COMPILATION_UNIT ) error ( IJavaModelStatusConstants . INVALID_ELEMENT_TYPES , element ) ; else if ( type == IJavaElement . PACKAGE_FRAGMENT && element instanceof JarPackageFragment ) error ( IJavaModelStatusConstants . INVALID_ELEMENT_TYPES , element ) ; IResource resource = ( ( JavaElement ) element ) . resource ( ) ; if ( resource instanceof IFolder ) { if ( resource . isLinked ( ) ) { error ( IJavaModelStatusConstants . INVALID_RESOURCE , element ) ; } } } } </s>
<s> package org . eclipse . jdt . internal . compiler ; import java . util . HashMap ; import org . eclipse . jdt . core . compiler . CategorizedProblem ; import org . eclipse . jdt . internal . compiler . ast . AbstractMethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . Annotation ; import org . eclipse . jdt . internal . compiler . ast . Expression ; import org . eclipse . jdt . internal . compiler . ast . FieldDeclaration ; import org . eclipse . jdt . internal . compiler . ast . ImportReference ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; public interface ISourceElementRequestor { public static class TypeInfo { public int declarationStart ; public int modifiers ; public char [ ] name ; public int nameSourceStart ; public int nameSourceEnd ; public char [ ] superclass ; public char [ ] [ ] superinterfaces ; public TypeParameterInfo [ ] typeParameters ; public char [ ] [ ] categories ; public boolean secondary ; public boolean anonymousMember ; public Annotation [ ] annotations ; public int extraFlags ; public TypeDeclaration node ; public HashMap childrenCategories = new HashMap ( ) ; } public static class TypeParameterInfo { public int declarationStart ; public int declarationEnd ; public char [ ] name ; public int nameSourceStart ; public int nameSourceEnd ; public char [ ] [ ] bounds ; } public static class MethodInfo { public boolean isConstructor ; public boolean isAnnotation ; public int declarationStart ; public int modifiers ; public char [ ] returnType ; public char [ ] name ; public int nameSourceStart ; public int nameSourceEnd ; public char [ ] [ ] parameterTypes ; public char [ ] [ ] parameterNames ; public char [ ] [ ] exceptionTypes ; public TypeParameterInfo [ ] typeParameters ; public char [ ] [ ] categories ; public Annotation [ ] annotations ; public char [ ] declaringPackageName ; public int declaringTypeModifiers ; public int extraFlags ; public AbstractMethodDeclaration node ; } public static class FieldInfo { public int declarationStart ; public int modifiers ; public char [ ] type ; public char [ ] name ; public int nameSourceStart ; public int nameSourceEnd ; public char [ ] [ ] categories ; public Annotation [ ] annotations ; public FieldDeclaration node ; } void acceptAnnotationTypeReference ( char [ ] [ ] annotation , int sourceStart , int sourceEnd ) ; void acceptAnnotationTypeReference ( char [ ] annotation , int sourcePosition ) ; void acceptConstructorReference ( char [ ] typeName , int argCount , int sourcePosition ) ; void acceptFieldReference ( char [ ] fieldName , int sourcePosition ) ; void acceptImport ( int declarationStart , int declarationEnd , char [ ] [ ] tokens , boolean onDemand , int modifiers ) ; void acceptLineSeparatorPositions ( int [ ] positions ) ; void acceptMethodReference ( char [ ] methodName , int argCount , int sourcePosition ) ; void acceptPackage ( ImportReference importReference ) ; void acceptProblem ( CategorizedProblem problem ) ; void acceptTypeReference ( char [ ] [ ] typeName , int sourceStart , int sourceEnd ) ; void acceptTypeReference ( char [ ] typeName , int sourcePosition ) ; void acceptUnknownReference ( char [ ] [ ] name , int sourceStart , int sourceEnd ) ; void acceptUnknownReference ( char [ ] name , int sourcePosition ) ; void enterCompilationUnit ( ) ; void enterConstructor ( MethodInfo methodInfo ) ; void enterField ( FieldInfo fieldInfo ) ; void enterInitializer ( int declarationStart , int modifiers ) ; void enterMethod ( MethodInfo methodInfo ) ; void enterType ( TypeInfo typeInfo ) ; void exitCompilationUnit ( int declarationEnd ) ; void exitConstructor ( int declarationEnd ) ; void exitField ( int initializationStart , int declarationEnd , int declarationSourceEnd ) ; void exitInitializer ( int declarationEnd ) ; void exitMethod ( int declarationEnd , Expression defaultValue ) ; void exitType ( int declarationEnd ) ; } </s>
<s> package org . eclipse . jdt . internal . compiler ; import org . eclipse . jdt . core . compiler . CategorizedProblem ; public interface IDocumentElementRequestor { void acceptImport ( int declarationStart , int declarationEnd , int [ ] javaDocPositions , char [ ] name , int nameStartPosition , boolean onDemand , int modifiers ) ; void acceptInitializer ( int declarationStart , int declarationEnd , int [ ] javaDocPositions , int modifiers , int modifiersStart , int bodyStart , int bodyEnd ) ; void acceptLineSeparatorPositions ( int [ ] positions ) ; void acceptPackage ( int declarationStart , int declarationEnd , int [ ] javaDocPositions , char [ ] name , int nameStartPosition ) ; void acceptProblem ( CategorizedProblem problem ) ; void enterClass ( int declarationStart , int [ ] javaDocPositions , int modifiers , int modifiersStart , int classStart , char [ ] name , int nameStart , int nameEnd , char [ ] superclass , int superclassStart , int superclassEnd , char [ ] [ ] superinterfaces , int [ ] superinterfaceStarts , int [ ] superinterfaceEnds , int bodyStart ) ; void enterCompilationUnit ( ) ; void enterConstructor ( int declarationStart , int [ ] javaDocPositions , int modifiers , int modifiersStart , char [ ] name , int nameStart , int nameEnd , char [ ] [ ] parameterTypes , int [ ] parameterTypeStarts , int [ ] parameterTypeEnds , char [ ] [ ] parameterNames , int [ ] parameterNameStarts , int [ ] parameterNameEnds , int parametersEnd , char [ ] [ ] exceptionTypes , int [ ] exceptionTypeStarts , int [ ] exceptionTypeEnds , int bodyStart ) ; void enterField ( int declarationStart , int [ ] javaDocPositions , int modifiers , int modifiersStart , char [ ] type , int typeStart , int typeEnd , int typeDimensionCount , char [ ] name , int nameStart , int nameEnd , int extendedTypeDimensionCount , int extendedTypeDimensionEnd ) ; void enterInterface ( int declarationStart , int [ ] javaDocPositions , int modifiers , int modifiersStart , int interfaceStart , char [ ] name , int nameStart , int nameEnd , char [ ] [ ] superinterfaces , int [ ] superinterfaceStarts , int [ ] superinterfaceEnds , int bodyStart ) ; void enterMethod ( int declarationStart , int [ ] javaDocPositions , int modifiers , int modifiersStart , char [ ] returnType , int returnTypeStart , int returnTypeEnd , int returnTypeDimensionCount , char [ ] name , int nameStart , int nameEnd , char [ ] [ ] parameterTypes , int [ ] parameterTypeStarts , int [ ] parameterTypeEnds , char [ ] [ ] parameterNames , int [ ] parameterNameStarts , int [ ] parameterNameEnds , int parametersEnd , int extendedReturnTypeDimensionCount , int extendedReturnTypeDimensionEnd , char [ ] [ ] exceptionTypes , int [ ] exceptionTypeStarts , int [ ] exceptionTypeEnds , int bodyStart ) ; void exitClass ( int bodyEnd , int declarationEnd ) ; void exitCompilationUnit ( int declarationEnd ) ; void exitConstructor ( int bodyEnd , int declarationEnd ) ; void exitField ( int bodyEnd , int declarationEnd ) ; void exitInterface ( int bodyEnd , int declarationEnd ) ; void exitMethod ( int bodyEnd , int declarationEnd ) ; } </s>
<s> package org . eclipse . jdt . internal . compiler ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . parser . JavadocParser ; import org . eclipse . jdt . internal . compiler . parser . Parser ; import org . eclipse . jdt . internal . compiler . parser . ScannerHelper ; import org . eclipse . jdt . internal . compiler . parser . TerminalTokens ; public class SourceJavadocParser extends JavadocParser { int categoriesPtr = - <NUM_LIT:1> ; char [ ] [ ] categories = CharOperation . NO_CHAR_CHAR ; public SourceJavadocParser ( Parser sourceParser ) { super ( sourceParser ) ; this . kind = SOURCE_PARSER | TEXT_VERIF ; } public boolean checkDeprecation ( int commentPtr ) { this . categoriesPtr = - <NUM_LIT:1> ; boolean result = super . checkDeprecation ( commentPtr ) ; if ( this . categoriesPtr > - <NUM_LIT:1> ) { System . arraycopy ( this . categories , <NUM_LIT:0> , this . categories = new char [ this . categoriesPtr + <NUM_LIT:1> ] [ ] , <NUM_LIT:0> , this . categoriesPtr + <NUM_LIT:1> ) ; } else { this . categories = CharOperation . NO_CHAR_CHAR ; } return result ; } protected boolean parseIdentifierTag ( boolean report ) { int end = this . lineEnd + <NUM_LIT:1> ; if ( super . parseIdentifierTag ( report ) && this . index <= end ) { if ( this . tagValue == TAG_CATEGORY_VALUE ) { int length = this . categories . length ; if ( ++ this . categoriesPtr >= length ) { System . arraycopy ( this . categories , <NUM_LIT:0> , this . categories = new char [ length + <NUM_LIT:5> ] [ ] , <NUM_LIT:0> , length ) ; length += <NUM_LIT:5> ; } this . categories [ this . categoriesPtr ] = this . identifierStack [ this . identifierPtr -- ] ; consumeToken ( ) ; while ( this . index < end ) { if ( readTokenSafely ( ) == TerminalTokens . TokenNameIdentifier && ( this . scanner . currentCharacter == '<CHAR_LIT:U+0020>' || ScannerHelper . isWhitespace ( this . scanner . currentCharacter ) ) ) { if ( this . index > ( this . lineEnd + <NUM_LIT:1> ) ) break ; if ( ++ this . categoriesPtr >= length ) { System . arraycopy ( this . categories , <NUM_LIT:0> , this . categories = new char [ length + <NUM_LIT:5> ] [ ] , <NUM_LIT:0> , length ) ; length += <NUM_LIT:5> ; } this . categories [ this . categoriesPtr ] = this . scanner . getCurrentIdentifierSource ( ) ; consumeToken ( ) ; } else { break ; } } this . index = end ; this . scanner . currentPosition = end ; consumeToken ( ) ; } return true ; } 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 . getNumericValue ( this . source [ this . index ++ ] ) ) > <NUM_LIT:15> || c1 < <NUM_LIT:0> ) || ( ( c2 = ScannerHelper . getNumericValue ( this . source [ this . index ++ ] ) ) > <NUM_LIT:15> || c2 < <NUM_LIT:0> ) || ( ( c3 = ScannerHelper . getNumericValue ( this . source [ this . index ++ ] ) ) > <NUM_LIT:15> || c3 < <NUM_LIT:0> ) || ( ( c4 = ScannerHelper . getNumericValue ( 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 . tagValue = TAG_DEPRECATED_VALUE ; this . deprecated = true ; } } break ; case '<CHAR_LIT:c>' : if ( ( readChar ( ) == '<CHAR_LIT:a>' ) && ( readChar ( ) == '<CHAR_LIT>' ) && ( readChar ( ) == '<CHAR_LIT:e>' ) && ( readChar ( ) == '<CHAR_LIT>' ) && ( readChar ( ) == '<CHAR_LIT>' ) && ( readChar ( ) == '<CHAR_LIT>' ) && ( readChar ( ) == '<CHAR_LIT>' ) ) { char c = readChar ( ) ; if ( ScannerHelper . isWhitespace ( c ) || c == '<CHAR_LIT>' ) { this . tagValue = TAG_CATEGORY_VALUE ; if ( this . scanner . source == null ) { this . scanner . setSource ( this . source ) ; } this . scanner . resetTo ( this . index , this . scanner . eofPosition ) ; parseIdentifierTag ( false ) ; } } break ; } } } </s>
<s> package org . eclipse . jdt . internal . compiler ; import java . util . HashMap ; import org . eclipse . core . runtime . IProgressMonitor ; import org . eclipse . core . runtime . OperationCanceledException ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . env . * ; import org . eclipse . jdt . internal . compiler . impl . * ; import org . eclipse . jdt . core . compiler . * ; import org . eclipse . jdt . internal . compiler . ast . * ; import org . eclipse . jdt . internal . compiler . lookup . * ; import org . eclipse . jdt . internal . compiler . problem . * ; import org . eclipse . jdt . internal . compiler . util . HashtableOfObjectToInt ; import org . eclipse . jdt . internal . core . util . CommentRecorderParser ; import org . eclipse . jdt . internal . core . util . Messages ; public class SourceElementParser extends CommentRecorderParser { ISourceElementRequestor requestor ; boolean reportReferenceInfo ; boolean reportLocalDeclarations ; HashtableOfObjectToInt sourceEnds = new HashtableOfObjectToInt ( ) ; HashMap nodesToCategories = new HashMap ( ) ; boolean useSourceJavadocParser = true ; SourceElementNotifier notifier ; public SourceElementParser ( final ISourceElementRequestor requestor , IProblemFactory problemFactory , CompilerOptions options , boolean reportLocalDeclarations , boolean optimizeStringLiterals ) { this ( requestor , problemFactory , options , reportLocalDeclarations , optimizeStringLiterals , true ) ; } public SourceElementParser ( ISourceElementRequestor requestor , IProblemFactory problemFactory , CompilerOptions options , boolean reportLocalDeclarations , boolean optimizeStringLiterals , boolean useSourceJavadocParser ) { super ( new ProblemReporter ( DefaultErrorHandlingPolicies . exitAfterAllProblems ( ) , options , problemFactory ) , optimizeStringLiterals ) ; this . reportLocalDeclarations = reportLocalDeclarations ; this . problemReporter = new ProblemReporter ( DefaultErrorHandlingPolicies . exitAfterAllProblems ( ) , options , problemFactory ) { public void record ( CategorizedProblem problem , CompilationResult unitResult , ReferenceContext context ) { unitResult . record ( problem , context ) ; SourceElementParser . this . requestor . acceptProblem ( problem ) ; } } ; this . requestor = requestor ; this . options = options ; this . notifier = new SourceElementNotifier ( this . requestor , reportLocalDeclarations ) ; this . useSourceJavadocParser = useSourceJavadocParser ; if ( useSourceJavadocParser ) { this . javadocParser = new SourceJavadocParser ( this ) ; } } private void acceptJavadocTypeReference ( Expression expression ) { if ( expression instanceof JavadocSingleTypeReference ) { JavadocSingleTypeReference singleRef = ( JavadocSingleTypeReference ) expression ; this . requestor . acceptTypeReference ( singleRef . token , singleRef . sourceStart ) ; } else if ( expression instanceof JavadocQualifiedTypeReference ) { JavadocQualifiedTypeReference qualifiedRef = ( JavadocQualifiedTypeReference ) expression ; this . requestor . acceptTypeReference ( qualifiedRef . tokens , qualifiedRef . sourceStart , qualifiedRef . sourceEnd ) ; } } public void addUnknownRef ( NameReference nameRef ) { if ( nameRef instanceof SingleNameReference ) { this . requestor . acceptUnknownReference ( ( ( SingleNameReference ) nameRef ) . token , nameRef . sourceStart ) ; } else { this . requestor . acceptUnknownReference ( ( ( QualifiedNameReference ) nameRef ) . tokens , nameRef . sourceStart , nameRef . sourceEnd ) ; } } 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 ; } } if ( this . reportReferenceInfo && this . javadocParser . checkDocComment && this . javadoc != null ) { TypeReference [ ] thrownExceptions = this . javadoc . exceptionReferences ; if ( thrownExceptions != null ) { for ( int i = <NUM_LIT:0> , max = thrownExceptions . length ; i < max ; i ++ ) { TypeReference typeRef = thrownExceptions [ i ] ; if ( typeRef instanceof JavadocSingleTypeReference ) { JavadocSingleTypeReference singleRef = ( JavadocSingleTypeReference ) typeRef ; this . requestor . acceptTypeReference ( singleRef . token , singleRef . sourceStart ) ; } else if ( typeRef instanceof JavadocQualifiedTypeReference ) { JavadocQualifiedTypeReference qualifiedRef = ( JavadocQualifiedTypeReference ) typeRef ; this . requestor . acceptTypeReference ( qualifiedRef . tokens , qualifiedRef . sourceStart , qualifiedRef . sourceEnd ) ; } } } Expression [ ] references = this . javadoc . seeReferences ; if ( references != null ) { for ( int i = <NUM_LIT:0> , max = references . length ; i < max ; i ++ ) { Expression reference = references [ i ] ; acceptJavadocTypeReference ( reference ) ; if ( reference instanceof JavadocFieldReference ) { JavadocFieldReference fieldRef = ( JavadocFieldReference ) reference ; this . requestor . acceptFieldReference ( fieldRef . token , fieldRef . sourceStart ) ; if ( fieldRef . receiver != null && ! fieldRef . receiver . isThis ( ) ) { acceptJavadocTypeReference ( fieldRef . receiver ) ; } } else if ( reference instanceof JavadocMessageSend ) { JavadocMessageSend messageSend = ( JavadocMessageSend ) reference ; int argCount = messageSend . arguments == null ? <NUM_LIT:0> : messageSend . arguments . length ; this . requestor . acceptMethodReference ( messageSend . selector , argCount , messageSend . sourceStart ) ; this . requestor . acceptConstructorReference ( messageSend . selector , argCount , messageSend . sourceStart ) ; if ( messageSend . receiver != null && ! messageSend . receiver . isThis ( ) ) { acceptJavadocTypeReference ( messageSend . receiver ) ; } } else if ( reference instanceof JavadocAllocationExpression ) { JavadocAllocationExpression constructor = ( JavadocAllocationExpression ) reference ; int argCount = constructor . arguments == null ? <NUM_LIT:0> : constructor . arguments . length ; if ( constructor . type != null ) { char [ ] [ ] compoundName = constructor . type . getParameterizedTypeName ( ) ; this . requestor . acceptConstructorReference ( compoundName [ compoundName . length - <NUM_LIT:1> ] , argCount , constructor . sourceStart ) ; if ( ! constructor . type . isThis ( ) ) { acceptJavadocTypeReference ( constructor . type ) ; } } } } } } } protected void classInstanceCreation ( boolean alwaysQualified ) { boolean previousFlag = this . reportReferenceInfo ; this . reportReferenceInfo = false ; super . classInstanceCreation ( alwaysQualified ) ; this . reportReferenceInfo = previousFlag ; if ( this . reportReferenceInfo ) { AllocationExpression alloc = ( AllocationExpression ) this . expressionStack [ this . expressionPtr ] ; TypeReference typeRef = alloc . type ; this . requestor . acceptConstructorReference ( typeRef instanceof SingleTypeReference ? ( ( SingleTypeReference ) typeRef ) . token : CharOperation . concatWith ( alloc . type . getParameterizedTypeName ( ) , '<CHAR_LIT:.>' ) , alloc . arguments == null ? <NUM_LIT:0> : alloc . arguments . length , alloc . sourceStart ) ; } } protected void consumeAnnotationAsModifier ( ) { super . consumeAnnotationAsModifier ( ) ; Annotation annotation = ( Annotation ) this . expressionStack [ this . expressionPtr ] ; if ( this . reportReferenceInfo ) { this . requestor . acceptAnnotationTypeReference ( annotation . type . getTypeName ( ) , annotation . sourceStart , annotation . sourceEnd ) ; } } protected void consumeClassInstanceCreationExpressionQualifiedWithTypeArguments ( ) { boolean previousFlag = this . reportReferenceInfo ; this . reportReferenceInfo = false ; super . consumeClassInstanceCreationExpressionQualifiedWithTypeArguments ( ) ; this . reportReferenceInfo = previousFlag ; if ( this . reportReferenceInfo ) { AllocationExpression alloc = ( AllocationExpression ) this . expressionStack [ this . expressionPtr ] ; TypeReference typeRef = alloc . type ; this . requestor . acceptConstructorReference ( typeRef instanceof SingleTypeReference ? ( ( SingleTypeReference ) typeRef ) . token : CharOperation . concatWith ( alloc . type . getParameterizedTypeName ( ) , '<CHAR_LIT:.>' ) , alloc . arguments == null ? <NUM_LIT:0> : alloc . arguments . length , alloc . sourceStart ) ; } } protected void consumeAnnotationTypeDeclarationHeaderName ( ) { int currentAstPtr = this . astPtr ; super . consumeAnnotationTypeDeclarationHeaderName ( ) ; if ( this . astPtr > currentAstPtr ) rememberCategories ( ) ; } protected void consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters ( ) { int currentAstPtr = this . astPtr ; super . consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters ( ) ; if ( this . astPtr > currentAstPtr ) rememberCategories ( ) ; } protected void consumeClassHeaderName1 ( ) { int currentAstPtr = this . astPtr ; super . consumeClassHeaderName1 ( ) ; if ( this . astPtr > currentAstPtr ) rememberCategories ( ) ; } protected void consumeClassInstanceCreationExpressionWithTypeArguments ( ) { boolean previousFlag = this . reportReferenceInfo ; this . reportReferenceInfo = false ; super . consumeClassInstanceCreationExpressionWithTypeArguments ( ) ; this . reportReferenceInfo = previousFlag ; if ( this . reportReferenceInfo ) { AllocationExpression alloc = ( AllocationExpression ) this . expressionStack [ this . expressionPtr ] ; TypeReference typeRef = alloc . type ; this . requestor . acceptConstructorReference ( typeRef instanceof SingleTypeReference ? ( ( SingleTypeReference ) typeRef ) . token : CharOperation . concatWith ( alloc . type . getParameterizedTypeName ( ) , '<CHAR_LIT:.>' ) , alloc . arguments == null ? <NUM_LIT:0> : alloc . arguments . length , alloc . sourceStart ) ; } } protected void consumeConstructorHeaderName ( ) { long selectorSourcePositions = this . identifierPositionStack [ this . identifierPtr ] ; int selectorSourceEnd = ( int ) selectorSourcePositions ; int currentAstPtr = this . astPtr ; super . consumeConstructorHeaderName ( ) ; if ( this . astPtr > currentAstPtr ) { this . sourceEnds . put ( this . astStack [ this . astPtr ] , selectorSourceEnd ) ; rememberCategories ( ) ; } } protected void consumeConstructorHeaderNameWithTypeParameters ( ) { long selectorSourcePositions = this . identifierPositionStack [ this . identifierPtr ] ; int selectorSourceEnd = ( int ) selectorSourcePositions ; int currentAstPtr = this . astPtr ; super . consumeConstructorHeaderNameWithTypeParameters ( ) ; if ( this . astPtr > currentAstPtr ) { this . sourceEnds . put ( this . astStack [ this . astPtr ] , selectorSourceEnd ) ; rememberCategories ( ) ; } } protected void consumeEnumConstantWithClassBody ( ) { super . consumeEnumConstantWithClassBody ( ) ; if ( ( this . currentToken == TokenNameCOMMA || this . currentToken == TokenNameSEMICOLON ) && this . astStack [ this . astPtr ] instanceof FieldDeclaration ) { this . sourceEnds . put ( this . astStack [ this . astPtr ] , this . scanner . currentPosition - <NUM_LIT:1> ) ; rememberCategories ( ) ; } } protected void consumeEnumConstantNoClassBody ( ) { super . consumeEnumConstantNoClassBody ( ) ; if ( ( this . currentToken == TokenNameCOMMA || this . currentToken == TokenNameSEMICOLON ) && this . astStack [ this . astPtr ] instanceof FieldDeclaration ) { this . sourceEnds . put ( this . astStack [ this . astPtr ] , this . scanner . currentPosition - <NUM_LIT:1> ) ; rememberCategories ( ) ; } } protected void consumeEnumHeaderName ( ) { int currentAstPtr = this . astPtr ; super . consumeEnumHeaderName ( ) ; if ( this . astPtr > currentAstPtr ) rememberCategories ( ) ; } protected void consumeEnumHeaderNameWithTypeParameters ( ) { int currentAstPtr = this . astPtr ; super . consumeEnumHeaderNameWithTypeParameters ( ) ; if ( this . astPtr > currentAstPtr ) rememberCategories ( ) ; } protected void consumeExitVariableWithInitialization ( ) { super . consumeExitVariableWithInitialization ( ) ; if ( ( this . currentToken == TokenNameCOMMA || this . currentToken == TokenNameSEMICOLON ) && this . astStack [ this . astPtr ] instanceof FieldDeclaration ) { this . sourceEnds . put ( this . astStack [ this . astPtr ] , this . scanner . currentPosition - <NUM_LIT:1> ) ; rememberCategories ( ) ; } } protected void consumeExitVariableWithoutInitialization ( ) { super . consumeExitVariableWithoutInitialization ( ) ; if ( ( this . currentToken == TokenNameCOMMA || this . currentToken == TokenNameSEMICOLON ) && this . astStack [ this . astPtr ] instanceof FieldDeclaration ) { this . sourceEnds . put ( this . astStack [ this . astPtr ] , this . scanner . currentPosition - <NUM_LIT:1> ) ; rememberCategories ( ) ; } } protected void consumeFieldAccess ( boolean isSuperAccess ) { super . consumeFieldAccess ( isSuperAccess ) ; FieldReference fr = ( FieldReference ) this . expressionStack [ this . expressionPtr ] ; if ( this . reportReferenceInfo ) { this . requestor . acceptFieldReference ( fr . token , fr . sourceStart ) ; } } protected void consumeFormalParameter ( boolean isVarArgs ) { super . consumeFormalParameter ( isVarArgs ) ; flushCommentsDefinedPriorTo ( this . scanner . currentPosition ) ; } protected void consumeInterfaceHeaderName1 ( ) { int currentAstPtr = this . astPtr ; super . consumeInterfaceHeaderName1 ( ) ; if ( this . astPtr > currentAstPtr ) rememberCategories ( ) ; } protected void consumeMemberValuePair ( ) { super . consumeMemberValuePair ( ) ; MemberValuePair memberValuepair = ( MemberValuePair ) this . astStack [ this . astPtr ] ; if ( this . reportReferenceInfo ) { this . requestor . acceptMethodReference ( memberValuepair . name , <NUM_LIT:0> , memberValuepair . sourceStart ) ; } } protected void consumeMarkerAnnotation ( ) { super . consumeMarkerAnnotation ( ) ; Annotation annotation = ( Annotation ) this . expressionStack [ this . expressionPtr ] ; if ( this . reportReferenceInfo ) { this . requestor . acceptAnnotationTypeReference ( annotation . type . getTypeName ( ) , annotation . sourceStart , annotation . sourceEnd ) ; } } protected void consumeMethodHeaderName ( boolean isAnnotationMethod ) { long selectorSourcePositions = this . identifierPositionStack [ this . identifierPtr ] ; int selectorSourceEnd = ( int ) selectorSourcePositions ; int currentAstPtr = this . astPtr ; super . consumeMethodHeaderName ( isAnnotationMethod ) ; if ( this . astPtr > currentAstPtr ) { this . sourceEnds . put ( this . astStack [ this . astPtr ] , selectorSourceEnd ) ; rememberCategories ( ) ; } } protected void consumeMethodHeaderNameWithTypeParameters ( boolean isAnnotationMethod ) { long selectorSourcePositions = this . identifierPositionStack [ this . identifierPtr ] ; int selectorSourceEnd = ( int ) selectorSourcePositions ; int currentAstPtr = this . astPtr ; super . consumeMethodHeaderNameWithTypeParameters ( isAnnotationMethod ) ; if ( this . astPtr > currentAstPtr ) this . sourceEnds . put ( this . astStack [ this . astPtr ] , selectorSourceEnd ) ; rememberCategories ( ) ; } protected void consumeMethodInvocationName ( ) { super . consumeMethodInvocationName ( ) ; MessageSend messageSend = ( MessageSend ) this . expressionStack [ this . expressionPtr ] ; Expression [ ] args = messageSend . arguments ; if ( this . reportReferenceInfo ) { this . requestor . acceptMethodReference ( messageSend . selector , args == null ? <NUM_LIT:0> : args . length , ( int ) ( messageSend . nameSourcePosition > > > <NUM_LIT:32> ) ) ; } } protected void consumeMethodInvocationNameWithTypeArguments ( ) { super . consumeMethodInvocationNameWithTypeArguments ( ) ; MessageSend messageSend = ( MessageSend ) this . expressionStack [ this . expressionPtr ] ; Expression [ ] args = messageSend . arguments ; if ( this . reportReferenceInfo ) { this . requestor . acceptMethodReference ( messageSend . selector , args == null ? <NUM_LIT:0> : args . length , ( int ) ( messageSend . nameSourcePosition > > > <NUM_LIT:32> ) ) ; } } protected void consumeMethodInvocationPrimary ( ) { super . consumeMethodInvocationPrimary ( ) ; MessageSend messageSend = ( MessageSend ) this . expressionStack [ this . expressionPtr ] ; Expression [ ] args = messageSend . arguments ; if ( this . reportReferenceInfo ) { this . requestor . acceptMethodReference ( messageSend . selector , args == null ? <NUM_LIT:0> : args . length , ( int ) ( messageSend . nameSourcePosition > > > <NUM_LIT:32> ) ) ; } } protected void consumeMethodInvocationPrimaryWithTypeArguments ( ) { super . consumeMethodInvocationPrimaryWithTypeArguments ( ) ; MessageSend messageSend = ( MessageSend ) this . expressionStack [ this . expressionPtr ] ; Expression [ ] args = messageSend . arguments ; if ( this . reportReferenceInfo ) { this . requestor . acceptMethodReference ( messageSend . selector , args == null ? <NUM_LIT:0> : args . length , ( int ) ( messageSend . nameSourcePosition > > > <NUM_LIT:32> ) ) ; } } protected void consumeMethodInvocationSuper ( ) { super . consumeMethodInvocationSuper ( ) ; MessageSend messageSend = ( MessageSend ) this . expressionStack [ this . expressionPtr ] ; Expression [ ] args = messageSend . arguments ; if ( this . reportReferenceInfo ) { this . requestor . acceptMethodReference ( messageSend . selector , args == null ? <NUM_LIT:0> : args . length , ( int ) ( messageSend . nameSourcePosition > > > <NUM_LIT:32> ) ) ; } } protected void consumeMethodInvocationSuperWithTypeArguments ( ) { super . consumeMethodInvocationSuperWithTypeArguments ( ) ; MessageSend messageSend = ( MessageSend ) this . expressionStack [ this . expressionPtr ] ; Expression [ ] args = messageSend . arguments ; if ( this . reportReferenceInfo ) { this . requestor . acceptMethodReference ( messageSend . selector , args == null ? <NUM_LIT:0> : args . length , ( int ) ( messageSend . nameSourcePosition > > > <NUM_LIT:32> ) ) ; } } protected void consumeNormalAnnotation ( ) { super . consumeNormalAnnotation ( ) ; Annotation annotation = ( Annotation ) this . expressionStack [ this . expressionPtr ] ; if ( this . reportReferenceInfo ) { this . requestor . acceptAnnotationTypeReference ( annotation . type . getTypeName ( ) , annotation . sourceStart , annotation . sourceEnd ) ; } } protected void consumeSingleMemberAnnotation ( ) { super . consumeSingleMemberAnnotation ( ) ; SingleMemberAnnotation member = ( SingleMemberAnnotation ) this . expressionStack [ this . expressionPtr ] ; if ( this . reportReferenceInfo ) { this . requestor . acceptMethodReference ( TypeConstants . VALUE , <NUM_LIT:0> , member . sourceStart ) ; } } 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 = newImportReference ( 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 ; } if ( this . reportReferenceInfo ) { int tokensLength = impt . tokens . length - <NUM_LIT:1> ; int start = ( int ) ( impt . sourcePositions [ tokensLength ] > > > <NUM_LIT:32> ) ; char [ ] last = impt . tokens [ tokensLength ] ; this . requestor . acceptFieldReference ( last , start ) ; this . requestor . acceptMethodReference ( last , <NUM_LIT:0> , start ) ; this . requestor . acceptTypeReference ( last , start ) ; if ( tokensLength > <NUM_LIT:0> ) { char [ ] [ ] compoundName = new char [ tokensLength ] [ ] ; System . arraycopy ( impt . tokens , <NUM_LIT:0> , compoundName , <NUM_LIT:0> , tokensLength ) ; int end = ( int ) impt . sourcePositions [ tokensLength - <NUM_LIT:1> ] ; this . requestor . acceptTypeReference ( compoundName , impt . sourceStart , end ) ; } } } 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 = newImportReference ( 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 ; } if ( this . reportReferenceInfo ) { this . requestor . acceptTypeReference ( impt . tokens , impt . sourceStart , impt . sourceEnd ) ; } } 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 ) ) ; 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 ; } if ( this . reportReferenceInfo ) { this . requestor . acceptTypeReference ( impt . tokens , impt . sourceStart , impt . sourceEnd ) ; } } 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 ) ) ; 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 ; } if ( this . reportReferenceInfo ) { this . requestor . acceptUnknownReference ( impt . tokens , impt . sourceStart , impt . sourceEnd ) ; } } public MethodDeclaration convertToMethodDeclaration ( ConstructorDeclaration c , CompilationResult compilationResult ) { MethodDeclaration methodDeclaration = super . convertToMethodDeclaration ( c , compilationResult ) ; int selectorSourceEnd = this . sourceEnds . removeKey ( c ) ; if ( selectorSourceEnd != - <NUM_LIT:1> ) this . sourceEnds . put ( methodDeclaration , selectorSourceEnd ) ; char [ ] [ ] categories = ( char [ ] [ ] ) this . nodesToCategories . remove ( c ) ; if ( categories != null ) this . nodesToCategories . put ( methodDeclaration , categories ) ; return methodDeclaration ; } protected CompilationUnitDeclaration endParse ( int act ) { if ( this . scanner . recordLineSeparator ) { this . requestor . acceptLineSeparatorPositions ( this . scanner . getLineEnds ( ) ) ; } if ( this . compilationUnit != null ) { CompilationUnitDeclaration result = super . endParse ( act ) ; return result ; } else { return null ; } } public TypeReference getTypeReference ( int dim ) { int length = this . identifierLengthStack [ this . identifierLengthPtr -- ] ; if ( length < <NUM_LIT:0> ) { TypeReference 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 ; } if ( this . reportReferenceInfo ) { this . requestor . acceptTypeReference ( ref . getParameterizedTypeName ( ) , ref . sourceStart , ref . sourceEnd ) ; } return ref ; } else { int numberOfIdentifiers = this . genericsIdentifiersLengthStack [ this . genericsIdentifiersLengthPtr -- ] ; if ( length != numberOfIdentifiers || this . genericsLengthStack [ this . genericsLengthPtr ] != <NUM_LIT:0> ) { TypeReference ref = getTypeReferenceForGenericType ( dim , length , numberOfIdentifiers ) ; if ( this . reportReferenceInfo ) { if ( length == <NUM_LIT:1> && numberOfIdentifiers == <NUM_LIT:1> ) { ParameterizedSingleTypeReference parameterizedSingleTypeReference = ( ParameterizedSingleTypeReference ) ref ; this . requestor . acceptTypeReference ( parameterizedSingleTypeReference . token , parameterizedSingleTypeReference . sourceStart ) ; } else { ParameterizedQualifiedTypeReference parameterizedQualifiedTypeReference = ( ParameterizedQualifiedTypeReference ) ref ; this . requestor . acceptTypeReference ( parameterizedQualifiedTypeReference . tokens , parameterizedQualifiedTypeReference . sourceStart , parameterizedQualifiedTypeReference . sourceEnd ) ; } } return ref ; } else if ( length == <NUM_LIT:1> ) { this . genericsLengthPtr -- ; if ( dim == <NUM_LIT:0> ) { SingleTypeReference ref = new SingleTypeReference ( this . identifierStack [ this . identifierPtr ] , this . identifierPositionStack [ this . identifierPtr -- ] ) ; if ( this . reportReferenceInfo ) { this . requestor . acceptTypeReference ( ref . token , ref . sourceStart ) ; } return ref ; } else { ArrayTypeReference ref = new ArrayTypeReference ( this . identifierStack [ this . identifierPtr ] , dim , this . identifierPositionStack [ this . identifierPtr -- ] ) ; ref . sourceEnd = this . endPosition ; if ( this . reportReferenceInfo ) { this . requestor . acceptTypeReference ( ref . token , ref . sourceStart ) ; } return ref ; } } 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> ) { QualifiedTypeReference ref = new QualifiedTypeReference ( tokens , positions ) ; if ( this . reportReferenceInfo ) { this . requestor . acceptTypeReference ( ref . tokens , ref . sourceStart , ref . sourceEnd ) ; } return ref ; } else { ArrayQualifiedTypeReference ref = new ArrayQualifiedTypeReference ( tokens , dim , positions ) ; ref . sourceEnd = this . endPosition ; if ( this . reportReferenceInfo ) { this . requestor . acceptTypeReference ( ref . tokens , ref . sourceStart , ref . sourceEnd ) ; } return ref ; } } } } public NameReference getUnspecifiedReference ( ) { int length ; if ( ( length = this . identifierLengthStack [ this . identifierLengthPtr -- ] ) == <NUM_LIT:1> ) { SingleNameReference ref = newSingleNameReference ( this . identifierStack [ this . identifierPtr ] , this . identifierPositionStack [ this . identifierPtr -- ] ) ; if ( this . reportReferenceInfo ) { addUnknownRef ( ref ) ; } return ref ; } 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 ) ; QualifiedNameReference ref = newQualifiedNameReference ( tokens , positions , ( int ) ( this . identifierPositionStack [ this . identifierPtr + <NUM_LIT:1> ] > > <NUM_LIT:32> ) , ( int ) this . identifierPositionStack [ this . identifierPtr + length ] ) ; if ( this . reportReferenceInfo ) { addUnknownRef ( ref ) ; } return ref ; } } public NameReference getUnspecifiedReferenceOptimized ( ) { int length ; if ( ( length = this . identifierLengthStack [ this . identifierLengthPtr -- ] ) == <NUM_LIT:1> ) { SingleNameReference ref = newSingleNameReference ( this . identifierStack [ this . identifierPtr ] , this . identifierPositionStack [ this . identifierPtr -- ] ) ; ref . bits &= ~ ASTNode . RestrictiveFlagMASK ; ref . bits |= Binding . LOCAL | Binding . FIELD ; if ( this . reportReferenceInfo ) { addUnknownRef ( ref ) ; } 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 ) ; QualifiedNameReference ref = newQualifiedNameReference ( 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 ; if ( this . reportReferenceInfo ) { addUnknownRef ( ref ) ; } return ref ; } protected ImportReference newImportReference ( char [ ] [ ] tokens , long [ ] positions , boolean onDemand , int mod ) { return new ImportReference ( tokens , positions , onDemand , mod ) ; } protected QualifiedNameReference newQualifiedNameReference ( char [ ] [ ] tokens , long [ ] positions , int sourceStart , int sourceEnd ) { return new QualifiedNameReference ( tokens , positions , sourceStart , sourceEnd ) ; } protected SingleNameReference newSingleNameReference ( char [ ] source , long positions ) { return new SingleNameReference ( source , positions ) ; } public CompilationUnitDeclaration parseCompilationUnit ( ICompilationUnit unit , boolean fullParse , IProgressMonitor pm ) { boolean old = this . diet ; CompilationUnitDeclaration parsedUnit = null ; try { this . diet = true ; this . reportReferenceInfo = fullParse ; CompilationResult compilationUnitResult = new CompilationResult ( unit , <NUM_LIT:0> , <NUM_LIT:0> , this . options . maxProblemsPerUnit ) ; parsedUnit = parse ( unit , compilationUnitResult ) ; if ( pm != null && pm . isCanceled ( ) ) throw new OperationCanceledException ( Messages . operation_cancelled ) ; if ( this . scanner . recordLineSeparator ) { this . requestor . acceptLineSeparatorPositions ( compilationUnitResult . getLineSeparatorPositions ( ) ) ; } int initialStart = this . scanner . initialPosition ; int initialEnd = this . scanner . eofPosition ; if ( this . reportLocalDeclarations || fullParse ) { this . diet = false ; getMethodBodies ( parsedUnit ) ; } this . scanner . resetTo ( initialStart , initialEnd ) ; this . notifier . notifySourceElementRequestor ( parsedUnit , this . scanner . initialPosition , this . scanner . eofPosition , this . reportReferenceInfo , this . sourceEnds , this . nodesToCategories ) ; return parsedUnit ; } catch ( AbortCompilation e ) { } finally { this . diet = old ; reset ( ) ; } return parsedUnit ; } private void rememberCategories ( ) { if ( this . useSourceJavadocParser ) { SourceJavadocParser sourceJavadocParser = ( SourceJavadocParser ) this . javadocParser ; char [ ] [ ] categories = sourceJavadocParser . categories ; if ( categories . length > <NUM_LIT:0> ) { this . nodesToCategories . put ( this . astStack [ this . astPtr ] , categories ) ; sourceJavadocParser . categories = CharOperation . NO_CHAR_CHAR ; } } } public void reset ( ) { this . sourceEnds = new HashtableOfObjectToInt ( ) ; this . nodesToCategories = new HashMap ( ) ; } public void setRequestor ( ISourceElementRequestor requestor ) { this . requestor = requestor ; this . notifier . requestor = requestor ; } } </s>
<s> package org . eclipse . jdt . internal . compiler ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . env . * ; import org . eclipse . jdt . internal . compiler . impl . * ; import org . eclipse . jdt . core . compiler . * ; import org . eclipse . jdt . internal . compiler . ast . * ; import org . eclipse . jdt . internal . compiler . parser . * ; import org . eclipse . jdt . internal . compiler . problem . * ; public class DocumentElementParser extends Parser { IDocumentElementRequestor requestor ; private int localIntPtr ; private int lastFieldEndPosition ; private int lastFieldBodyEndPosition ; private int typeStartPosition ; private long selectorSourcePositions ; private int typeDims ; private int extendsDim ; private int declarationSourceStart ; int [ ] [ ] intArrayStack ; int intArrayPtr ; public DocumentElementParser ( final IDocumentElementRequestor requestor , IProblemFactory problemFactory , CompilerOptions options ) { super ( new ProblemReporter ( DefaultErrorHandlingPolicies . exitAfterAllProblems ( ) , options , problemFactory ) , false ) ; this . requestor = requestor ; this . intArrayStack = new int [ <NUM_LIT:30> ] [ ] ; this . options = options ; this . javadocParser . checkDocComment = false ; setMethodsFullRecovery ( false ) ; setStatementsRecovery ( false ) ; } public void checkComment ( ) { pushOnIntArrayStack ( getJavaDocPositions ( ) ) ; boolean deprecated = false ; int lastCommentIndex = - <NUM_LIT:1> ; int commentPtr = this . scanner . commentPtr ; nextComment : for ( lastCommentIndex = this . scanner . commentPtr ; lastCommentIndex >= <NUM_LIT:0> ; lastCommentIndex -- ) { int commentSourceStart = this . scanner . commentStarts [ lastCommentIndex ] ; if ( commentSourceStart < <NUM_LIT:0> || this . scanner . commentStops [ lastCommentIndex ] < <NUM_LIT:0> || ( this . modifiersSourceStart != - <NUM_LIT:1> && this . modifiersSourceStart < commentSourceStart ) ) { continue nextComment ; } deprecated = this . javadocParser . checkDeprecation ( lastCommentIndex ) ; break nextComment ; } if ( deprecated ) { checkAndSetModifiers ( ClassFileConstants . AccDeprecated ) ; } if ( commentPtr >= <NUM_LIT:0> ) { this . declarationSourceStart = this . scanner . commentStarts [ <NUM_LIT:0> ] ; if ( this . declarationSourceStart < <NUM_LIT:0> ) this . declarationSourceStart = - this . declarationSourceStart ; } } protected void consumeClassBodyDeclaration ( ) { super . consumeClassBodyDeclaration ( ) ; Initializer initializer = ( Initializer ) this . astStack [ this . astPtr ] ; this . requestor . acceptInitializer ( initializer . declarationSourceStart , initializer . declarationSourceEnd , this . intArrayStack [ this . intArrayPtr -- ] , <NUM_LIT:0> , this . modifiersSourceStart , initializer . block . sourceStart , initializer . block . sourceEnd ) ; } protected void consumeClassDeclaration ( ) { super . consumeClassDeclaration ( ) ; if ( isLocalDeclaration ( ) ) { return ; } this . requestor . exitClass ( this . endStatementPosition , ( ( TypeDeclaration ) this . astStack [ this . astPtr ] ) . declarationSourceEnd ) ; } protected void consumeClassHeader ( ) { super . consumeClassHeader ( ) ; if ( isLocalDeclaration ( ) ) { this . intArrayPtr -- ; return ; } TypeDeclaration typeDecl = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; TypeReference [ ] superInterfaces = typeDecl . superInterfaces ; char [ ] [ ] interfaceNames = null ; int [ ] interfaceNameStarts = null ; int [ ] interfaceNameEnds = null ; if ( superInterfaces != null ) { int superInterfacesLength = superInterfaces . length ; interfaceNames = new char [ superInterfacesLength ] [ ] ; interfaceNameStarts = new int [ superInterfacesLength ] ; interfaceNameEnds = new int [ superInterfacesLength ] ; for ( int i = <NUM_LIT:0> ; i < superInterfacesLength ; i ++ ) { TypeReference superInterface = superInterfaces [ i ] ; interfaceNames [ i ] = CharOperation . concatWith ( superInterface . getTypeName ( ) , '<CHAR_LIT:.>' ) ; interfaceNameStarts [ i ] = superInterface . sourceStart ; interfaceNameEnds [ i ] = superInterface . sourceEnd ; } } this . scanner . commentPtr = - <NUM_LIT:1> ; TypeReference superclass = typeDecl . superclass ; if ( superclass == null ) { this . requestor . enterClass ( typeDecl . declarationSourceStart , this . intArrayStack [ this . intArrayPtr -- ] , typeDecl . modifiers , typeDecl . modifiersSourceStart , this . typeStartPosition , typeDecl . name , typeDecl . sourceStart , typeDecl . sourceEnd , null , - <NUM_LIT:1> , - <NUM_LIT:1> , interfaceNames , interfaceNameStarts , interfaceNameEnds , this . scanner . currentPosition - <NUM_LIT:1> ) ; } else { this . requestor . enterClass ( typeDecl . declarationSourceStart , this . intArrayStack [ this . intArrayPtr -- ] , typeDecl . modifiers , typeDecl . modifiersSourceStart , this . typeStartPosition , typeDecl . name , typeDecl . sourceStart , typeDecl . sourceEnd , CharOperation . concatWith ( superclass . getTypeName ( ) , '<CHAR_LIT:.>' ) , superclass . sourceStart , superclass . sourceEnd , interfaceNames , interfaceNameStarts , interfaceNameEnds , this . scanner . currentPosition - <NUM_LIT:1> ) ; } } 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 -- ; this . typeStartPosition = typeDecl . declarationSourceStart = this . intStack [ this . intPtr -- ] ; this . intPtr -- ; int declSourceStart = this . intStack [ this . intPtr -- ] ; typeDecl . modifiersSourceStart = this . intStack [ this . intPtr -- ] ; typeDecl . modifiers = this . intStack [ this . intPtr -- ] ; if ( typeDecl . declarationSourceStart > declSourceStart ) { typeDecl . declarationSourceStart = declSourceStart ; } 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 ) ; typeDecl . javadoc = this . javadoc ; this . javadoc = null ; } protected void consumeCompilationUnit ( ) { this . requestor . exitCompilationUnit ( this . scanner . source . length - <NUM_LIT:1> ) ; } protected void consumeConstructorDeclaration ( ) { super . consumeConstructorDeclaration ( ) ; if ( isLocalDeclaration ( ) ) { return ; } ConstructorDeclaration cd = ( ConstructorDeclaration ) this . astStack [ this . astPtr ] ; this . requestor . exitConstructor ( this . endStatementPosition , cd . declarationSourceEnd ) ; } protected void consumeConstructorHeader ( ) { super . consumeConstructorHeader ( ) ; if ( isLocalDeclaration ( ) ) { this . intArrayPtr -- ; return ; } ConstructorDeclaration cd = ( ConstructorDeclaration ) this . astStack [ this . astPtr ] ; Argument [ ] arguments = cd . arguments ; char [ ] [ ] argumentTypes = null ; char [ ] [ ] argumentNames = null ; int [ ] argumentTypeStarts = null ; int [ ] argumentTypeEnds = null ; int [ ] argumentNameStarts = null ; int [ ] argumentNameEnds = null ; if ( arguments != null ) { int argumentLength = arguments . length ; argumentTypes = new char [ argumentLength ] [ ] ; argumentNames = new char [ argumentLength ] [ ] ; argumentNameStarts = new int [ argumentLength ] ; argumentNameEnds = new int [ argumentLength ] ; argumentTypeStarts = new int [ argumentLength ] ; argumentTypeEnds = new int [ argumentLength ] ; for ( int i = <NUM_LIT:0> ; i < argumentLength ; i ++ ) { Argument argument = arguments [ i ] ; TypeReference argumentType = argument . type ; argumentTypes [ i ] = returnTypeName ( argumentType ) ; argumentNames [ i ] = argument . name ; argumentNameStarts [ i ] = argument . sourceStart ; argumentNameEnds [ i ] = argument . sourceEnd ; argumentTypeStarts [ i ] = argumentType . sourceStart ; argumentTypeEnds [ i ] = argumentType . sourceEnd ; } } TypeReference [ ] thrownExceptions = cd . thrownExceptions ; char [ ] [ ] exceptionTypes = null ; int [ ] exceptionTypeStarts = null ; int [ ] exceptionTypeEnds = null ; if ( thrownExceptions != null ) { int thrownExceptionLength = thrownExceptions . length ; exceptionTypes = new char [ thrownExceptionLength ] [ ] ; exceptionTypeStarts = new int [ thrownExceptionLength ] ; exceptionTypeEnds = new int [ thrownExceptionLength ] ; for ( int i = <NUM_LIT:0> ; i < thrownExceptionLength ; i ++ ) { TypeReference exception = thrownExceptions [ i ] ; exceptionTypes [ i ] = CharOperation . concatWith ( exception . getTypeName ( ) , '<CHAR_LIT:.>' ) ; exceptionTypeStarts [ i ] = exception . sourceStart ; exceptionTypeEnds [ i ] = exception . sourceEnd ; } } this . requestor . enterConstructor ( cd . declarationSourceStart , this . intArrayStack [ this . intArrayPtr -- ] , cd . modifiers , cd . modifiersSourceStart , cd . selector , cd . sourceStart , ( int ) ( this . selectorSourcePositions & <NUM_LIT> ) , argumentTypes , argumentTypeStarts , argumentTypeEnds , argumentNames , argumentNameStarts , argumentNameEnds , this . rParenPos , exceptionTypes , exceptionTypeStarts , exceptionTypeEnds , this . scanner . currentPosition - <NUM_LIT:1> ) ; } protected void consumeConstructorHeaderName ( ) { ConstructorDeclaration cd = new ConstructorDeclaration ( this . compilationUnit . compilationResult ) ; cd . selector = this . identifierStack [ this . identifierPtr ] ; this . selectorSourcePositions = this . identifierPositionStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; cd . declarationSourceStart = this . intStack [ this . intPtr -- ] ; cd . modifiersSourceStart = 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 ) ( this . selectorSourcePositions > > > <NUM_LIT:32> ) ; pushOnAstStack ( cd ) ; cd . sourceEnd = this . lParenPos ; cd . bodyStart = this . lParenPos + <NUM_LIT:1> ; } protected void consumeDefaultModifiers ( ) { checkComment ( ) ; pushOnIntStack ( this . modifiers ) ; pushOnIntStack ( - <NUM_LIT:1> ) ; pushOnIntStack ( this . declarationSourceStart >= <NUM_LIT:0> ? this . declarationSourceStart : this . scanner . startPosition ) ; resetModifiers ( ) ; pushOnExpressionStackLengthStack ( <NUM_LIT:0> ) ; } protected void consumeDiet ( ) { super . consumeDiet ( ) ; pushOnIntArrayStack ( getJavaDocPositions ( ) ) ; } protected void consumeEnterCompilationUnit ( ) { this . requestor . enterCompilationUnit ( ) ; } protected void consumeEnterVariable ( ) { boolean isLocalDeclaration = isLocalDeclaration ( ) ; if ( ! isLocalDeclaration && ( this . variablesCounter [ this . nestedType ] != <NUM_LIT:0> ) ) { this . requestor . exitField ( this . lastFieldBodyEndPosition , this . lastFieldEndPosition ) ; } char [ ] varName = this . identifierStack [ this . identifierPtr ] ; long namePosition = this . identifierPositionStack [ this . identifierPtr -- ] ; int extendedTypeDimension = this . intStack [ this . intPtr -- ] ; AbstractVariableDeclaration declaration ; if ( this . nestedMethod [ this . nestedType ] != <NUM_LIT:0> ) { declaration = new LocalDeclaration ( varName , ( int ) ( namePosition > > > <NUM_LIT:32> ) , ( int ) namePosition ) ; } else { declaration = new FieldDeclaration ( varName , ( int ) ( namePosition > > > <NUM_LIT:32> ) , ( int ) namePosition ) ; } this . identifierLengthPtr -- ; TypeReference type ; int variableIndex = this . variablesCounter [ this . nestedType ] ; int typeDim = <NUM_LIT:0> ; if ( variableIndex == <NUM_LIT:0> ) { if ( this . nestedMethod [ this . nestedType ] != <NUM_LIT:0> ) { declaration . declarationSourceStart = this . intStack [ this . intPtr -- ] ; declaration . modifiersSourceStart = this . intStack [ this . intPtr -- ] ; declaration . modifiers = this . intStack [ this . intPtr -- ] ; type = getTypeReference ( typeDim = this . intStack [ this . intPtr -- ] ) ; pushOnAstStack ( type ) ; } else { type = getTypeReference ( typeDim = this . intStack [ this . intPtr -- ] ) ; pushOnAstStack ( type ) ; declaration . declarationSourceStart = this . intStack [ this . intPtr -- ] ; declaration . modifiersSourceStart = 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 ) ; } } 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 ; declaration . modifiersSourceStart = previousVariable . modifiersSourceStart ; 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 ) ; } } this . localIntPtr = this . intPtr ; if ( extendedTypeDimension == <NUM_LIT:0> ) { declaration . type = type ; } else { int dimension = typeDim + extendedTypeDimension ; declaration . type = copyDims ( type , dimension ) ; } this . variablesCounter [ this . nestedType ] ++ ; this . nestedMethod [ this . nestedType ] ++ ; pushOnAstStack ( declaration ) ; int [ ] javadocPositions = this . intArrayStack [ this . intArrayPtr ] ; if ( ! isLocalDeclaration ) { this . requestor . enterField ( declaration . declarationSourceStart , javadocPositions , declaration . modifiers , declaration . modifiersSourceStart , returnTypeName ( declaration . type ) , type . sourceStart , type . sourceEnd , this . typeDims , varName , ( int ) ( namePosition > > > <NUM_LIT:32> ) , ( int ) namePosition , extendedTypeDimension , extendedTypeDimension == <NUM_LIT:0> ? - <NUM_LIT:1> : this . endPosition ) ; } } protected void consumeExitVariableWithInitialization ( ) { super . consumeExitVariableWithInitialization ( ) ; this . nestedMethod [ this . nestedType ] -- ; this . lastFieldEndPosition = this . scanner . currentPosition - <NUM_LIT:1> ; this . lastFieldBodyEndPosition = ( ( AbstractVariableDeclaration ) this . astStack [ this . astPtr ] ) . initialization . sourceEnd ; } protected void consumeExitVariableWithoutInitialization ( ) { super . consumeExitVariableWithoutInitialization ( ) ; this . nestedMethod [ this . nestedType ] -- ; this . lastFieldEndPosition = this . scanner . currentPosition - <NUM_LIT:1> ; this . lastFieldBodyEndPosition = this . scanner . startPosition - <NUM_LIT:1> ; } protected void consumeFieldDeclaration ( ) { int variableIndex = this . variablesCounter [ this . nestedType ] ; super . consumeFieldDeclaration ( ) ; this . intArrayPtr -- ; if ( isLocalDeclaration ( ) ) return ; if ( variableIndex != <NUM_LIT:0> ) { this . requestor . exitField ( this . lastFieldBodyEndPosition , this . lastFieldEndPosition ) ; } } protected void consumeFormalParameter ( boolean isVarArgs ) { this . identifierLengthPtr -- ; char [ ] parameterName = 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 ; } this . intPtr -= <NUM_LIT:3> ; Argument arg = new Argument ( parameterName , namePositions , type , this . intStack [ this . intPtr + <NUM_LIT:1> ] ) ; 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 . intArrayPtr -- ; } protected void consumeInterfaceDeclaration ( ) { super . consumeInterfaceDeclaration ( ) ; if ( isLocalDeclaration ( ) ) { return ; } this . requestor . exitInterface ( this . endStatementPosition , ( ( TypeDeclaration ) this . astStack [ this . astPtr ] ) . declarationSourceEnd ) ; } protected void consumeInterfaceHeader ( ) { super . consumeInterfaceHeader ( ) ; if ( isLocalDeclaration ( ) ) { this . intArrayPtr -- ; return ; } TypeDeclaration typeDecl = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; TypeReference [ ] superInterfaces = typeDecl . superInterfaces ; char [ ] [ ] interfaceNames = null ; int [ ] interfaceNameStarts = null ; int [ ] interfacenameEnds = null ; int superInterfacesLength = <NUM_LIT:0> ; if ( superInterfaces != null ) { superInterfacesLength = superInterfaces . length ; interfaceNames = new char [ superInterfacesLength ] [ ] ; interfaceNameStarts = new int [ superInterfacesLength ] ; interfacenameEnds = new int [ superInterfacesLength ] ; } if ( superInterfaces != null ) { for ( int i = <NUM_LIT:0> ; i < superInterfacesLength ; i ++ ) { TypeReference superInterface = superInterfaces [ i ] ; interfaceNames [ i ] = CharOperation . concatWith ( superInterface . getTypeName ( ) , '<CHAR_LIT:.>' ) ; interfaceNameStarts [ i ] = superInterface . sourceStart ; interfacenameEnds [ i ] = superInterface . sourceEnd ; } } this . scanner . commentPtr = - <NUM_LIT:1> ; this . requestor . enterInterface ( typeDecl . declarationSourceStart , this . intArrayStack [ this . intArrayPtr -- ] , typeDecl . modifiers , typeDecl . modifiersSourceStart , this . typeStartPosition , typeDecl . name , typeDecl . sourceStart , typeDecl . sourceEnd , interfaceNames , interfaceNameStarts , interfacenameEnds , this . scanner . currentPosition - <NUM_LIT:1> ) ; } 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 -- ; this . typeStartPosition = typeDecl . declarationSourceStart = this . intStack [ this . intPtr -- ] ; this . intPtr -- ; int declSourceStart = this . intStack [ this . intPtr -- ] ; typeDecl . modifiersSourceStart = this . intStack [ this . intPtr -- ] ; typeDecl . modifiers = this . intStack [ this . intPtr -- ] | ClassFileConstants . AccInterface ; if ( typeDecl . declarationSourceStart > declSourceStart ) { typeDecl . declarationSourceStart = declSourceStart ; } 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 ) ; typeDecl . javadoc = this . javadoc ; this . javadoc = null ; } protected void consumeInternalCompilationUnit ( ) { } protected void consumeInternalCompilationUnitWithTypes ( ) { int length ; if ( ( length = this . astLengthStack [ this . astLengthPtr -- ] ) != <NUM_LIT:0> ) { 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 consumeLocalVariableDeclaration ( ) { super . consumeLocalVariableDeclaration ( ) ; this . intArrayPtr -- ; } protected void consumeMethodDeclaration ( boolean isNotAbstract ) { super . consumeMethodDeclaration ( isNotAbstract ) ; if ( isLocalDeclaration ( ) ) { return ; } MethodDeclaration md = ( MethodDeclaration ) this . astStack [ this . astPtr ] ; this . requestor . exitMethod ( this . endStatementPosition , md . declarationSourceEnd ) ; } protected void consumeMethodHeader ( ) { super . consumeMethodHeader ( ) ; if ( isLocalDeclaration ( ) ) { this . intArrayPtr -- ; return ; } MethodDeclaration md = ( MethodDeclaration ) this . astStack [ this . astPtr ] ; TypeReference returnType = md . returnType ; char [ ] returnTypeName = returnTypeName ( returnType ) ; Argument [ ] arguments = md . arguments ; char [ ] [ ] argumentTypes = null ; char [ ] [ ] argumentNames = null ; int [ ] argumentTypeStarts = null ; int [ ] argumentTypeEnds = null ; int [ ] argumentNameStarts = null ; int [ ] argumentNameEnds = null ; if ( arguments != null ) { int argumentLength = arguments . length ; argumentTypes = new char [ argumentLength ] [ ] ; argumentNames = new char [ argumentLength ] [ ] ; argumentNameStarts = new int [ argumentLength ] ; argumentNameEnds = new int [ argumentLength ] ; argumentTypeStarts = new int [ argumentLength ] ; argumentTypeEnds = new int [ argumentLength ] ; for ( int i = <NUM_LIT:0> ; i < argumentLength ; i ++ ) { Argument argument = arguments [ i ] ; TypeReference argumentType = argument . type ; argumentTypes [ i ] = returnTypeName ( argumentType ) ; argumentNames [ i ] = argument . name ; argumentNameStarts [ i ] = argument . sourceStart ; argumentNameEnds [ i ] = argument . sourceEnd ; argumentTypeStarts [ i ] = argumentType . sourceStart ; argumentTypeEnds [ i ] = argumentType . sourceEnd ; } } TypeReference [ ] thrownExceptions = md . thrownExceptions ; char [ ] [ ] exceptionTypes = null ; int [ ] exceptionTypeStarts = null ; int [ ] exceptionTypeEnds = null ; if ( thrownExceptions != null ) { int thrownExceptionLength = thrownExceptions . length ; exceptionTypeStarts = new int [ thrownExceptionLength ] ; exceptionTypeEnds = new int [ thrownExceptionLength ] ; exceptionTypes = new char [ thrownExceptionLength ] [ ] ; for ( int i = <NUM_LIT:0> ; i < thrownExceptionLength ; i ++ ) { TypeReference exception = thrownExceptions [ i ] ; exceptionTypes [ i ] = CharOperation . concatWith ( exception . getTypeName ( ) , '<CHAR_LIT:.>' ) ; exceptionTypeStarts [ i ] = exception . sourceStart ; exceptionTypeEnds [ i ] = exception . sourceEnd ; } } this . requestor . enterMethod ( md . declarationSourceStart , this . intArrayStack [ this . intArrayPtr -- ] , md . modifiers , md . modifiersSourceStart , returnTypeName , returnType . sourceStart , returnType . sourceEnd , this . typeDims , md . selector , md . sourceStart , ( int ) ( this . selectorSourcePositions & <NUM_LIT> ) , argumentTypes , argumentTypeStarts , argumentTypeEnds , argumentNames , argumentNameStarts , argumentNameEnds , this . rParenPos , this . extendsDim , this . extendsDim == <NUM_LIT:0> ? - <NUM_LIT:1> : this . endPosition , exceptionTypes , exceptionTypeStarts , exceptionTypeEnds , this . scanner . currentPosition - <NUM_LIT:1> ) ; } protected void consumeMethodHeaderExtendedDims ( ) { MethodDeclaration md = ( MethodDeclaration ) this . astStack [ this . astPtr ] ; int extendedDims = this . intStack [ this . intPtr -- ] ; this . extendsDim = 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> ; } } } protected void consumeMethodHeaderName ( boolean isAnnotationMethod ) { MethodDeclaration md = null ; if ( isAnnotationMethod ) { md = new AnnotationMethodDeclaration ( this . compilationUnit . compilationResult ) ; } else { md = new MethodDeclaration ( this . compilationUnit . compilationResult ) ; } md . selector = this . identifierStack [ this . identifierPtr ] ; this . selectorSourcePositions = this . identifierPositionStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; md . returnType = getTypeReference ( this . typeDims = this . intStack [ this . intPtr -- ] ) ; md . declarationSourceStart = this . intStack [ this . intPtr -- ] ; md . modifiersSourceStart = 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 ) ( this . selectorSourcePositions > > > <NUM_LIT:32> ) ; pushOnAstStack ( md ) ; md . bodyStart = this . scanner . currentPosition - <NUM_LIT:1> ; } protected void consumeModifiers ( ) { checkComment ( ) ; pushOnIntStack ( this . modifiers ) ; pushOnIntStack ( this . modifiersSourceStart ) ; pushOnIntStack ( this . declarationSourceStart >= <NUM_LIT:0> ? this . declarationSourceStart : this . modifiersSourceStart ) ; resetModifiers ( ) ; } protected void consumePackageComment ( ) { if ( this . options . sourceLevel >= ClassFileConstants . JDK1_5 ) { checkComment ( ) ; } else { pushOnIntArrayStack ( getJavaDocPositions ( ) ) ; } resetModifiers ( ) ; } protected void consumePackageDeclarationName ( ) { super . consumePackageDeclarationName ( ) ; ImportReference importReference = this . compilationUnit . currentPackage ; this . requestor . acceptPackage ( importReference . declarationSourceStart , importReference . declarationSourceEnd , this . intArrayStack [ this . intArrayPtr -- ] , CharOperation . concatWith ( importReference . getImportName ( ) , '<CHAR_LIT:.>' ) , importReference . sourceStart ) ; } protected void consumePackageDeclarationNameWithModifiers ( ) { super . consumePackageDeclarationNameWithModifiers ( ) ; ImportReference importReference = this . compilationUnit . currentPackage ; this . requestor . acceptPackage ( importReference . declarationSourceStart , importReference . declarationSourceEnd , this . intArrayStack [ this . intArrayPtr -- ] , CharOperation . concatWith ( importReference . getImportName ( ) , '<CHAR_LIT:.>' ) , importReference . sourceStart ) ; } protected void consumePushModifiers ( ) { checkComment ( ) ; pushOnIntStack ( this . modifiers ) ; if ( this . modifiersSourceStart < <NUM_LIT:0> ) { pushOnIntStack ( - <NUM_LIT:1> ) ; pushOnIntStack ( this . declarationSourceStart >= <NUM_LIT:0> ? this . declarationSourceStart : this . scanner . startPosition ) ; } else { pushOnIntStack ( this . modifiersSourceStart ) ; pushOnIntStack ( this . declarationSourceStart >= <NUM_LIT:0> ? this . declarationSourceStart : this . modifiersSourceStart ) ; } resetModifiers ( ) ; pushOnExpressionStackLengthStack ( <NUM_LIT:0> ) ; } protected void consumePushRealModifiers ( ) { checkComment ( ) ; pushOnIntStack ( this . modifiers ) ; if ( this . modifiersSourceStart < <NUM_LIT:0> ) { pushOnIntStack ( - <NUM_LIT:1> ) ; pushOnIntStack ( this . declarationSourceStart >= <NUM_LIT:0> ? this . declarationSourceStart : this . scanner . startPosition ) ; } else { pushOnIntStack ( this . modifiersSourceStart ) ; pushOnIntStack ( this . declarationSourceStart >= <NUM_LIT:0> ? this . declarationSourceStart : this . modifiersSourceStart ) ; } resetModifiers ( ) ; } protected void consumeSingleStaticImportDeclarationName ( ) { pushOnIntArrayStack ( getJavaDocPositions ( ) ) ; super . consumeSingleStaticImportDeclarationName ( ) ; ImportReference importReference = ( ImportReference ) this . astStack [ this . astPtr ] ; this . requestor . acceptImport ( importReference . declarationSourceStart , importReference . declarationSourceEnd , this . intArrayStack [ this . intArrayPtr -- ] , CharOperation . concatWith ( importReference . getImportName ( ) , '<CHAR_LIT:.>' ) , importReference . sourceStart , false , ClassFileConstants . AccStatic ) ; } protected void consumeSingleTypeImportDeclarationName ( ) { pushOnIntArrayStack ( getJavaDocPositions ( ) ) ; super . consumeSingleTypeImportDeclarationName ( ) ; ImportReference importReference = ( ImportReference ) this . astStack [ this . astPtr ] ; this . requestor . acceptImport ( importReference . declarationSourceStart , importReference . declarationSourceEnd , this . intArrayStack [ this . intArrayPtr -- ] , CharOperation . concatWith ( importReference . getImportName ( ) , '<CHAR_LIT:.>' ) , importReference . sourceStart , false , ClassFileConstants . AccDefault ) ; } protected void consumeStaticImportOnDemandDeclarationName ( ) { pushOnIntArrayStack ( getJavaDocPositions ( ) ) ; super . consumeStaticImportOnDemandDeclarationName ( ) ; ImportReference importReference = ( ImportReference ) this . astStack [ this . astPtr ] ; this . requestor . acceptImport ( importReference . declarationSourceStart , importReference . declarationSourceEnd , this . intArrayStack [ this . intArrayPtr -- ] , CharOperation . concatWith ( importReference . getImportName ( ) , '<CHAR_LIT:.>' ) , importReference . sourceStart , true , ClassFileConstants . AccStatic ) ; } protected void consumeStaticInitializer ( ) { super . consumeStaticInitializer ( ) ; Initializer initializer = ( Initializer ) this . astStack [ this . astPtr ] ; this . requestor . acceptInitializer ( initializer . declarationSourceStart , initializer . declarationSourceEnd , this . intArrayStack [ this . intArrayPtr -- ] , ClassFileConstants . AccStatic , this . intStack [ this . intPtr -- ] , initializer . block . sourceStart , initializer . declarationSourceEnd ) ; } protected void consumeStaticOnly ( ) { checkComment ( ) ; pushOnIntStack ( this . modifiersSourceStart ) ; pushOnIntStack ( this . scanner . currentPosition ) ; pushOnIntStack ( this . declarationSourceStart >= <NUM_LIT:0> ? this . declarationSourceStart : this . modifiersSourceStart ) ; jumpOverMethodBody ( ) ; this . nestedMethod [ this . nestedType ] ++ ; resetModifiers ( ) ; } protected void consumeTypeImportOnDemandDeclarationName ( ) { pushOnIntArrayStack ( getJavaDocPositions ( ) ) ; super . consumeTypeImportOnDemandDeclarationName ( ) ; ImportReference importReference = ( ImportReference ) this . astStack [ this . astPtr ] ; this . requestor . acceptImport ( importReference . declarationSourceStart , importReference . declarationSourceEnd , this . intArrayStack [ this . intArrayPtr -- ] , CharOperation . concatWith ( importReference . getImportName ( ) , '<CHAR_LIT:.>' ) , importReference . sourceStart , true , ClassFileConstants . AccDefault ) ; } public int flushCommentsDefinedPriorTo ( int position ) { return this . lastFieldEndPosition = super . flushCommentsDefinedPriorTo ( position ) ; } public CompilationUnitDeclaration endParse ( int act ) { if ( this . scanner . recordLineSeparator ) { this . requestor . acceptLineSeparatorPositions ( this . scanner . getLineEnds ( ) ) ; } return super . endParse ( act ) ; } public void initialize ( boolean initializeNLS ) { super . initialize ( initializeNLS ) ; this . intArrayPtr = - <NUM_LIT:1> ; } public void initialize ( ) { super . initialize ( ) ; this . intArrayPtr = - <NUM_LIT:1> ; } private boolean isLocalDeclaration ( ) { int nestedDepth = this . nestedType ; while ( nestedDepth >= <NUM_LIT:0> ) { if ( this . nestedMethod [ nestedDepth ] != <NUM_LIT:0> ) { return true ; } nestedDepth -- ; } return false ; } protected void parse ( ) { this . diet = true ; super . parse ( ) ; } public void parseCompilationUnit ( ICompilationUnit unit ) { char [ ] regionSource = unit . getContents ( ) ; try { initialize ( true ) ; goForCompilationUnit ( ) ; this . referenceContext = this . compilationUnit = new CompilationUnitDeclaration ( problemReporter ( ) , new CompilationResult ( unit , <NUM_LIT:0> , <NUM_LIT:0> , this . options . maxProblemsPerUnit ) , regionSource . length ) ; this . scanner . resetTo ( <NUM_LIT:0> , regionSource . length ) ; this . scanner . setSource ( regionSource ) ; parse ( ) ; } catch ( AbortCompilation ex ) { } } public void parseConstructor ( char [ ] regionSource ) { try { initialize ( ) ; goForClassBodyDeclarations ( ) ; this . referenceContext = this . compilationUnit = new CompilationUnitDeclaration ( problemReporter ( ) , new CompilationResult ( regionSource , <NUM_LIT:0> , <NUM_LIT:0> , this . options . maxProblemsPerUnit ) , regionSource . length ) ; this . scanner . resetTo ( <NUM_LIT:0> , regionSource . length ) ; this . scanner . setSource ( regionSource ) ; parse ( ) ; } catch ( AbortCompilation ex ) { } } public void parseField ( char [ ] regionSource ) { try { initialize ( ) ; goForFieldDeclaration ( ) ; this . referenceContext = this . compilationUnit = new CompilationUnitDeclaration ( problemReporter ( ) , new CompilationResult ( regionSource , <NUM_LIT:0> , <NUM_LIT:0> , this . options . maxProblemsPerUnit ) , regionSource . length ) ; this . scanner . resetTo ( <NUM_LIT:0> , regionSource . length ) ; this . scanner . setSource ( regionSource ) ; parse ( ) ; } catch ( AbortCompilation ex ) { } } public void parseImport ( char [ ] regionSource ) { try { initialize ( ) ; goForImportDeclaration ( ) ; this . referenceContext = this . compilationUnit = new CompilationUnitDeclaration ( problemReporter ( ) , new CompilationResult ( regionSource , <NUM_LIT:0> , <NUM_LIT:0> , this . options . maxProblemsPerUnit ) , regionSource . length ) ; this . scanner . resetTo ( <NUM_LIT:0> , regionSource . length ) ; this . scanner . setSource ( regionSource ) ; parse ( ) ; } catch ( AbortCompilation ex ) { } } public void parseInitializer ( char [ ] regionSource ) { try { initialize ( ) ; goForInitializer ( ) ; this . referenceContext = this . compilationUnit = new CompilationUnitDeclaration ( problemReporter ( ) , new CompilationResult ( regionSource , <NUM_LIT:0> , <NUM_LIT:0> , this . options . maxProblemsPerUnit ) , regionSource . length ) ; this . scanner . resetTo ( <NUM_LIT:0> , regionSource . length ) ; this . scanner . setSource ( regionSource ) ; parse ( ) ; } catch ( AbortCompilation ex ) { } } public void parseMethod ( char [ ] regionSource ) { try { initialize ( ) ; goForGenericMethodDeclaration ( ) ; this . referenceContext = this . compilationUnit = new CompilationUnitDeclaration ( problemReporter ( ) , new CompilationResult ( regionSource , <NUM_LIT:0> , <NUM_LIT:0> , this . options . maxProblemsPerUnit ) , regionSource . length ) ; this . scanner . resetTo ( <NUM_LIT:0> , regionSource . length ) ; this . scanner . setSource ( regionSource ) ; parse ( ) ; } catch ( AbortCompilation ex ) { } } public void parsePackage ( char [ ] regionSource ) { try { initialize ( ) ; goForPackageDeclaration ( ) ; this . referenceContext = this . compilationUnit = new CompilationUnitDeclaration ( problemReporter ( ) , new CompilationResult ( regionSource , <NUM_LIT:0> , <NUM_LIT:0> , this . options . maxProblemsPerUnit ) , regionSource . length ) ; this . scanner . resetTo ( <NUM_LIT:0> , regionSource . length ) ; this . scanner . setSource ( regionSource ) ; parse ( ) ; } catch ( AbortCompilation ex ) { } } public void parseType ( char [ ] regionSource ) { try { initialize ( ) ; goForTypeDeclaration ( ) ; this . referenceContext = this . compilationUnit = new CompilationUnitDeclaration ( problemReporter ( ) , new CompilationResult ( regionSource , <NUM_LIT:0> , <NUM_LIT:0> , this . options . maxProblemsPerUnit ) , regionSource . length ) ; this . scanner . resetTo ( <NUM_LIT:0> , regionSource . length ) ; this . scanner . setSource ( regionSource ) ; parse ( ) ; } catch ( AbortCompilation ex ) { } } public ProblemReporter problemReporter ( ) { this . problemReporter . referenceContext = this . referenceContext ; return this . problemReporter ; } protected void pushOnIntArrayStack ( int [ ] positions ) { int stackLength = this . intArrayStack . length ; if ( ++ this . intArrayPtr >= stackLength ) { System . arraycopy ( this . intArrayStack , <NUM_LIT:0> , this . intArrayStack = new int [ stackLength + StackIncrement ] [ ] , <NUM_LIT:0> , stackLength ) ; } this . intArrayStack [ this . intArrayPtr ] = positions ; } protected void resetModifiers ( ) { super . resetModifiers ( ) ; this . declarationSourceStart = - <NUM_LIT:1> ; } protected boolean resumeOnSyntaxError ( ) { return false ; } private char [ ] returnTypeName ( TypeReference type ) { int dimension = type . dimensions ( ) ; if ( dimension != <NUM_LIT:0> ) { char [ ] dimensionsArray = new char [ dimension * <NUM_LIT:2> ] ; for ( int i = <NUM_LIT:0> ; i < dimension ; i ++ ) { dimensionsArray [ i * <NUM_LIT:2> ] = '<CHAR_LIT:[>' ; dimensionsArray [ ( i * <NUM_LIT:2> ) + <NUM_LIT:1> ] = '<CHAR_LIT:]>' ; } return CharOperation . concat ( CharOperation . concatWith ( type . getTypeName ( ) , '<CHAR_LIT:.>' ) , dimensionsArray ) ; } return CharOperation . concatWith ( type . getTypeName ( ) , '<CHAR_LIT:.>' ) ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( "<STR_LIT>" + this . intArrayPtr + "<STR_LIT:n>" ) ; buffer . append ( super . toString ( ) ) ; return buffer . toString ( ) ; } protected TypeReference typeReference ( int dim , int localIdentifierPtr , int localIdentifierLengthPtr ) { int length ; TypeReference ref ; if ( ( length = this . identifierLengthStack [ localIdentifierLengthPtr ] ) == <NUM_LIT:1> ) { if ( dim == <NUM_LIT:0> ) { ref = new SingleTypeReference ( this . identifierStack [ localIdentifierPtr ] , this . identifierPositionStack [ localIdentifierPtr -- ] ) ; } else { ref = new ArrayTypeReference ( this . identifierStack [ localIdentifierPtr ] , dim , this . identifierPositionStack [ localIdentifierPtr -- ] ) ; ref . sourceEnd = this . endPosition ; } } else { if ( length < <NUM_LIT:0> ) { ref = TypeReference . baseTypeReference ( - length , dim ) ; ref . sourceStart = this . intStack [ this . localIntPtr -- ] ; if ( dim == <NUM_LIT:0> ) { ref . sourceEnd = this . intStack [ this . localIntPtr -- ] ; } else { this . localIntPtr -- ; ref . sourceEnd = this . endPosition ; } } else { char [ ] [ ] tokens = new char [ length ] [ ] ; localIdentifierPtr -= length ; long [ ] positions = new long [ length ] ; System . arraycopy ( this . identifierStack , localIdentifierPtr + <NUM_LIT:1> , tokens , <NUM_LIT:0> , length ) ; System . arraycopy ( this . identifierPositionStack , localIdentifierPtr + <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 ) ; } } return ref ; } } </s>
<s> package org . eclipse . jdt . internal . compiler ; import org . eclipse . jdt . core . compiler . CategorizedProblem ; import org . eclipse . jdt . internal . compiler . ast . Expression ; import org . eclipse . jdt . internal . compiler . ast . ImportReference ; public class SourceElementRequestorAdapter implements ISourceElementRequestor { public void acceptAnnotationTypeReference ( char [ ] [ ] typeName , int sourceStart , int sourceEnd ) { } public void acceptAnnotationTypeReference ( char [ ] typeName , int sourcePosition ) { } public void acceptConstructorReference ( char [ ] typeName , int argCount , int sourcePosition ) { } public void acceptFieldReference ( char [ ] fieldName , int sourcePosition ) { } public void acceptImport ( int declarationStart , int declarationEnd , char [ ] [ ] tokens , boolean onDemand , int modifiers ) { } public void acceptLineSeparatorPositions ( int [ ] positions ) { } public void acceptMethodReference ( char [ ] methodName , int argCount , int sourcePosition ) { } public void acceptPackage ( ImportReference importReference ) { } public void acceptProblem ( CategorizedProblem problem ) { } public void acceptTypeReference ( char [ ] [ ] typeName , int sourceStart , int sourceEnd ) { } public void acceptTypeReference ( char [ ] typeName , int sourcePosition ) { } public void acceptUnknownReference ( char [ ] [ ] name , int sourceStart , int sourceEnd ) { } public void acceptUnknownReference ( char [ ] name , int sourcePosition ) { } public void enterCompilationUnit ( ) { } public void enterConstructor ( MethodInfo methodInfo ) { } public void enterField ( FieldInfo fieldInfo ) { } public void enterInitializer ( int declarationStart , int modifiers ) { } public void enterMethod ( MethodInfo methodInfo ) { } public void enterType ( TypeInfo typeInfo ) { } public void exitCompilationUnit ( int declarationEnd ) { } public void exitConstructor ( int declarationEnd ) { } public void exitField ( int initializationStart , int declarationEnd , int declarationSourceEnd ) { } public void exitInitializer ( int declarationEnd ) { } public void exitMethod ( int declarationEnd , Expression defaultValue ) { } public void exitType ( int declarationEnd ) { } } </s>
<s> package org . eclipse . jdt . internal . compiler . parser ; import java . util . ArrayList ; import org . eclipse . jdt . core . Signature ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . ArrayQualifiedTypeReference ; import org . eclipse . jdt . internal . compiler . ast . ArrayTypeReference ; import org . eclipse . jdt . internal . compiler . ast . ImportReference ; import org . eclipse . jdt . internal . compiler . ast . ParameterizedQualifiedTypeReference ; import org . eclipse . jdt . internal . compiler . ast . ParameterizedSingleTypeReference ; import org . eclipse . jdt . internal . compiler . ast . QualifiedTypeReference ; import org . eclipse . jdt . internal . compiler . ast . SingleTypeReference ; import org . eclipse . jdt . internal . compiler . ast . TypeParameter ; import org . eclipse . jdt . internal . compiler . ast . TypeReference ; import org . eclipse . jdt . internal . compiler . ast . Wildcard ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . TypeConstants ; import org . eclipse . jdt . internal . compiler . problem . ProblemReporter ; public abstract class TypeConverter { int namePos ; protected ProblemReporter problemReporter ; protected boolean has1_5Compliance ; private char memberTypeSeparator ; protected TypeConverter ( ProblemReporter problemReporter , char memberTypeSeparator ) { this . problemReporter = problemReporter ; this . has1_5Compliance = problemReporter . options . complianceLevel >= ClassFileConstants . JDK1_5 ; this . memberTypeSeparator = memberTypeSeparator ; } private void addIdentifiers ( String typeSignature , int start , int endExclusive , int identCount , ArrayList fragments ) { if ( identCount == <NUM_LIT:1> ) { char [ ] identifier ; typeSignature . getChars ( start , endExclusive , identifier = new char [ endExclusive - start ] , <NUM_LIT:0> ) ; fragments . add ( identifier ) ; } else fragments . add ( extractIdentifiers ( typeSignature , start , endExclusive - <NUM_LIT:1> , identCount ) ) ; } protected ImportReference createImportReference ( String [ ] importName , int start , int end , boolean onDemand , int modifiers ) { int length = importName . length ; long [ ] positions = new long [ length ] ; long position = ( ( long ) start << <NUM_LIT:32> ) + end ; char [ ] [ ] qImportName = new char [ length ] [ ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { qImportName [ i ] = importName [ i ] . toCharArray ( ) ; positions [ i ] = position ; } return new ImportReference ( qImportName , positions , onDemand , modifiers ) ; } protected TypeParameter createTypeParameter ( char [ ] typeParameterName , char [ ] [ ] typeParameterBounds , int start , int end ) { TypeParameter parameter = new TypeParameter ( ) ; parameter . name = typeParameterName ; parameter . sourceStart = start ; parameter . sourceEnd = end ; if ( typeParameterBounds != null ) { int length = typeParameterBounds . length ; if ( length > <NUM_LIT:0> ) { parameter . type = createTypeReference ( typeParameterBounds [ <NUM_LIT:0> ] , start , end ) ; if ( length > <NUM_LIT:1> ) { parameter . bounds = new TypeReference [ length - <NUM_LIT:1> ] ; for ( int i = <NUM_LIT:1> ; i < length ; i ++ ) { TypeReference bound = createTypeReference ( typeParameterBounds [ i ] , start , end ) ; bound . bits |= ASTNode . IsSuperType ; parameter . bounds [ i - <NUM_LIT:1> ] = bound ; } } } } return parameter ; } protected TypeReference createTypeReference ( char [ ] typeName , int start , int end ) { int length = typeName . length ; this . namePos = <NUM_LIT:0> ; return decodeType ( typeName , length , start , end ) ; } protected TypeReference createTypeReference ( String typeSignature , int start , int end ) { int length = typeSignature . length ( ) ; this . namePos = <NUM_LIT:0> ; return decodeType ( typeSignature , length , start , end ) ; } private TypeReference decodeType ( String typeSignature , int length , int start , int end ) { int identCount = <NUM_LIT:1> ; int dim = <NUM_LIT:0> ; int nameFragmentStart = this . namePos , nameFragmentEnd = - <NUM_LIT:1> ; boolean nameStarted = false ; ArrayList fragments = null ; typeLoop : while ( this . namePos < length ) { char currentChar = typeSignature . charAt ( this . namePos ) ; switch ( currentChar ) { case Signature . C_BOOLEAN : if ( ! nameStarted ) { this . namePos ++ ; if ( dim == <NUM_LIT:0> ) return new SingleTypeReference ( TypeBinding . BOOLEAN . simpleName , ( ( long ) start << <NUM_LIT:32> ) + end ) ; else return new ArrayTypeReference ( TypeBinding . BOOLEAN . simpleName , dim , ( ( long ) start << <NUM_LIT:32> ) + end ) ; } break ; case Signature . C_BYTE : if ( ! nameStarted ) { this . namePos ++ ; if ( dim == <NUM_LIT:0> ) return new SingleTypeReference ( TypeBinding . BYTE . simpleName , ( ( long ) start << <NUM_LIT:32> ) + end ) ; else return new ArrayTypeReference ( TypeBinding . BYTE . simpleName , dim , ( ( long ) start << <NUM_LIT:32> ) + end ) ; } break ; case Signature . C_CHAR : if ( ! nameStarted ) { this . namePos ++ ; if ( dim == <NUM_LIT:0> ) return new SingleTypeReference ( TypeBinding . CHAR . simpleName , ( ( long ) start << <NUM_LIT:32> ) + end ) ; else return new ArrayTypeReference ( TypeBinding . CHAR . simpleName , dim , ( ( long ) start << <NUM_LIT:32> ) + end ) ; } break ; case Signature . C_DOUBLE : if ( ! nameStarted ) { this . namePos ++ ; if ( dim == <NUM_LIT:0> ) return new SingleTypeReference ( TypeBinding . DOUBLE . simpleName , ( ( long ) start << <NUM_LIT:32> ) + end ) ; else return new ArrayTypeReference ( TypeBinding . DOUBLE . simpleName , dim , ( ( long ) start << <NUM_LIT:32> ) + end ) ; } break ; case Signature . C_FLOAT : if ( ! nameStarted ) { this . namePos ++ ; if ( dim == <NUM_LIT:0> ) return new SingleTypeReference ( TypeBinding . FLOAT . simpleName , ( ( long ) start << <NUM_LIT:32> ) + end ) ; else return new ArrayTypeReference ( TypeBinding . FLOAT . simpleName , dim , ( ( long ) start << <NUM_LIT:32> ) + end ) ; } break ; case Signature . C_INT : if ( ! nameStarted ) { this . namePos ++ ; if ( dim == <NUM_LIT:0> ) return new SingleTypeReference ( TypeBinding . INT . simpleName , ( ( long ) start << <NUM_LIT:32> ) + end ) ; else return new ArrayTypeReference ( TypeBinding . INT . simpleName , dim , ( ( long ) start << <NUM_LIT:32> ) + end ) ; } break ; case Signature . C_LONG : if ( ! nameStarted ) { this . namePos ++ ; if ( dim == <NUM_LIT:0> ) return new SingleTypeReference ( TypeBinding . LONG . simpleName , ( ( long ) start << <NUM_LIT:32> ) + end ) ; else return new ArrayTypeReference ( TypeBinding . LONG . simpleName , dim , ( ( long ) start << <NUM_LIT:32> ) + end ) ; } break ; case Signature . C_SHORT : if ( ! nameStarted ) { this . namePos ++ ; if ( dim == <NUM_LIT:0> ) return new SingleTypeReference ( TypeBinding . SHORT . simpleName , ( ( long ) start << <NUM_LIT:32> ) + end ) ; else return new ArrayTypeReference ( TypeBinding . SHORT . simpleName , dim , ( ( long ) start << <NUM_LIT:32> ) + end ) ; } break ; case Signature . C_VOID : if ( ! nameStarted ) { this . namePos ++ ; return new SingleTypeReference ( TypeBinding . VOID . simpleName , ( ( long ) start << <NUM_LIT:32> ) + end ) ; } break ; case Signature . C_RESOLVED : case Signature . C_UNRESOLVED : case Signature . C_TYPE_VARIABLE : if ( ! nameStarted ) { nameFragmentStart = this . namePos + <NUM_LIT:1> ; nameStarted = true ; } break ; case Signature . C_STAR : this . namePos ++ ; Wildcard result = new Wildcard ( Wildcard . UNBOUND ) ; result . sourceStart = start ; result . sourceEnd = end ; return result ; case Signature . C_EXTENDS : this . namePos ++ ; result = new Wildcard ( Wildcard . EXTENDS ) ; result . bound = decodeType ( typeSignature , length , start , end ) ; result . sourceStart = start ; result . sourceEnd = end ; return result ; case Signature . C_SUPER : this . namePos ++ ; result = new Wildcard ( Wildcard . SUPER ) ; result . bound = decodeType ( typeSignature , length , start , end ) ; result . sourceStart = start ; result . sourceEnd = end ; return result ; case Signature . C_ARRAY : dim ++ ; break ; case Signature . C_GENERIC_END : case Signature . C_SEMICOLON : nameFragmentEnd = this . namePos - <NUM_LIT:1> ; this . namePos ++ ; break typeLoop ; case Signature . C_DOLLAR : if ( this . memberTypeSeparator != Signature . C_DOLLAR ) break ; case Signature . C_DOT : if ( ! nameStarted ) { nameFragmentStart = this . namePos + <NUM_LIT:1> ; nameStarted = true ; } else if ( this . namePos > nameFragmentStart ) identCount ++ ; break ; case Signature . C_GENERIC_START : nameFragmentEnd = this . namePos - <NUM_LIT:1> ; if ( ! this . has1_5Compliance ) break typeLoop ; if ( fragments == null ) fragments = new ArrayList ( <NUM_LIT:2> ) ; addIdentifiers ( typeSignature , nameFragmentStart , nameFragmentEnd + <NUM_LIT:1> , identCount , fragments ) ; this . namePos ++ ; TypeReference [ ] arguments = decodeTypeArguments ( typeSignature , length , start , end ) ; fragments . add ( arguments ) ; identCount = <NUM_LIT:1> ; nameStarted = false ; break ; } this . namePos ++ ; } if ( fragments == null ) { if ( identCount == <NUM_LIT:1> ) { if ( dim == <NUM_LIT:0> ) { char [ ] nameFragment = new char [ nameFragmentEnd - nameFragmentStart + <NUM_LIT:1> ] ; typeSignature . getChars ( nameFragmentStart , nameFragmentEnd + <NUM_LIT:1> , nameFragment , <NUM_LIT:0> ) ; return new SingleTypeReference ( nameFragment , ( ( long ) start << <NUM_LIT:32> ) + end ) ; } else { char [ ] nameFragment = new char [ nameFragmentEnd - nameFragmentStart + <NUM_LIT:1> ] ; typeSignature . getChars ( nameFragmentStart , nameFragmentEnd + <NUM_LIT:1> , nameFragment , <NUM_LIT:0> ) ; return new ArrayTypeReference ( nameFragment , dim , ( ( long ) start << <NUM_LIT:32> ) + end ) ; } } else { long [ ] positions = new long [ identCount ] ; long pos = ( ( long ) start << <NUM_LIT:32> ) + end ; for ( int i = <NUM_LIT:0> ; i < identCount ; i ++ ) { positions [ i ] = pos ; } char [ ] [ ] identifiers = extractIdentifiers ( typeSignature , nameFragmentStart , nameFragmentEnd , identCount ) ; if ( dim == <NUM_LIT:0> ) { return new QualifiedTypeReference ( identifiers , positions ) ; } else { return new ArrayQualifiedTypeReference ( identifiers , dim , positions ) ; } } } else { if ( nameStarted ) { addIdentifiers ( typeSignature , nameFragmentStart , nameFragmentEnd + <NUM_LIT:1> , identCount , fragments ) ; } int fragmentLength = fragments . size ( ) ; if ( fragmentLength == <NUM_LIT:2> ) { Object firstFragment = fragments . get ( <NUM_LIT:0> ) ; if ( firstFragment instanceof char [ ] ) { return new ParameterizedSingleTypeReference ( ( char [ ] ) firstFragment , ( TypeReference [ ] ) fragments . get ( <NUM_LIT:1> ) , dim , ( ( long ) start << <NUM_LIT:32> ) + end ) ; } } identCount = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < fragmentLength ; i ++ ) { Object element = fragments . get ( i ) ; if ( element instanceof char [ ] [ ] ) { identCount += ( ( char [ ] [ ] ) element ) . length ; } else if ( element instanceof char [ ] ) identCount ++ ; } char [ ] [ ] tokens = new char [ identCount ] [ ] ; TypeReference [ ] [ ] arguments = new TypeReference [ identCount ] [ ] ; int index = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < fragmentLength ; i ++ ) { Object element = fragments . get ( i ) ; if ( element instanceof char [ ] [ ] ) { char [ ] [ ] fragmentTokens = ( char [ ] [ ] ) element ; int fragmentTokenLength = fragmentTokens . length ; System . arraycopy ( fragmentTokens , <NUM_LIT:0> , tokens , index , fragmentTokenLength ) ; index += fragmentTokenLength ; } else if ( element instanceof char [ ] ) { tokens [ index ++ ] = ( char [ ] ) element ; } else { arguments [ index - <NUM_LIT:1> ] = ( TypeReference [ ] ) element ; } } long [ ] positions = new long [ identCount ] ; long pos = ( ( long ) start << <NUM_LIT:32> ) + end ; for ( int i = <NUM_LIT:0> ; i < identCount ; i ++ ) { positions [ i ] = pos ; } return new ParameterizedQualifiedTypeReference ( tokens , arguments , dim , positions ) ; } } private TypeReference decodeType ( char [ ] typeName , int length , int start , int end ) { int identCount = <NUM_LIT:1> ; int dim = <NUM_LIT:0> ; int nameFragmentStart = this . namePos , nameFragmentEnd = - <NUM_LIT:1> ; ArrayList fragments = null ; typeLoop : while ( this . namePos < length ) { char currentChar = typeName [ this . namePos ] ; switch ( currentChar ) { case '<CHAR_LIT>' : this . namePos ++ ; while ( typeName [ this . namePos ] == '<CHAR_LIT:U+0020>' ) this . namePos ++ ; switch ( typeName [ this . namePos ] ) { case '<CHAR_LIT>' : checkSuper : { int max = TypeConstants . WILDCARD_SUPER . length - <NUM_LIT:1> ; for ( int ahead = <NUM_LIT:1> ; ahead < max ; ahead ++ ) { if ( typeName [ this . namePos + ahead ] != TypeConstants . WILDCARD_SUPER [ ahead + <NUM_LIT:1> ] ) { break checkSuper ; } } this . namePos += max ; Wildcard result = new Wildcard ( Wildcard . SUPER ) ; result . bound = decodeType ( typeName , length , start , end ) ; result . sourceStart = start ; result . sourceEnd = end ; return result ; } break ; case '<CHAR_LIT:e>' : checkExtends : { int max = TypeConstants . WILDCARD_EXTENDS . length - <NUM_LIT:1> ; for ( int ahead = <NUM_LIT:1> ; ahead < max ; ahead ++ ) { if ( typeName [ this . namePos + ahead ] != TypeConstants . WILDCARD_EXTENDS [ ahead + <NUM_LIT:1> ] ) { break checkExtends ; } } this . namePos += max ; Wildcard result = new Wildcard ( Wildcard . EXTENDS ) ; result . bound = decodeType ( typeName , length , start , end ) ; result . sourceStart = start ; result . sourceEnd = end ; return result ; } break ; } Wildcard result = new Wildcard ( Wildcard . UNBOUND ) ; result . sourceStart = start ; result . sourceEnd = end ; return result ; case '<CHAR_LIT:[>' : if ( dim == <NUM_LIT:0> ) nameFragmentEnd = this . namePos - <NUM_LIT:1> ; dim ++ ; break ; case '<CHAR_LIT:]>' : break ; case '<CHAR_LIT:>>' : case '<CHAR_LIT:U+002C>' : break typeLoop ; case '<CHAR_LIT:.>' : if ( nameFragmentStart < <NUM_LIT:0> ) nameFragmentStart = this . namePos + <NUM_LIT:1> ; identCount ++ ; break ; case '<CHAR_LIT>' : if ( ! this . has1_5Compliance ) break typeLoop ; if ( fragments == null ) fragments = new ArrayList ( <NUM_LIT:2> ) ; nameFragmentEnd = this . namePos - <NUM_LIT:1> ; char [ ] [ ] identifiers = CharOperation . splitOn ( '<CHAR_LIT:.>' , typeName , nameFragmentStart , this . namePos ) ; fragments . add ( identifiers ) ; this . namePos ++ ; TypeReference [ ] arguments = decodeTypeArguments ( typeName , length , start , end ) ; fragments . add ( arguments ) ; identCount = <NUM_LIT:0> ; nameFragmentStart = - <NUM_LIT:1> ; nameFragmentEnd = - <NUM_LIT:1> ; break ; } this . namePos ++ ; } if ( nameFragmentEnd < <NUM_LIT:0> ) nameFragmentEnd = this . namePos - <NUM_LIT:1> ; if ( fragments == null ) { if ( identCount == <NUM_LIT:1> ) { if ( dim == <NUM_LIT:0> ) { char [ ] nameFragment ; if ( nameFragmentStart != <NUM_LIT:0> || nameFragmentEnd >= <NUM_LIT:0> ) { int nameFragmentLength = nameFragmentEnd - nameFragmentStart + <NUM_LIT:1> ; System . arraycopy ( typeName , nameFragmentStart , nameFragment = new char [ nameFragmentLength ] , <NUM_LIT:0> , nameFragmentLength ) ; } else { nameFragment = typeName ; } return new SingleTypeReference ( nameFragment , ( ( long ) start << <NUM_LIT:32> ) + end ) ; } else { int nameFragmentLength = nameFragmentEnd - nameFragmentStart + <NUM_LIT:1> ; char [ ] nameFragment = new char [ nameFragmentLength ] ; System . arraycopy ( typeName , nameFragmentStart , nameFragment , <NUM_LIT:0> , nameFragmentLength ) ; return new ArrayTypeReference ( nameFragment , dim , ( ( long ) start << <NUM_LIT:32> ) + end ) ; } } else { long [ ] positions = new long [ identCount ] ; long pos = ( ( long ) start << <NUM_LIT:32> ) + end ; for ( int i = <NUM_LIT:0> ; i < identCount ; i ++ ) { positions [ i ] = pos ; } char [ ] [ ] identifiers = CharOperation . splitOn ( '<CHAR_LIT:.>' , typeName , nameFragmentStart , nameFragmentEnd + <NUM_LIT:1> ) ; if ( dim == <NUM_LIT:0> ) { return new QualifiedTypeReference ( identifiers , positions ) ; } else { return new ArrayQualifiedTypeReference ( identifiers , dim , positions ) ; } } } else { if ( nameFragmentStart > <NUM_LIT:0> && nameFragmentStart < length ) { char [ ] [ ] identifiers = CharOperation . splitOn ( '<CHAR_LIT:.>' , typeName , nameFragmentStart , nameFragmentEnd + <NUM_LIT:1> ) ; fragments . add ( identifiers ) ; } int fragmentLength = fragments . size ( ) ; if ( fragmentLength == <NUM_LIT:2> ) { char [ ] [ ] firstFragment = ( char [ ] [ ] ) fragments . get ( <NUM_LIT:0> ) ; if ( firstFragment . length == <NUM_LIT:1> ) { return new ParameterizedSingleTypeReference ( firstFragment [ <NUM_LIT:0> ] , ( TypeReference [ ] ) fragments . get ( <NUM_LIT:1> ) , dim , ( ( long ) start << <NUM_LIT:32> ) + end ) ; } } identCount = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < fragmentLength ; i ++ ) { Object element = fragments . get ( i ) ; if ( element instanceof char [ ] [ ] ) { identCount += ( ( char [ ] [ ] ) element ) . length ; } } char [ ] [ ] tokens = new char [ identCount ] [ ] ; TypeReference [ ] [ ] arguments = new TypeReference [ identCount ] [ ] ; int index = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < fragmentLength ; i ++ ) { Object element = fragments . get ( i ) ; if ( element instanceof char [ ] [ ] ) { char [ ] [ ] fragmentTokens = ( char [ ] [ ] ) element ; int fragmentTokenLength = fragmentTokens . length ; System . arraycopy ( fragmentTokens , <NUM_LIT:0> , tokens , index , fragmentTokenLength ) ; index += fragmentTokenLength ; } else { arguments [ index - <NUM_LIT:1> ] = ( TypeReference [ ] ) element ; } } long [ ] positions = new long [ identCount ] ; long pos = ( ( long ) start << <NUM_LIT:32> ) + end ; for ( int i = <NUM_LIT:0> ; i < identCount ; i ++ ) { positions [ i ] = pos ; } return new ParameterizedQualifiedTypeReference ( tokens , arguments , dim , positions ) ; } } private TypeReference [ ] decodeTypeArguments ( char [ ] typeName , int length , int start , int end ) { ArrayList argumentList = new ArrayList ( <NUM_LIT:1> ) ; int count = <NUM_LIT:0> ; argumentsLoop : while ( this . namePos < length ) { TypeReference argument = decodeType ( typeName , length , start , end ) ; count ++ ; argumentList . add ( argument ) ; if ( this . namePos >= length ) break argumentsLoop ; if ( typeName [ this . namePos ] == '<CHAR_LIT:>>' ) { break argumentsLoop ; } this . namePos ++ ; } TypeReference [ ] typeArguments = new TypeReference [ count ] ; argumentList . toArray ( typeArguments ) ; return typeArguments ; } private TypeReference [ ] decodeTypeArguments ( String typeSignature , int length , int start , int end ) { ArrayList argumentList = new ArrayList ( <NUM_LIT:1> ) ; int count = <NUM_LIT:0> ; argumentsLoop : while ( this . namePos < length ) { TypeReference argument = decodeType ( typeSignature , length , start , end ) ; count ++ ; argumentList . add ( argument ) ; if ( this . namePos >= length ) break argumentsLoop ; if ( typeSignature . charAt ( this . namePos ) == Signature . C_GENERIC_END ) { break argumentsLoop ; } } TypeReference [ ] typeArguments = new TypeReference [ count ] ; argumentList . toArray ( typeArguments ) ; return typeArguments ; } private char [ ] [ ] extractIdentifiers ( String typeSignature , int start , int endInclusive , int identCount ) { char [ ] [ ] result = new char [ identCount ] [ ] ; int charIndex = start ; int i = <NUM_LIT:0> ; while ( charIndex < endInclusive ) { char currentChar ; if ( ( currentChar = typeSignature . charAt ( charIndex ) ) == this . memberTypeSeparator || currentChar == Signature . C_DOT ) { typeSignature . getChars ( start , charIndex , result [ i ++ ] = new char [ charIndex - start ] , <NUM_LIT:0> ) ; start = ++ charIndex ; } else charIndex ++ ; } typeSignature . getChars ( start , charIndex + <NUM_LIT:1> , result [ i ++ ] = new char [ charIndex - start + <NUM_LIT:1> ] , <NUM_LIT:0> ) ; return result ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . parser ; import org . codehaus . jdt . groovy . integration . LanguageSupportFactory ; import org . eclipse . jdt . core . IAnnotatable ; import org . eclipse . jdt . core . IAnnotation ; import org . eclipse . jdt . core . IImportDeclaration ; import org . eclipse . jdt . core . IJavaElement ; import org . eclipse . jdt . core . ISourceRange ; import org . eclipse . jdt . core . JavaModelException ; import org . eclipse . jdt . core . Signature ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . CompilationResult ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . AbstractMethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . Annotation ; import org . eclipse . jdt . internal . compiler . ast . AnnotationMethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . Argument ; import org . eclipse . jdt . internal . compiler . ast . ArrayInitializer ; import org . eclipse . jdt . internal . compiler . ast . Block ; import org . eclipse . jdt . internal . compiler . ast . CompilationUnitDeclaration ; import org . eclipse . jdt . internal . compiler . ast . ConstructorDeclaration ; import org . eclipse . jdt . internal . compiler . ast . Expression ; import org . eclipse . jdt . internal . compiler . 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 . MethodDeclaration ; 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 ; import org . eclipse . jdt . internal . compiler . env . ICompilationUnit ; import org . eclipse . jdt . internal . compiler . env . ISourceImport ; import org . eclipse . jdt . internal . compiler . env . ISourceType ; import org . eclipse . jdt . internal . compiler . lookup . ExtraCompilerModifiers ; import org . eclipse . jdt . internal . compiler . problem . ProblemReporter ; import org . eclipse . jdt . internal . core . CompilationUnitElementInfo ; import org . eclipse . jdt . internal . core . ImportDeclaration ; import org . eclipse . jdt . internal . core . InitializerElementInfo ; import org . eclipse . jdt . internal . core . JavaElement ; import org . eclipse . jdt . internal . core . PackageFragment ; import org . eclipse . jdt . internal . core . SourceAnnotationMethodInfo ; import org . eclipse . jdt . internal . core . SourceField ; import org . eclipse . jdt . internal . core . SourceFieldElementInfo ; import org . eclipse . jdt . internal . core . SourceMethod ; import org . eclipse . jdt . internal . core . SourceMethodElementInfo ; import org . eclipse . jdt . internal . core . SourceType ; import org . eclipse . jdt . internal . core . SourceTypeElementInfo ; import org . eclipse . jdt . internal . core . util . Util ; public class SourceTypeConverter extends TypeConverter { static class AnonymousMemberFound extends RuntimeException { private static final long serialVersionUID = <NUM_LIT:1L> ; } public static final int FIELD = <NUM_LIT> ; public static final int CONSTRUCTOR = <NUM_LIT> ; public static final int METHOD = <NUM_LIT> ; public static final int MEMBER_TYPE = <NUM_LIT> ; public static final int FIELD_INITIALIZATION = <NUM_LIT> ; public static final int FIELD_AND_METHOD = FIELD | CONSTRUCTOR | METHOD ; public static final int LOCAL_TYPE = <NUM_LIT> ; public static final int NONE = <NUM_LIT:0> ; private int flags ; private CompilationUnitDeclaration unit ; private Parser parser ; private ICompilationUnit cu ; private char [ ] source ; private SourceTypeConverter ( int flags , ProblemReporter problemReporter ) { super ( problemReporter , Signature . C_DOT ) ; this . flags = flags ; } public static CompilationUnitDeclaration buildCompilationUnit ( ISourceType [ ] sourceTypes , int flags , ProblemReporter problemReporter , CompilationResult compilationResult ) { SourceTypeConverter converter = new SourceTypeConverter ( flags , problemReporter ) ; try { return converter . convert ( sourceTypes , compilationResult ) ; } catch ( JavaModelException e ) { return null ; } } private CompilationUnitDeclaration convert ( ISourceType [ ] sourceTypes , CompilationResult compilationResult ) throws JavaModelException { this . unit = LanguageSupportFactory . newCompilationUnitDeclaration ( ( ICompilationUnit ) ( ( SourceTypeElementInfo ) sourceTypes [ <NUM_LIT:0> ] ) . getHandle ( ) . getCompilationUnit ( ) , this . problemReporter , compilationResult , <NUM_LIT:0> ) ; if ( sourceTypes . length == <NUM_LIT:0> ) return this . unit ; SourceTypeElementInfo topLevelTypeInfo = ( SourceTypeElementInfo ) sourceTypes [ <NUM_LIT:0> ] ; org . eclipse . jdt . core . ICompilationUnit cuHandle = topLevelTypeInfo . getHandle ( ) . getCompilationUnit ( ) ; this . cu = ( ICompilationUnit ) cuHandle ; if ( LanguageSupportFactory . isInterestingSourceFile ( new String ( compilationResult . getFileName ( ) ) ) ) { try { return LanguageSupportFactory . getParser ( this , problemReporter . options , problemReporter , true , <NUM_LIT:3> ) . dietParse ( this . cu , compilationResult ) ; } catch ( Throwable t ) { t . printStackTrace ( ) ; } } if ( this . has1_5Compliance && ( ( CompilationUnitElementInfo ) ( ( JavaElement ) this . cu ) . getElementInfo ( ) ) . annotationNumber > <NUM_LIT:10> ) { if ( ( this . flags & LOCAL_TYPE ) == <NUM_LIT:0> ) { return new Parser ( this . problemReporter , true ) . dietParse ( this . cu , compilationResult ) ; } } int start = topLevelTypeInfo . getNameSourceStart ( ) ; int end = topLevelTypeInfo . getNameSourceEnd ( ) ; String [ ] packageName = ( ( PackageFragment ) cuHandle . getParent ( ) ) . names ; if ( packageName . length > <NUM_LIT:0> ) this . unit . currentPackage = createImportReference ( packageName , start , end , false , ClassFileConstants . AccDefault ) ; IImportDeclaration [ ] importDeclarations = topLevelTypeInfo . getHandle ( ) . getCompilationUnit ( ) . getImports ( ) ; int importCount = importDeclarations . length ; this . unit . imports = new ImportReference [ importCount ] ; for ( int i = <NUM_LIT:0> ; i < importCount ; i ++ ) { ImportDeclaration importDeclaration = ( ImportDeclaration ) importDeclarations [ i ] ; ISourceImport sourceImport = ( ISourceImport ) importDeclaration . getElementInfo ( ) ; String nameWithoutStar = importDeclaration . getNameWithoutStar ( ) ; this . unit . imports [ i ] = createImportReference ( Util . splitOn ( '<CHAR_LIT:.>' , nameWithoutStar , <NUM_LIT:0> , nameWithoutStar . length ( ) ) , sourceImport . getDeclarationSourceStart ( ) , sourceImport . getDeclarationSourceEnd ( ) , importDeclaration . isOnDemand ( ) , sourceImport . getModifiers ( ) ) ; } try { int typeCount = sourceTypes . length ; final TypeDeclaration [ ] types = new TypeDeclaration [ typeCount ] ; for ( int i = <NUM_LIT:0> ; i < typeCount ; i ++ ) { SourceTypeElementInfo typeInfo = ( SourceTypeElementInfo ) sourceTypes [ i ] ; types [ i ] = convert ( ( SourceType ) typeInfo . getHandle ( ) , compilationResult ) ; } this . unit . types = types ; return this . unit ; } catch ( AnonymousMemberFound e ) { return new Parser ( this . problemReporter , true ) . parse ( this . cu , compilationResult ) ; } } private Initializer convert ( InitializerElementInfo initializerInfo , CompilationResult compilationResult ) throws JavaModelException { Block block = new Block ( <NUM_LIT:0> ) ; Initializer initializer = new Initializer ( block , ClassFileConstants . AccDefault ) ; int start = initializerInfo . getDeclarationSourceStart ( ) ; int end = initializerInfo . getDeclarationSourceEnd ( ) ; initializer . sourceStart = initializer . declarationSourceStart = start ; initializer . sourceEnd = initializer . declarationSourceEnd = end ; initializer . modifiers = initializerInfo . getModifiers ( ) ; IJavaElement [ ] children = initializerInfo . getChildren ( ) ; int typesLength = children . length ; if ( typesLength > <NUM_LIT:0> ) { Statement [ ] statements = new Statement [ typesLength ] ; for ( int i = <NUM_LIT:0> ; i < typesLength ; i ++ ) { SourceType type = ( SourceType ) children [ i ] ; TypeDeclaration localType = convert ( type , compilationResult ) ; if ( ( localType . bits & ASTNode . IsAnonymousType ) != <NUM_LIT:0> ) { QualifiedAllocationExpression expression = new QualifiedAllocationExpression ( localType ) ; expression . type = localType . superclass ; localType . superclass = null ; localType . superInterfaces = null ; localType . allocation = expression ; statements [ i ] = expression ; } else { statements [ i ] = localType ; } } block . statements = statements ; } return initializer ; } private FieldDeclaration convert ( SourceField fieldHandle , TypeDeclaration type , CompilationResult compilationResult ) throws JavaModelException { SourceFieldElementInfo fieldInfo = ( SourceFieldElementInfo ) fieldHandle . getElementInfo ( ) ; FieldDeclaration field = new FieldDeclaration ( ) ; int start = fieldInfo . getNameSourceStart ( ) ; int end = fieldInfo . getNameSourceEnd ( ) ; field . name = fieldHandle . getElementName ( ) . toCharArray ( ) ; field . sourceStart = start ; field . sourceEnd = end ; field . declarationSourceStart = fieldInfo . getDeclarationSourceStart ( ) ; field . declarationSourceEnd = fieldInfo . getDeclarationSourceEnd ( ) ; int modifiers = fieldInfo . getModifiers ( ) ; boolean isEnumConstant = ( modifiers & ClassFileConstants . AccEnum ) != <NUM_LIT:0> ; if ( isEnumConstant ) { field . modifiers = modifiers & ~ ClassFileConstants . AccEnum ; } else { field . modifiers = modifiers ; field . type = createTypeReference ( fieldInfo . getTypeName ( ) , start , end ) ; } if ( this . has1_5Compliance ) { field . annotations = convertAnnotations ( fieldHandle ) ; } if ( ( this . flags & FIELD_INITIALIZATION ) != <NUM_LIT:0> ) { char [ ] initializationSource = fieldInfo . getInitializationSource ( ) ; if ( initializationSource != null ) { if ( this . parser == null ) { this . parser = new Parser ( this . problemReporter , true ) ; } this . parser . parse ( field , type , this . unit , initializationSource ) ; } } if ( ( this . flags & LOCAL_TYPE ) != <NUM_LIT:0> ) { IJavaElement [ ] children = fieldInfo . getChildren ( ) ; int childrenLength = children . length ; if ( childrenLength == <NUM_LIT:1> ) { field . initialization = convert ( children [ <NUM_LIT:0> ] , isEnumConstant ? field : null , compilationResult ) ; } else if ( childrenLength > <NUM_LIT:1> ) { ArrayInitializer initializer = new ArrayInitializer ( ) ; field . initialization = initializer ; Expression [ ] expressions = new Expression [ childrenLength ] ; initializer . expressions = expressions ; for ( int i = <NUM_LIT:0> ; i < childrenLength ; i ++ ) { expressions [ i ] = convert ( children [ i ] , isEnumConstant ? field : null , compilationResult ) ; } } } return field ; } private QualifiedAllocationExpression convert ( IJavaElement localType , FieldDeclaration enumConstant , CompilationResult compilationResult ) throws JavaModelException { TypeDeclaration anonymousLocalTypeDeclaration = convert ( ( SourceType ) localType , compilationResult ) ; QualifiedAllocationExpression expression = new QualifiedAllocationExpression ( anonymousLocalTypeDeclaration ) ; expression . type = anonymousLocalTypeDeclaration . superclass ; anonymousLocalTypeDeclaration . superclass = null ; anonymousLocalTypeDeclaration . superInterfaces = null ; anonymousLocalTypeDeclaration . allocation = expression ; if ( enumConstant != null ) { anonymousLocalTypeDeclaration . modifiers &= ~ ClassFileConstants . AccEnum ; expression . enumConstant = enumConstant ; expression . type = null ; } return expression ; } private AbstractMethodDeclaration convert ( SourceMethod methodHandle , SourceMethodElementInfo methodInfo , CompilationResult compilationResult ) throws JavaModelException { AbstractMethodDeclaration method ; int start = methodInfo . getNameSourceStart ( ) ; int end = methodInfo . getNameSourceEnd ( ) ; TypeParameter [ ] typeParams = null ; if ( this . has1_5Compliance ) { char [ ] [ ] typeParameterNames = methodInfo . getTypeParameterNames ( ) ; if ( typeParameterNames != null ) { int parameterCount = typeParameterNames . length ; if ( parameterCount > <NUM_LIT:0> ) { char [ ] [ ] [ ] typeParameterBounds = methodInfo . getTypeParameterBounds ( ) ; typeParams = new TypeParameter [ parameterCount ] ; for ( int i = <NUM_LIT:0> ; i < parameterCount ; i ++ ) { typeParams [ i ] = createTypeParameter ( typeParameterNames [ i ] , typeParameterBounds [ i ] , start , end ) ; } } } } int modifiers = methodInfo . getModifiers ( ) ; if ( methodInfo . isConstructor ( ) ) { ConstructorDeclaration decl = new ConstructorDeclaration ( compilationResult ) ; decl . bits &= ~ ASTNode . IsDefaultConstructor ; method = decl ; decl . typeParameters = typeParams ; } else { MethodDeclaration decl ; if ( methodInfo . isAnnotationMethod ( ) ) { AnnotationMethodDeclaration annotationMethodDeclaration = new AnnotationMethodDeclaration ( compilationResult ) ; SourceAnnotationMethodInfo annotationMethodInfo = ( SourceAnnotationMethodInfo ) methodInfo ; boolean hasDefaultValue = annotationMethodInfo . defaultValueStart != - <NUM_LIT:1> || annotationMethodInfo . defaultValueEnd != - <NUM_LIT:1> ; if ( ( this . flags & FIELD_INITIALIZATION ) != <NUM_LIT:0> ) { if ( hasDefaultValue ) { char [ ] defaultValueSource = CharOperation . subarray ( getSource ( ) , annotationMethodInfo . defaultValueStart , annotationMethodInfo . defaultValueEnd + <NUM_LIT:1> ) ; if ( defaultValueSource != null ) { Expression expression = parseMemberValue ( defaultValueSource ) ; if ( expression != null ) { annotationMethodDeclaration . defaultValue = expression ; } } else { hasDefaultValue = false ; } } } if ( hasDefaultValue ) modifiers |= ClassFileConstants . AccAnnotationDefault ; decl = annotationMethodDeclaration ; } else { decl = new MethodDeclaration ( compilationResult ) ; } decl . returnType = createTypeReference ( methodInfo . getReturnTypeName ( ) , start , end ) ; decl . typeParameters = typeParams ; method = decl ; } method . selector = methodHandle . getElementName ( ) . toCharArray ( ) ; boolean isVarargs = ( modifiers & ClassFileConstants . AccVarargs ) != <NUM_LIT:0> ; method . modifiers = modifiers & ~ ClassFileConstants . AccVarargs ; method . sourceStart = start ; method . sourceEnd = end ; method . declarationSourceStart = methodInfo . getDeclarationSourceStart ( ) ; method . declarationSourceEnd = methodInfo . getDeclarationSourceEnd ( ) ; if ( this . has1_5Compliance ) { method . annotations = convertAnnotations ( methodHandle ) ; } String [ ] argumentTypeSignatures = methodHandle . getParameterTypes ( ) ; char [ ] [ ] argumentNames = methodInfo . getArgumentNames ( ) ; int argumentCount = argumentTypeSignatures == null ? <NUM_LIT:0> : argumentTypeSignatures . length ; if ( argumentCount > <NUM_LIT:0> ) { long position = ( ( long ) start << <NUM_LIT:32> ) + end ; method . arguments = new Argument [ argumentCount ] ; for ( int i = <NUM_LIT:0> ; i < argumentCount ; i ++ ) { TypeReference typeReference = createTypeReference ( argumentTypeSignatures [ i ] , start , end ) ; if ( isVarargs && i == argumentCount - <NUM_LIT:1> ) { typeReference . bits |= ASTNode . IsVarArgs ; } method . arguments [ i ] = new Argument ( argumentNames [ i ] , position , typeReference , ClassFileConstants . AccDefault ) ; } } char [ ] [ ] exceptionTypeNames = methodInfo . getExceptionTypeNames ( ) ; int exceptionCount = exceptionTypeNames == null ? <NUM_LIT:0> : exceptionTypeNames . length ; if ( exceptionCount > <NUM_LIT:0> ) { method . thrownExceptions = new TypeReference [ exceptionCount ] ; for ( int i = <NUM_LIT:0> ; i < exceptionCount ; i ++ ) { method . thrownExceptions [ i ] = createTypeReference ( exceptionTypeNames [ i ] , start , end ) ; } } if ( ( this . flags & LOCAL_TYPE ) != <NUM_LIT:0> ) { IJavaElement [ ] children = methodInfo . getChildren ( ) ; int typesLength = children . length ; if ( typesLength != <NUM_LIT:0> ) { Statement [ ] statements = new Statement [ typesLength ] ; for ( int i = <NUM_LIT:0> ; i < typesLength ; i ++ ) { SourceType type = ( SourceType ) children [ i ] ; TypeDeclaration localType = convert ( type , compilationResult ) ; if ( ( localType . bits & ASTNode . IsAnonymousType ) != <NUM_LIT:0> ) { QualifiedAllocationExpression expression = new QualifiedAllocationExpression ( localType ) ; expression . type = localType . superclass ; localType . superclass = null ; localType . superInterfaces = null ; localType . allocation = expression ; statements [ i ] = expression ; } else { statements [ i ] = localType ; } } method . statements = statements ; } } return method ; } private TypeDeclaration convert ( SourceType typeHandle , CompilationResult compilationResult ) throws JavaModelException { SourceTypeElementInfo typeInfo = ( SourceTypeElementInfo ) typeHandle . getElementInfo ( ) ; if ( typeInfo . isAnonymousMember ( ) ) throw new AnonymousMemberFound ( ) ; TypeDeclaration type = new TypeDeclaration ( compilationResult ) ; if ( typeInfo . getEnclosingType ( ) == null ) { if ( typeHandle . isAnonymous ( ) ) { type . name = CharOperation . NO_CHAR ; type . bits |= ( ASTNode . IsAnonymousType | ASTNode . IsLocalType ) ; } else { if ( typeHandle . isLocal ( ) ) { type . bits |= ASTNode . IsLocalType ; } } } else { type . bits |= ASTNode . IsMemberType ; } if ( ( type . bits & ASTNode . IsAnonymousType ) == <NUM_LIT:0> ) { type . name = typeInfo . getName ( ) ; } type . name = typeInfo . getName ( ) ; int start , end ; type . sourceStart = start = typeInfo . getNameSourceStart ( ) ; type . sourceEnd = end = typeInfo . getNameSourceEnd ( ) ; type . modifiers = typeInfo . getModifiers ( ) ; type . declarationSourceStart = typeInfo . getDeclarationSourceStart ( ) ; type . declarationSourceEnd = typeInfo . getDeclarationSourceEnd ( ) ; type . bodyEnd = type . declarationSourceEnd ; if ( this . has1_5Compliance ) { type . annotations = convertAnnotations ( typeHandle ) ; char [ ] [ ] typeParameterNames = typeInfo . getTypeParameterNames ( ) ; if ( typeParameterNames . length > <NUM_LIT:0> ) { int parameterCount = typeParameterNames . length ; char [ ] [ ] [ ] typeParameterBounds = typeInfo . getTypeParameterBounds ( ) ; type . typeParameters = new TypeParameter [ parameterCount ] ; for ( int i = <NUM_LIT:0> ; i < parameterCount ; i ++ ) { type . typeParameters [ i ] = createTypeParameter ( typeParameterNames [ i ] , typeParameterBounds [ i ] , start , end ) ; } } } if ( typeInfo . getSuperclassName ( ) != null ) { type . superclass = createTypeReference ( typeInfo . getSuperclassName ( ) , start , end ) ; type . superclass . bits |= ASTNode . IsSuperType ; } char [ ] [ ] interfaceNames = typeInfo . getInterfaceNames ( ) ; int interfaceCount = interfaceNames == null ? <NUM_LIT:0> : interfaceNames . length ; if ( interfaceCount > <NUM_LIT:0> ) { type . superInterfaces = new TypeReference [ interfaceCount ] ; for ( int i = <NUM_LIT:0> ; i < interfaceCount ; i ++ ) { type . superInterfaces [ i ] = createTypeReference ( interfaceNames [ i ] , start , end ) ; type . superInterfaces [ i ] . bits |= ASTNode . IsSuperType ; } } if ( ( this . flags & MEMBER_TYPE ) != <NUM_LIT:0> ) { SourceType [ ] sourceMemberTypes = typeInfo . getMemberTypeHandles ( ) ; int sourceMemberTypeCount = sourceMemberTypes . length ; type . memberTypes = new TypeDeclaration [ sourceMemberTypeCount ] ; for ( int i = <NUM_LIT:0> ; i < sourceMemberTypeCount ; i ++ ) { type . memberTypes [ i ] = convert ( sourceMemberTypes [ i ] , compilationResult ) ; } } InitializerElementInfo [ ] initializers = null ; int initializerCount = <NUM_LIT:0> ; if ( ( this . flags & LOCAL_TYPE ) != <NUM_LIT:0> ) { initializers = typeInfo . getInitializers ( ) ; initializerCount = initializers . length ; } SourceField [ ] sourceFields = null ; int sourceFieldCount = <NUM_LIT:0> ; if ( ( this . flags & FIELD ) != <NUM_LIT:0> ) { sourceFields = typeInfo . getFieldHandles ( ) ; sourceFieldCount = sourceFields . length ; } int length = initializerCount + sourceFieldCount ; if ( length > <NUM_LIT:0> ) { type . fields = new FieldDeclaration [ length ] ; for ( int i = <NUM_LIT:0> ; i < initializerCount ; i ++ ) { type . fields [ i ] = convert ( initializers [ i ] , compilationResult ) ; } int index = <NUM_LIT:0> ; for ( int i = initializerCount ; i < length ; i ++ ) { type . fields [ i ] = convert ( sourceFields [ index ++ ] , type , compilationResult ) ; } } boolean needConstructor = ( this . flags & CONSTRUCTOR ) != <NUM_LIT:0> ; boolean needMethod = ( this . flags & METHOD ) != <NUM_LIT:0> ; if ( needConstructor || needMethod ) { SourceMethod [ ] sourceMethods = typeInfo . getMethodHandles ( ) ; int sourceMethodCount = sourceMethods . length ; int extraConstructor = <NUM_LIT:0> ; int methodCount = <NUM_LIT:0> ; int kind = TypeDeclaration . kind ( type . modifiers ) ; boolean isAbstract = kind == TypeDeclaration . INTERFACE_DECL || kind == TypeDeclaration . ANNOTATION_TYPE_DECL ; if ( ! isAbstract ) { extraConstructor = needConstructor ? <NUM_LIT:1> : <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < sourceMethodCount ; i ++ ) { if ( sourceMethods [ i ] . isConstructor ( ) ) { if ( needConstructor ) { extraConstructor = <NUM_LIT:0> ; methodCount ++ ; } } else if ( needMethod ) { methodCount ++ ; } } } else { methodCount = needMethod ? sourceMethodCount : <NUM_LIT:0> ; } type . methods = new AbstractMethodDeclaration [ methodCount + extraConstructor ] ; if ( extraConstructor != <NUM_LIT:0> ) { type . methods [ <NUM_LIT:0> ] = type . createDefaultConstructor ( false , false ) ; } int index = <NUM_LIT:0> ; boolean hasAbstractMethods = false ; for ( int i = <NUM_LIT:0> ; i < sourceMethodCount ; i ++ ) { SourceMethod sourceMethod = sourceMethods [ i ] ; SourceMethodElementInfo methodInfo = ( SourceMethodElementInfo ) sourceMethod . getElementInfo ( ) ; boolean isConstructor = methodInfo . isConstructor ( ) ; if ( ( methodInfo . getModifiers ( ) & ClassFileConstants . AccAbstract ) != <NUM_LIT:0> ) { hasAbstractMethods = true ; } if ( ( isConstructor && needConstructor ) || ( ! isConstructor && needMethod ) ) { AbstractMethodDeclaration method = convert ( sourceMethod , methodInfo , compilationResult ) ; if ( isAbstract || method . isAbstract ( ) ) { method . modifiers |= ExtraCompilerModifiers . AccSemicolonBody ; } type . methods [ extraConstructor + index ++ ] = method ; } } if ( hasAbstractMethods ) type . bits |= ASTNode . HasAbstractMethods ; } return type ; } private Annotation [ ] convertAnnotations ( IAnnotatable element ) throws JavaModelException { IAnnotation [ ] annotations = element . getAnnotations ( ) ; int length = annotations . length ; Annotation [ ] astAnnotations = new Annotation [ length ] ; if ( length > <NUM_LIT:0> ) { char [ ] cuSource = getSource ( ) ; int recordedAnnotations = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { ISourceRange positions = annotations [ i ] . getSourceRange ( ) ; int start = positions . getOffset ( ) ; int end = start + positions . getLength ( ) ; char [ ] annotationSource = CharOperation . subarray ( cuSource , start , end ) ; if ( annotationSource != null ) { Expression expression = parseMemberValue ( annotationSource ) ; if ( expression instanceof Annotation ) { astAnnotations [ recordedAnnotations ++ ] = ( Annotation ) expression ; } } } if ( length != recordedAnnotations ) { System . arraycopy ( astAnnotations , <NUM_LIT:0> , ( astAnnotations = new Annotation [ recordedAnnotations ] ) , <NUM_LIT:0> , recordedAnnotations ) ; } } return astAnnotations ; } private char [ ] getSource ( ) { if ( this . source == null ) this . source = this . cu . getContents ( ) ; return this . source ; } private Expression parseMemberValue ( char [ ] memberValue ) { if ( this . parser == null ) { this . parser = new Parser ( this . problemReporter , true ) ; } return this . parser . parseMemberValue ( memberValue , <NUM_LIT:0> , memberValue . length , this . unit ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler ; import org . eclipse . jdt . core . IType ; import org . eclipse . jdt . core . JavaModelException ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileReader ; import org . eclipse . jdt . internal . compiler . env . IBinaryNestedType ; public final class ExtraFlags { public final static int HasNonPrivateStaticMemberTypes = <NUM_LIT> ; public final static int IsMemberType = <NUM_LIT> ; public final static int IsLocalType = <NUM_LIT> ; public final static int ParameterTypesStoredAsSignature = <NUM_LIT> ; public static int getExtraFlags ( ClassFileReader reader ) { int extraFlags = <NUM_LIT:0> ; if ( reader . isNestedType ( ) ) { extraFlags |= ExtraFlags . IsMemberType ; } if ( reader . isLocal ( ) ) { extraFlags |= ExtraFlags . IsLocalType ; } IBinaryNestedType [ ] memberTypes = reader . getMemberTypes ( ) ; int memberTypeCounter = memberTypes == null ? <NUM_LIT:0> : memberTypes . length ; if ( memberTypeCounter > <NUM_LIT:0> ) { done : for ( int i = <NUM_LIT:0> ; i < memberTypeCounter ; i ++ ) { int modifiers = memberTypes [ i ] . getModifiers ( ) ; if ( ( modifiers & ClassFileConstants . AccStatic ) != <NUM_LIT:0> && ( modifiers & ClassFileConstants . AccPrivate ) == <NUM_LIT:0> ) { extraFlags |= ExtraFlags . HasNonPrivateStaticMemberTypes ; break done ; } } } return extraFlags ; } public static int getExtraFlags ( IType type ) throws JavaModelException { int extraFlags = <NUM_LIT:0> ; if ( type . isMember ( ) ) { extraFlags |= ExtraFlags . IsMemberType ; } if ( type . isLocal ( ) ) { extraFlags |= ExtraFlags . IsLocalType ; } IType [ ] memberTypes = type . getTypes ( ) ; int memberTypeCounter = memberTypes == null ? <NUM_LIT:0> : memberTypes . length ; if ( memberTypeCounter > <NUM_LIT:0> ) { done : for ( int i = <NUM_LIT:0> ; i < memberTypeCounter ; i ++ ) { int flags = memberTypes [ i ] . getFlags ( ) ; if ( ( flags & ClassFileConstants . AccStatic ) != <NUM_LIT:0> && ( flags & ClassFileConstants . AccPrivate ) == <NUM_LIT:0> ) { extraFlags |= ExtraFlags . HasNonPrivateStaticMemberTypes ; break done ; } } } return extraFlags ; } public static int getExtraFlags ( TypeDeclaration typeDeclaration ) { int extraFlags = <NUM_LIT:0> ; if ( typeDeclaration . enclosingType != null ) { extraFlags |= ExtraFlags . IsMemberType ; } TypeDeclaration [ ] memberTypes = typeDeclaration . memberTypes ; int memberTypeCounter = memberTypes == null ? <NUM_LIT:0> : memberTypes . length ; if ( memberTypeCounter > <NUM_LIT:0> ) { done : for ( int i = <NUM_LIT:0> ; i < memberTypeCounter ; i ++ ) { int modifiers = memberTypes [ i ] . modifiers ; if ( ( modifiers & ClassFileConstants . AccStatic ) != <NUM_LIT:0> && ( modifiers & ClassFileConstants . AccPrivate ) == <NUM_LIT:0> ) { extraFlags |= ExtraFlags . HasNonPrivateStaticMemberTypes ; break done ; } } } return extraFlags ; } } </s>
<s> package org . eclipse . jdt . internal . compiler ; import java . util . ArrayList ; import java . util . Map ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ISourceElementRequestor . TypeParameterInfo ; 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 . ArrayInitializer ; import org . eclipse . jdt . internal . compiler . ast . ArrayReference ; import org . eclipse . jdt . internal . compiler . ast . Assignment ; import org . eclipse . jdt . internal . compiler . ast . ClassLiteralAccess ; import org . eclipse . jdt . internal . compiler . ast . CompilationUnitDeclaration ; import org . eclipse . jdt . internal . compiler . ast . ConstructorDeclaration ; import org . eclipse . jdt . internal . compiler . ast . ExplicitConstructorCall ; import org . eclipse . jdt . internal . compiler . ast . Expression ; 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 . MessageSend ; import org . eclipse . jdt . internal . compiler . ast . MethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . QualifiedAllocationExpression ; 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 . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . ClassScope ; import org . eclipse . jdt . internal . compiler . lookup . ExtraCompilerModifiers ; import org . eclipse . jdt . internal . compiler . lookup . MethodScope ; import org . eclipse . jdt . internal . compiler . lookup . TypeConstants ; import org . eclipse . jdt . internal . compiler . util . HashtableOfObjectToInt ; public class SourceElementNotifier { public class LocalDeclarationVisitor extends ASTVisitor { public ImportReference currentPackage ; ArrayList declaringTypes ; public void pushDeclaringType ( TypeDeclaration declaringType ) { if ( this . declaringTypes == null ) { this . declaringTypes = new ArrayList ( ) ; } this . declaringTypes . add ( declaringType ) ; } public void popDeclaringType ( ) { this . declaringTypes . remove ( this . declaringTypes . size ( ) - <NUM_LIT:1> ) ; } public TypeDeclaration peekDeclaringType ( ) { if ( this . declaringTypes == null ) return null ; int size = this . declaringTypes . size ( ) ; if ( size == <NUM_LIT:0> ) return null ; return ( TypeDeclaration ) this . declaringTypes . get ( size - <NUM_LIT:1> ) ; } public boolean visit ( TypeDeclaration typeDeclaration , BlockScope scope ) { notifySourceElementRequestor ( typeDeclaration , true , peekDeclaringType ( ) , this . currentPackage ) ; return false ; } public boolean visit ( TypeDeclaration typeDeclaration , ClassScope scope ) { notifySourceElementRequestor ( typeDeclaration , true , peekDeclaringType ( ) , this . currentPackage ) ; return false ; } } ISourceElementRequestor requestor ; boolean reportReferenceInfo ; char [ ] [ ] typeNames ; char [ ] [ ] superTypeNames ; int nestedTypeIndex ; LocalDeclarationVisitor localDeclarationVisitor = null ; HashtableOfObjectToInt sourceEnds ; Map nodesToCategories ; int initialPosition ; int eofPosition ; public SourceElementNotifier ( ISourceElementRequestor requestor , boolean reportLocalDeclarations ) { this . requestor = requestor ; if ( reportLocalDeclarations ) { this . localDeclarationVisitor = new LocalDeclarationVisitor ( ) ; } this . typeNames = new char [ <NUM_LIT:4> ] [ ] ; this . superTypeNames = new char [ <NUM_LIT:4> ] [ ] ; this . nestedTypeIndex = <NUM_LIT:0> ; } protected char [ ] [ ] [ ] getArguments ( Argument [ ] arguments ) { int argumentLength = arguments . length ; char [ ] [ ] argumentTypes = new char [ argumentLength ] [ ] ; char [ ] [ ] argumentNames = new char [ argumentLength ] [ ] ; for ( int i = <NUM_LIT:0> ; i < argumentLength ; i ++ ) { argumentTypes [ i ] = CharOperation . concatWith ( arguments [ i ] . type . getParameterizedTypeName ( ) , '<CHAR_LIT:.>' ) ; argumentNames [ i ] = arguments [ i ] . name ; } return new char [ ] [ ] [ ] { argumentTypes , argumentNames } ; } protected char [ ] [ ] getInterfaceNames ( TypeDeclaration typeDeclaration ) { char [ ] [ ] interfaceNames = null ; int superInterfacesLength = <NUM_LIT:0> ; TypeReference [ ] superInterfaces = typeDeclaration . superInterfaces ; if ( superInterfaces != null ) { superInterfacesLength = superInterfaces . length ; interfaceNames = new char [ superInterfacesLength ] [ ] ; } else { if ( ( typeDeclaration . bits & ASTNode . IsAnonymousType ) != <NUM_LIT:0> ) { QualifiedAllocationExpression alloc = typeDeclaration . allocation ; if ( alloc != null && alloc . type != null ) { superInterfaces = new TypeReference [ ] { alloc . type } ; superInterfacesLength = <NUM_LIT:1> ; interfaceNames = new char [ <NUM_LIT:1> ] [ ] ; } } } if ( superInterfaces != null ) { for ( int i = <NUM_LIT:0> ; i < superInterfacesLength ; i ++ ) { interfaceNames [ i ] = CharOperation . concatWith ( superInterfaces [ i ] . getParameterizedTypeName ( ) , '<CHAR_LIT:.>' ) ; } } return interfaceNames ; } protected char [ ] getSuperclassName ( TypeDeclaration typeDeclaration ) { TypeReference superclass = typeDeclaration . superclass ; return superclass != null ? CharOperation . concatWith ( superclass . getParameterizedTypeName ( ) , '<CHAR_LIT:.>' ) : null ; } protected char [ ] [ ] getThrownExceptions ( AbstractMethodDeclaration methodDeclaration ) { char [ ] [ ] thrownExceptionTypes = null ; TypeReference [ ] thrownExceptions = methodDeclaration . thrownExceptions ; if ( thrownExceptions != null ) { int thrownExceptionLength = thrownExceptions . length ; thrownExceptionTypes = new char [ thrownExceptionLength ] [ ] ; for ( int i = <NUM_LIT:0> ; i < thrownExceptionLength ; i ++ ) { thrownExceptionTypes [ i ] = CharOperation . concatWith ( thrownExceptions [ i ] . getParameterizedTypeName ( ) , '<CHAR_LIT:.>' ) ; } } return thrownExceptionTypes ; } protected char [ ] [ ] getTypeParameterBounds ( TypeParameter typeParameter ) { TypeReference firstBound = typeParameter . type ; TypeReference [ ] otherBounds = typeParameter . bounds ; char [ ] [ ] typeParameterBounds = null ; if ( firstBound != null ) { if ( otherBounds != null ) { int otherBoundsLength = otherBounds . length ; char [ ] [ ] boundNames = new char [ otherBoundsLength + <NUM_LIT:1> ] [ ] ; boundNames [ <NUM_LIT:0> ] = CharOperation . concatWith ( firstBound . getParameterizedTypeName ( ) , '<CHAR_LIT:.>' ) ; for ( int j = <NUM_LIT:0> ; j < otherBoundsLength ; j ++ ) { boundNames [ j + <NUM_LIT:1> ] = CharOperation . concatWith ( otherBounds [ j ] . getParameterizedTypeName ( ) , '<CHAR_LIT:.>' ) ; } typeParameterBounds = boundNames ; } else { typeParameterBounds = new char [ ] [ ] { CharOperation . concatWith ( firstBound . getParameterizedTypeName ( ) , '<CHAR_LIT:.>' ) } ; } } else { typeParameterBounds = CharOperation . NO_CHAR_CHAR ; } return typeParameterBounds ; } private TypeParameterInfo [ ] getTypeParameterInfos ( TypeParameter [ ] typeParameters ) { if ( typeParameters == null ) return null ; int typeParametersLength = typeParameters . length ; TypeParameterInfo [ ] result = new TypeParameterInfo [ typeParametersLength ] ; for ( int i = <NUM_LIT:0> ; i < typeParametersLength ; i ++ ) { TypeParameter typeParameter = typeParameters [ i ] ; char [ ] [ ] typeParameterBounds = getTypeParameterBounds ( typeParameter ) ; ISourceElementRequestor . TypeParameterInfo typeParameterInfo = new ISourceElementRequestor . TypeParameterInfo ( ) ; typeParameterInfo . declarationStart = typeParameter . declarationSourceStart ; typeParameterInfo . declarationEnd = typeParameter . declarationSourceEnd ; typeParameterInfo . name = typeParameter . name ; typeParameterInfo . nameSourceStart = typeParameter . sourceStart ; typeParameterInfo . nameSourceEnd = typeParameter . sourceEnd ; typeParameterInfo . bounds = typeParameterBounds ; result [ i ] = typeParameterInfo ; } return result ; } private boolean hasDeprecatedAnnotation ( Annotation [ ] annotations ) { if ( annotations != null ) { for ( int i = <NUM_LIT:0> , length = annotations . length ; i < length ; i ++ ) { Annotation annotation = annotations [ i ] ; if ( CharOperation . equals ( annotation . type . getLastToken ( ) , TypeConstants . JAVA_LANG_DEPRECATED [ <NUM_LIT:2> ] ) ) { return true ; } } } return false ; } protected void notifySourceElementRequestor ( AbstractMethodDeclaration methodDeclaration , TypeDeclaration declaringType , ImportReference currentPackage ) { boolean isInRange = this . initialPosition <= methodDeclaration . declarationSourceStart && this . eofPosition >= methodDeclaration . declarationSourceEnd ; if ( methodDeclaration . isClinit ( ) ) { this . visitIfNeeded ( methodDeclaration ) ; return ; } if ( methodDeclaration . isDefaultConstructor ( ) ) { if ( this . reportReferenceInfo ) { ConstructorDeclaration constructorDeclaration = ( ConstructorDeclaration ) methodDeclaration ; ExplicitConstructorCall constructorCall = constructorDeclaration . constructorCall ; if ( constructorCall != null ) { switch ( constructorCall . accessMode ) { case ExplicitConstructorCall . This : this . requestor . acceptConstructorReference ( this . typeNames [ this . nestedTypeIndex - <NUM_LIT:1> ] , constructorCall . arguments == null ? <NUM_LIT:0> : constructorCall . arguments . length , constructorCall . sourceStart ) ; break ; case ExplicitConstructorCall . Super : case ExplicitConstructorCall . ImplicitSuper : this . requestor . acceptConstructorReference ( this . superTypeNames [ this . nestedTypeIndex - <NUM_LIT:1> ] , constructorCall . arguments == null ? <NUM_LIT:0> : constructorCall . arguments . length , constructorCall . sourceStart ) ; break ; } } } return ; } char [ ] [ ] argumentTypes = null ; char [ ] [ ] argumentNames = null ; boolean isVarArgs = false ; Argument [ ] arguments = methodDeclaration . arguments ; if ( arguments != null ) { char [ ] [ ] [ ] argumentTypesAndNames = getArguments ( arguments ) ; argumentTypes = argumentTypesAndNames [ <NUM_LIT:0> ] ; argumentNames = argumentTypesAndNames [ <NUM_LIT:1> ] ; isVarArgs = arguments [ arguments . length - <NUM_LIT:1> ] . isVarArgs ( ) ; } char [ ] [ ] thrownExceptionTypes = getThrownExceptions ( methodDeclaration ) ; int selectorSourceEnd = - <NUM_LIT:1> ; if ( methodDeclaration . isConstructor ( ) ) { selectorSourceEnd = this . sourceEnds . get ( methodDeclaration ) ; if ( isInRange ) { int currentModifiers = methodDeclaration . modifiers ; if ( isVarArgs ) currentModifiers |= ClassFileConstants . AccVarargs ; boolean deprecated = ( currentModifiers & ClassFileConstants . AccDeprecated ) != <NUM_LIT:0> || hasDeprecatedAnnotation ( methodDeclaration . annotations ) ; ISourceElementRequestor . MethodInfo methodInfo = new ISourceElementRequestor . MethodInfo ( ) ; methodInfo . isConstructor = true ; methodInfo . declarationStart = methodDeclaration . declarationSourceStart ; methodInfo . modifiers = deprecated ? ( currentModifiers & ExtraCompilerModifiers . AccJustFlag ) | ClassFileConstants . AccDeprecated : currentModifiers & ExtraCompilerModifiers . AccJustFlag ; methodInfo . name = methodDeclaration . selector ; methodInfo . nameSourceStart = methodDeclaration . sourceStart ; methodInfo . nameSourceEnd = selectorSourceEnd ; methodInfo . parameterTypes = argumentTypes ; methodInfo . parameterNames = argumentNames ; methodInfo . exceptionTypes = thrownExceptionTypes ; methodInfo . typeParameters = getTypeParameterInfos ( methodDeclaration . typeParameters ( ) ) ; methodInfo . categories = ( char [ ] [ ] ) this . nodesToCategories . get ( methodDeclaration ) ; methodInfo . annotations = methodDeclaration . annotations ; methodInfo . declaringPackageName = currentPackage == null ? CharOperation . NO_CHAR : CharOperation . concatWith ( currentPackage . tokens , '<CHAR_LIT:.>' ) ; methodInfo . declaringTypeModifiers = declaringType . modifiers ; methodInfo . extraFlags = ExtraFlags . getExtraFlags ( declaringType ) ; methodInfo . node = methodDeclaration ; this . requestor . enterConstructor ( methodInfo ) ; } if ( this . reportReferenceInfo ) { ConstructorDeclaration constructorDeclaration = ( ConstructorDeclaration ) methodDeclaration ; ExplicitConstructorCall constructorCall = constructorDeclaration . constructorCall ; if ( constructorCall != null ) { switch ( constructorCall . accessMode ) { case ExplicitConstructorCall . This : this . requestor . acceptConstructorReference ( this . typeNames [ this . nestedTypeIndex - <NUM_LIT:1> ] , constructorCall . arguments == null ? <NUM_LIT:0> : constructorCall . arguments . length , constructorCall . sourceStart ) ; break ; case ExplicitConstructorCall . Super : case ExplicitConstructorCall . ImplicitSuper : this . requestor . acceptConstructorReference ( this . superTypeNames [ this . nestedTypeIndex - <NUM_LIT:1> ] , constructorCall . arguments == null ? <NUM_LIT:0> : constructorCall . arguments . length , constructorCall . sourceStart ) ; break ; } } } this . visitIfNeeded ( methodDeclaration ) ; if ( isInRange ) { this . requestor . exitConstructor ( methodDeclaration . declarationSourceEnd ) ; } return ; } selectorSourceEnd = this . sourceEnds . get ( methodDeclaration ) ; if ( isInRange ) { int currentModifiers = methodDeclaration . modifiers ; if ( isVarArgs ) currentModifiers |= ClassFileConstants . AccVarargs ; boolean deprecated = ( currentModifiers & ClassFileConstants . AccDeprecated ) != <NUM_LIT:0> || hasDeprecatedAnnotation ( methodDeclaration . annotations ) ; TypeReference returnType = methodDeclaration instanceof MethodDeclaration ? ( ( MethodDeclaration ) methodDeclaration ) . returnType : null ; ISourceElementRequestor . MethodInfo methodInfo = new ISourceElementRequestor . MethodInfo ( ) ; methodInfo . isAnnotation = methodDeclaration instanceof AnnotationMethodDeclaration ; methodInfo . declarationStart = methodDeclaration . declarationSourceStart ; methodInfo . modifiers = deprecated ? ( currentModifiers & ExtraCompilerModifiers . AccJustFlag ) | ClassFileConstants . AccDeprecated : currentModifiers & ExtraCompilerModifiers . AccJustFlag ; methodInfo . returnType = returnType == null ? null : CharOperation . concatWith ( returnType . getParameterizedTypeName ( ) , '<CHAR_LIT:.>' ) ; methodInfo . name = methodDeclaration . selector ; methodInfo . nameSourceStart = methodDeclaration . sourceStart ; methodInfo . nameSourceEnd = selectorSourceEnd ; methodInfo . parameterTypes = argumentTypes ; methodInfo . parameterNames = argumentNames ; methodInfo . exceptionTypes = thrownExceptionTypes ; methodInfo . typeParameters = getTypeParameterInfos ( methodDeclaration . typeParameters ( ) ) ; methodInfo . categories = ( char [ ] [ ] ) this . nodesToCategories . get ( methodDeclaration ) ; methodInfo . annotations = methodDeclaration . annotations ; methodInfo . node = methodDeclaration ; this . requestor . enterMethod ( methodInfo ) ; } this . visitIfNeeded ( methodDeclaration ) ; if ( isInRange ) { if ( methodDeclaration instanceof AnnotationMethodDeclaration ) { AnnotationMethodDeclaration annotationMethodDeclaration = ( AnnotationMethodDeclaration ) methodDeclaration ; Expression expression = annotationMethodDeclaration . defaultValue ; if ( expression != null ) { this . requestor . exitMethod ( methodDeclaration . declarationSourceEnd , expression ) ; return ; } } this . requestor . exitMethod ( methodDeclaration . declarationSourceEnd , null ) ; } } public void notifySourceElementRequestor ( CompilationUnitDeclaration parsedUnit , int sourceStart , int sourceEnd , boolean reportReference , HashtableOfObjectToInt sourceEndsMap , Map nodesToCategoriesMap ) { this . initialPosition = sourceStart ; this . eofPosition = sourceEnd ; this . reportReferenceInfo = reportReference ; this . sourceEnds = sourceEndsMap ; this . nodesToCategories = nodesToCategoriesMap ; try { boolean isInRange = this . initialPosition <= parsedUnit . sourceStart && this . eofPosition >= parsedUnit . sourceEnd ; int length = <NUM_LIT:0> ; ASTNode [ ] nodes = null ; if ( isInRange ) { this . requestor . enterCompilationUnit ( ) ; } ImportReference currentPackage = parsedUnit . currentPackage ; if ( this . localDeclarationVisitor != null ) { this . localDeclarationVisitor . currentPackage = currentPackage ; } ImportReference [ ] imports = parsedUnit . imports ; TypeDeclaration [ ] types = parsedUnit . types ; length = ( currentPackage == null ? <NUM_LIT:0> : <NUM_LIT:1> ) + ( imports == null ? <NUM_LIT:0> : imports . length ) + ( types == null ? <NUM_LIT:0> : types . length ) ; nodes = new ASTNode [ length ] ; int index = <NUM_LIT:0> ; if ( currentPackage != null ) { nodes [ index ++ ] = currentPackage ; } if ( imports != null ) { for ( int i = <NUM_LIT:0> , max = imports . length ; i < max ; i ++ ) { nodes [ index ++ ] = imports [ i ] ; } } if ( types != null ) { for ( int i = <NUM_LIT:0> , max = types . length ; i < max ; i ++ ) { nodes [ index ++ ] = types [ i ] ; } } if ( length > <NUM_LIT:0> ) { quickSort ( nodes , <NUM_LIT:0> , length - <NUM_LIT:1> ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { ASTNode node = nodes [ i ] ; if ( node instanceof ImportReference ) { ImportReference importRef = ( ImportReference ) node ; if ( node == parsedUnit . currentPackage ) { notifySourceElementRequestor ( importRef , true ) ; } else { notifySourceElementRequestor ( importRef , false ) ; } } else { notifySourceElementRequestor ( ( TypeDeclaration ) node , true , null , currentPackage ) ; } } } if ( isInRange ) { this . requestor . exitCompilationUnit ( parsedUnit . sourceEnd ) ; } } finally { reset ( ) ; } } protected void notifySourceElementRequestor ( FieldDeclaration fieldDeclaration , TypeDeclaration declaringType ) { boolean isInRange = this . initialPosition <= fieldDeclaration . declarationSourceStart && this . eofPosition >= fieldDeclaration . declarationSourceEnd ; switch ( fieldDeclaration . getKind ( ) ) { case AbstractVariableDeclaration . ENUM_CONSTANT : if ( this . reportReferenceInfo ) { if ( fieldDeclaration . initialization instanceof AllocationExpression ) { AllocationExpression alloc = ( AllocationExpression ) fieldDeclaration . initialization ; this . requestor . acceptConstructorReference ( declaringType . name , alloc . arguments == null ? <NUM_LIT:0> : alloc . arguments . length , alloc . sourceStart ) ; } } case AbstractVariableDeclaration . FIELD : int fieldEndPosition = this . sourceEnds . get ( fieldDeclaration ) ; if ( fieldEndPosition == - <NUM_LIT:1> ) { fieldEndPosition = fieldDeclaration . declarationSourceEnd ; } if ( isInRange ) { int currentModifiers = fieldDeclaration . modifiers ; boolean deprecated = ( currentModifiers & ClassFileConstants . AccDeprecated ) != <NUM_LIT:0> || hasDeprecatedAnnotation ( fieldDeclaration . annotations ) ; char [ ] typeName = null ; if ( fieldDeclaration . type == null ) { typeName = declaringType . name ; currentModifiers |= ClassFileConstants . AccEnum ; } else { typeName = CharOperation . concatWith ( fieldDeclaration . type . getParameterizedTypeName ( ) , '<CHAR_LIT:.>' ) ; } ISourceElementRequestor . FieldInfo fieldInfo = new ISourceElementRequestor . FieldInfo ( ) ; fieldInfo . declarationStart = fieldDeclaration . declarationSourceStart ; fieldInfo . name = fieldDeclaration . name ; fieldInfo . modifiers = deprecated ? ( currentModifiers & ExtraCompilerModifiers . AccJustFlag ) | ClassFileConstants . AccDeprecated : currentModifiers & ExtraCompilerModifiers . AccJustFlag ; fieldInfo . type = typeName ; fieldInfo . nameSourceStart = fieldDeclaration . sourceStart ; fieldInfo . nameSourceEnd = fieldDeclaration . sourceEnd ; fieldInfo . categories = ( char [ ] [ ] ) this . nodesToCategories . get ( fieldDeclaration ) ; fieldInfo . annotations = fieldDeclaration . annotations ; fieldInfo . node = fieldDeclaration ; this . requestor . enterField ( fieldInfo ) ; } this . visitIfNeeded ( fieldDeclaration , declaringType ) ; if ( isInRange ) { this . requestor . exitField ( ( fieldDeclaration . initialization == null || fieldDeclaration . initialization instanceof ArrayInitializer || fieldDeclaration . initialization instanceof AllocationExpression || fieldDeclaration . initialization instanceof ArrayAllocationExpression || fieldDeclaration . initialization instanceof Assignment || fieldDeclaration . initialization instanceof ClassLiteralAccess || fieldDeclaration . initialization instanceof MessageSend || fieldDeclaration . initialization instanceof ArrayReference || fieldDeclaration . initialization instanceof ThisReference ) ? - <NUM_LIT:1> : fieldDeclaration . initialization . sourceStart , fieldEndPosition , fieldDeclaration . declarationSourceEnd ) ; } break ; case AbstractVariableDeclaration . INITIALIZER : if ( isInRange ) { this . requestor . enterInitializer ( fieldDeclaration . declarationSourceStart , fieldDeclaration . modifiers ) ; } this . visitIfNeeded ( ( Initializer ) fieldDeclaration ) ; if ( isInRange ) { this . requestor . exitInitializer ( fieldDeclaration . declarationSourceEnd ) ; } break ; } } protected void notifySourceElementRequestor ( ImportReference importReference , boolean isPackage ) { if ( isPackage ) { this . requestor . acceptPackage ( importReference ) ; } else { this . requestor . acceptImport ( importReference . declarationSourceStart , importReference . declarationSourceEnd , importReference . tokens , ( importReference . bits & ASTNode . OnDemand ) != <NUM_LIT:0> , importReference . modifiers ) ; } } protected void notifySourceElementRequestor ( TypeDeclaration typeDeclaration , boolean notifyTypePresence , TypeDeclaration declaringType , ImportReference currentPackage ) { if ( CharOperation . equals ( TypeConstants . PACKAGE_INFO_NAME , typeDeclaration . name ) ) return ; boolean isInRange = this . initialPosition <= typeDeclaration . declarationSourceStart && this . eofPosition >= typeDeclaration . declarationSourceEnd ; FieldDeclaration [ ] fields = typeDeclaration . fields ; AbstractMethodDeclaration [ ] methods = typeDeclaration . methods ; TypeDeclaration [ ] memberTypes = typeDeclaration . memberTypes ; int fieldCounter = fields == null ? <NUM_LIT:0> : fields . length ; int methodCounter = methods == null ? <NUM_LIT:0> : methods . length ; int memberTypeCounter = memberTypes == null ? <NUM_LIT:0> : memberTypes . length ; int fieldIndex = <NUM_LIT:0> ; int methodIndex = <NUM_LIT:0> ; int memberTypeIndex = <NUM_LIT:0> ; if ( notifyTypePresence ) { char [ ] [ ] interfaceNames = getInterfaceNames ( typeDeclaration ) ; int kind = TypeDeclaration . kind ( typeDeclaration . modifiers ) ; char [ ] implicitSuperclassName = TypeConstants . CharArray_JAVA_LANG_OBJECT ; if ( isInRange ) { int currentModifiers = typeDeclaration . modifiers ; boolean deprecated = ( currentModifiers & ClassFileConstants . AccDeprecated ) != <NUM_LIT:0> || hasDeprecatedAnnotation ( typeDeclaration . annotations ) ; boolean isEnumInit = typeDeclaration . allocation != null && typeDeclaration . allocation . enumConstant != null ; char [ ] superclassName ; if ( isEnumInit ) { currentModifiers |= ClassFileConstants . AccEnum ; superclassName = declaringType . name ; } else { superclassName = getSuperclassName ( typeDeclaration ) ; } ISourceElementRequestor . TypeInfo typeInfo = new ISourceElementRequestor . TypeInfo ( ) ; if ( typeDeclaration . allocation == null ) { typeInfo . declarationStart = typeDeclaration . declarationSourceStart ; } else if ( isEnumInit ) { typeInfo . declarationStart = typeDeclaration . allocation . enumConstant . sourceStart ; } else { typeInfo . declarationStart = typeDeclaration . allocation . sourceStart ; } typeInfo . modifiers = deprecated ? ( currentModifiers & ExtraCompilerModifiers . AccJustFlag ) | ClassFileConstants . AccDeprecated : currentModifiers & ExtraCompilerModifiers . AccJustFlag ; typeInfo . name = typeDeclaration . name ; typeInfo . nameSourceStart = isEnumInit ? typeDeclaration . allocation . enumConstant . sourceStart : typeDeclaration . sourceStart ; typeInfo . nameSourceEnd = sourceEnd ( typeDeclaration ) ; typeInfo . superclass = superclassName ; typeInfo . superinterfaces = interfaceNames ; typeInfo . typeParameters = getTypeParameterInfos ( typeDeclaration . typeParameters ) ; typeInfo . categories = ( char [ ] [ ] ) this . nodesToCategories . get ( typeDeclaration ) ; typeInfo . secondary = typeDeclaration . isSecondary ( ) ; typeInfo . anonymousMember = typeDeclaration . allocation != null && typeDeclaration . allocation . enclosingInstance != null ; typeInfo . annotations = typeDeclaration . annotations ; typeInfo . extraFlags = ExtraFlags . getExtraFlags ( typeDeclaration ) ; typeInfo . node = typeDeclaration ; this . requestor . enterType ( typeInfo ) ; switch ( kind ) { case TypeDeclaration . CLASS_DECL : if ( superclassName != null ) implicitSuperclassName = superclassName ; break ; case TypeDeclaration . INTERFACE_DECL : implicitSuperclassName = TypeConstants . CharArray_JAVA_LANG_OBJECT ; break ; case TypeDeclaration . ENUM_DECL : implicitSuperclassName = TypeConstants . CharArray_JAVA_LANG_ENUM ; break ; case TypeDeclaration . ANNOTATION_TYPE_DECL : implicitSuperclassName = TypeConstants . CharArray_JAVA_LANG_ANNOTATION_ANNOTATION ; break ; } } if ( this . nestedTypeIndex == this . typeNames . length ) { System . arraycopy ( this . typeNames , <NUM_LIT:0> , ( this . typeNames = new char [ this . nestedTypeIndex * <NUM_LIT:2> ] [ ] ) , <NUM_LIT:0> , this . nestedTypeIndex ) ; System . arraycopy ( this . superTypeNames , <NUM_LIT:0> , ( this . superTypeNames = new char [ this . nestedTypeIndex * <NUM_LIT:2> ] [ ] ) , <NUM_LIT:0> , this . nestedTypeIndex ) ; } this . typeNames [ this . nestedTypeIndex ] = typeDeclaration . name ; this . superTypeNames [ this . nestedTypeIndex ++ ] = implicitSuperclassName ; } while ( ( fieldIndex < fieldCounter ) || ( memberTypeIndex < memberTypeCounter ) || ( methodIndex < methodCounter ) ) { FieldDeclaration nextFieldDeclaration = null ; AbstractMethodDeclaration nextMethodDeclaration = null ; TypeDeclaration nextMemberDeclaration = null ; int position = Integer . MAX_VALUE ; int nextDeclarationType = - <NUM_LIT:1> ; if ( fieldIndex < fieldCounter ) { nextFieldDeclaration = fields [ fieldIndex ] ; if ( nextFieldDeclaration . declarationSourceStart < position ) { position = nextFieldDeclaration . declarationSourceStart ; nextDeclarationType = <NUM_LIT:0> ; } } if ( methodIndex < methodCounter ) { nextMethodDeclaration = methods [ methodIndex ] ; if ( nextMethodDeclaration . declarationSourceStart < position ) { position = nextMethodDeclaration . declarationSourceStart ; nextDeclarationType = <NUM_LIT:1> ; } } if ( memberTypeIndex < memberTypeCounter ) { nextMemberDeclaration = memberTypes [ memberTypeIndex ] ; if ( nextMemberDeclaration . declarationSourceStart < position ) { position = nextMemberDeclaration . declarationSourceStart ; nextDeclarationType = <NUM_LIT:2> ; } } switch ( nextDeclarationType ) { case <NUM_LIT:0> : fieldIndex ++ ; notifySourceElementRequestor ( nextFieldDeclaration , typeDeclaration ) ; break ; case <NUM_LIT:1> : methodIndex ++ ; notifySourceElementRequestor ( nextMethodDeclaration , typeDeclaration , currentPackage ) ; break ; case <NUM_LIT:2> : memberTypeIndex ++ ; notifySourceElementRequestor ( nextMemberDeclaration , true , null , currentPackage ) ; } } if ( notifyTypePresence ) { if ( isInRange ) { this . requestor . exitType ( typeDeclaration . declarationSourceEnd ) ; } this . nestedTypeIndex -- ; } } private static void quickSort ( ASTNode [ ] sortedCollection , int left , int right ) { int original_left = left ; int original_right = right ; ASTNode mid = sortedCollection [ left + ( right - left ) / <NUM_LIT:2> ] ; do { while ( sortedCollection [ left ] . sourceStart < mid . sourceStart ) { left ++ ; } while ( mid . sourceStart < sortedCollection [ right ] . sourceStart ) { right -- ; } if ( left <= right ) { ASTNode tmp = sortedCollection [ left ] ; sortedCollection [ left ] = sortedCollection [ right ] ; sortedCollection [ right ] = tmp ; left ++ ; right -- ; } } while ( left <= right ) ; if ( original_left < right ) { quickSort ( sortedCollection , original_left , right ) ; } if ( left < original_right ) { quickSort ( sortedCollection , left , original_right ) ; } } private void reset ( ) { this . typeNames = new char [ <NUM_LIT:4> ] [ ] ; this . superTypeNames = new char [ <NUM_LIT:4> ] [ ] ; this . nestedTypeIndex = <NUM_LIT:0> ; this . sourceEnds = null ; } private int sourceEnd ( TypeDeclaration typeDeclaration ) { if ( ( typeDeclaration . bits & ASTNode . IsAnonymousType ) != <NUM_LIT:0> ) { QualifiedAllocationExpression allocation = typeDeclaration . allocation ; if ( allocation . enumConstant != null ) return allocation . enumConstant . sourceEnd ; return allocation . type . sourceEnd ; } else { return typeDeclaration . sourceEnd ; } } private void visitIfNeeded ( AbstractMethodDeclaration method ) { if ( this . localDeclarationVisitor != null && ( method . bits & ASTNode . HasLocalType ) != <NUM_LIT:0> ) { if ( method instanceof ConstructorDeclaration ) { ConstructorDeclaration constructorDeclaration = ( ConstructorDeclaration ) method ; if ( constructorDeclaration . constructorCall != null ) { constructorDeclaration . constructorCall . traverse ( this . localDeclarationVisitor , method . scope ) ; } } if ( method . statements != null ) { int statementsLength = method . statements . length ; for ( int i = <NUM_LIT:0> ; i < statementsLength ; i ++ ) method . statements [ i ] . traverse ( this . localDeclarationVisitor , method . scope ) ; } } } private void visitIfNeeded ( FieldDeclaration field , TypeDeclaration declaringType ) { if ( this . localDeclarationVisitor != null && ( field . bits & ASTNode . HasLocalType ) != <NUM_LIT:0> ) { if ( field . initialization != null ) { try { this . localDeclarationVisitor . pushDeclaringType ( declaringType ) ; field . initialization . traverse ( this . localDeclarationVisitor , ( MethodScope ) null ) ; } finally { this . localDeclarationVisitor . popDeclaringType ( ) ; } } } } private void visitIfNeeded ( Initializer initializer ) { if ( this . localDeclarationVisitor != null && ( initializer . bits & ASTNode . HasLocalType ) != <NUM_LIT:0> ) { if ( initializer . block != null ) { initializer . block . traverse ( this . localDeclarationVisitor , null ) ; } } } } </s>
<s> package org . eclipse . jdt . core . compiler ; import org . eclipse . jdt . internal . compiler . parser . ScannerHelper ; public final class CharOperation { public static final char [ ] NO_CHAR = new char [ <NUM_LIT:0> ] ; public static final char [ ] [ ] NO_CHAR_CHAR = new char [ <NUM_LIT:0> ] [ ] ; public static final String [ ] NO_STRINGS = new String [ <NUM_LIT:0> ] ; public static final char [ ] append ( char [ ] array , char suffix ) { if ( array == null ) return new char [ ] { suffix } ; int length = array . length ; System . arraycopy ( array , <NUM_LIT:0> , array = new char [ length + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; array [ length ] = suffix ; return array ; } public static final char [ ] append ( char [ ] target , int index , char [ ] array , int start , int end ) { int targetLength = target . length ; int subLength = end - start ; int newTargetLength = subLength + index ; if ( newTargetLength > targetLength ) { System . arraycopy ( target , <NUM_LIT:0> , target = new char [ newTargetLength * <NUM_LIT:2> ] , <NUM_LIT:0> , index ) ; } System . arraycopy ( array , start , target , index , subLength ) ; return target ; } public static final char [ ] [ ] arrayConcat ( char [ ] [ ] first , char [ ] [ ] second ) { if ( first == null ) return second ; if ( second == null ) return first ; int length1 = first . length ; int length2 = second . length ; char [ ] [ ] result = new char [ length1 + length2 ] [ ] ; System . arraycopy ( first , <NUM_LIT:0> , result , <NUM_LIT:0> , length1 ) ; System . arraycopy ( second , <NUM_LIT:0> , result , length1 , length2 ) ; return result ; } public static final boolean camelCaseMatch ( char [ ] pattern , char [ ] name ) { if ( pattern == null ) return true ; if ( name == null ) return false ; return camelCaseMatch ( pattern , <NUM_LIT:0> , pattern . length , name , <NUM_LIT:0> , name . length , false ) ; } public static final boolean camelCaseMatch ( char [ ] pattern , char [ ] name , boolean samePartCount ) { if ( pattern == null ) return true ; if ( name == null ) return false ; return camelCaseMatch ( pattern , <NUM_LIT:0> , pattern . length , name , <NUM_LIT:0> , name . length , samePartCount ) ; } public static final boolean camelCaseMatch ( char [ ] pattern , int patternStart , int patternEnd , char [ ] name , int nameStart , int nameEnd ) { return camelCaseMatch ( pattern , patternStart , patternEnd , name , nameStart , nameEnd , false ) ; } public static final boolean camelCaseMatch ( char [ ] pattern , int patternStart , int patternEnd , char [ ] name , int nameStart , int nameEnd , boolean samePartCount ) { if ( name == null ) return false ; if ( pattern == null ) return true ; if ( patternEnd < <NUM_LIT:0> ) patternEnd = pattern . length ; if ( nameEnd < <NUM_LIT:0> ) nameEnd = name . length ; if ( patternEnd <= patternStart ) return nameEnd <= nameStart ; if ( nameEnd <= nameStart ) return false ; if ( name [ nameStart ] != pattern [ patternStart ] ) { return false ; } char patternChar , nameChar ; int iPattern = patternStart ; int iName = nameStart ; while ( true ) { iPattern ++ ; iName ++ ; if ( iPattern == patternEnd ) { if ( ! samePartCount || iName == nameEnd ) return true ; while ( true ) { if ( iName == nameEnd ) { return true ; } nameChar = name [ iName ] ; if ( nameChar < ScannerHelper . MAX_OBVIOUS ) { if ( ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ nameChar ] & ScannerHelper . C_UPPER_LETTER ) != <NUM_LIT:0> ) { return false ; } } else if ( ! Character . isJavaIdentifierPart ( nameChar ) || Character . isUpperCase ( nameChar ) ) { return false ; } iName ++ ; } } if ( iName == nameEnd ) { return false ; } if ( ( patternChar = pattern [ iPattern ] ) == name [ iName ] ) { continue ; } if ( patternChar < ScannerHelper . MAX_OBVIOUS ) { if ( ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ patternChar ] & ( ScannerHelper . C_UPPER_LETTER | ScannerHelper . C_DIGIT ) ) == <NUM_LIT:0> ) { return false ; } } else if ( Character . isJavaIdentifierPart ( patternChar ) && ! Character . isUpperCase ( patternChar ) && ! Character . isDigit ( patternChar ) ) { return false ; } while ( true ) { if ( iName == nameEnd ) { return false ; } nameChar = name [ iName ] ; if ( nameChar < ScannerHelper . MAX_OBVIOUS ) { int charNature = ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ nameChar ] ; if ( ( charNature & ( ScannerHelper . C_LOWER_LETTER | ScannerHelper . C_SPECIAL ) ) != <NUM_LIT:0> ) { iName ++ ; } else if ( ( charNature & ScannerHelper . C_DIGIT ) != <NUM_LIT:0> ) { if ( patternChar == nameChar ) break ; iName ++ ; } else if ( patternChar != nameChar ) { return false ; } else { break ; } } else if ( Character . isJavaIdentifierPart ( nameChar ) && ! Character . isUpperCase ( nameChar ) ) { iName ++ ; } else if ( Character . isDigit ( nameChar ) ) { if ( patternChar == nameChar ) break ; iName ++ ; } else if ( patternChar != nameChar ) { return false ; } else { break ; } } } } public static String [ ] charArrayToStringArray ( char [ ] [ ] charArrays ) { if ( charArrays == null ) return null ; int length = charArrays . length ; if ( length == <NUM_LIT:0> ) return NO_STRINGS ; String [ ] strings = new String [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) strings [ i ] = new String ( charArrays [ i ] ) ; return strings ; } public static String charToString ( char [ ] charArray ) { if ( charArray == null ) return null ; return new String ( charArray ) ; } public static final char [ ] [ ] arrayConcat ( char [ ] [ ] first , char [ ] second ) { if ( second == null ) return first ; if ( first == null ) return new char [ ] [ ] { second } ; int length = first . length ; char [ ] [ ] result = new char [ length + <NUM_LIT:1> ] [ ] ; System . arraycopy ( first , <NUM_LIT:0> , result , <NUM_LIT:0> , length ) ; result [ length ] = second ; return result ; } public static final int compareTo ( char [ ] array1 , char [ ] array2 ) { int length1 = array1 . length ; int length2 = array2 . length ; int min = Math . min ( length1 , length2 ) ; for ( int i = <NUM_LIT:0> ; i < min ; i ++ ) { if ( array1 [ i ] != array2 [ i ] ) { return array1 [ i ] - array2 [ i ] ; } } return length1 - length2 ; } public static final int compareWith ( char [ ] array , char [ ] prefix ) { int arrayLength = array . length ; int prefixLength = prefix . length ; int min = Math . min ( arrayLength , prefixLength ) ; int i = <NUM_LIT:0> ; while ( min -- != <NUM_LIT:0> ) { char c1 = array [ i ] ; char c2 = prefix [ i ++ ] ; if ( c1 != c2 ) return c1 - c2 ; } if ( prefixLength == i ) return <NUM_LIT:0> ; return - <NUM_LIT:1> ; } public static final char [ ] concat ( char [ ] first , char [ ] second ) { if ( first == null ) return second ; if ( second == null ) return first ; int length1 = first . length ; int length2 = second . length ; char [ ] result = new char [ length1 + length2 ] ; System . arraycopy ( first , <NUM_LIT:0> , result , <NUM_LIT:0> , length1 ) ; System . arraycopy ( second , <NUM_LIT:0> , result , length1 , length2 ) ; return result ; } public static final char [ ] concat ( char [ ] first , char [ ] second , char [ ] third ) { if ( first == null ) return concat ( second , third ) ; if ( second == null ) return concat ( first , third ) ; if ( third == null ) return concat ( first , second ) ; int length1 = first . length ; int length2 = second . length ; int length3 = third . length ; char [ ] result = new char [ length1 + length2 + length3 ] ; System . arraycopy ( first , <NUM_LIT:0> , result , <NUM_LIT:0> , length1 ) ; System . arraycopy ( second , <NUM_LIT:0> , result , length1 , length2 ) ; System . arraycopy ( third , <NUM_LIT:0> , result , length1 + length2 , length3 ) ; return result ; } public static final char [ ] concat ( char [ ] first , char [ ] second , char separator ) { if ( first == null ) return second ; if ( second == null ) return first ; int length1 = first . length ; if ( length1 == <NUM_LIT:0> ) return second ; int length2 = second . length ; if ( length2 == <NUM_LIT:0> ) return first ; char [ ] result = new char [ length1 + length2 + <NUM_LIT:1> ] ; System . arraycopy ( first , <NUM_LIT:0> , result , <NUM_LIT:0> , length1 ) ; result [ length1 ] = separator ; System . arraycopy ( second , <NUM_LIT:0> , result , length1 + <NUM_LIT:1> , length2 ) ; return result ; } public static final char [ ] concat ( char [ ] first , char sep1 , char [ ] second , char sep2 , char [ ] third ) { if ( first == null ) return concat ( second , third , sep2 ) ; if ( second == null ) return concat ( first , third , sep1 ) ; if ( third == null ) return concat ( first , second , sep1 ) ; int length1 = first . length ; int length2 = second . length ; int length3 = third . length ; char [ ] result = new char [ length1 + length2 + length3 + <NUM_LIT:2> ] ; System . arraycopy ( first , <NUM_LIT:0> , result , <NUM_LIT:0> , length1 ) ; result [ length1 ] = sep1 ; System . arraycopy ( second , <NUM_LIT:0> , result , length1 + <NUM_LIT:1> , length2 ) ; result [ length1 + length2 + <NUM_LIT:1> ] = sep2 ; System . arraycopy ( third , <NUM_LIT:0> , result , length1 + length2 + <NUM_LIT:2> , length3 ) ; return result ; } public static final char [ ] concat ( char prefix , char [ ] array , char suffix ) { if ( array == null ) return new char [ ] { prefix , suffix } ; int length = array . length ; char [ ] result = new char [ length + <NUM_LIT:2> ] ; result [ <NUM_LIT:0> ] = prefix ; System . arraycopy ( array , <NUM_LIT:0> , result , <NUM_LIT:1> , length ) ; result [ length + <NUM_LIT:1> ] = suffix ; return result ; } public static final char [ ] concatWith ( char [ ] name , char [ ] [ ] array , char separator ) { int nameLength = name == null ? <NUM_LIT:0> : name . length ; if ( nameLength == <NUM_LIT:0> ) return concatWith ( array , separator ) ; int length = array == null ? <NUM_LIT:0> : array . length ; if ( length == <NUM_LIT:0> ) return name ; int size = nameLength ; int index = length ; while ( -- index >= <NUM_LIT:0> ) if ( array [ index ] . length > <NUM_LIT:0> ) size += array [ index ] . length + <NUM_LIT:1> ; char [ ] result = new char [ size ] ; index = size ; for ( int i = length - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) { int subLength = array [ i ] . length ; if ( subLength > <NUM_LIT:0> ) { index -= subLength ; System . arraycopy ( array [ i ] , <NUM_LIT:0> , result , index , subLength ) ; result [ -- index ] = separator ; } } System . arraycopy ( name , <NUM_LIT:0> , result , <NUM_LIT:0> , nameLength ) ; return result ; } public static final char [ ] concatWith ( char [ ] [ ] array , char [ ] name , char separator ) { int nameLength = name == null ? <NUM_LIT:0> : name . length ; if ( nameLength == <NUM_LIT:0> ) return concatWith ( array , separator ) ; int length = array == null ? <NUM_LIT:0> : array . length ; if ( length == <NUM_LIT:0> ) return name ; int size = nameLength ; int index = length ; while ( -- index >= <NUM_LIT:0> ) if ( array [ index ] . length > <NUM_LIT:0> ) size += array [ index ] . length + <NUM_LIT:1> ; char [ ] result = new char [ size ] ; index = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { int subLength = array [ i ] . length ; if ( subLength > <NUM_LIT:0> ) { System . arraycopy ( array [ i ] , <NUM_LIT:0> , result , index , subLength ) ; index += subLength ; result [ index ++ ] = separator ; } } System . arraycopy ( name , <NUM_LIT:0> , result , index , nameLength ) ; return result ; } public static final char [ ] concatWith ( char [ ] [ ] array , char separator ) { int length = array == null ? <NUM_LIT:0> : array . length ; if ( length == <NUM_LIT:0> ) return CharOperation . NO_CHAR ; int size = length - <NUM_LIT:1> ; int index = length ; while ( -- index >= <NUM_LIT:0> ) { if ( array [ index ] . length == <NUM_LIT:0> ) size -- ; else size += array [ index ] . length ; } if ( size <= <NUM_LIT:0> ) return CharOperation . NO_CHAR ; char [ ] result = new char [ size ] ; index = length ; while ( -- index >= <NUM_LIT:0> ) { length = array [ index ] . length ; if ( length > <NUM_LIT:0> ) { System . arraycopy ( array [ index ] , <NUM_LIT:0> , result , ( size -= length ) , length ) ; if ( -- size >= <NUM_LIT:0> ) result [ size ] = separator ; } } return result ; } public static final boolean contains ( char character , char [ ] [ ] array ) { for ( int i = array . length ; -- i >= <NUM_LIT:0> ; ) { char [ ] subarray = array [ i ] ; for ( int j = subarray . length ; -- j >= <NUM_LIT:0> ; ) if ( subarray [ j ] == character ) return true ; } return false ; } public static final boolean contains ( char character , char [ ] array ) { for ( int i = array . length ; -- i >= <NUM_LIT:0> ; ) if ( array [ i ] == character ) return true ; return false ; } public static final boolean contains ( char [ ] characters , char [ ] array ) { for ( int i = array . length ; -- i >= <NUM_LIT:0> ; ) for ( int j = characters . length ; -- j >= <NUM_LIT:0> ; ) if ( array [ i ] == characters [ j ] ) return true ; return false ; } public static final char [ ] [ ] deepCopy ( char [ ] [ ] toCopy ) { int toCopyLength = toCopy . length ; char [ ] [ ] result = new char [ toCopyLength ] [ ] ; for ( int i = <NUM_LIT:0> ; i < toCopyLength ; i ++ ) { char [ ] toElement = toCopy [ i ] ; int toElementLength = toElement . length ; char [ ] resultElement = new char [ toElementLength ] ; System . arraycopy ( toElement , <NUM_LIT:0> , resultElement , <NUM_LIT:0> , toElementLength ) ; result [ i ] = resultElement ; } return result ; } public static final boolean endsWith ( char [ ] array , char [ ] toBeFound ) { int i = toBeFound . length ; int j = array . length - i ; if ( j < <NUM_LIT:0> ) return false ; while ( -- i >= <NUM_LIT:0> ) if ( toBeFound [ i ] != array [ i + j ] ) return false ; return true ; } public static final boolean equals ( char [ ] [ ] first , char [ ] [ ] second ) { if ( first == second ) return true ; if ( first == null || second == null ) return false ; if ( first . length != second . length ) return false ; for ( int i = first . length ; -- i >= <NUM_LIT:0> ; ) if ( ! equals ( first [ i ] , second [ i ] ) ) return false ; return true ; } public static final boolean equals ( char [ ] [ ] first , char [ ] [ ] second , boolean isCaseSensitive ) { if ( isCaseSensitive ) { return equals ( first , second ) ; } if ( first == second ) return true ; if ( first == null || second == null ) return false ; if ( first . length != second . length ) return false ; for ( int i = first . length ; -- i >= <NUM_LIT:0> ; ) if ( ! equals ( first [ i ] , second [ i ] , false ) ) return false ; return true ; } public static final boolean equals ( char [ ] first , char [ ] second ) { if ( first == second ) return true ; if ( first == null || second == null ) return false ; if ( first . length != second . length ) return false ; for ( int i = first . length ; -- i >= <NUM_LIT:0> ; ) if ( first [ i ] != second [ i ] ) return false ; return true ; } public static final boolean equals ( char [ ] first , char [ ] second , int secondStart , int secondEnd ) { return equals ( first , second , secondStart , secondEnd , true ) ; } public static final boolean equals ( char [ ] first , char [ ] second , int secondStart , int secondEnd , boolean isCaseSensitive ) { if ( first == second ) return true ; if ( first == null || second == null ) return false ; if ( first . length != secondEnd - secondStart ) return false ; if ( isCaseSensitive ) { for ( int i = first . length ; -- i >= <NUM_LIT:0> ; ) if ( first [ i ] != second [ i + secondStart ] ) return false ; } else { for ( int i = first . length ; -- i >= <NUM_LIT:0> ; ) if ( ScannerHelper . toLowerCase ( first [ i ] ) != ScannerHelper . toLowerCase ( second [ i + secondStart ] ) ) return false ; } return true ; } public static final boolean equals ( char [ ] first , char [ ] second , boolean isCaseSensitive ) { if ( isCaseSensitive ) { return equals ( first , second ) ; } if ( first == second ) return true ; if ( first == null || second == null ) return false ; if ( first . length != second . length ) return false ; for ( int i = first . length ; -- i >= <NUM_LIT:0> ; ) if ( ScannerHelper . toLowerCase ( first [ i ] ) != ScannerHelper . toLowerCase ( second [ i ] ) ) return false ; return true ; } public static final boolean fragmentEquals ( char [ ] fragment , char [ ] name , int startIndex , boolean isCaseSensitive ) { int max = fragment . length ; if ( name . length < max + startIndex ) return false ; if ( isCaseSensitive ) { for ( int i = max ; -- i >= <NUM_LIT:0> ; ) if ( fragment [ i ] != name [ i + startIndex ] ) return false ; return true ; } for ( int i = max ; -- i >= <NUM_LIT:0> ; ) if ( ScannerHelper . toLowerCase ( fragment [ i ] ) != ScannerHelper . toLowerCase ( name [ i + startIndex ] ) ) return false ; return true ; } public static final int hashCode ( char [ ] array ) { int length = array . length ; int hash = length == <NUM_LIT:0> ? <NUM_LIT:31> : array [ <NUM_LIT:0> ] ; if ( length < <NUM_LIT:8> ) { for ( int i = length ; -- i > <NUM_LIT:0> ; ) hash = ( hash * <NUM_LIT:31> ) + array [ i ] ; } else { for ( int i = length - <NUM_LIT:1> , last = i > <NUM_LIT:16> ? i - <NUM_LIT:16> : <NUM_LIT:0> ; i > last ; i -= <NUM_LIT:2> ) hash = ( hash * <NUM_LIT:31> ) + array [ i ] ; } return hash & <NUM_LIT> ; } public static boolean isWhitespace ( char c ) { return c < ScannerHelper . MAX_OBVIOUS && ( ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] & ScannerHelper . C_JLS_SPACE ) != <NUM_LIT:0> ) ; } public static final int indexOf ( char toBeFound , char [ ] array ) { return indexOf ( toBeFound , array , <NUM_LIT:0> ) ; } public static final int indexOf ( char [ ] toBeFound , char [ ] array , boolean isCaseSensitive ) { return indexOf ( toBeFound , array , isCaseSensitive , <NUM_LIT:0> ) ; } public static final int indexOf ( final char [ ] toBeFound , final char [ ] array , final boolean isCaseSensitive , final int start ) { return indexOf ( toBeFound , array , isCaseSensitive , start , array . length ) ; } public static final int indexOf ( final char [ ] toBeFound , final char [ ] array , final boolean isCaseSensitive , final int start , final int end ) { final int arrayLength = end ; final int toBeFoundLength = toBeFound . length ; if ( toBeFoundLength > arrayLength || start < <NUM_LIT:0> ) return - <NUM_LIT:1> ; if ( toBeFoundLength == <NUM_LIT:0> ) return <NUM_LIT:0> ; if ( toBeFoundLength == arrayLength ) { if ( isCaseSensitive ) { for ( int i = start ; i < arrayLength ; i ++ ) { if ( array [ i ] != toBeFound [ i ] ) return - <NUM_LIT:1> ; } return <NUM_LIT:0> ; } else { for ( int i = start ; i < arrayLength ; i ++ ) { if ( ScannerHelper . toLowerCase ( array [ i ] ) != ScannerHelper . toLowerCase ( toBeFound [ i ] ) ) return - <NUM_LIT:1> ; } return <NUM_LIT:0> ; } } if ( isCaseSensitive ) { arrayLoop : for ( int i = start , max = arrayLength - toBeFoundLength + <NUM_LIT:1> ; i < max ; i ++ ) { if ( array [ i ] == toBeFound [ <NUM_LIT:0> ] ) { for ( int j = <NUM_LIT:1> ; j < toBeFoundLength ; j ++ ) { if ( array [ i + j ] != toBeFound [ j ] ) continue arrayLoop ; } return i ; } } } else { arrayLoop : for ( int i = start , max = arrayLength - toBeFoundLength + <NUM_LIT:1> ; i < max ; i ++ ) { if ( ScannerHelper . toLowerCase ( array [ i ] ) == ScannerHelper . toLowerCase ( toBeFound [ <NUM_LIT:0> ] ) ) { for ( int j = <NUM_LIT:1> ; j < toBeFoundLength ; j ++ ) { if ( ScannerHelper . toLowerCase ( array [ i + j ] ) != ScannerHelper . toLowerCase ( toBeFound [ j ] ) ) continue arrayLoop ; } return i ; } } } return - <NUM_LIT:1> ; } public static final int indexOf ( char toBeFound , char [ ] array , int start ) { for ( int i = start ; i < array . length ; i ++ ) if ( toBeFound == array [ i ] ) return i ; return - <NUM_LIT:1> ; } public static final int indexOf ( char toBeFound , char [ ] array , int start , int end ) { for ( int i = start ; i < end ; i ++ ) if ( toBeFound == array [ i ] ) return i ; return - <NUM_LIT:1> ; } public static final int lastIndexOf ( char toBeFound , char [ ] array ) { for ( int i = array . length ; -- i >= <NUM_LIT:0> ; ) if ( toBeFound == array [ i ] ) return i ; return - <NUM_LIT:1> ; } public static final int lastIndexOf ( char toBeFound , char [ ] array , int startIndex ) { for ( int i = array . length ; -- i >= startIndex ; ) if ( toBeFound == array [ i ] ) return i ; return - <NUM_LIT:1> ; } public static final int lastIndexOf ( char toBeFound , char [ ] array , int startIndex , int endIndex ) { for ( int i = endIndex ; -- i >= startIndex ; ) if ( toBeFound == array [ i ] ) return i ; return - <NUM_LIT:1> ; } final static public char [ ] lastSegment ( char [ ] array , char separator ) { int pos = lastIndexOf ( separator , array ) ; if ( pos < <NUM_LIT:0> ) return array ; return subarray ( array , pos + <NUM_LIT:1> , array . length ) ; } public static final boolean match ( char [ ] pattern , char [ ] name , boolean isCaseSensitive ) { if ( name == null ) return false ; if ( pattern == null ) return true ; return match ( pattern , <NUM_LIT:0> , pattern . length , name , <NUM_LIT:0> , name . length , isCaseSensitive ) ; } public static final boolean match ( char [ ] pattern , int patternStart , int patternEnd , char [ ] name , int nameStart , int nameEnd , boolean isCaseSensitive ) { if ( name == null ) return false ; if ( pattern == null ) return true ; int iPattern = patternStart ; int iName = nameStart ; if ( patternEnd < <NUM_LIT:0> ) patternEnd = pattern . length ; if ( nameEnd < <NUM_LIT:0> ) nameEnd = name . length ; char patternChar = <NUM_LIT:0> ; while ( ( iPattern < patternEnd ) && ( patternChar = pattern [ iPattern ] ) != '<CHAR_LIT>' ) { if ( iName == nameEnd ) return false ; if ( patternChar != ( isCaseSensitive ? name [ iName ] : ScannerHelper . toLowerCase ( name [ iName ] ) ) && patternChar != '<CHAR_LIT>' ) { return false ; } iName ++ ; iPattern ++ ; } int segmentStart ; if ( patternChar == '<CHAR_LIT>' ) { segmentStart = ++ iPattern ; } else { segmentStart = <NUM_LIT:0> ; } int prefixStart = iName ; checkSegment : while ( iName < nameEnd ) { if ( iPattern == patternEnd ) { iPattern = segmentStart ; iName = ++ prefixStart ; continue checkSegment ; } if ( ( patternChar = pattern [ iPattern ] ) == '<CHAR_LIT>' ) { segmentStart = ++ iPattern ; if ( segmentStart == patternEnd ) { return true ; } prefixStart = iName ; continue checkSegment ; } if ( ( isCaseSensitive ? name [ iName ] : ScannerHelper . toLowerCase ( name [ iName ] ) ) != patternChar && patternChar != '<CHAR_LIT>' ) { iPattern = segmentStart ; iName = ++ prefixStart ; continue checkSegment ; } iName ++ ; iPattern ++ ; } return ( segmentStart == patternEnd ) || ( iName == nameEnd && iPattern == patternEnd ) || ( iPattern == patternEnd - <NUM_LIT:1> && pattern [ iPattern ] == '<CHAR_LIT>' ) ; } public static final boolean pathMatch ( char [ ] pattern , char [ ] filepath , boolean isCaseSensitive , char pathSeparator ) { if ( filepath == null ) return false ; if ( pattern == null ) return true ; int pSegmentStart = pattern [ <NUM_LIT:0> ] == pathSeparator ? <NUM_LIT:1> : <NUM_LIT:0> ; int pLength = pattern . length ; int pSegmentEnd = CharOperation . indexOf ( pathSeparator , pattern , pSegmentStart + <NUM_LIT:1> ) ; if ( pSegmentEnd < <NUM_LIT:0> ) pSegmentEnd = pLength ; boolean freeTrailingDoubleStar = pattern [ pLength - <NUM_LIT:1> ] == pathSeparator ; int fSegmentStart , fLength = filepath . length ; if ( filepath [ <NUM_LIT:0> ] != pathSeparator ) { fSegmentStart = <NUM_LIT:0> ; } else { fSegmentStart = <NUM_LIT:1> ; } if ( fSegmentStart != pSegmentStart ) { return false ; } int fSegmentEnd = CharOperation . indexOf ( pathSeparator , filepath , fSegmentStart + <NUM_LIT:1> ) ; if ( fSegmentEnd < <NUM_LIT:0> ) fSegmentEnd = fLength ; while ( pSegmentStart < pLength && ! ( pSegmentEnd == pLength && freeTrailingDoubleStar || ( pSegmentEnd == pSegmentStart + <NUM_LIT:2> && pattern [ pSegmentStart ] == '<CHAR_LIT>' && pattern [ pSegmentStart + <NUM_LIT:1> ] == '<CHAR_LIT>' ) ) ) { if ( fSegmentStart >= fLength ) return false ; if ( ! CharOperation . match ( pattern , pSegmentStart , pSegmentEnd , filepath , fSegmentStart , fSegmentEnd , isCaseSensitive ) ) { return false ; } pSegmentEnd = CharOperation . indexOf ( pathSeparator , pattern , pSegmentStart = pSegmentEnd + <NUM_LIT:1> ) ; if ( pSegmentEnd < <NUM_LIT:0> ) pSegmentEnd = pLength ; fSegmentEnd = CharOperation . indexOf ( pathSeparator , filepath , fSegmentStart = fSegmentEnd + <NUM_LIT:1> ) ; if ( fSegmentEnd < <NUM_LIT:0> ) fSegmentEnd = fLength ; } int pSegmentRestart ; if ( ( pSegmentStart >= pLength && freeTrailingDoubleStar ) || ( pSegmentEnd == pSegmentStart + <NUM_LIT:2> && pattern [ pSegmentStart ] == '<CHAR_LIT>' && pattern [ pSegmentStart + <NUM_LIT:1> ] == '<CHAR_LIT>' ) ) { pSegmentEnd = CharOperation . indexOf ( pathSeparator , pattern , pSegmentStart = pSegmentEnd + <NUM_LIT:1> ) ; if ( pSegmentEnd < <NUM_LIT:0> ) pSegmentEnd = pLength ; pSegmentRestart = pSegmentStart ; } else { if ( pSegmentStart >= pLength ) return fSegmentStart >= fLength ; pSegmentRestart = <NUM_LIT:0> ; } int fSegmentRestart = fSegmentStart ; checkSegment : while ( fSegmentStart < fLength ) { if ( pSegmentStart >= pLength ) { if ( freeTrailingDoubleStar ) return true ; pSegmentEnd = CharOperation . indexOf ( pathSeparator , pattern , pSegmentStart = pSegmentRestart ) ; if ( pSegmentEnd < <NUM_LIT:0> ) pSegmentEnd = pLength ; fSegmentRestart = CharOperation . indexOf ( pathSeparator , filepath , fSegmentRestart + <NUM_LIT:1> ) ; if ( fSegmentRestart < <NUM_LIT:0> ) { fSegmentRestart = fLength ; } else { fSegmentRestart ++ ; } fSegmentEnd = CharOperation . indexOf ( pathSeparator , filepath , fSegmentStart = fSegmentRestart ) ; if ( fSegmentEnd < <NUM_LIT:0> ) fSegmentEnd = fLength ; continue checkSegment ; } if ( pSegmentEnd == pSegmentStart + <NUM_LIT:2> && pattern [ pSegmentStart ] == '<CHAR_LIT>' && pattern [ pSegmentStart + <NUM_LIT:1> ] == '<CHAR_LIT>' ) { pSegmentEnd = CharOperation . indexOf ( pathSeparator , pattern , pSegmentStart = pSegmentEnd + <NUM_LIT:1> ) ; if ( pSegmentEnd < <NUM_LIT:0> ) pSegmentEnd = pLength ; pSegmentRestart = pSegmentStart ; fSegmentRestart = fSegmentStart ; if ( pSegmentStart >= pLength ) return true ; continue checkSegment ; } if ( ! CharOperation . match ( pattern , pSegmentStart , pSegmentEnd , filepath , fSegmentStart , fSegmentEnd , isCaseSensitive ) ) { pSegmentEnd = CharOperation . indexOf ( pathSeparator , pattern , pSegmentStart = pSegmentRestart ) ; if ( pSegmentEnd < <NUM_LIT:0> ) pSegmentEnd = pLength ; fSegmentRestart = CharOperation . indexOf ( pathSeparator , filepath , fSegmentRestart + <NUM_LIT:1> ) ; if ( fSegmentRestart < <NUM_LIT:0> ) { fSegmentRestart = fLength ; } else { fSegmentRestart ++ ; } fSegmentEnd = CharOperation . indexOf ( pathSeparator , filepath , fSegmentStart = fSegmentRestart ) ; if ( fSegmentEnd < <NUM_LIT:0> ) fSegmentEnd = fLength ; continue checkSegment ; } pSegmentEnd = CharOperation . indexOf ( pathSeparator , pattern , pSegmentStart = pSegmentEnd + <NUM_LIT:1> ) ; if ( pSegmentEnd < <NUM_LIT:0> ) pSegmentEnd = pLength ; fSegmentEnd = CharOperation . indexOf ( pathSeparator , filepath , fSegmentStart = fSegmentEnd + <NUM_LIT:1> ) ; if ( fSegmentEnd < <NUM_LIT:0> ) fSegmentEnd = fLength ; } return ( pSegmentRestart >= pSegmentEnd ) || ( fSegmentStart >= fLength && pSegmentStart >= pLength ) || ( pSegmentStart == pLength - <NUM_LIT:2> && pattern [ pSegmentStart ] == '<CHAR_LIT>' && pattern [ pSegmentStart + <NUM_LIT:1> ] == '<CHAR_LIT>' ) || ( pSegmentStart == pLength && freeTrailingDoubleStar ) ; } public static final int occurencesOf ( char toBeFound , char [ ] array ) { int count = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < array . length ; i ++ ) if ( toBeFound == array [ i ] ) count ++ ; return count ; } public static final int occurencesOf ( char toBeFound , char [ ] array , int start ) { int count = <NUM_LIT:0> ; for ( int i = start ; i < array . length ; i ++ ) if ( toBeFound == array [ i ] ) count ++ ; return count ; } public static final int parseInt ( char [ ] array , int start , int length ) throws NumberFormatException { if ( length == <NUM_LIT:1> ) { int result = array [ start ] - '<CHAR_LIT:0>' ; if ( result < <NUM_LIT:0> || result > <NUM_LIT:9> ) { throw new NumberFormatException ( "<STR_LIT>" ) ; } return result ; } else { return Integer . parseInt ( new String ( array , start , length ) ) ; } } public static final boolean prefixEquals ( char [ ] prefix , char [ ] name ) { int max = prefix . length ; if ( name . length < max ) return false ; for ( int i = max ; -- i >= <NUM_LIT:0> ; ) if ( prefix [ i ] != name [ i ] ) return false ; return true ; } public static final boolean prefixEquals ( char [ ] prefix , char [ ] name , boolean isCaseSensitive ) { int max = prefix . length ; if ( name . length < max ) return false ; if ( isCaseSensitive ) { for ( int i = max ; -- i >= <NUM_LIT:0> ; ) if ( prefix [ i ] != name [ i ] ) return false ; return true ; } for ( int i = max ; -- i >= <NUM_LIT:0> ; ) if ( ScannerHelper . toLowerCase ( prefix [ i ] ) != ScannerHelper . toLowerCase ( name [ i ] ) ) return false ; return true ; } public static final char [ ] remove ( char [ ] array , char toBeRemoved ) { if ( array == null ) return null ; int length = array . length ; if ( length == <NUM_LIT:0> ) return array ; char [ ] result = null ; int count = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { char c = array [ i ] ; if ( c == toBeRemoved ) { if ( result == null ) { result = new char [ length ] ; System . arraycopy ( array , <NUM_LIT:0> , result , <NUM_LIT:0> , i ) ; count = i ; } } else if ( result != null ) { result [ count ++ ] = c ; } } if ( result == null ) return array ; System . arraycopy ( result , <NUM_LIT:0> , result = new char [ count ] , <NUM_LIT:0> , count ) ; return result ; } public static final void replace ( char [ ] array , char toBeReplaced , char replacementChar ) { if ( toBeReplaced != replacementChar ) { for ( int i = <NUM_LIT:0> , max = array . length ; i < max ; i ++ ) { if ( array [ i ] == toBeReplaced ) array [ i ] = replacementChar ; } } } public static final void replace ( char [ ] array , char [ ] toBeReplaced , char replacementChar ) { replace ( array , toBeReplaced , replacementChar , <NUM_LIT:0> , array . length ) ; } public static final void replace ( char [ ] array , char [ ] toBeReplaced , char replacementChar , int start , int end ) { for ( int i = end ; -- i >= start ; ) for ( int j = toBeReplaced . length ; -- j >= <NUM_LIT:0> ; ) if ( array [ i ] == toBeReplaced [ j ] ) array [ i ] = replacementChar ; } public static final char [ ] replace ( char [ ] array , char [ ] toBeReplaced , char [ ] replacementChars ) { int max = array . length ; int replacedLength = toBeReplaced . length ; int replacementLength = replacementChars . length ; int [ ] starts = new int [ <NUM_LIT:5> ] ; int occurrenceCount = <NUM_LIT:0> ; if ( ! equals ( toBeReplaced , replacementChars ) ) { next : for ( int i = <NUM_LIT:0> ; i < max ; ) { int index = indexOf ( toBeReplaced , array , true , i ) ; if ( index == - <NUM_LIT:1> ) { i ++ ; continue next ; } if ( occurrenceCount == starts . length ) { System . arraycopy ( starts , <NUM_LIT:0> , starts = new int [ occurrenceCount * <NUM_LIT:2> ] , <NUM_LIT:0> , occurrenceCount ) ; } starts [ occurrenceCount ++ ] = index ; i = index + replacedLength ; } } if ( occurrenceCount == <NUM_LIT:0> ) return array ; char [ ] result = new char [ max + occurrenceCount * ( replacementLength - replacedLength ) ] ; int inStart = <NUM_LIT:0> , outStart = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < occurrenceCount ; i ++ ) { int offset = starts [ i ] - inStart ; System . arraycopy ( array , inStart , result , outStart , offset ) ; inStart += offset ; outStart += offset ; System . arraycopy ( replacementChars , <NUM_LIT:0> , result , outStart , replacementLength ) ; inStart += replacedLength ; outStart += replacementLength ; } System . arraycopy ( array , inStart , result , outStart , max - inStart ) ; return result ; } public static final char [ ] replaceOnCopy ( char [ ] array , char toBeReplaced , char replacementChar ) { char [ ] result = null ; for ( int i = <NUM_LIT:0> , length = array . length ; i < length ; i ++ ) { char c = array [ i ] ; if ( c == toBeReplaced ) { if ( result == null ) { result = new char [ length ] ; System . arraycopy ( array , <NUM_LIT:0> , result , <NUM_LIT:0> , i ) ; } result [ i ] = replacementChar ; } else if ( result != null ) { result [ i ] = c ; } } if ( result == null ) return array ; return result ; } public static final char [ ] [ ] splitAndTrimOn ( char divider , char [ ] array ) { int length = array == null ? <NUM_LIT:0> : array . length ; if ( length == <NUM_LIT:0> ) return NO_CHAR_CHAR ; int wordCount = <NUM_LIT:1> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) if ( array [ i ] == divider ) wordCount ++ ; char [ ] [ ] split = new char [ wordCount ] [ ] ; int last = <NUM_LIT:0> , currentWord = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( array [ i ] == divider ) { int start = last , end = i - <NUM_LIT:1> ; while ( start < i && array [ start ] == '<CHAR_LIT:U+0020>' ) start ++ ; while ( end > start && array [ end ] == '<CHAR_LIT:U+0020>' ) end -- ; split [ currentWord ] = new char [ end - start + <NUM_LIT:1> ] ; System . arraycopy ( array , start , split [ currentWord ++ ] , <NUM_LIT:0> , end - start + <NUM_LIT:1> ) ; last = i + <NUM_LIT:1> ; } } int start = last , end = length - <NUM_LIT:1> ; while ( start < length && array [ start ] == '<CHAR_LIT:U+0020>' ) start ++ ; while ( end > start && array [ end ] == '<CHAR_LIT:U+0020>' ) end -- ; split [ currentWord ] = new char [ end - start + <NUM_LIT:1> ] ; System . arraycopy ( array , start , split [ currentWord ++ ] , <NUM_LIT:0> , end - start + <NUM_LIT:1> ) ; return split ; } public static final char [ ] [ ] splitOn ( char divider , char [ ] array ) { int length = array == null ? <NUM_LIT:0> : array . length ; if ( length == <NUM_LIT:0> ) return NO_CHAR_CHAR ; int wordCount = <NUM_LIT:1> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) if ( array [ i ] == divider ) wordCount ++ ; char [ ] [ ] split = new char [ wordCount ] [ ] ; int last = <NUM_LIT:0> , currentWord = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( array [ i ] == divider ) { split [ currentWord ] = new char [ i - last ] ; System . arraycopy ( array , last , split [ currentWord ++ ] , <NUM_LIT:0> , i - last ) ; last = i + <NUM_LIT:1> ; } } split [ currentWord ] = new char [ length - last ] ; System . arraycopy ( array , last , split [ currentWord ] , <NUM_LIT:0> , length - last ) ; return split ; } public static final char [ ] [ ] splitOn ( char divider , char [ ] array , int start , int end ) { int length = array == null ? <NUM_LIT:0> : array . length ; if ( length == <NUM_LIT:0> || start > end ) return NO_CHAR_CHAR ; int wordCount = <NUM_LIT:1> ; for ( int i = start ; i < end ; i ++ ) if ( array [ i ] == divider ) wordCount ++ ; char [ ] [ ] split = new char [ wordCount ] [ ] ; int last = start , currentWord = <NUM_LIT:0> ; for ( int i = start ; i < end ; i ++ ) { if ( array [ i ] == divider ) { split [ currentWord ] = new char [ i - last ] ; System . arraycopy ( array , last , split [ currentWord ++ ] , <NUM_LIT:0> , i - last ) ; last = i + <NUM_LIT:1> ; } } split [ currentWord ] = new char [ end - last ] ; System . arraycopy ( array , last , split [ currentWord ] , <NUM_LIT:0> , end - last ) ; return split ; } public static final char [ ] [ ] subarray ( char [ ] [ ] array , int start , int end ) { if ( end == - <NUM_LIT:1> ) end = array . length ; if ( start > end ) return null ; if ( start < <NUM_LIT:0> ) return null ; if ( end > array . length ) return null ; char [ ] [ ] result = new char [ end - start ] [ ] ; System . arraycopy ( array , start , result , <NUM_LIT:0> , end - start ) ; return result ; } public static final char [ ] subarray ( char [ ] array , int start , int end ) { if ( end == - <NUM_LIT:1> ) end = array . length ; if ( start > end ) return null ; if ( start < <NUM_LIT:0> ) return null ; if ( end > array . length ) return null ; char [ ] result = new char [ end - start ] ; System . arraycopy ( array , start , result , <NUM_LIT:0> , end - start ) ; return result ; } final static public char [ ] toLowerCase ( char [ ] chars ) { if ( chars == null ) return null ; int length = chars . length ; char [ ] lowerChars = null ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { char c = chars [ i ] ; char lc = ScannerHelper . toLowerCase ( c ) ; if ( ( c != lc ) || ( lowerChars != null ) ) { if ( lowerChars == null ) { System . arraycopy ( chars , <NUM_LIT:0> , lowerChars = new char [ length ] , <NUM_LIT:0> , i ) ; } lowerChars [ i ] = lc ; } } return lowerChars == null ? chars : lowerChars ; } final static public char [ ] toUpperCase ( char [ ] chars ) { if ( chars == null ) return null ; int length = chars . length ; char [ ] upperChars = null ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { char c = chars [ i ] ; char lc = ScannerHelper . toUpperCase ( c ) ; if ( ( c != lc ) || ( upperChars != null ) ) { if ( upperChars == null ) { System . arraycopy ( chars , <NUM_LIT:0> , upperChars = new char [ length ] , <NUM_LIT:0> , i ) ; } upperChars [ i ] = lc ; } } return upperChars == null ? chars : upperChars ; } final static public char [ ] trim ( char [ ] chars ) { if ( chars == null ) return null ; int start = <NUM_LIT:0> , length = chars . length , end = length - <NUM_LIT:1> ; while ( start < length && chars [ start ] == '<CHAR_LIT:U+0020>' ) { start ++ ; } while ( end > start && chars [ end ] == '<CHAR_LIT:U+0020>' ) { end -- ; } if ( start != <NUM_LIT:0> || end != length - <NUM_LIT:1> ) { return subarray ( chars , start , end + <NUM_LIT:1> ) ; } return chars ; } final static public String toString ( char [ ] [ ] array ) { char [ ] result = concatWith ( array , '<CHAR_LIT:.>' ) ; return new String ( result ) ; } final static public String [ ] toStrings ( char [ ] [ ] array ) { if ( array == null ) return NO_STRINGS ; int length = array . length ; if ( length == <NUM_LIT:0> ) return NO_STRINGS ; String [ ] result = new String [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) result [ i ] = new String ( array [ i ] ) ; return result ; } } </s>
<s> package org . eclipse . jdt . core . compiler ; import org . eclipse . jdt . internal . compiler . lookup . ProblemReasons ; public interface IProblem { String [ ] getArguments ( ) ; int getID ( ) ; String getMessage ( ) ; char [ ] getOriginatingFileName ( ) ; int getSourceEnd ( ) ; int getSourceLineNumber ( ) ; int getSourceStart ( ) ; boolean isError ( ) ; boolean isWarning ( ) ; void setSourceEnd ( int sourceEnd ) ; void setSourceLineNumber ( int lineNumber ) ; void setSourceStart ( int sourceStart ) ; int TypeRelated = <NUM_LIT> ; int FieldRelated = <NUM_LIT> ; int MethodRelated = <NUM_LIT> ; int ConstructorRelated = <NUM_LIT> ; int ImportRelated = <NUM_LIT> ; int Internal = <NUM_LIT> ; int Syntax = <NUM_LIT> ; int Javadoc = <NUM_LIT> ; int IgnoreCategoriesMask = <NUM_LIT> ; int Unclassified = <NUM_LIT:0> ; int ObjectHasNoSuperclass = TypeRelated + <NUM_LIT:1> ; int UndefinedType = TypeRelated + <NUM_LIT:2> ; int NotVisibleType = TypeRelated + <NUM_LIT:3> ; int AmbiguousType = TypeRelated + <NUM_LIT:4> ; int UsingDeprecatedType = TypeRelated + <NUM_LIT:5> ; int InternalTypeNameProvided = TypeRelated + <NUM_LIT:6> ; int UnusedPrivateType = Internal + TypeRelated + <NUM_LIT:7> ; int IncompatibleTypesInEqualityOperator = TypeRelated + <NUM_LIT:15> ; int IncompatibleTypesInConditionalOperator = TypeRelated + <NUM_LIT:16> ; int TypeMismatch = TypeRelated + <NUM_LIT> ; int IndirectAccessToStaticType = Internal + TypeRelated + <NUM_LIT> ; int MissingEnclosingInstanceForConstructorCall = TypeRelated + <NUM_LIT:20> ; int MissingEnclosingInstance = TypeRelated + <NUM_LIT> ; int IncorrectEnclosingInstanceReference = TypeRelated + <NUM_LIT> ; int IllegalEnclosingInstanceSpecification = TypeRelated + <NUM_LIT> ; int CannotDefineStaticInitializerInLocalType = Internal + <NUM_LIT:24> ; int OuterLocalMustBeFinal = Internal + <NUM_LIT> ; int CannotDefineInterfaceInLocalType = Internal + <NUM_LIT> ; int IllegalPrimitiveOrArrayTypeForEnclosingInstance = TypeRelated + <NUM_LIT> ; int EnclosingInstanceInConstructorCall = Internal + <NUM_LIT> ; int AnonymousClassCannotExtendFinalClass = TypeRelated + <NUM_LIT> ; int CannotDefineAnnotationInLocalType = Internal + <NUM_LIT:30> ; int CannotDefineEnumInLocalType = Internal + <NUM_LIT:31> ; int NonStaticContextForEnumMemberType = Internal + <NUM_LIT:32> ; int TypeHidingType = TypeRelated + <NUM_LIT> ; int UndefinedName = Internal + FieldRelated + <NUM_LIT> ; int UninitializedLocalVariable = Internal + <NUM_LIT> ; int VariableTypeCannotBeVoid = Internal + <NUM_LIT> ; int VariableTypeCannotBeVoidArray = Internal + <NUM_LIT> ; int CannotAllocateVoidArray = Internal + <NUM_LIT> ; int RedefinedLocal = Internal + <NUM_LIT> ; int RedefinedArgument = Internal + <NUM_LIT> ; int DuplicateFinalLocalInitialization = Internal + <NUM_LIT> ; int NonBlankFinalLocalAssignment = Internal + <NUM_LIT> ; int ParameterAssignment = Internal + <NUM_LIT> ; int FinalOuterLocalAssignment = Internal + <NUM_LIT> ; int LocalVariableIsNeverUsed = Internal + <NUM_LIT> ; int ArgumentIsNeverUsed = Internal + <NUM_LIT> ; int BytecodeExceeds64KLimit = Internal + <NUM_LIT> ; int BytecodeExceeds64KLimitForClinit = Internal + <NUM_LIT> ; int TooManyArgumentSlots = Internal + <NUM_LIT> ; int TooManyLocalVariableSlots = Internal + <NUM_LIT> ; int TooManySyntheticArgumentSlots = Internal + <NUM_LIT> ; int TooManyArrayDimensions = Internal + <NUM_LIT> ; int BytecodeExceeds64KLimitForConstructor = Internal + <NUM_LIT> ; int UndefinedField = FieldRelated + <NUM_LIT> ; int NotVisibleField = FieldRelated + <NUM_LIT> ; int AmbiguousField = FieldRelated + <NUM_LIT> ; int UsingDeprecatedField = FieldRelated + <NUM_LIT> ; int NonStaticFieldFromStaticInvocation = FieldRelated + <NUM_LIT> ; int ReferenceToForwardField = FieldRelated + Internal + <NUM_LIT> ; int NonStaticAccessToStaticField = Internal + FieldRelated + <NUM_LIT> ; int UnusedPrivateField = Internal + FieldRelated + <NUM_LIT> ; int IndirectAccessToStaticField = Internal + FieldRelated + <NUM_LIT> ; int UnqualifiedFieldAccess = Internal + FieldRelated + <NUM_LIT> ; int FinalFieldAssignment = FieldRelated + <NUM_LIT> ; int UninitializedBlankFinalField = FieldRelated + <NUM_LIT> ; int DuplicateBlankFinalFieldInitialization = FieldRelated + <NUM_LIT> ; int UnresolvedVariable = FieldRelated + <NUM_LIT> ; int LocalVariableHidingLocalVariable = Internal + <NUM_LIT> ; int LocalVariableHidingField = Internal + FieldRelated + <NUM_LIT> ; int FieldHidingLocalVariable = Internal + FieldRelated + <NUM_LIT> ; int FieldHidingField = Internal + FieldRelated + <NUM_LIT> ; int ArgumentHidingLocalVariable = Internal + <NUM_LIT> ; int ArgumentHidingField = Internal + <NUM_LIT> ; int MissingSerialVersion = Internal + <NUM_LIT> ; int UndefinedMethod = MethodRelated + <NUM_LIT:100> ; int NotVisibleMethod = MethodRelated + <NUM_LIT> ; int AmbiguousMethod = MethodRelated + <NUM_LIT> ; int UsingDeprecatedMethod = MethodRelated + <NUM_LIT> ; int DirectInvocationOfAbstractMethod = MethodRelated + <NUM_LIT> ; int VoidMethodReturnsValue = MethodRelated + <NUM_LIT> ; int MethodReturnsVoid = MethodRelated + <NUM_LIT> ; int MethodRequiresBody = Internal + MethodRelated + <NUM_LIT> ; int ShouldReturnValue = Internal + MethodRelated + <NUM_LIT> ; int MethodButWithConstructorName = MethodRelated + <NUM_LIT> ; int MissingReturnType = TypeRelated + <NUM_LIT> ; int BodyForNativeMethod = Internal + MethodRelated + <NUM_LIT> ; int BodyForAbstractMethod = Internal + MethodRelated + <NUM_LIT> ; int NoMessageSendOnBaseType = MethodRelated + <NUM_LIT> ; int ParameterMismatch = MethodRelated + <NUM_LIT> ; int NoMessageSendOnArrayType = MethodRelated + <NUM_LIT> ; int NonStaticAccessToStaticMethod = Internal + MethodRelated + <NUM_LIT> ; int UnusedPrivateMethod = Internal + MethodRelated + <NUM_LIT> ; int IndirectAccessToStaticMethod = Internal + MethodRelated + <NUM_LIT> ; int MissingTypeInMethod = MethodRelated + <NUM_LIT> ; int MissingTypeInConstructor = ConstructorRelated + <NUM_LIT> ; int UndefinedConstructor = ConstructorRelated + <NUM_LIT> ; int NotVisibleConstructor = ConstructorRelated + <NUM_LIT> ; int AmbiguousConstructor = ConstructorRelated + <NUM_LIT> ; int UsingDeprecatedConstructor = ConstructorRelated + <NUM_LIT> ; int UnusedPrivateConstructor = Internal + MethodRelated + <NUM_LIT> ; int InstanceFieldDuringConstructorInvocation = ConstructorRelated + <NUM_LIT> ; int InstanceMethodDuringConstructorInvocation = ConstructorRelated + <NUM_LIT> ; int RecursiveConstructorInvocation = ConstructorRelated + <NUM_LIT> ; int ThisSuperDuringConstructorInvocation = ConstructorRelated + <NUM_LIT> ; int InvalidExplicitConstructorCall = ConstructorRelated + Syntax + <NUM_LIT> ; int UndefinedConstructorInDefaultConstructor = ConstructorRelated + <NUM_LIT> ; int NotVisibleConstructorInDefaultConstructor = ConstructorRelated + <NUM_LIT> ; int AmbiguousConstructorInDefaultConstructor = ConstructorRelated + <NUM_LIT> ; int UndefinedConstructorInImplicitConstructorCall = ConstructorRelated + <NUM_LIT> ; int NotVisibleConstructorInImplicitConstructorCall = ConstructorRelated + <NUM_LIT> ; int AmbiguousConstructorInImplicitConstructorCall = ConstructorRelated + <NUM_LIT> ; int UnhandledExceptionInDefaultConstructor = TypeRelated + <NUM_LIT> ; int UnhandledExceptionInImplicitConstructorCall = TypeRelated + <NUM_LIT> ; int UnusedObjectAllocation = Internal + <NUM_LIT> ; int DeadCode = Internal + <NUM_LIT> ; int ArrayReferenceRequired = Internal + <NUM_LIT> ; int NoImplicitStringConversionForCharArrayExpression = Internal + <NUM_LIT> ; int StringConstantIsExceedingUtf8Limit = Internal + <NUM_LIT> ; int NonConstantExpression = Internal + <NUM_LIT> ; int NumericValueOutOfRange = Internal + <NUM_LIT> ; int IllegalCast = TypeRelated + <NUM_LIT> ; int InvalidClassInstantiation = TypeRelated + <NUM_LIT> ; int CannotDefineDimensionExpressionsWithInit = Internal + <NUM_LIT> ; int MustDefineEitherDimensionExpressionsOrInitializer = Internal + <NUM_LIT> ; int InvalidOperator = Internal + <NUM_LIT> ; int CodeCannotBeReached = Internal + <NUM_LIT> ; int CannotReturnInInitializer = Internal + <NUM_LIT> ; int InitializerMustCompleteNormally = Internal + <NUM_LIT> ; int InvalidVoidExpression = Internal + <NUM_LIT> ; int MaskedCatch = TypeRelated + <NUM_LIT> ; int DuplicateDefaultCase = Internal + <NUM_LIT> ; int UnreachableCatch = TypeRelated + MethodRelated + <NUM_LIT> ; int UnhandledException = TypeRelated + <NUM_LIT> ; int IncorrectSwitchType = TypeRelated + <NUM_LIT> ; int DuplicateCase = FieldRelated + <NUM_LIT> ; int DuplicateLabel = Internal + <NUM_LIT> ; int InvalidBreak = Internal + <NUM_LIT> ; int InvalidContinue = Internal + <NUM_LIT> ; int UndefinedLabel = Internal + <NUM_LIT> ; int InvalidTypeToSynchronized = Internal + <NUM_LIT> ; int InvalidNullToSynchronized = Internal + <NUM_LIT> ; int CannotThrowNull = Internal + <NUM_LIT> ; int AssignmentHasNoEffect = Internal + <NUM_LIT> ; int PossibleAccidentalBooleanAssignment = Internal + <NUM_LIT> ; int SuperfluousSemicolon = Internal + <NUM_LIT> ; int UnnecessaryCast = Internal + TypeRelated + <NUM_LIT> ; int UnnecessaryArgumentCast = Internal + TypeRelated + <NUM_LIT> ; int UnnecessaryInstanceof = Internal + TypeRelated + <NUM_LIT> ; int FinallyMustCompleteNormally = Internal + <NUM_LIT> ; int UnusedMethodDeclaredThrownException = Internal + <NUM_LIT> ; int UnusedConstructorDeclaredThrownException = Internal + <NUM_LIT> ; int InvalidCatchBlockSequence = Internal + TypeRelated + <NUM_LIT> ; int EmptyControlFlowStatement = Internal + TypeRelated + <NUM_LIT> ; int UnnecessaryElse = Internal + <NUM_LIT> ; int NeedToEmulateFieldReadAccess = FieldRelated + <NUM_LIT> ; int NeedToEmulateFieldWriteAccess = FieldRelated + <NUM_LIT> ; int NeedToEmulateMethodAccess = MethodRelated + <NUM_LIT> ; int NeedToEmulateConstructorAccess = MethodRelated + <NUM_LIT> ; int FallthroughCase = Internal + <NUM_LIT> ; int InheritedMethodHidesEnclosingName = MethodRelated + <NUM_LIT> ; int InheritedFieldHidesEnclosingName = FieldRelated + <NUM_LIT> ; int InheritedTypeHidesEnclosingName = TypeRelated + <NUM_LIT> ; int IllegalUsageOfQualifiedTypeReference = Internal + Syntax + <NUM_LIT> ; int UnusedLabel = Internal + <NUM_LIT> ; int ThisInStaticContext = Internal + <NUM_LIT> ; int StaticMethodRequested = Internal + MethodRelated + <NUM_LIT> ; int IllegalDimension = Internal + <NUM_LIT> ; int InvalidTypeExpression = Internal + <NUM_LIT> ; int ParsingError = Syntax + Internal + <NUM_LIT> ; int ParsingErrorNoSuggestion = Syntax + Internal + <NUM_LIT> ; int InvalidUnaryExpression = Syntax + Internal + <NUM_LIT> ; int InterfaceCannotHaveConstructors = Syntax + Internal + <NUM_LIT> ; int ArrayConstantsOnlyInArrayInitializers = Syntax + Internal + <NUM_LIT> ; int ParsingErrorOnKeyword = Syntax + Internal + <NUM_LIT> ; int ParsingErrorOnKeywordNoSuggestion = Syntax + Internal + <NUM_LIT> ; int ComparingIdentical = Internal + <NUM_LIT> ; int UnmatchedBracket = Syntax + Internal + <NUM_LIT> ; int NoFieldOnBaseType = FieldRelated + <NUM_LIT> ; int InvalidExpressionAsStatement = Syntax + Internal + <NUM_LIT> ; int ExpressionShouldBeAVariable = Syntax + Internal + <NUM_LIT> ; int MissingSemiColon = Syntax + Internal + <NUM_LIT> ; int InvalidParenthesizedExpression = Syntax + Internal + <NUM_LIT> ; int ParsingErrorInsertTokenBefore = Syntax + Internal + <NUM_LIT> ; int ParsingErrorInsertTokenAfter = Syntax + Internal + <NUM_LIT> ; int ParsingErrorDeleteToken = Syntax + Internal + <NUM_LIT> ; int ParsingErrorDeleteTokens = Syntax + Internal + <NUM_LIT> ; int ParsingErrorMergeTokens = Syntax + Internal + <NUM_LIT> ; int ParsingErrorInvalidToken = Syntax + Internal + <NUM_LIT> ; int ParsingErrorMisplacedConstruct = Syntax + Internal + <NUM_LIT> ; int ParsingErrorReplaceTokens = Syntax + Internal + <NUM_LIT> ; int ParsingErrorNoSuggestionForTokens = Syntax + Internal + <NUM_LIT> ; int ParsingErrorUnexpectedEOF = Syntax + Internal + <NUM_LIT> ; int ParsingErrorInsertToComplete = Syntax + Internal + <NUM_LIT> ; int ParsingErrorInsertToCompleteScope = Syntax + Internal + <NUM_LIT> ; int ParsingErrorInsertToCompletePhrase = Syntax + Internal + <NUM_LIT> ; int EndOfSource = Syntax + Internal + <NUM_LIT> ; int InvalidHexa = Syntax + Internal + <NUM_LIT> ; int InvalidOctal = Syntax + Internal + <NUM_LIT> ; int InvalidCharacterConstant = Syntax + Internal + <NUM_LIT> ; int InvalidEscape = Syntax + Internal + <NUM_LIT> ; int InvalidInput = Syntax + Internal + <NUM_LIT:255> ; int InvalidUnicodeEscape = Syntax + Internal + <NUM_LIT> ; int InvalidFloat = Syntax + Internal + <NUM_LIT> ; int NullSourceString = Syntax + Internal + <NUM_LIT> ; int UnterminatedString = Syntax + Internal + <NUM_LIT> ; int UnterminatedComment = Syntax + Internal + <NUM_LIT> ; int NonExternalizedStringLiteral = Internal + <NUM_LIT> ; int InvalidDigit = Syntax + Internal + <NUM_LIT> ; int InvalidLowSurrogate = Syntax + Internal + <NUM_LIT> ; int InvalidHighSurrogate = Syntax + Internal + <NUM_LIT> ; int UnnecessaryNLSTag = Internal + <NUM_LIT> ; int DiscouragedReference = TypeRelated + <NUM_LIT> ; int InterfaceCannotHaveInitializers = TypeRelated + <NUM_LIT> ; int DuplicateModifierForType = TypeRelated + <NUM_LIT> ; int IllegalModifierForClass = TypeRelated + <NUM_LIT> ; int IllegalModifierForInterface = TypeRelated + <NUM_LIT> ; int IllegalModifierForMemberClass = TypeRelated + <NUM_LIT> ; int IllegalModifierForMemberInterface = TypeRelated + <NUM_LIT> ; int IllegalModifierForLocalClass = TypeRelated + <NUM_LIT> ; int ForbiddenReference = TypeRelated + <NUM_LIT> ; int IllegalModifierCombinationFinalAbstractForClass = TypeRelated + <NUM_LIT> ; int IllegalVisibilityModifierForInterfaceMemberType = TypeRelated + <NUM_LIT> ; int IllegalVisibilityModifierCombinationForMemberType = TypeRelated + <NUM_LIT> ; int IllegalStaticModifierForMemberType = TypeRelated + <NUM_LIT> ; int SuperclassMustBeAClass = TypeRelated + <NUM_LIT> ; int ClassExtendFinalClass = TypeRelated + <NUM_LIT> ; int DuplicateSuperInterface = TypeRelated + <NUM_LIT> ; int SuperInterfaceMustBeAnInterface = TypeRelated + <NUM_LIT> ; int HierarchyCircularitySelfReference = TypeRelated + <NUM_LIT> ; int HierarchyCircularity = TypeRelated + <NUM_LIT> ; int HidingEnclosingType = TypeRelated + <NUM_LIT> ; int DuplicateNestedType = TypeRelated + <NUM_LIT> ; int CannotThrowType = TypeRelated + <NUM_LIT> ; int PackageCollidesWithType = TypeRelated + <NUM_LIT> ; int TypeCollidesWithPackage = TypeRelated + <NUM_LIT> ; int DuplicateTypes = TypeRelated + <NUM_LIT> ; int IsClassPathCorrect = TypeRelated + <NUM_LIT> ; int PublicClassMustMatchFileName = TypeRelated + <NUM_LIT> ; int MustSpecifyPackage = Internal + <NUM_LIT> ; int HierarchyHasProblems = TypeRelated + <NUM_LIT> ; int PackageIsNotExpectedPackage = Internal + <NUM_LIT> ; int ObjectCannotHaveSuperTypes = Internal + <NUM_LIT> ; int ObjectMustBeClass = Internal + <NUM_LIT> ; int RedundantSuperinterface = TypeRelated + <NUM_LIT> ; int ShouldImplementHashcode = TypeRelated + <NUM_LIT> ; int AbstractMethodsInConcreteClass = TypeRelated + <NUM_LIT> ; int SuperclassNotFound = TypeRelated + <NUM_LIT> + ProblemReasons . NotFound ; int SuperclassNotVisible = TypeRelated + <NUM_LIT> + ProblemReasons . NotVisible ; int SuperclassAmbiguous = TypeRelated + <NUM_LIT> + ProblemReasons . Ambiguous ; int SuperclassInternalNameProvided = TypeRelated + <NUM_LIT> + ProblemReasons . InternalNameProvided ; int SuperclassInheritedNameHidesEnclosingName = TypeRelated + <NUM_LIT> + ProblemReasons . InheritedNameHidesEnclosingName ; int InterfaceNotFound = TypeRelated + <NUM_LIT> + ProblemReasons . NotFound ; int InterfaceNotVisible = TypeRelated + <NUM_LIT> + ProblemReasons . NotVisible ; int InterfaceAmbiguous = TypeRelated + <NUM_LIT> + ProblemReasons . Ambiguous ; int InterfaceInternalNameProvided = TypeRelated + <NUM_LIT> + ProblemReasons . InternalNameProvided ; int InterfaceInheritedNameHidesEnclosingName = TypeRelated + <NUM_LIT> + ProblemReasons . InheritedNameHidesEnclosingName ; int DuplicateField = FieldRelated + <NUM_LIT> ; int DuplicateModifierForField = FieldRelated + <NUM_LIT> ; int IllegalModifierForField = FieldRelated + <NUM_LIT> ; int IllegalModifierForInterfaceField = FieldRelated + <NUM_LIT> ; int IllegalVisibilityModifierCombinationForField = FieldRelated + <NUM_LIT> ; int IllegalModifierCombinationFinalVolatileForField = FieldRelated + <NUM_LIT> ; int UnexpectedStaticModifierForField = FieldRelated + <NUM_LIT> ; int FieldTypeNotFound = FieldRelated + <NUM_LIT> + ProblemReasons . NotFound ; int FieldTypeNotVisible = FieldRelated + <NUM_LIT> + ProblemReasons . NotVisible ; int FieldTypeAmbiguous = FieldRelated + <NUM_LIT> + ProblemReasons . Ambiguous ; int FieldTypeInternalNameProvided = FieldRelated + <NUM_LIT> + ProblemReasons . InternalNameProvided ; int FieldTypeInheritedNameHidesEnclosingName = FieldRelated + <NUM_LIT> + ProblemReasons . InheritedNameHidesEnclosingName ; int DuplicateMethod = MethodRelated + <NUM_LIT> ; int IllegalModifierForArgument = MethodRelated + <NUM_LIT> ; int DuplicateModifierForMethod = MethodRelated + <NUM_LIT> ; int IllegalModifierForMethod = MethodRelated + <NUM_LIT> ; int IllegalModifierForInterfaceMethod = MethodRelated + <NUM_LIT> ; int IllegalVisibilityModifierCombinationForMethod = MethodRelated + <NUM_LIT> ; int UnexpectedStaticModifierForMethod = MethodRelated + <NUM_LIT> ; int IllegalAbstractModifierCombinationForMethod = MethodRelated + <NUM_LIT> ; int AbstractMethodInAbstractClass = MethodRelated + <NUM_LIT> ; int ArgumentTypeCannotBeVoid = MethodRelated + <NUM_LIT> ; int ArgumentTypeCannotBeVoidArray = MethodRelated + <NUM_LIT> ; int ReturnTypeCannotBeVoidArray = MethodRelated + <NUM_LIT> ; int NativeMethodsCannotBeStrictfp = MethodRelated + <NUM_LIT> ; int DuplicateModifierForArgument = MethodRelated + <NUM_LIT> ; int IllegalModifierForConstructor = MethodRelated + <NUM_LIT> ; int ArgumentTypeNotFound = MethodRelated + <NUM_LIT> + ProblemReasons . NotFound ; int ArgumentTypeNotVisible = MethodRelated + <NUM_LIT> + ProblemReasons . NotVisible ; int ArgumentTypeAmbiguous = MethodRelated + <NUM_LIT> + ProblemReasons . Ambiguous ; int ArgumentTypeInternalNameProvided = MethodRelated + <NUM_LIT> + ProblemReasons . InternalNameProvided ; int ArgumentTypeInheritedNameHidesEnclosingName = MethodRelated + <NUM_LIT> + ProblemReasons . InheritedNameHidesEnclosingName ; int ExceptionTypeNotFound = MethodRelated + <NUM_LIT> + ProblemReasons . NotFound ; int ExceptionTypeNotVisible = MethodRelated + <NUM_LIT> + ProblemReasons . NotVisible ; int ExceptionTypeAmbiguous = MethodRelated + <NUM_LIT> + ProblemReasons . Ambiguous ; int ExceptionTypeInternalNameProvided = MethodRelated + <NUM_LIT> + ProblemReasons . InternalNameProvided ; int ExceptionTypeInheritedNameHidesEnclosingName = MethodRelated + <NUM_LIT> + ProblemReasons . InheritedNameHidesEnclosingName ; int ReturnTypeNotFound = MethodRelated + <NUM_LIT> + ProblemReasons . NotFound ; int ReturnTypeNotVisible = MethodRelated + <NUM_LIT> + ProblemReasons . NotVisible ; int ReturnTypeAmbiguous = MethodRelated + <NUM_LIT> + ProblemReasons . Ambiguous ; int ReturnTypeInternalNameProvided = MethodRelated + <NUM_LIT> + ProblemReasons . InternalNameProvided ; int ReturnTypeInheritedNameHidesEnclosingName = MethodRelated + <NUM_LIT> + ProblemReasons . InheritedNameHidesEnclosingName ; int ConflictingImport = ImportRelated + <NUM_LIT> ; int DuplicateImport = ImportRelated + <NUM_LIT> ; int CannotImportPackage = ImportRelated + <NUM_LIT> ; int UnusedImport = ImportRelated + <NUM_LIT> ; int ImportNotFound = ImportRelated + <NUM_LIT> + ProblemReasons . NotFound ; int ImportNotVisible = ImportRelated + <NUM_LIT> + ProblemReasons . NotVisible ; int ImportAmbiguous = ImportRelated + <NUM_LIT> + ProblemReasons . Ambiguous ; int ImportInternalNameProvided = ImportRelated + <NUM_LIT> + ProblemReasons . InternalNameProvided ; int ImportInheritedNameHidesEnclosingName = ImportRelated + <NUM_LIT> + ProblemReasons . InheritedNameHidesEnclosingName ; int InvalidTypeForStaticImport = ImportRelated + <NUM_LIT> ; int DuplicateModifierForVariable = MethodRelated + <NUM_LIT> ; int IllegalModifierForVariable = MethodRelated + <NUM_LIT> ; int LocalVariableCannotBeNull = Internal + <NUM_LIT> ; int LocalVariableCanOnlyBeNull = Internal + <NUM_LIT> ; int LocalVariableMayBeNull = Internal + <NUM_LIT> ; int AbstractMethodMustBeImplemented = MethodRelated + <NUM_LIT> ; int FinalMethodCannotBeOverridden = MethodRelated + <NUM_LIT> ; int IncompatibleExceptionInThrowsClause = MethodRelated + <NUM_LIT> ; int IncompatibleExceptionInInheritedMethodThrowsClause = MethodRelated + <NUM_LIT> ; int IncompatibleReturnType = MethodRelated + <NUM_LIT> ; int InheritedMethodReducesVisibility = MethodRelated + <NUM_LIT> ; int CannotOverrideAStaticMethodWithAnInstanceMethod = MethodRelated + <NUM_LIT> ; int CannotHideAnInstanceMethodWithAStaticMethod = MethodRelated + <NUM_LIT> ; int StaticInheritedMethodConflicts = MethodRelated + <NUM_LIT> ; int MethodReducesVisibility = MethodRelated + <NUM_LIT> ; int OverridingNonVisibleMethod = MethodRelated + <NUM_LIT> ; int AbstractMethodCannotBeOverridden = MethodRelated + <NUM_LIT> ; int OverridingDeprecatedMethod = MethodRelated + <NUM_LIT> ; int IncompatibleReturnTypeForNonInheritedInterfaceMethod = MethodRelated + <NUM_LIT> ; int IncompatibleExceptionInThrowsClauseForNonInheritedInterfaceMethod = MethodRelated + <NUM_LIT> ; int IllegalVararg = MethodRelated + <NUM_LIT> ; int OverridingMethodWithoutSuperInvocation = MethodRelated + <NUM_LIT> ; int MissingSynchronizedModifierInInheritedMethod = MethodRelated + <NUM_LIT> ; int AbstractMethodMustBeImplementedOverConcreteMethod = MethodRelated + <NUM_LIT> ; int InheritedIncompatibleReturnType = MethodRelated + <NUM_LIT> ; int CodeSnippetMissingClass = Internal + <NUM_LIT> ; int CodeSnippetMissingMethod = Internal + <NUM_LIT> ; int CannotUseSuperInCodeSnippet = Internal + <NUM_LIT> ; int TooManyConstantsInConstantPool = Internal + <NUM_LIT> ; int TooManyBytesForStringConstant = Internal + <NUM_LIT> ; int TooManyFields = Internal + <NUM_LIT> ; int TooManyMethods = Internal + <NUM_LIT> ; int UseAssertAsAnIdentifier = Internal + <NUM_LIT> ; int UseEnumAsAnIdentifier = Internal + <NUM_LIT> ; int EnumConstantsCannotBeSurroundedByParenthesis = Syntax + Internal + <NUM_LIT> ; int Task = Internal + <NUM_LIT> ; int NullLocalVariableReference = Internal + <NUM_LIT> ; int PotentialNullLocalVariableReference = Internal + <NUM_LIT> ; int RedundantNullCheckOnNullLocalVariable = Internal + <NUM_LIT> ; int NullLocalVariableComparisonYieldsFalse = Internal + <NUM_LIT> ; int RedundantLocalVariableNullAssignment = Internal + <NUM_LIT> ; int NullLocalVariableInstanceofYieldsFalse = Internal + <NUM_LIT> ; int RedundantNullCheckOnNonNullLocalVariable = Internal + <NUM_LIT> ; int NonNullLocalVariableComparisonYieldsFalse = Internal + <NUM_LIT> ; int UndocumentedEmptyBlock = Internal + <NUM_LIT> ; int JavadocInvalidSeeUrlReference = Javadoc + Internal + <NUM_LIT> ; int JavadocMissingTagDescription = Javadoc + Internal + <NUM_LIT> ; int JavadocDuplicateTag = Javadoc + Internal + <NUM_LIT> ; int JavadocHiddenReference = Javadoc + Internal + <NUM_LIT> ; int JavadocInvalidMemberTypeQualification = Javadoc + Internal + <NUM_LIT> ; int JavadocMissingIdentifier = Javadoc + Internal + <NUM_LIT> ; int JavadocNonStaticTypeFromStaticInvocation = Javadoc + Internal + <NUM_LIT> ; int JavadocInvalidParamTagTypeParameter = Javadoc + Internal + <NUM_LIT> ; int JavadocUnexpectedTag = Javadoc + Internal + <NUM_LIT> ; int JavadocMissingParamTag = Javadoc + Internal + <NUM_LIT> ; int JavadocMissingParamName = Javadoc + Internal + <NUM_LIT> ; int JavadocDuplicateParamName = Javadoc + Internal + <NUM_LIT> ; int JavadocInvalidParamName = Javadoc + Internal + <NUM_LIT> ; int JavadocMissingReturnTag = Javadoc + Internal + <NUM_LIT> ; int JavadocDuplicateReturnTag = Javadoc + Internal + <NUM_LIT> ; int JavadocMissingThrowsTag = Javadoc + Internal + <NUM_LIT> ; int JavadocMissingThrowsClassName = Javadoc + Internal + <NUM_LIT> ; int JavadocInvalidThrowsClass = Javadoc + Internal + <NUM_LIT> ; int JavadocDuplicateThrowsClassName = Javadoc + Internal + <NUM_LIT> ; int JavadocInvalidThrowsClassName = Javadoc + Internal + <NUM_LIT> ; int JavadocMissingSeeReference = Javadoc + Internal + <NUM_LIT> ; int JavadocInvalidSeeReference = Javadoc + Internal + <NUM_LIT> ; int JavadocInvalidSeeHref = Javadoc + Internal + <NUM_LIT> ; int JavadocInvalidSeeArgs = Javadoc + Internal + <NUM_LIT> ; int JavadocMissing = Javadoc + Internal + <NUM_LIT> ; int JavadocInvalidTag = Javadoc + Internal + <NUM_LIT> ; int JavadocUndefinedField = Javadoc + Internal + <NUM_LIT> ; int JavadocNotVisibleField = Javadoc + Internal + <NUM_LIT> ; int JavadocAmbiguousField = Javadoc + Internal + <NUM_LIT> ; int JavadocUsingDeprecatedField = Javadoc + Internal + <NUM_LIT> ; int JavadocUndefinedConstructor = Javadoc + Internal + <NUM_LIT> ; int JavadocNotVisibleConstructor = Javadoc + Internal + <NUM_LIT> ; int JavadocAmbiguousConstructor = Javadoc + Internal + <NUM_LIT> ; int JavadocUsingDeprecatedConstructor = Javadoc + Internal + <NUM_LIT> ; int JavadocUndefinedMethod = Javadoc + Internal + <NUM_LIT> ; int JavadocNotVisibleMethod = Javadoc + Internal + <NUM_LIT> ; int JavadocAmbiguousMethod = Javadoc + Internal + <NUM_LIT> ; int JavadocUsingDeprecatedMethod = Javadoc + Internal + <NUM_LIT> ; int JavadocNoMessageSendOnBaseType = Javadoc + Internal + <NUM_LIT> ; int JavadocParameterMismatch = Javadoc + Internal + <NUM_LIT> ; int JavadocNoMessageSendOnArrayType = Javadoc + Internal + <NUM_LIT> ; int JavadocUndefinedType = Javadoc + Internal + <NUM_LIT> ; int JavadocNotVisibleType = Javadoc + Internal + <NUM_LIT> ; int JavadocAmbiguousType = Javadoc + Internal + <NUM_LIT> ; int JavadocUsingDeprecatedType = Javadoc + Internal + <NUM_LIT> ; int JavadocInternalTypeNameProvided = Javadoc + Internal + <NUM_LIT> ; int JavadocInheritedMethodHidesEnclosingName = Javadoc + Internal + <NUM_LIT> ; int JavadocInheritedFieldHidesEnclosingName = Javadoc + Internal + <NUM_LIT> ; int JavadocInheritedNameHidesEnclosingTypeName = Javadoc + Internal + <NUM_LIT> ; int JavadocAmbiguousMethodReference = Javadoc + Internal + <NUM_LIT> ; int JavadocUnterminatedInlineTag = Javadoc + Internal + <NUM_LIT> ; int JavadocMalformedSeeReference = Javadoc + Internal + <NUM_LIT> ; int JavadocMessagePrefix = Internal + <NUM_LIT> ; int JavadocMissingHashCharacter = Javadoc + Internal + <NUM_LIT> ; int JavadocEmptyReturnTag = Javadoc + Internal + <NUM_LIT> ; int JavadocInvalidValueReference = Javadoc + Internal + <NUM_LIT> ; int JavadocUnexpectedText = Javadoc + Internal + <NUM_LIT> ; int JavadocInvalidParamTagName = Javadoc + Internal + <NUM_LIT> ; int DuplicateTypeVariable = Internal + <NUM_LIT> ; int IllegalTypeVariableSuperReference = Internal + <NUM_LIT> ; int NonStaticTypeFromStaticInvocation = Internal + <NUM_LIT> ; int ObjectCannotBeGeneric = Internal + <NUM_LIT> ; int NonGenericType = TypeRelated + <NUM_LIT> ; int IncorrectArityForParameterizedType = TypeRelated + <NUM_LIT> ; int TypeArgumentMismatch = TypeRelated + <NUM_LIT> ; int DuplicateMethodErasure = TypeRelated + <NUM_LIT> ; int ReferenceToForwardTypeVariable = TypeRelated + <NUM_LIT> ; int BoundMustBeAnInterface = TypeRelated + <NUM_LIT> ; int UnsafeRawConstructorInvocation = TypeRelated + <NUM_LIT> ; int UnsafeRawMethodInvocation = TypeRelated + <NUM_LIT> ; int UnsafeTypeConversion = TypeRelated + <NUM_LIT> ; int InvalidTypeVariableExceptionType = TypeRelated + <NUM_LIT> ; int InvalidParameterizedExceptionType = TypeRelated + <NUM_LIT> ; int IllegalGenericArray = TypeRelated + <NUM_LIT> ; int UnsafeRawFieldAssignment = TypeRelated + <NUM_LIT> ; int FinalBoundForTypeVariable = TypeRelated + <NUM_LIT> ; int UndefinedTypeVariable = Internal + <NUM_LIT> ; int SuperInterfacesCollide = TypeRelated + <NUM_LIT> ; int WildcardConstructorInvocation = TypeRelated + <NUM_LIT> ; int WildcardMethodInvocation = TypeRelated + <NUM_LIT> ; int WildcardFieldAssignment = TypeRelated + <NUM_LIT> ; int GenericMethodTypeArgumentMismatch = TypeRelated + <NUM_LIT> ; int GenericConstructorTypeArgumentMismatch = TypeRelated + <NUM_LIT> ; int UnsafeGenericCast = TypeRelated + <NUM_LIT> ; int IllegalInstanceofParameterizedType = Internal + <NUM_LIT> ; int IllegalInstanceofTypeParameter = Internal + <NUM_LIT> ; int NonGenericMethod = TypeRelated + <NUM_LIT> ; int IncorrectArityForParameterizedMethod = TypeRelated + <NUM_LIT> ; int ParameterizedMethodArgumentTypeMismatch = TypeRelated + <NUM_LIT> ; int NonGenericConstructor = TypeRelated + <NUM_LIT> ; int IncorrectArityForParameterizedConstructor = TypeRelated + <NUM_LIT> ; int ParameterizedConstructorArgumentTypeMismatch = TypeRelated + <NUM_LIT> ; int TypeArgumentsForRawGenericMethod = TypeRelated + <NUM_LIT> ; int TypeArgumentsForRawGenericConstructor = TypeRelated + <NUM_LIT> ; int SuperTypeUsingWildcard = TypeRelated + <NUM_LIT> ; int GenericTypeCannotExtendThrowable = TypeRelated + <NUM_LIT> ; int IllegalClassLiteralForTypeVariable = TypeRelated + <NUM_LIT> ; int UnsafeReturnTypeOverride = MethodRelated + <NUM_LIT> ; int MethodNameClash = MethodRelated + <NUM_LIT> ; int RawMemberTypeCannotBeParameterized = TypeRelated + <NUM_LIT> ; int MissingArgumentsForParameterizedMemberType = TypeRelated + <NUM_LIT> ; int StaticMemberOfParameterizedType = TypeRelated + <NUM_LIT> ; int BoundHasConflictingArguments = TypeRelated + <NUM_LIT> ; int DuplicateParameterizedMethods = MethodRelated + <NUM_LIT> ; int IllegalQualifiedParameterizedTypeAllocation = TypeRelated + <NUM_LIT> ; int DuplicateBounds = TypeRelated + <NUM_LIT> ; int BoundCannotBeArray = TypeRelated + <NUM_LIT> ; int UnsafeRawGenericConstructorInvocation = TypeRelated + <NUM_LIT> ; int UnsafeRawGenericMethodInvocation = TypeRelated + <NUM_LIT> ; int TypeParameterHidingType = TypeRelated + <NUM_LIT> ; int RawTypeReference = TypeRelated + <NUM_LIT> ; int NoAdditionalBoundAfterTypeVariable = TypeRelated + <NUM_LIT> ; int UnsafeGenericArrayForVarargs = MethodRelated + <NUM_LIT> ; int IllegalAccessFromTypeVariable = TypeRelated + <NUM_LIT> ; int TypeHidingTypeParameterFromType = TypeRelated + <NUM_LIT> ; int TypeHidingTypeParameterFromMethod = TypeRelated + <NUM_LIT> ; int InvalidUsageOfWildcard = Syntax + Internal + <NUM_LIT> ; int UnusedTypeArgumentsForMethodInvocation = MethodRelated + <NUM_LIT> ; int IncompatibleTypesInForeach = TypeRelated + <NUM_LIT> ; int InvalidTypeForCollection = Internal + <NUM_LIT> ; int InvalidTypeForCollectionTarget14 = Internal + <NUM_LIT> ; int InvalidUsageOfTypeParameters = Syntax + Internal + <NUM_LIT> ; int InvalidUsageOfStaticImports = Syntax + Internal + <NUM_LIT> ; int InvalidUsageOfForeachStatements = Syntax + Internal + <NUM_LIT> ; int InvalidUsageOfTypeArguments = Syntax + Internal + <NUM_LIT> ; int InvalidUsageOfEnumDeclarations = Syntax + Internal + <NUM_LIT> ; int InvalidUsageOfVarargs = Syntax + Internal + <NUM_LIT> ; int InvalidUsageOfAnnotations = Syntax + Internal + <NUM_LIT> ; int InvalidUsageOfAnnotationDeclarations = Syntax + Internal + <NUM_LIT> ; int InvalidUsageOfTypeParametersForAnnotationDeclaration = Syntax + Internal + <NUM_LIT> ; int InvalidUsageOfTypeParametersForEnumDeclaration = Syntax + Internal + <NUM_LIT> ; int IllegalModifierForAnnotationMethod = MethodRelated + <NUM_LIT> ; int IllegalExtendedDimensions = MethodRelated + <NUM_LIT> ; int InvalidFileNameForPackageAnnotations = Syntax + Internal + <NUM_LIT> ; int IllegalModifierForAnnotationType = TypeRelated + <NUM_LIT> ; int IllegalModifierForAnnotationMemberType = TypeRelated + <NUM_LIT> ; int InvalidAnnotationMemberType = TypeRelated + <NUM_LIT> ; int AnnotationCircularitySelfReference = TypeRelated + <NUM_LIT> ; int AnnotationCircularity = TypeRelated + <NUM_LIT> ; int DuplicateAnnotation = TypeRelated + <NUM_LIT> ; int MissingValueForAnnotationMember = TypeRelated + <NUM_LIT> ; int DuplicateAnnotationMember = Internal + <NUM_LIT> ; int UndefinedAnnotationMember = MethodRelated + <NUM_LIT> ; int AnnotationValueMustBeClassLiteral = Internal + <NUM_LIT> ; int AnnotationValueMustBeConstant = Internal + <NUM_LIT> ; int AnnotationFieldNeedConstantInitialization = Internal + <NUM_LIT> ; int IllegalModifierForAnnotationField = Internal + <NUM_LIT> ; int AnnotationCannotOverrideMethod = MethodRelated + <NUM_LIT> ; int AnnotationMembersCannotHaveParameters = Syntax + Internal + <NUM_LIT> ; int AnnotationMembersCannotHaveTypeParameters = Syntax + Internal + <NUM_LIT> ; int AnnotationTypeDeclarationCannotHaveSuperclass = Syntax + Internal + <NUM_LIT> ; int AnnotationTypeDeclarationCannotHaveSuperinterfaces = Syntax + Internal + <NUM_LIT> ; int DuplicateTargetInTargetAnnotation = Internal + <NUM_LIT> ; int DisallowedTargetForAnnotation = TypeRelated + <NUM_LIT> ; int MethodMustOverride = MethodRelated + <NUM_LIT> ; int AnnotationTypeDeclarationCannotHaveConstructor = Syntax + Internal + <NUM_LIT> ; int AnnotationValueMustBeAnnotation = Internal + <NUM_LIT> ; int AnnotationTypeUsedAsSuperInterface = TypeRelated + <NUM_LIT> ; int MissingOverrideAnnotation = MethodRelated + <NUM_LIT> ; int FieldMissingDeprecatedAnnotation = Internal + <NUM_LIT> ; int MethodMissingDeprecatedAnnotation = Internal + <NUM_LIT> ; int TypeMissingDeprecatedAnnotation = Internal + <NUM_LIT> ; int UnhandledWarningToken = Internal + <NUM_LIT> ; int AnnotationValueMustBeArrayInitializer = Internal + <NUM_LIT> ; int AnnotationValueMustBeAnEnumConstant = Internal + <NUM_LIT> ; int MethodMustOverrideOrImplement = MethodRelated + <NUM_LIT> ; int UnusedWarningToken = Internal + <NUM_LIT> ; int MissingOverrideAnnotationForInterfaceMethodImplementation = MethodRelated + <NUM_LIT> ; int UnusedTypeArgumentsForConstructorInvocation = MethodRelated + <NUM_LIT> ; int CorruptedSignature = Internal + <NUM_LIT> ; int InvalidEncoding = Internal + <NUM_LIT> ; int CannotReadSource = Internal + <NUM_LIT> ; int BoxingConversion = Internal + <NUM_LIT> ; int UnboxingConversion = Internal + <NUM_LIT> ; int IllegalModifierForEnum = TypeRelated + <NUM_LIT> ; int IllegalModifierForEnumConstant = FieldRelated + <NUM_LIT> ; int IllegalModifierForLocalEnum = TypeRelated + <NUM_LIT> ; int IllegalModifierForMemberEnum = TypeRelated + <NUM_LIT> ; int CannotDeclareEnumSpecialMethod = MethodRelated + <NUM_LIT> ; int IllegalQualifiedEnumConstantLabel = FieldRelated + <NUM_LIT> ; int CannotExtendEnum = TypeRelated + <NUM_LIT> ; int CannotInvokeSuperConstructorInEnum = MethodRelated + <NUM_LIT> ; int EnumAbstractMethodMustBeImplemented = MethodRelated + <NUM_LIT> ; int EnumSwitchCannotTargetField = FieldRelated + <NUM_LIT> ; int IllegalModifierForEnumConstructor = MethodRelated + <NUM_LIT> ; int MissingEnumConstantCase = FieldRelated + <NUM_LIT> ; int EnumStaticFieldInInInitializerContext = FieldRelated + <NUM_LIT> ; int EnumConstantMustImplementAbstractMethod = MethodRelated + <NUM_LIT> ; int EnumConstantCannotDefineAbstractMethod = MethodRelated + <NUM_LIT> ; int AbstractMethodInEnum = MethodRelated + <NUM_LIT> ; int IllegalExtendedDimensionsForVarArgs = Syntax + Internal + <NUM_LIT> ; int MethodVarargsArgumentNeedCast = MethodRelated + <NUM_LIT> ; int ConstructorVarargsArgumentNeedCast = ConstructorRelated + <NUM_LIT> ; int VarargsConflict = MethodRelated + <NUM_LIT> ; int JavadocGenericMethodTypeArgumentMismatch = Javadoc + Internal + <NUM_LIT> ; int JavadocNonGenericMethod = Javadoc + Internal + <NUM_LIT> ; int JavadocIncorrectArityForParameterizedMethod = Javadoc + Internal + <NUM_LIT> ; int JavadocParameterizedMethodArgumentTypeMismatch = Javadoc + Internal + <NUM_LIT> ; int JavadocTypeArgumentsForRawGenericMethod = Javadoc + Internal + <NUM_LIT> ; int JavadocGenericConstructorTypeArgumentMismatch = Javadoc + Internal + <NUM_LIT> ; int JavadocNonGenericConstructor = Javadoc + Internal + <NUM_LIT> ; int JavadocIncorrectArityForParameterizedConstructor = Javadoc + Internal + <NUM_LIT> ; int JavadocParameterizedConstructorArgumentTypeMismatch = Javadoc + Internal + <NUM_LIT> ; int JavadocTypeArgumentsForRawGenericConstructor = Javadoc + Internal + <NUM_LIT> ; int ExternalProblemNotFixable = <NUM_LIT> ; int ExternalProblemFixable = <NUM_LIT> ; } </s>
<s> package org . eclipse . jdt . core . compiler ; public class InvalidInputException extends Exception { private static final long serialVersionUID = <NUM_LIT> ; public InvalidInputException ( ) { super ( ) ; } public InvalidInputException ( String message ) { super ( message ) ; } } </s>
<s> package org . eclipse . jdt . core . compiler ; import org . eclipse . jdt . core . compiler . batch . BatchCompiler ; public abstract class CompilationProgress { public abstract void begin ( int remainingWork ) ; public abstract void done ( ) ; public abstract boolean isCanceled ( ) ; public abstract void setTaskName ( String name ) ; public abstract void worked ( int workIncrement , int remainingWork ) ; } </s>
<s> package org . eclipse . jdt . core . compiler ; import org . eclipse . jdt . internal . compiler . problem . DefaultProblem ; public abstract class CategorizedProblem implements IProblem { public static final int CAT_UNSPECIFIED = <NUM_LIT:0> ; public static final int CAT_BUILDPATH = <NUM_LIT:10> ; public static final int CAT_SYNTAX = <NUM_LIT:20> ; public static final int CAT_IMPORT = <NUM_LIT:30> ; public static final int CAT_TYPE = <NUM_LIT> ; public static final int CAT_MEMBER = <NUM_LIT> ; public static final int CAT_INTERNAL = <NUM_LIT> ; public static final int CAT_JAVADOC = <NUM_LIT> ; public static final int CAT_CODE_STYLE = <NUM_LIT> ; public static final int CAT_POTENTIAL_PROGRAMMING_PROBLEM = <NUM_LIT> ; public static final int CAT_NAME_SHADOWING_CONFLICT = <NUM_LIT:100> ; public static final int CAT_DEPRECATION = <NUM_LIT> ; public static final int CAT_UNNECESSARY_CODE = <NUM_LIT> ; public static final int CAT_UNCHECKED_RAW = <NUM_LIT> ; public static final int CAT_NLS = <NUM_LIT> ; public static final int CAT_RESTRICTION = <NUM_LIT> ; public abstract int getCategoryID ( ) ; public abstract String getMarkerType ( ) ; public String [ ] getExtraMarkerAttributeNames ( ) { return CharOperation . NO_STRINGS ; } public Object [ ] getExtraMarkerAttributeValues ( ) { return DefaultProblem . EMPTY_VALUES ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . codegen ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ClassFile ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . lookup . TagBits ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . TypeConstants ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; import org . eclipse . jdt . internal . compiler . util . HashtableOfObject ; import org . eclipse . jdt . internal . compiler . util . Util ; public class ConstantPool implements ClassFileConstants , TypeIds { public static final int DOUBLE_INITIAL_SIZE = <NUM_LIT:5> ; public static final int FLOAT_INITIAL_SIZE = <NUM_LIT:3> ; public static final int INT_INITIAL_SIZE = <NUM_LIT> ; public static final int LONG_INITIAL_SIZE = <NUM_LIT:5> ; public static final int UTF8_INITIAL_SIZE = <NUM_LIT> ; public static final int STRING_INITIAL_SIZE = <NUM_LIT> ; public static final int METHODS_AND_FIELDS_INITIAL_SIZE = <NUM_LIT> ; public static final int CLASS_INITIAL_SIZE = <NUM_LIT> ; public static final int NAMEANDTYPE_INITIAL_SIZE = <NUM_LIT> ; public static final int CONSTANTPOOL_INITIAL_SIZE = <NUM_LIT> ; public static final int CONSTANTPOOL_GROW_SIZE = <NUM_LIT> ; protected DoubleCache doubleCache ; protected FloatCache floatCache ; protected IntegerCache intCache ; protected LongCache longCache ; public CharArrayCache UTF8Cache ; protected CharArrayCache stringCache ; protected HashtableOfObject methodsAndFieldsCache ; protected CharArrayCache classCache ; protected HashtableOfObject nameAndTypeCacheForFieldsAndMethods ; public byte [ ] poolContent ; public int currentIndex = <NUM_LIT:1> ; public int currentOffset ; public int [ ] offsets ; public ClassFile classFile ; public static final char [ ] Append = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ARRAY_NEWINSTANCE_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ARRAY_NEWINSTANCE_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ArrayCopy = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ArrayCopySignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ArrayJavaLangClassConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ArrayJavaLangObjectConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] booleanBooleanSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] BooleanConstrSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] BOOLEANVALUE_BOOLEAN_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] BOOLEANVALUE_BOOLEAN_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] byteByteSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ByteConstrSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] BYTEVALUE_BYTE_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] BYTEVALUE_BYTE_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] charCharacterSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] CharConstrSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] CHARVALUE_CHARACTER_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] CHARVALUE_CHARACTER_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] Clinit = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] DefaultConstructorSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ClinitSignature = DefaultConstructorSignature ; public static final char [ ] DesiredAssertionStatus = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] DesiredAssertionStatusSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] DoubleConstrSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] doubleDoubleSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] DOUBLEVALUE_DOUBLE_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] DOUBLEVALUE_DOUBLE_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] Exit = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ExitIntSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] FloatConstrSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] floatFloatSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] FLOATVALUE_FLOAT_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] FLOATVALUE_FLOAT_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ForName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ForNameSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_BOOLEAN_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_BOOLEAN_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_BYTE_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_BYTE_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_CHAR_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_CHAR_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_DOUBLE_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_DOUBLE_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_FLOAT_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_FLOAT_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_INT_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_INT_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_LONG_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_LONG_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_OBJECT_METHOD_NAME = "<STR_LIT:get>" . toCharArray ( ) ; public static final char [ ] GET_OBJECT_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_SHORT_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_SHORT_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GetClass = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GetClassSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GetComponentType = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GetComponentTypeSignature = GetClassSignature ; public static final char [ ] GetConstructor = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GetConstructorSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GETDECLAREDCONSTRUCTOR_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GETDECLAREDCONSTRUCTOR_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GETDECLAREDFIELD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GETDECLAREDFIELD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GETDECLAREDMETHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GETDECLAREDMETHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GetMessage = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GetMessageSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] HasNext = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] HasNextSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] Init = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] IntConstrSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ITERATOR_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ITERATOR_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] Intern = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] InternSignature = GetMessageSignature ; public static final char [ ] IntIntegerSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] INTVALUE_INTEGER_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] INTVALUE_INTEGER_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] INVOKE_METHOD_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] INVOKE_METHOD_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] [ ] JAVA_LANG_REFLECT_ACCESSIBLEOBJECT = new char [ ] [ ] { TypeConstants . JAVA , TypeConstants . LANG , TypeConstants . REFLECT , "<STR_LIT>" . toCharArray ( ) } ; public static final char [ ] [ ] JAVA_LANG_REFLECT_ARRAY = new char [ ] [ ] { TypeConstants . JAVA , TypeConstants . LANG , TypeConstants . REFLECT , "<STR_LIT>" . toCharArray ( ) } ; public static final char [ ] JavaIoPrintStreamSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangAssertionErrorConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangBooleanConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangByteConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangCharacterConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangClassConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangClassNotFoundExceptionConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangClassSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangDoubleConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangEnumConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangErrorConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangExceptionConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangFloatConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangIntegerConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangLongConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangNoClassDefFoundErrorConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangNoSuchFieldErrorConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangObjectConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVALANGREFLECTACCESSIBLEOBJECT_CONSTANTPOOLNAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVALANGREFLECTARRAY_CONSTANTPOOLNAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangReflectConstructorConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangReflectConstructorNewInstanceSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVALANGREFLECTFIELD_CONSTANTPOOLNAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVALANGREFLECTMETHOD_CONSTANTPOOLNAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangShortConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangStringBufferConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangStringBuilderConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangStringConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangStringSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangObjectSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangSystemConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangThrowableConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangVoidConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaUtilIteratorConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] LongConstrSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] longLongSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] LONGVALUE_LONG_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] LONGVALUE_LONG_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] NewInstance = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] NewInstanceSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] Next = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] NextSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ObjectConstrSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ObjectSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] Ordinal = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] OrdinalSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] Out = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_BOOLEAN_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_BOOLEAN_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_BYTE_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_BYTE_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_CHAR_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_CHAR_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_DOUBLE_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_DOUBLE_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_FLOAT_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_FLOAT_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_INT_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_INT_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_LONG_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_LONG_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_OBJECT_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_OBJECT_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_SHORT_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_SHORT_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SETACCESSIBLE_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SETACCESSIBLE_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ShortConstrSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] shortShortSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SHORTVALUE_SHORT_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SHORTVALUE_SHORT_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBufferAppendBooleanSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBufferAppendCharSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBufferAppendDoubleSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBufferAppendFloatSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBufferAppendIntSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBufferAppendLongSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBufferAppendObjectSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBufferAppendStringSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendBooleanSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendCharSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendDoubleSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendFloatSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendIntSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendLongSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendObjectSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendStringSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringConstructorSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] This = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ToString = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ToStringSignature = GetMessageSignature ; public static final char [ ] TYPE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ValueOf = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ValueOfBooleanSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ValueOfCharSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ValueOfDoubleSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ValueOfFloatSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ValueOfIntSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ValueOfLongSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ValueOfObjectSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ValueOfStringClassSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVA_LANG_ANNOTATION_DOCUMENTED = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVA_LANG_ANNOTATION_ELEMENTTYPE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVA_LANG_ANNOTATION_RETENTION = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVA_LANG_ANNOTATION_RETENTIONPOLICY = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVA_LANG_ANNOTATION_TARGET = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVA_LANG_DEPRECATED = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVA_LANG_ANNOTATION_INHERITED = "<STR_LIT>" . toCharArray ( ) ; public ConstantPool ( ClassFile classFile ) { this . UTF8Cache = new CharArrayCache ( UTF8_INITIAL_SIZE ) ; this . stringCache = new CharArrayCache ( STRING_INITIAL_SIZE ) ; this . methodsAndFieldsCache = new HashtableOfObject ( METHODS_AND_FIELDS_INITIAL_SIZE ) ; this . classCache = new CharArrayCache ( CLASS_INITIAL_SIZE ) ; this . nameAndTypeCacheForFieldsAndMethods = new HashtableOfObject ( NAMEANDTYPE_INITIAL_SIZE ) ; this . offsets = new int [ <NUM_LIT:5> ] ; initialize ( classFile ) ; } public void initialize ( ClassFile givenClassFile ) { this . poolContent = givenClassFile . header ; this . currentOffset = givenClassFile . headerOffset ; this . currentIndex = <NUM_LIT:1> ; this . classFile = givenClassFile ; } public byte [ ] dumpBytes ( ) { System . arraycopy ( this . poolContent , <NUM_LIT:0> , ( this . poolContent = new byte [ this . currentOffset ] ) , <NUM_LIT:0> , this . currentOffset ) ; return this . poolContent ; } public int literalIndex ( byte [ ] utf8encoding , char [ ] stringCharArray ) { int index ; if ( ( index = this . UTF8Cache . putIfAbsent ( stringCharArray , this . currentIndex ) ) < <NUM_LIT:0> ) { if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } this . currentIndex ++ ; int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( Utf8Tag ) ; int utf8encodingLength = utf8encoding . length ; if ( this . currentOffset + <NUM_LIT:2> + utf8encodingLength >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:2> + utf8encodingLength ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) ( utf8encodingLength > > <NUM_LIT:8> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) utf8encodingLength ; System . arraycopy ( utf8encoding , <NUM_LIT:0> , this . poolContent , this . currentOffset , utf8encodingLength ) ; this . currentOffset += utf8encodingLength ; } return index ; } public int literalIndex ( TypeBinding binding ) { TypeBinding typeBinding = binding . leafComponentType ( ) ; if ( ( typeBinding . tagBits & TagBits . ContainsNestedTypeReferences ) != <NUM_LIT:0> ) { Util . recordNestedType ( this . classFile , typeBinding ) ; } return literalIndex ( binding . signature ( ) ) ; } public int literalIndex ( char [ ] utf8Constant ) { int index ; if ( ( index = this . UTF8Cache . putIfAbsent ( utf8Constant , this . currentIndex ) ) < <NUM_LIT:0> ) { if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( Utf8Tag ) ; int savedCurrentOffset = this . currentOffset ; if ( this . currentOffset + <NUM_LIT:2> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:2> ) ; } this . currentOffset += <NUM_LIT:2> ; length = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < utf8Constant . length ; i ++ ) { char current = utf8Constant [ i ] ; if ( ( current >= <NUM_LIT> ) && ( current <= <NUM_LIT> ) ) { writeU1 ( current ) ; length ++ ; } else { if ( current > <NUM_LIT> ) { length += <NUM_LIT:3> ; writeU1 ( <NUM_LIT> | ( ( current > > <NUM_LIT:12> ) & <NUM_LIT> ) ) ; writeU1 ( <NUM_LIT> | ( ( current > > <NUM_LIT:6> ) & <NUM_LIT> ) ) ; writeU1 ( <NUM_LIT> | ( current & <NUM_LIT> ) ) ; } else { length += <NUM_LIT:2> ; writeU1 ( <NUM_LIT> | ( ( current > > <NUM_LIT:6> ) & <NUM_LIT> ) ) ; writeU1 ( <NUM_LIT> | ( current & <NUM_LIT> ) ) ; } } } if ( length >= <NUM_LIT> ) { this . currentOffset = savedCurrentOffset - <NUM_LIT:1> ; this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceForConstant ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } if ( index > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } this . currentIndex ++ ; this . poolContent [ savedCurrentOffset ] = ( byte ) ( length > > <NUM_LIT:8> ) ; this . poolContent [ savedCurrentOffset + <NUM_LIT:1> ] = ( byte ) length ; } return index ; } public int literalIndex ( char [ ] stringCharArray , byte [ ] utf8encoding ) { int index ; if ( ( index = this . stringCache . putIfAbsent ( stringCharArray , this . currentIndex ) ) < <NUM_LIT:0> ) { this . currentIndex ++ ; if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( StringTag ) ; int stringIndexOffset = this . currentOffset ; if ( this . currentOffset + <NUM_LIT:2> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:2> ) ; } this . currentOffset += <NUM_LIT:2> ; final int stringIndex = literalIndex ( utf8encoding , stringCharArray ) ; this . poolContent [ stringIndexOffset ++ ] = ( byte ) ( stringIndex > > <NUM_LIT:8> ) ; this . poolContent [ stringIndexOffset ] = ( byte ) stringIndex ; } return index ; } public int literalIndex ( double key ) { int index ; if ( this . doubleCache == null ) { this . doubleCache = new DoubleCache ( DOUBLE_INITIAL_SIZE ) ; } if ( ( index = this . doubleCache . putIfAbsent ( key , this . currentIndex ) ) < <NUM_LIT:0> ) { if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } this . currentIndex += <NUM_LIT:2> ; int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( DoubleTag ) ; long temp = java . lang . Double . doubleToLongBits ( key ) ; length = this . poolContent . length ; if ( this . currentOffset + <NUM_LIT:8> >= length ) { resizePoolContents ( <NUM_LIT:8> ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp > > > <NUM_LIT> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp > > > <NUM_LIT> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp > > > <NUM_LIT> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp > > > <NUM_LIT:32> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp > > > <NUM_LIT:24> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp > > > <NUM_LIT:16> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp > > > <NUM_LIT:8> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) temp ; } return index ; } public int literalIndex ( float key ) { int index ; if ( this . floatCache == null ) { this . floatCache = new FloatCache ( FLOAT_INITIAL_SIZE ) ; } if ( ( index = this . floatCache . putIfAbsent ( key , this . currentIndex ) ) < <NUM_LIT:0> ) { if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } this . currentIndex ++ ; int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( FloatTag ) ; int temp = java . lang . Float . floatToIntBits ( key ) ; if ( this . currentOffset + <NUM_LIT:4> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:4> ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp > > > <NUM_LIT:24> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp > > > <NUM_LIT:16> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp > > > <NUM_LIT:8> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) temp ; } return index ; } public int literalIndex ( int key ) { int index ; if ( this . intCache == null ) { this . intCache = new IntegerCache ( INT_INITIAL_SIZE ) ; } if ( ( index = this . intCache . putIfAbsent ( key , this . currentIndex ) ) < <NUM_LIT:0> ) { this . currentIndex ++ ; if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( IntegerTag ) ; if ( this . currentOffset + <NUM_LIT:4> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:4> ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key > > > <NUM_LIT:24> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key > > > <NUM_LIT:16> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key > > > <NUM_LIT:8> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) key ; } return index ; } public int literalIndex ( long key ) { int index ; if ( this . longCache == null ) { this . longCache = new LongCache ( LONG_INITIAL_SIZE ) ; } if ( ( index = this . longCache . putIfAbsent ( key , this . currentIndex ) ) < <NUM_LIT:0> ) { if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } this . currentIndex += <NUM_LIT:2> ; int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( LongTag ) ; if ( this . currentOffset + <NUM_LIT:8> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:8> ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key > > > <NUM_LIT> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key > > > <NUM_LIT> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key > > > <NUM_LIT> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key > > > <NUM_LIT:32> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key > > > <NUM_LIT:24> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key > > > <NUM_LIT:16> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key > > > <NUM_LIT:8> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) key ; } return index ; } public int literalIndex ( String stringConstant ) { int index ; char [ ] stringCharArray = stringConstant . toCharArray ( ) ; if ( ( index = this . stringCache . putIfAbsent ( stringCharArray , this . currentIndex ) ) < <NUM_LIT:0> ) { this . currentIndex ++ ; if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( StringTag ) ; int stringIndexOffset = this . currentOffset ; if ( this . currentOffset + <NUM_LIT:2> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:2> ) ; } this . currentOffset += <NUM_LIT:2> ; final int stringIndex = literalIndex ( stringCharArray ) ; this . poolContent [ stringIndexOffset ++ ] = ( byte ) ( stringIndex > > <NUM_LIT:8> ) ; this . poolContent [ stringIndexOffset ] = ( byte ) stringIndex ; } return index ; } public int literalIndexForType ( final char [ ] constantPoolName ) { int index ; if ( ( index = this . classCache . putIfAbsent ( constantPoolName , this . currentIndex ) ) < <NUM_LIT:0> ) { this . currentIndex ++ ; if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( ClassTag ) ; int nameIndexOffset = this . currentOffset ; if ( this . currentOffset + <NUM_LIT:2> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:2> ) ; } this . currentOffset += <NUM_LIT:2> ; final int nameIndex = literalIndex ( constantPoolName ) ; this . poolContent [ nameIndexOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . poolContent [ nameIndexOffset ] = ( byte ) nameIndex ; } return index ; } public int literalIndexForType ( final TypeBinding binding ) { TypeBinding typeBinding = binding . leafComponentType ( ) ; if ( ( typeBinding . tagBits & TagBits . ContainsNestedTypeReferences ) != <NUM_LIT:0> ) { Util . recordNestedType ( this . classFile , typeBinding ) ; } return this . literalIndexForType ( binding . constantPoolName ( ) ) ; } public int literalIndexForMethod ( char [ ] declaringClass , char [ ] selector , char [ ] signature , boolean isInterface ) { int index ; if ( ( index = putInCacheIfAbsent ( declaringClass , selector , signature , this . currentIndex ) ) < <NUM_LIT:0> ) { this . currentIndex ++ ; if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( isInterface ? InterfaceMethodRefTag : MethodRefTag ) ; int classIndexOffset = this . currentOffset ; if ( this . currentOffset + <NUM_LIT:4> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:4> ) ; } this . currentOffset += <NUM_LIT:4> ; final int classIndex = literalIndexForType ( declaringClass ) ; final int nameAndTypeIndex = literalIndexForNameAndType ( selector , signature ) ; this . poolContent [ classIndexOffset ++ ] = ( byte ) ( classIndex > > <NUM_LIT:8> ) ; this . poolContent [ classIndexOffset ++ ] = ( byte ) classIndex ; this . poolContent [ classIndexOffset ++ ] = ( byte ) ( nameAndTypeIndex > > <NUM_LIT:8> ) ; this . poolContent [ classIndexOffset ] = ( byte ) nameAndTypeIndex ; } return index ; } public int literalIndexForMethod ( TypeBinding declaringClass , char [ ] selector , char [ ] signature , boolean isInterface ) { if ( ( declaringClass . tagBits & TagBits . ContainsNestedTypeReferences ) != <NUM_LIT:0> ) { Util . recordNestedType ( this . classFile , declaringClass ) ; } return this . literalIndexForMethod ( declaringClass . constantPoolName ( ) , selector , signature , isInterface ) ; } public int literalIndexForNameAndType ( char [ ] name , char [ ] signature ) { int index ; if ( ( index = putInNameAndTypeCacheIfAbsent ( name , signature , this . currentIndex ) ) < <NUM_LIT:0> ) { this . currentIndex ++ ; if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( NameAndTypeTag ) ; int nameIndexOffset = this . currentOffset ; if ( this . currentOffset + <NUM_LIT:4> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:4> ) ; } this . currentOffset += <NUM_LIT:4> ; final int nameIndex = literalIndex ( name ) ; final int typeIndex = literalIndex ( signature ) ; this . poolContent [ nameIndexOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . poolContent [ nameIndexOffset ++ ] = ( byte ) nameIndex ; this . poolContent [ nameIndexOffset ++ ] = ( byte ) ( typeIndex > > <NUM_LIT:8> ) ; this . poolContent [ nameIndexOffset ] = ( byte ) typeIndex ; } return index ; } public int literalIndexForField ( char [ ] declaringClass , char [ ] name , char [ ] signature ) { int index ; if ( ( index = putInCacheIfAbsent ( declaringClass , name , signature , this . currentIndex ) ) < <NUM_LIT:0> ) { this . currentIndex ++ ; if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( FieldRefTag ) ; int classIndexOffset = this . currentOffset ; if ( this . currentOffset + <NUM_LIT:4> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:4> ) ; } this . currentOffset += <NUM_LIT:4> ; final int classIndex = literalIndexForType ( declaringClass ) ; final int nameAndTypeIndex = literalIndexForNameAndType ( name , signature ) ; this . poolContent [ classIndexOffset ++ ] = ( byte ) ( classIndex > > <NUM_LIT:8> ) ; this . poolContent [ classIndexOffset ++ ] = ( byte ) classIndex ; this . poolContent [ classIndexOffset ++ ] = ( byte ) ( nameAndTypeIndex > > <NUM_LIT:8> ) ; this . poolContent [ classIndexOffset ] = ( byte ) nameAndTypeIndex ; } return index ; } public int literalIndexForLdc ( char [ ] stringCharArray ) { int savedCurrentIndex = this . currentIndex ; int savedCurrentOffset = this . currentOffset ; int index ; if ( ( index = this . stringCache . putIfAbsent ( stringCharArray , this . currentIndex ) ) < <NUM_LIT:0> ) { if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } this . currentIndex ++ ; int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( StringTag ) ; int stringIndexOffset = this . currentOffset ; if ( this . currentOffset + <NUM_LIT:2> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:2> ) ; } this . currentOffset += <NUM_LIT:2> ; int stringIndex ; if ( ( stringIndex = this . UTF8Cache . putIfAbsent ( stringCharArray , this . currentIndex ) ) < <NUM_LIT:0> ) { if ( ( stringIndex = - stringIndex ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } this . currentIndex ++ ; length = this . offsets . length ; if ( length <= stringIndex ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ stringIndex * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ stringIndex ] = this . currentOffset ; writeU1 ( Utf8Tag ) ; int lengthOffset = this . currentOffset ; if ( this . currentOffset + <NUM_LIT:2> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:2> ) ; } this . currentOffset += <NUM_LIT:2> ; length = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < stringCharArray . length ; i ++ ) { char current = stringCharArray [ i ] ; if ( ( current >= <NUM_LIT> ) && ( current <= <NUM_LIT> ) ) { length ++ ; if ( this . currentOffset + <NUM_LIT:1> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:1> ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) ( current ) ; } else if ( current > <NUM_LIT> ) { length += <NUM_LIT:3> ; if ( this . currentOffset + <NUM_LIT:3> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:3> ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) ( <NUM_LIT> | ( ( current > > <NUM_LIT:12> ) & <NUM_LIT> ) ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( <NUM_LIT> | ( ( current > > <NUM_LIT:6> ) & <NUM_LIT> ) ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( <NUM_LIT> | ( current & <NUM_LIT> ) ) ; } else { if ( this . currentOffset + <NUM_LIT:2> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:2> ) ; } length += <NUM_LIT:2> ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( <NUM_LIT> | ( ( current > > <NUM_LIT:6> ) & <NUM_LIT> ) ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( <NUM_LIT> | ( current & <NUM_LIT> ) ) ; } } if ( length >= <NUM_LIT> ) { this . currentOffset = savedCurrentOffset ; this . currentIndex = savedCurrentIndex ; this . stringCache . remove ( stringCharArray ) ; this . UTF8Cache . remove ( stringCharArray ) ; return <NUM_LIT:0> ; } this . poolContent [ lengthOffset ++ ] = ( byte ) ( length > > <NUM_LIT:8> ) ; this . poolContent [ lengthOffset ] = ( byte ) length ; } this . poolContent [ stringIndexOffset ++ ] = ( byte ) ( stringIndex > > <NUM_LIT:8> ) ; this . poolContent [ stringIndexOffset ] = ( byte ) stringIndex ; } return index ; } private int putInNameAndTypeCacheIfAbsent ( final char [ ] key1 , final char [ ] key2 , int value ) { int index ; Object key1Value = this . nameAndTypeCacheForFieldsAndMethods . get ( key1 ) ; if ( key1Value == null ) { CachedIndexEntry cachedIndexEntry = new CachedIndexEntry ( key2 , value ) ; index = - value ; this . nameAndTypeCacheForFieldsAndMethods . put ( key1 , cachedIndexEntry ) ; } else if ( key1Value instanceof CachedIndexEntry ) { CachedIndexEntry entry = ( CachedIndexEntry ) key1Value ; if ( CharOperation . equals ( key2 , entry . signature ) ) { index = entry . index ; } else { CharArrayCache charArrayCache = new CharArrayCache ( ) ; charArrayCache . putIfAbsent ( entry . signature , entry . index ) ; index = charArrayCache . putIfAbsent ( key2 , value ) ; this . nameAndTypeCacheForFieldsAndMethods . put ( key1 , charArrayCache ) ; } } else { CharArrayCache charArrayCache = ( CharArrayCache ) key1Value ; index = charArrayCache . putIfAbsent ( key2 , value ) ; } return index ; } private int putInCacheIfAbsent ( final char [ ] key1 , final char [ ] key2 , final char [ ] key3 , int value ) { int index ; HashtableOfObject key1Value = ( HashtableOfObject ) this . methodsAndFieldsCache . get ( key1 ) ; if ( key1Value == null ) { key1Value = new HashtableOfObject ( ) ; this . methodsAndFieldsCache . put ( key1 , key1Value ) ; CachedIndexEntry cachedIndexEntry = new CachedIndexEntry ( key3 , value ) ; index = - value ; key1Value . put ( key2 , cachedIndexEntry ) ; } else { Object key2Value = key1Value . get ( key2 ) ; if ( key2Value == null ) { CachedIndexEntry cachedIndexEntry = new CachedIndexEntry ( key3 , value ) ; index = - value ; key1Value . put ( key2 , cachedIndexEntry ) ; } else if ( key2Value instanceof CachedIndexEntry ) { CachedIndexEntry entry = ( CachedIndexEntry ) key2Value ; if ( CharOperation . equals ( key3 , entry . signature ) ) { index = entry . index ; } else { CharArrayCache charArrayCache = new CharArrayCache ( ) ; charArrayCache . putIfAbsent ( entry . signature , entry . index ) ; index = charArrayCache . putIfAbsent ( key3 , value ) ; key1Value . put ( key2 , charArrayCache ) ; } } else { CharArrayCache charArrayCache = ( CharArrayCache ) key2Value ; index = charArrayCache . putIfAbsent ( key3 , value ) ; } } return index ; } public void resetForClinit ( int constantPoolIndex , int constantPoolOffset ) { this . currentIndex = constantPoolIndex ; this . currentOffset = constantPoolOffset ; if ( this . UTF8Cache . get ( AttributeNamesConstants . CodeName ) >= constantPoolIndex ) { this . UTF8Cache . remove ( AttributeNamesConstants . CodeName ) ; } if ( this . UTF8Cache . get ( ConstantPool . ClinitSignature ) >= constantPoolIndex ) { this . UTF8Cache . remove ( ConstantPool . ClinitSignature ) ; } if ( this . UTF8Cache . get ( ConstantPool . Clinit ) >= constantPoolIndex ) { this . UTF8Cache . remove ( ConstantPool . Clinit ) ; } } private final void resizePoolContents ( int minimalSize ) { int length = this . poolContent . length ; int toAdd = length ; if ( toAdd < minimalSize ) toAdd = minimalSize ; System . arraycopy ( this . poolContent , <NUM_LIT:0> , this . poolContent = new byte [ length + toAdd ] , <NUM_LIT:0> , length ) ; } protected final void writeU1 ( int value ) { if ( this . currentOffset + <NUM_LIT:1> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:1> ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) value ; } protected final void writeU2 ( int value ) { if ( this . currentOffset + <NUM_LIT:2> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:2> ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) ( value > > > <NUM_LIT:8> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) value ; } public void reset ( ) { if ( this . doubleCache != null ) this . doubleCache . clear ( ) ; if ( this . floatCache != null ) this . floatCache . clear ( ) ; if ( this . intCache != null ) this . intCache . clear ( ) ; if ( this . longCache != null ) this . longCache . clear ( ) ; this . UTF8Cache . clear ( ) ; this . stringCache . clear ( ) ; this . methodsAndFieldsCache . clear ( ) ; this . classCache . clear ( ) ; this . nameAndTypeCacheForFieldsAndMethods . clear ( ) ; this . currentIndex = <NUM_LIT:1> ; this . currentOffset = <NUM_LIT:0> ; } public void resetForAttributeName ( char [ ] attributeName , int constantPoolIndex , int constantPoolOffset ) { this . currentIndex = constantPoolIndex ; this . currentOffset = constantPoolOffset ; if ( this . UTF8Cache . get ( attributeName ) >= constantPoolIndex ) { this . UTF8Cache . remove ( attributeName ) ; } } } </s>
<s> package org . eclipse . jdt . internal . compiler . codegen ; public class DoubleCache { private double keyTable [ ] ; private int valueTable [ ] ; private int elementSize ; public DoubleCache ( ) { this ( <NUM_LIT> ) ; } public DoubleCache ( int initialCapacity ) { this . elementSize = <NUM_LIT:0> ; this . keyTable = new double [ initialCapacity ] ; this . valueTable = new int [ initialCapacity ] ; } public void clear ( ) { for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) { this . keyTable [ i ] = <NUM_LIT:0.0> ; this . valueTable [ i ] = <NUM_LIT:0> ; } this . elementSize = <NUM_LIT:0> ; } public boolean containsKey ( double key ) { if ( key == <NUM_LIT:0.0> ) { for ( int i = <NUM_LIT:0> , max = this . elementSize ; i < max ; i ++ ) { if ( this . keyTable [ i ] == <NUM_LIT:0.0> ) { long value1 = Double . doubleToLongBits ( key ) ; long value2 = Double . doubleToLongBits ( this . keyTable [ i ] ) ; if ( value1 == - <NUM_LIT> && value2 == - <NUM_LIT> ) return true ; if ( value1 == <NUM_LIT:0> && value2 == <NUM_LIT:0> ) return true ; } } } else { for ( int i = <NUM_LIT:0> , max = this . elementSize ; i < max ; i ++ ) { if ( this . keyTable [ i ] == key ) { return true ; } } } return false ; } public int put ( double key , int value ) { if ( this . elementSize == this . keyTable . length ) { System . arraycopy ( this . keyTable , <NUM_LIT:0> , ( this . keyTable = new double [ this . elementSize * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . elementSize ) ; System . arraycopy ( this . valueTable , <NUM_LIT:0> , ( this . valueTable = new int [ this . elementSize * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . elementSize ) ; } this . keyTable [ this . elementSize ] = key ; this . valueTable [ this . elementSize ] = value ; this . elementSize ++ ; return value ; } public int putIfAbsent ( double key , int value ) { if ( key == <NUM_LIT:0.0> ) { for ( int i = <NUM_LIT:0> , max = this . elementSize ; i < max ; i ++ ) { if ( this . keyTable [ i ] == <NUM_LIT:0.0> ) { long value1 = Double . doubleToLongBits ( key ) ; long value2 = Double . doubleToLongBits ( this . keyTable [ i ] ) ; if ( value1 == - <NUM_LIT> && value2 == - <NUM_LIT> ) return this . valueTable [ i ] ; if ( value1 == <NUM_LIT:0> && value2 == <NUM_LIT:0> ) return this . valueTable [ i ] ; } } } else { for ( int i = <NUM_LIT:0> , max = this . elementSize ; i < max ; i ++ ) { if ( this . keyTable [ i ] == key ) { return this . valueTable [ i ] ; } } } if ( this . elementSize == this . keyTable . length ) { System . arraycopy ( this . keyTable , <NUM_LIT:0> , ( this . keyTable = new double [ this . elementSize * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . elementSize ) ; System . arraycopy ( this . valueTable , <NUM_LIT:0> , ( this . valueTable = new int [ this . elementSize * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . elementSize ) ; } this . keyTable [ this . elementSize ] = key ; this . valueTable [ this . elementSize ] = value ; this . elementSize ++ ; return - value ; } public String toString ( ) { int max = this . elementSize ; StringBuffer buf = new StringBuffer ( ) ; buf . append ( "<STR_LIT:{>" ) ; for ( int i = <NUM_LIT:0> ; i < max ; ++ i ) { if ( ( this . keyTable [ i ] != <NUM_LIT:0> ) || ( ( this . keyTable [ i ] == <NUM_LIT:0> ) && ( this . valueTable [ i ] != <NUM_LIT:0> ) ) ) { buf . append ( this . keyTable [ i ] ) . append ( "<STR_LIT>" ) . append ( this . valueTable [ i ] ) ; } if ( i < max ) { buf . append ( "<STR_LIT:U+002CU+0020>" ) ; } } buf . append ( "<STR_LIT:}>" ) ; return buf . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . codegen ; public class IntegerCache { public int keyTable [ ] ; public int valueTable [ ] ; int elementSize ; int threshold ; public IntegerCache ( ) { this ( <NUM_LIT> ) ; } public IntegerCache ( int initialCapacity ) { this . elementSize = <NUM_LIT:0> ; this . threshold = ( int ) ( initialCapacity * <NUM_LIT> ) ; this . keyTable = new int [ initialCapacity ] ; this . valueTable = new int [ initialCapacity ] ; } public void clear ( ) { for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) { this . keyTable [ i ] = <NUM_LIT:0> ; this . valueTable [ i ] = <NUM_LIT:0> ; } this . elementSize = <NUM_LIT:0> ; } public boolean containsKey ( int key ) { int index = hash ( key ) , length = this . keyTable . length ; while ( ( this . keyTable [ index ] != <NUM_LIT:0> ) || ( ( this . keyTable [ index ] == <NUM_LIT:0> ) && ( this . valueTable [ index ] != <NUM_LIT:0> ) ) ) { if ( this . keyTable [ index ] == key ) return true ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return false ; } public int hash ( int key ) { return ( key & <NUM_LIT> ) % this . keyTable . length ; } public int put ( int key , int value ) { int index = hash ( key ) , length = this . keyTable . length ; while ( ( this . keyTable [ index ] != <NUM_LIT:0> ) || ( ( this . keyTable [ index ] == <NUM_LIT:0> ) && ( this . valueTable [ index ] != <NUM_LIT:0> ) ) ) { if ( this . keyTable [ index ] == key ) return this . valueTable [ index ] = value ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } this . keyTable [ index ] = key ; this . valueTable [ index ] = value ; if ( ++ this . elementSize > this . threshold ) { rehash ( ) ; } return value ; } public int putIfAbsent ( int key , int value ) { int index = hash ( key ) , length = this . keyTable . length ; while ( ( this . keyTable [ index ] != <NUM_LIT:0> ) || ( ( this . keyTable [ index ] == <NUM_LIT:0> ) && ( this . valueTable [ index ] != <NUM_LIT:0> ) ) ) { if ( this . keyTable [ index ] == key ) return this . valueTable [ index ] ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } this . keyTable [ index ] = key ; this . valueTable [ index ] = value ; if ( ++ this . elementSize > this . threshold ) { rehash ( ) ; } return - value ; } private void rehash ( ) { IntegerCache newHashtable = new IntegerCache ( this . keyTable . length * <NUM_LIT:2> ) ; for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) { int key = this . keyTable [ i ] ; int value = this . valueTable [ i ] ; if ( ( key != <NUM_LIT:0> ) || ( ( key == <NUM_LIT:0> ) && ( value != <NUM_LIT:0> ) ) ) { newHashtable . put ( key , value ) ; } } this . keyTable = newHashtable . keyTable ; this . valueTable = newHashtable . valueTable ; this . threshold = newHashtable . threshold ; } public int size ( ) { return this . elementSize ; } public String toString ( ) { int max = size ( ) ; StringBuffer buf = new StringBuffer ( ) ; buf . append ( "<STR_LIT:{>" ) ; for ( int i = <NUM_LIT:0> ; i < max ; ++ i ) { if ( ( this . keyTable [ i ] != <NUM_LIT:0> ) || ( ( this . keyTable [ i ] == <NUM_LIT:0> ) && ( this . valueTable [ i ] != <NUM_LIT:0> ) ) ) { buf . append ( this . keyTable [ i ] ) . append ( "<STR_LIT>" ) . append ( this . valueTable [ i ] ) ; } if ( i < max ) { buf . append ( "<STR_LIT:U+002CU+0020>" ) ; } } buf . append ( "<STR_LIT:}>" ) ; return buf . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . codegen ; import java . text . MessageFormat ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; public class StackMapFrame { public static final int USED = <NUM_LIT:1> ; public static final int SAME_FRAME = <NUM_LIT:0> ; public static final int CHOP_FRAME = <NUM_LIT:1> ; public static final int APPEND_FRAME = <NUM_LIT:2> ; public static final int SAME_FRAME_EXTENDED = <NUM_LIT:3> ; public static final int FULL_FRAME = <NUM_LIT:4> ; public static final int SAME_LOCALS_1_STACK_ITEMS = <NUM_LIT:5> ; public static final int SAME_LOCALS_1_STACK_ITEMS_EXTENDED = <NUM_LIT:6> ; public int pc ; public int numberOfStackItems ; private int numberOfLocals ; public int localIndex ; public VerificationTypeInfo [ ] locals ; public VerificationTypeInfo [ ] stackItems ; private int numberOfDifferentLocals = - <NUM_LIT:1> ; public int tagBits ; public StackMapFrame ( int initialLocalSize ) { this . locals = new VerificationTypeInfo [ initialLocalSize ] ; this . numberOfLocals = - <NUM_LIT:1> ; this . numberOfDifferentLocals = - <NUM_LIT:1> ; } public int getFrameType ( StackMapFrame prevFrame ) { final int offsetDelta = getOffsetDelta ( prevFrame ) ; switch ( this . numberOfStackItems ) { case <NUM_LIT:0> : switch ( numberOfDifferentLocals ( prevFrame ) ) { case <NUM_LIT:0> : return offsetDelta <= <NUM_LIT> ? SAME_FRAME : SAME_FRAME_EXTENDED ; case <NUM_LIT:1> : case <NUM_LIT:2> : case <NUM_LIT:3> : return APPEND_FRAME ; case - <NUM_LIT:1> : case - <NUM_LIT:2> : case - <NUM_LIT:3> : return CHOP_FRAME ; } break ; case <NUM_LIT:1> : switch ( numberOfDifferentLocals ( prevFrame ) ) { case <NUM_LIT:0> : return offsetDelta <= <NUM_LIT> ? SAME_LOCALS_1_STACK_ITEMS : SAME_LOCALS_1_STACK_ITEMS_EXTENDED ; } } return FULL_FRAME ; } public void addLocal ( int resolvedPosition , VerificationTypeInfo info ) { if ( this . locals == null ) { this . locals = new VerificationTypeInfo [ resolvedPosition + <NUM_LIT:1> ] ; this . locals [ resolvedPosition ] = info ; } else { final int length = this . locals . length ; if ( resolvedPosition >= length ) { System . arraycopy ( this . locals , <NUM_LIT:0> , this . locals = new VerificationTypeInfo [ resolvedPosition + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; } this . locals [ resolvedPosition ] = info ; } } public void addStackItem ( VerificationTypeInfo info ) { if ( info == null ) { throw new IllegalArgumentException ( "<STR_LIT>" ) ; } if ( this . stackItems == null ) { this . stackItems = new VerificationTypeInfo [ <NUM_LIT:1> ] ; this . stackItems [ <NUM_LIT:0> ] = info ; this . numberOfStackItems = <NUM_LIT:1> ; } else { final int length = this . stackItems . length ; if ( this . numberOfStackItems == length ) { System . arraycopy ( this . stackItems , <NUM_LIT:0> , this . stackItems = new VerificationTypeInfo [ length + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; } this . stackItems [ this . numberOfStackItems ++ ] = info ; } } public void addStackItem ( TypeBinding binding ) { if ( this . stackItems == null ) { this . stackItems = new VerificationTypeInfo [ <NUM_LIT:1> ] ; this . stackItems [ <NUM_LIT:0> ] = new VerificationTypeInfo ( binding ) ; this . numberOfStackItems = <NUM_LIT:1> ; } else { final int length = this . stackItems . length ; if ( this . numberOfStackItems == length ) { System . arraycopy ( this . stackItems , <NUM_LIT:0> , this . stackItems = new VerificationTypeInfo [ length + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; } this . stackItems [ this . numberOfStackItems ++ ] = new VerificationTypeInfo ( binding ) ; } } public StackMapFrame duplicate ( ) { int length = this . locals . length ; StackMapFrame result = new StackMapFrame ( length ) ; result . numberOfLocals = - <NUM_LIT:1> ; result . numberOfDifferentLocals = - <NUM_LIT:1> ; result . pc = this . pc ; result . numberOfStackItems = this . numberOfStackItems ; if ( length != <NUM_LIT:0> ) { result . locals = new VerificationTypeInfo [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { final VerificationTypeInfo verificationTypeInfo = this . locals [ i ] ; if ( verificationTypeInfo != null ) { result . locals [ i ] = verificationTypeInfo . duplicate ( ) ; } } } length = this . numberOfStackItems ; if ( length != <NUM_LIT:0> ) { result . stackItems = new VerificationTypeInfo [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { result . stackItems [ i ] = this . stackItems [ i ] . duplicate ( ) ; } } return result ; } public int numberOfDifferentLocals ( StackMapFrame prevFrame ) { if ( this . numberOfDifferentLocals != - <NUM_LIT:1> ) return this . numberOfDifferentLocals ; if ( prevFrame == null ) { this . numberOfDifferentLocals = <NUM_LIT:0> ; return <NUM_LIT:0> ; } VerificationTypeInfo [ ] prevLocals = prevFrame . locals ; VerificationTypeInfo [ ] currentLocals = this . locals ; int prevLocalsLength = prevLocals == null ? <NUM_LIT:0> : prevLocals . length ; int currentLocalsLength = currentLocals == null ? <NUM_LIT:0> : currentLocals . length ; int prevNumberOfLocals = prevFrame . getNumberOfLocals ( ) ; int currentNumberOfLocals = getNumberOfLocals ( ) ; int result = <NUM_LIT:0> ; if ( prevNumberOfLocals == <NUM_LIT:0> ) { if ( currentNumberOfLocals != <NUM_LIT:0> ) { result = currentNumberOfLocals ; int counter = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < currentLocalsLength && counter < currentNumberOfLocals ; i ++ ) { if ( currentLocals [ i ] != null ) { switch ( currentLocals [ i ] . id ( ) ) { case TypeIds . T_double : case TypeIds . T_long : i ++ ; } counter ++ ; } else { result = Integer . MAX_VALUE ; this . numberOfDifferentLocals = result ; return result ; } } } } else if ( currentNumberOfLocals == <NUM_LIT:0> ) { int counter = <NUM_LIT:0> ; result = - prevNumberOfLocals ; for ( int i = <NUM_LIT:0> ; i < prevLocalsLength && counter < prevNumberOfLocals ; i ++ ) { if ( prevLocals [ i ] != null ) { switch ( prevLocals [ i ] . id ( ) ) { case TypeIds . T_double : case TypeIds . T_long : i ++ ; } counter ++ ; } else { result = Integer . MAX_VALUE ; this . numberOfDifferentLocals = result ; return result ; } } } else { int indexInPrevLocals = <NUM_LIT:0> ; int indexInCurrentLocals = <NUM_LIT:0> ; int currentLocalsCounter = <NUM_LIT:0> ; int prevLocalsCounter = <NUM_LIT:0> ; currentLocalsLoop : for ( ; indexInCurrentLocals < currentLocalsLength && currentLocalsCounter < currentNumberOfLocals ; indexInCurrentLocals ++ ) { VerificationTypeInfo currentLocal = currentLocals [ indexInCurrentLocals ] ; if ( currentLocal != null ) { currentLocalsCounter ++ ; switch ( currentLocal . id ( ) ) { case TypeIds . T_double : case TypeIds . T_long : indexInCurrentLocals ++ ; } } if ( indexInPrevLocals < prevLocalsLength && prevLocalsCounter < prevNumberOfLocals ) { VerificationTypeInfo prevLocal = prevLocals [ indexInPrevLocals ] ; if ( prevLocal != null ) { prevLocalsCounter ++ ; switch ( prevLocal . id ( ) ) { case TypeIds . T_double : case TypeIds . T_long : indexInPrevLocals ++ ; } } if ( equals ( prevLocal , currentLocal ) && indexInPrevLocals == indexInCurrentLocals ) { if ( result != <NUM_LIT:0> ) { result = Integer . MAX_VALUE ; this . numberOfDifferentLocals = result ; return result ; } } else { result = Integer . MAX_VALUE ; this . numberOfDifferentLocals = result ; return result ; } indexInPrevLocals ++ ; continue currentLocalsLoop ; } if ( currentLocal != null ) { result ++ ; } else { result = Integer . MAX_VALUE ; this . numberOfDifferentLocals = result ; return result ; } indexInCurrentLocals ++ ; break currentLocalsLoop ; } if ( currentLocalsCounter < currentNumberOfLocals ) { for ( ; indexInCurrentLocals < currentLocalsLength && currentLocalsCounter < currentNumberOfLocals ; indexInCurrentLocals ++ ) { VerificationTypeInfo currentLocal = currentLocals [ indexInCurrentLocals ] ; if ( currentLocal == null ) { result = Integer . MAX_VALUE ; this . numberOfDifferentLocals = result ; return result ; } result ++ ; currentLocalsCounter ++ ; switch ( currentLocal . id ( ) ) { case TypeIds . T_double : case TypeIds . T_long : indexInCurrentLocals ++ ; } } } else if ( prevLocalsCounter < prevNumberOfLocals ) { result = - result ; for ( ; indexInPrevLocals < prevLocalsLength && prevLocalsCounter < prevNumberOfLocals ; indexInPrevLocals ++ ) { VerificationTypeInfo prevLocal = prevLocals [ indexInPrevLocals ] ; if ( prevLocal == null ) { result = Integer . MAX_VALUE ; this . numberOfDifferentLocals = result ; return result ; } result -- ; prevLocalsCounter ++ ; switch ( prevLocal . id ( ) ) { case TypeIds . T_double : case TypeIds . T_long : indexInPrevLocals ++ ; } } } } this . numberOfDifferentLocals = result ; return result ; } public int getNumberOfLocals ( ) { if ( this . numberOfLocals != - <NUM_LIT:1> ) { return this . numberOfLocals ; } int result = <NUM_LIT:0> ; final int length = this . locals == null ? <NUM_LIT:0> : this . locals . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( this . locals [ i ] != null ) { switch ( this . locals [ i ] . id ( ) ) { case TypeIds . T_double : case TypeIds . T_long : i ++ ; } result ++ ; } } this . numberOfLocals = result ; return result ; } public int getOffsetDelta ( StackMapFrame prevFrame ) { if ( prevFrame == null ) return this . pc ; return prevFrame . pc == - <NUM_LIT:1> ? this . pc : this . pc - prevFrame . pc - <NUM_LIT:1> ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; printFrame ( buffer , this ) ; return String . valueOf ( buffer ) ; } private void printFrame ( StringBuffer buffer , StackMapFrame frame ) { String pattern = "<STR_LIT>" ; int localsLength = frame . locals == null ? <NUM_LIT:0> : frame . locals . length ; buffer . append ( MessageFormat . format ( pattern , new String [ ] { Integer . toString ( frame . pc ) , Integer . toString ( frame . getNumberOfLocals ( ) ) , Integer . toString ( frame . numberOfStackItems ) , print ( frame . locals , localsLength ) , print ( frame . stackItems , frame . numberOfStackItems ) } ) ) ; } private String print ( VerificationTypeInfo [ ] infos , int length ) { StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( '<CHAR_LIT:[>' ) ; if ( infos != null ) { for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( i != <NUM_LIT:0> ) buffer . append ( '<CHAR_LIT:U+002C>' ) ; VerificationTypeInfo verificationTypeInfo = infos [ i ] ; if ( verificationTypeInfo == null ) { buffer . append ( "<STR_LIT>" ) ; continue ; } buffer . append ( verificationTypeInfo ) ; } } buffer . append ( '<CHAR_LIT:]>' ) ; return String . valueOf ( buffer ) ; } public void putLocal ( int resolvedPosition , VerificationTypeInfo info ) { if ( this . locals == null ) { this . locals = new VerificationTypeInfo [ resolvedPosition + <NUM_LIT:1> ] ; this . locals [ resolvedPosition ] = info ; } else { final int length = this . locals . length ; if ( resolvedPosition >= length ) { System . arraycopy ( this . locals , <NUM_LIT:0> , this . locals = new VerificationTypeInfo [ resolvedPosition + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; } this . locals [ resolvedPosition ] = info ; } } public void replaceWithElementType ( ) { VerificationTypeInfo info = this . stackItems [ this . numberOfStackItems - <NUM_LIT:1> ] ; VerificationTypeInfo info2 = info . duplicate ( ) ; info2 . replaceWithElementType ( ) ; this . stackItems [ this . numberOfStackItems - <NUM_LIT:1> ] = info2 ; } public int getIndexOfDifferentLocals ( int differentLocalsCount ) { for ( int i = this . locals . length - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) { VerificationTypeInfo currentLocal = this . locals [ i ] ; if ( currentLocal == null ) { continue ; } else { differentLocalsCount -- ; } if ( differentLocalsCount == <NUM_LIT:0> ) { return i ; } } return <NUM_LIT:0> ; } private boolean equals ( VerificationTypeInfo info , VerificationTypeInfo info2 ) { if ( info == null ) { return info2 == null ; } if ( info2 == null ) return false ; return info . equals ( info2 ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . codegen ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; public class VerificationTypeInfo { public static final int ITEM_TOP = <NUM_LIT:0> ; public static final int ITEM_INTEGER = <NUM_LIT:1> ; public static final int ITEM_FLOAT = <NUM_LIT:2> ; public static final int ITEM_DOUBLE = <NUM_LIT:3> ; public static final int ITEM_LONG = <NUM_LIT:4> ; public static final int ITEM_NULL = <NUM_LIT:5> ; public static final int ITEM_UNINITIALIZED_THIS = <NUM_LIT:6> ; public static final int ITEM_OBJECT = <NUM_LIT:7> ; public static final int ITEM_UNINITIALIZED = <NUM_LIT:8> ; public int tag ; private int id ; private char [ ] constantPoolName ; public int offset ; private VerificationTypeInfo ( ) { } public VerificationTypeInfo ( int id , char [ ] constantPoolName ) { this ( id , VerificationTypeInfo . ITEM_OBJECT , constantPoolName ) ; } public VerificationTypeInfo ( int id , int tag , char [ ] constantPoolName ) { this . id = id ; this . tag = tag ; this . constantPoolName = constantPoolName ; } public VerificationTypeInfo ( int tag , TypeBinding binding ) { this ( binding ) ; this . tag = tag ; } public VerificationTypeInfo ( TypeBinding binding ) { this . id = binding . id ; switch ( binding . id ) { case TypeIds . T_boolean : case TypeIds . T_byte : case TypeIds . T_char : case TypeIds . T_int : case TypeIds . T_short : this . tag = VerificationTypeInfo . ITEM_INTEGER ; break ; case TypeIds . T_float : this . tag = VerificationTypeInfo . ITEM_FLOAT ; break ; case TypeIds . T_long : this . tag = VerificationTypeInfo . ITEM_LONG ; break ; case TypeIds . T_double : this . tag = VerificationTypeInfo . ITEM_DOUBLE ; break ; case TypeIds . T_null : this . tag = VerificationTypeInfo . ITEM_NULL ; break ; default : this . tag = VerificationTypeInfo . ITEM_OBJECT ; this . constantPoolName = binding . constantPoolName ( ) ; } } public void setBinding ( TypeBinding binding ) { this . constantPoolName = binding . constantPoolName ( ) ; final int typeBindingId = binding . id ; this . id = typeBindingId ; switch ( typeBindingId ) { case TypeIds . T_boolean : case TypeIds . T_byte : case TypeIds . T_char : case TypeIds . T_int : case TypeIds . T_short : this . tag = VerificationTypeInfo . ITEM_INTEGER ; break ; case TypeIds . T_float : this . tag = VerificationTypeInfo . ITEM_FLOAT ; break ; case TypeIds . T_long : this . tag = VerificationTypeInfo . ITEM_LONG ; break ; case TypeIds . T_double : this . tag = VerificationTypeInfo . ITEM_DOUBLE ; break ; case TypeIds . T_null : this . tag = VerificationTypeInfo . ITEM_NULL ; break ; default : this . tag = VerificationTypeInfo . ITEM_OBJECT ; } } public int id ( ) { return this . id ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; switch ( this . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED_THIS : buffer . append ( "<STR_LIT>" ) . append ( readableName ( ) ) . append ( "<STR_LIT:)>" ) ; break ; case VerificationTypeInfo . ITEM_UNINITIALIZED : buffer . append ( "<STR_LIT>" ) . append ( readableName ( ) ) . append ( "<STR_LIT:)>" ) ; break ; case VerificationTypeInfo . ITEM_OBJECT : buffer . append ( readableName ( ) ) ; break ; case VerificationTypeInfo . ITEM_DOUBLE : buffer . append ( '<CHAR_LIT>' ) ; break ; case VerificationTypeInfo . ITEM_FLOAT : buffer . append ( '<CHAR_LIT>' ) ; break ; case VerificationTypeInfo . ITEM_INTEGER : buffer . append ( '<CHAR_LIT>' ) ; break ; case VerificationTypeInfo . ITEM_LONG : buffer . append ( '<CHAR_LIT>' ) ; break ; case VerificationTypeInfo . ITEM_NULL : buffer . append ( "<STR_LIT:null>" ) ; break ; case VerificationTypeInfo . ITEM_TOP : buffer . append ( "<STR_LIT>" ) ; break ; } return String . valueOf ( buffer ) ; } public VerificationTypeInfo duplicate ( ) { final VerificationTypeInfo verificationTypeInfo = new VerificationTypeInfo ( ) ; verificationTypeInfo . id = this . id ; verificationTypeInfo . tag = this . tag ; verificationTypeInfo . constantPoolName = this . constantPoolName ; verificationTypeInfo . offset = this . offset ; return verificationTypeInfo ; } public boolean equals ( Object obj ) { if ( obj instanceof VerificationTypeInfo ) { VerificationTypeInfo info1 = ( VerificationTypeInfo ) obj ; return info1 . tag == this . tag && CharOperation . equals ( info1 . constantPoolName ( ) , constantPoolName ( ) ) ; } return false ; } public int hashCode ( ) { return this . tag + this . id + this . constantPoolName . length + this . offset ; } public char [ ] constantPoolName ( ) { return this . constantPoolName ; } public char [ ] readableName ( ) { return this . constantPoolName ; } public void replaceWithElementType ( ) { if ( this . constantPoolName [ <NUM_LIT:1> ] == '<CHAR_LIT>' ) { this . constantPoolName = CharOperation . subarray ( this . constantPoolName , <NUM_LIT:2> , this . constantPoolName . length - <NUM_LIT:1> ) ; } else { this . constantPoolName = CharOperation . subarray ( this . constantPoolName , <NUM_LIT:1> , this . constantPoolName . length ) ; if ( this . constantPoolName . length == <NUM_LIT:1> ) { switch ( this . constantPoolName [ <NUM_LIT:0> ] ) { case '<CHAR_LIT>' : this . id = TypeIds . T_int ; break ; case '<CHAR_LIT>' : this . id = TypeIds . T_byte ; break ; case '<CHAR_LIT>' : this . id = TypeIds . T_short ; break ; case '<CHAR_LIT>' : this . id = TypeIds . T_char ; break ; case '<CHAR_LIT>' : this . id = TypeIds . T_long ; break ; case '<CHAR_LIT>' : this . id = TypeIds . T_float ; break ; case '<CHAR_LIT>' : this . id = TypeIds . T_double ; break ; case '<CHAR_LIT:Z>' : this . id = TypeIds . T_boolean ; break ; case '<CHAR_LIT>' : this . id = TypeIds . T_null ; break ; case '<CHAR_LIT>' : this . id = TypeIds . T_void ; break ; } } } } } </s>
<s> package org . eclipse . jdt . internal . compiler . codegen ; public abstract class Label { public CodeStream codeStream ; public int position = POS_NOT_SET ; public final static int POS_NOT_SET = - <NUM_LIT:1> ; public Label ( ) { } public Label ( CodeStream codeStream ) { this . codeStream = codeStream ; } public abstract void place ( ) ; } </s>
<s> package org . eclipse . jdt . internal . compiler . codegen ; public class ObjectCache { public Object keyTable [ ] ; public int valueTable [ ] ; int elementSize ; int threshold ; public ObjectCache ( ) { this ( <NUM_LIT> ) ; } public ObjectCache ( int initialCapacity ) { this . elementSize = <NUM_LIT:0> ; this . threshold = ( int ) ( initialCapacity * <NUM_LIT> ) ; this . keyTable = new Object [ initialCapacity ] ; this . valueTable = new int [ initialCapacity ] ; } public void clear ( ) { for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) { this . keyTable [ i ] = null ; this . valueTable [ i ] = <NUM_LIT:0> ; } this . elementSize = <NUM_LIT:0> ; } public boolean containsKey ( Object key ) { int index = hashCode ( key ) , length = this . keyTable . length ; while ( this . keyTable [ index ] != null ) { if ( this . keyTable [ index ] == key ) return true ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return false ; } public int get ( Object key ) { int index = hashCode ( key ) , length = this . keyTable . length ; while ( this . keyTable [ index ] != null ) { if ( this . keyTable [ index ] == key ) return this . valueTable [ index ] ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return - <NUM_LIT:1> ; } public int hashCode ( Object key ) { return ( key . hashCode ( ) & <NUM_LIT> ) % this . keyTable . length ; } public int put ( Object key , int value ) { int index = hashCode ( key ) , length = this . keyTable . length ; while ( this . keyTable [ index ] != null ) { if ( this . keyTable [ index ] == key ) return this . valueTable [ index ] = value ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } this . keyTable [ index ] = key ; this . valueTable [ index ] = value ; if ( ++ this . elementSize > this . threshold ) rehash ( ) ; return value ; } private void rehash ( ) { ObjectCache newHashtable = new ObjectCache ( this . keyTable . length * <NUM_LIT:2> ) ; for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) if ( this . keyTable [ i ] != null ) newHashtable . put ( this . keyTable [ i ] , this . valueTable [ i ] ) ; this . keyTable = newHashtable . keyTable ; this . valueTable = newHashtable . valueTable ; this . threshold = newHashtable . threshold ; } public int size ( ) { return this . elementSize ; } public String toString ( ) { int max = size ( ) ; StringBuffer buf = new StringBuffer ( ) ; buf . append ( "<STR_LIT:{>" ) ; for ( int i = <NUM_LIT:0> ; i < max ; ++ i ) { if ( this . keyTable [ i ] != null ) { buf . append ( this . keyTable [ i ] ) . append ( "<STR_LIT>" ) . append ( this . valueTable [ i ] ) ; } if ( i < max ) { buf . append ( "<STR_LIT:U+002CU+0020>" ) ; } } buf . append ( "<STR_LIT:}>" ) ; return buf . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . codegen ; public class FloatCache { private float keyTable [ ] ; private int valueTable [ ] ; private int elementSize ; public FloatCache ( ) { this ( <NUM_LIT> ) ; } public FloatCache ( int initialCapacity ) { this . elementSize = <NUM_LIT:0> ; this . keyTable = new float [ initialCapacity ] ; this . valueTable = new int [ initialCapacity ] ; } public void clear ( ) { for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) { this . keyTable [ i ] = <NUM_LIT:0.0f> ; this . valueTable [ i ] = <NUM_LIT:0> ; } this . elementSize = <NUM_LIT:0> ; } public boolean containsKey ( float key ) { if ( key == <NUM_LIT:0.0f> ) { for ( int i = <NUM_LIT:0> , max = this . elementSize ; i < max ; i ++ ) { if ( this . keyTable [ i ] == <NUM_LIT:0.0f> ) { int value1 = Float . floatToIntBits ( key ) ; int value2 = Float . floatToIntBits ( this . keyTable [ i ] ) ; if ( value1 == - <NUM_LIT> && value2 == - <NUM_LIT> ) return true ; if ( value1 == <NUM_LIT:0> && value2 == <NUM_LIT:0> ) return true ; } } } else { for ( int i = <NUM_LIT:0> , max = this . elementSize ; i < max ; i ++ ) { if ( this . keyTable [ i ] == key ) { return true ; } } } return false ; } public int put ( float key , int value ) { if ( this . elementSize == this . keyTable . length ) { System . arraycopy ( this . keyTable , <NUM_LIT:0> , ( this . keyTable = new float [ this . elementSize * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . elementSize ) ; System . arraycopy ( this . valueTable , <NUM_LIT:0> , ( this . valueTable = new int [ this . elementSize * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . elementSize ) ; } this . keyTable [ this . elementSize ] = key ; this . valueTable [ this . elementSize ] = value ; this . elementSize ++ ; return value ; } public int putIfAbsent ( float key , int value ) { if ( key == <NUM_LIT:0.0f> ) { for ( int i = <NUM_LIT:0> , max = this . elementSize ; i < max ; i ++ ) { if ( this . keyTable [ i ] == <NUM_LIT:0.0f> ) { int value1 = Float . floatToIntBits ( key ) ; int value2 = Float . floatToIntBits ( this . keyTable [ i ] ) ; if ( value1 == - <NUM_LIT> && value2 == - <NUM_LIT> ) return this . valueTable [ i ] ; if ( value1 == <NUM_LIT:0> && value2 == <NUM_LIT:0> ) return this . valueTable [ i ] ; } } } else { for ( int i = <NUM_LIT:0> , max = this . elementSize ; i < max ; i ++ ) { if ( this . keyTable [ i ] == key ) { return this . valueTable [ i ] ; } } } if ( this . elementSize == this . keyTable . length ) { System . arraycopy ( this . keyTable , <NUM_LIT:0> , ( this . keyTable = new float [ this . elementSize * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . elementSize ) ; System . arraycopy ( this . valueTable , <NUM_LIT:0> , ( this . valueTable = new int [ this . elementSize * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . elementSize ) ; } this . keyTable [ this . elementSize ] = key ; this . valueTable [ this . elementSize ] = value ; this . elementSize ++ ; return - value ; } public String toString ( ) { int max = this . elementSize ; StringBuffer buf = new StringBuffer ( ) ; buf . append ( "<STR_LIT:{>" ) ; for ( int i = <NUM_LIT:0> ; i < max ; ++ i ) { if ( ( this . keyTable [ i ] != <NUM_LIT:0> ) || ( ( this . keyTable [ i ] == <NUM_LIT:0> ) && ( this . valueTable [ i ] != <NUM_LIT:0> ) ) ) { buf . append ( this . keyTable [ i ] ) . append ( "<STR_LIT>" ) . append ( this . valueTable [ i ] ) ; } if ( i < max ) { buf . append ( "<STR_LIT:U+002CU+0020>" ) ; } } buf . append ( "<STR_LIT:}>" ) ; return buf . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . codegen ; import org . eclipse . jdt . core . compiler . CharOperation ; public class CharArrayCache { public char [ ] keyTable [ ] ; public int valueTable [ ] ; int elementSize ; int threshold ; public CharArrayCache ( ) { this ( <NUM_LIT:9> ) ; } public CharArrayCache ( int initialCapacity ) { this . elementSize = <NUM_LIT:0> ; this . threshold = ( initialCapacity * <NUM_LIT:2> ) / <NUM_LIT:3> ; this . keyTable = new char [ initialCapacity ] [ ] ; this . valueTable = new int [ initialCapacity ] ; } public void clear ( ) { for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) { this . keyTable [ i ] = null ; this . valueTable [ i ] = <NUM_LIT:0> ; } this . elementSize = <NUM_LIT:0> ; } public boolean containsKey ( char [ ] key ) { int length = this . keyTable . length , index = CharOperation . hashCode ( key ) % length ; while ( this . keyTable [ index ] != null ) { if ( CharOperation . equals ( this . keyTable [ index ] , key ) ) return true ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return false ; } public int get ( char [ ] key ) { int length = this . keyTable . length , index = CharOperation . hashCode ( key ) % length ; while ( this . keyTable [ index ] != null ) { if ( CharOperation . equals ( this . keyTable [ index ] , key ) ) return this . valueTable [ index ] ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return - <NUM_LIT:1> ; } public int putIfAbsent ( char [ ] key , int value ) { int length = this . keyTable . length , index = CharOperation . hashCode ( key ) % length ; while ( this . keyTable [ index ] != null ) { if ( CharOperation . equals ( this . keyTable [ index ] , key ) ) return this . valueTable [ index ] ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } this . keyTable [ index ] = key ; this . valueTable [ index ] = value ; if ( ++ this . elementSize > this . threshold ) rehash ( ) ; return - value ; } private int put ( char [ ] key , int value ) { int length = this . keyTable . length , index = CharOperation . hashCode ( key ) % length ; while ( this . keyTable [ index ] != null ) { if ( CharOperation . equals ( this . keyTable [ index ] , key ) ) return this . valueTable [ index ] = value ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } this . keyTable [ index ] = key ; this . valueTable [ index ] = value ; if ( ++ this . elementSize > this . threshold ) rehash ( ) ; return value ; } private void rehash ( ) { CharArrayCache newHashtable = new CharArrayCache ( this . keyTable . length * <NUM_LIT:2> ) ; for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) if ( this . keyTable [ i ] != null ) newHashtable . put ( this . keyTable [ i ] , this . valueTable [ i ] ) ; this . keyTable = newHashtable . keyTable ; this . valueTable = newHashtable . valueTable ; this . threshold = newHashtable . threshold ; } public void remove ( char [ ] key ) { int length = this . keyTable . length , index = CharOperation . hashCode ( key ) % length ; while ( this . keyTable [ index ] != null ) { if ( CharOperation . equals ( this . keyTable [ index ] , key ) ) { this . valueTable [ index ] = <NUM_LIT:0> ; this . keyTable [ index ] = null ; return ; } if ( ++ index == length ) { index = <NUM_LIT:0> ; } } } public char [ ] returnKeyFor ( int value ) { for ( int i = this . keyTable . length ; i -- > <NUM_LIT:0> ; ) { if ( this . valueTable [ i ] == value ) { return this . keyTable [ i ] ; } } return null ; } public int size ( ) { return this . elementSize ; } public String toString ( ) { int max = size ( ) ; StringBuffer buf = new StringBuffer ( ) ; buf . append ( "<STR_LIT:{>" ) ; for ( int i = <NUM_LIT:0> ; i < max ; ++ i ) { if ( this . keyTable [ i ] != null ) { buf . append ( this . keyTable [ i ] ) . append ( "<STR_LIT>" ) . append ( this . valueTable [ i ] ) ; } if ( i < max ) { buf . append ( "<STR_LIT:U+002CU+0020>" ) ; } } buf . append ( "<STR_LIT:}>" ) ; return buf . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . codegen ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . HashMap ; import java . util . HashSet ; import java . util . Iterator ; import java . util . Set ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ClassFile ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . lookup . FieldBinding ; import org . eclipse . jdt . internal . compiler . lookup . LocalVariableBinding ; import org . eclipse . jdt . internal . compiler . lookup . MethodBinding ; 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 StackMapFrameCodeStream extends CodeStream { public static class ExceptionMarker implements Comparable { public char [ ] constantPoolName ; public int pc ; public ExceptionMarker ( int pc , char [ ] constantPoolName ) { this . pc = pc ; this . constantPoolName = constantPoolName ; } public int compareTo ( Object o ) { if ( o instanceof ExceptionMarker ) { return this . pc - ( ( ExceptionMarker ) o ) . pc ; } return <NUM_LIT:0> ; } public boolean equals ( Object obj ) { if ( obj instanceof ExceptionMarker ) { ExceptionMarker marker = ( ExceptionMarker ) obj ; return this . pc == marker . pc && CharOperation . equals ( this . constantPoolName , marker . constantPoolName ) ; } return false ; } public int hashCode ( ) { return this . pc + this . constantPoolName . hashCode ( ) ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( '<CHAR_LIT:(>' ) . append ( this . pc ) . append ( '<CHAR_LIT:U+002C>' ) . append ( this . constantPoolName ) . append ( '<CHAR_LIT:)>' ) ; return String . valueOf ( buffer ) ; } } public static class StackDepthMarker { public int pc ; public int delta ; public TypeBinding typeBinding ; public StackDepthMarker ( int pc , int delta , TypeBinding typeBinding ) { this . pc = pc ; this . typeBinding = typeBinding ; this . delta = delta ; } public StackDepthMarker ( int pc , int delta ) { this . pc = pc ; this . delta = delta ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( '<CHAR_LIT:(>' ) . append ( this . pc ) . append ( '<CHAR_LIT:U+002C>' ) . append ( this . delta ) ; if ( this . typeBinding != null ) { buffer . append ( '<CHAR_LIT:U+002C>' ) . append ( this . typeBinding . qualifiedPackageName ( ) ) . append ( this . typeBinding . qualifiedSourceName ( ) ) ; } buffer . append ( '<CHAR_LIT:)>' ) ; return String . valueOf ( buffer ) ; } } public static class StackMarker { public int pc ; public int destinationPC ; public VerificationTypeInfo [ ] infos ; public StackMarker ( int pc , int destinationPC ) { this . pc = pc ; this . destinationPC = destinationPC ; } public void setInfos ( VerificationTypeInfo [ ] infos ) { this . infos = infos ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( "<STR_LIT>" ) . append ( this . pc ) . append ( "<STR_LIT:U+0020toU+0020>" ) . append ( this . destinationPC ) ; if ( this . infos != null ) { for ( int i = <NUM_LIT:0> , max = this . infos . length ; i < max ; i ++ ) { if ( i > <NUM_LIT:0> ) buffer . append ( '<CHAR_LIT:U+002C>' ) ; buffer . append ( this . infos [ i ] ) ; } } buffer . append ( '<CHAR_LIT:]>' ) ; return String . valueOf ( buffer ) ; } } static class FramePosition { int counter ; } public int [ ] stateIndexes ; public int stateIndexesCounter ; private HashMap framePositions ; public Set exceptionMarkers ; public ArrayList stackDepthMarkers ; public ArrayList stackMarkers ; public StackMapFrameCodeStream ( ClassFile givenClassFile ) { super ( givenClassFile ) ; this . generateAttributes |= ClassFileConstants . ATTR_STACK_MAP ; } public void addDefinitelyAssignedVariables ( Scope scope , int initStateIndex ) { loop : for ( int i = <NUM_LIT:0> ; i < this . visibleLocalsCount ; i ++ ) { LocalVariableBinding localBinding = this . visibleLocals [ i ] ; if ( localBinding != null ) { boolean isDefinitelyAssigned = isDefinitelyAssigned ( scope , initStateIndex , localBinding ) ; if ( ! isDefinitelyAssigned ) { if ( this . stateIndexes != null ) { for ( int j = <NUM_LIT:0> , max = this . stateIndexesCounter ; j < max ; j ++ ) { if ( isDefinitelyAssigned ( scope , this . stateIndexes [ j ] , localBinding ) ) { if ( ( localBinding . initializationCount == <NUM_LIT:0> ) || ( localBinding . initializationPCs [ ( ( localBinding . initializationCount - <NUM_LIT:1> ) << <NUM_LIT:1> ) + <NUM_LIT:1> ] != - <NUM_LIT:1> ) ) { localBinding . recordInitializationStartPC ( this . position ) ; } continue loop ; } } } } else { if ( ( localBinding . initializationCount == <NUM_LIT:0> ) || ( localBinding . initializationPCs [ ( ( localBinding . initializationCount - <NUM_LIT:1> ) << <NUM_LIT:1> ) + <NUM_LIT:1> ] != - <NUM_LIT:1> ) ) { localBinding . recordInitializationStartPC ( this . position ) ; } } } } } public void addExceptionMarker ( int pc , TypeBinding typeBinding ) { if ( this . exceptionMarkers == null ) { this . exceptionMarkers = new HashSet ( ) ; } if ( typeBinding == null ) { this . exceptionMarkers . add ( new ExceptionMarker ( pc , ConstantPool . JavaLangThrowableConstantPoolName ) ) ; } else { switch ( typeBinding . id ) { case TypeIds . T_null : this . exceptionMarkers . add ( new ExceptionMarker ( pc , ConstantPool . JavaLangClassNotFoundExceptionConstantPoolName ) ) ; break ; case TypeIds . T_long : this . exceptionMarkers . add ( new ExceptionMarker ( pc , ConstantPool . JavaLangNoSuchFieldErrorConstantPoolName ) ) ; break ; default : this . exceptionMarkers . add ( new ExceptionMarker ( pc , typeBinding . constantPoolName ( ) ) ) ; } } } public void addFramePosition ( int pc ) { Integer newEntry = new Integer ( pc ) ; FramePosition value ; if ( ( value = ( FramePosition ) this . framePositions . get ( newEntry ) ) != null ) { value . counter ++ ; } else { this . framePositions . put ( newEntry , new FramePosition ( ) ) ; } } public void optimizeBranch ( int oldPosition , BranchLabel lbl ) { super . optimizeBranch ( oldPosition , lbl ) ; removeFramePosition ( oldPosition ) ; } public void removeFramePosition ( int pc ) { Integer entry = new Integer ( pc ) ; FramePosition value ; if ( ( value = ( FramePosition ) this . framePositions . get ( entry ) ) != null ) { value . counter -- ; if ( value . counter <= <NUM_LIT:0> ) { this . framePositions . remove ( entry ) ; } } } public void addVariable ( LocalVariableBinding localBinding ) { if ( localBinding . initializationPCs == null ) { record ( localBinding ) ; } localBinding . recordInitializationStartPC ( this . position ) ; } private void addStackMarker ( int pc , int destinationPC ) { if ( this . stackMarkers == null ) { this . stackMarkers = new ArrayList ( ) ; this . stackMarkers . add ( new StackMarker ( pc , destinationPC ) ) ; } else { int size = this . stackMarkers . size ( ) ; if ( size == <NUM_LIT:0> || ( ( StackMarker ) this . stackMarkers . get ( size - <NUM_LIT:1> ) ) . pc != this . position ) { this . stackMarkers . add ( new StackMarker ( pc , destinationPC ) ) ; } } } private void addStackDepthMarker ( int pc , int delta , TypeBinding typeBinding ) { if ( this . stackDepthMarkers == null ) { this . stackDepthMarkers = new ArrayList ( ) ; this . stackDepthMarkers . add ( new StackDepthMarker ( pc , delta , typeBinding ) ) ; } else { int size = this . stackDepthMarkers . size ( ) ; if ( size == <NUM_LIT:0> || ( ( StackDepthMarker ) this . stackDepthMarkers . get ( size - <NUM_LIT:1> ) ) . pc != this . position ) { this . stackDepthMarkers . add ( new StackDepthMarker ( pc , delta , typeBinding ) ) ; } } } public void decrStackSize ( int offset ) { super . decrStackSize ( offset ) ; addStackDepthMarker ( this . position , - <NUM_LIT:1> , null ) ; } public void recordExpressionType ( TypeBinding typeBinding ) { addStackDepthMarker ( this . position , <NUM_LIT:0> , typeBinding ) ; } public void generateClassLiteralAccessForType ( TypeBinding accessedType , FieldBinding syntheticFieldBinding ) { if ( accessedType . isBaseType ( ) && accessedType != TypeBinding . NULL ) { getTYPE ( accessedType . id ) ; return ; } if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { this . ldc ( accessedType ) ; } else { BranchLabel endLabel = new BranchLabel ( this ) ; if ( syntheticFieldBinding != null ) { fieldAccess ( Opcodes . OPC_getstatic , syntheticFieldBinding , null ) ; dup ( ) ; ifnonnull ( endLabel ) ; pop ( ) ; } ExceptionLabel classNotFoundExceptionHandler = new ExceptionLabel ( this , TypeBinding . NULL ) ; classNotFoundExceptionHandler . placeStart ( ) ; this . ldc ( accessedType == TypeBinding . NULL ? "<STR_LIT>" : String . valueOf ( accessedType . constantPoolName ( ) ) . replace ( '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ) ; invokeClassForName ( ) ; classNotFoundExceptionHandler . placeEnd ( ) ; if ( syntheticFieldBinding != null ) { dup ( ) ; fieldAccess ( Opcodes . OPC_putstatic , syntheticFieldBinding , null ) ; } int fromPC = this . position ; goto_ ( endLabel ) ; int savedStackDepth = this . stackDepth ; pushExceptionOnStack ( TypeBinding . NULL ) ; classNotFoundExceptionHandler . place ( ) ; newNoClassDefFoundError ( ) ; dup_x1 ( ) ; swap ( ) ; invokeThrowableGetMessage ( ) ; invokeNoClassDefFoundErrorStringConstructor ( ) ; athrow ( ) ; endLabel . place ( ) ; addStackMarker ( fromPC , this . position ) ; this . stackDepth = savedStackDepth ; } } public ExceptionMarker [ ] getExceptionMarkers ( ) { Set exceptionMarkerSet = this . exceptionMarkers ; if ( this . exceptionMarkers == null ) return null ; int size = exceptionMarkerSet . size ( ) ; ExceptionMarker [ ] markers = new ExceptionMarker [ size ] ; int n = <NUM_LIT:0> ; for ( Iterator iterator = exceptionMarkerSet . iterator ( ) ; iterator . hasNext ( ) ; ) { markers [ n ++ ] = ( ExceptionMarker ) iterator . next ( ) ; } Arrays . sort ( markers ) ; return markers ; } public int [ ] getFramePositions ( ) { Set set = this . framePositions . keySet ( ) ; int size = set . size ( ) ; int [ ] positions = new int [ size ] ; int n = <NUM_LIT:0> ; for ( Iterator iterator = set . iterator ( ) ; iterator . hasNext ( ) ; ) { positions [ n ++ ] = ( ( Integer ) iterator . next ( ) ) . intValue ( ) ; } Arrays . sort ( positions ) ; return positions ; } public StackDepthMarker [ ] getStackDepthMarkers ( ) { if ( this . stackDepthMarkers == null ) return null ; int length = this . stackDepthMarkers . size ( ) ; if ( length == <NUM_LIT:0> ) return null ; StackDepthMarker [ ] result = new StackDepthMarker [ length ] ; this . stackDepthMarkers . toArray ( result ) ; return result ; } public StackMarker [ ] getStackMarkers ( ) { if ( this . stackMarkers == null ) return null ; int length = this . stackMarkers . size ( ) ; if ( length == <NUM_LIT:0> ) return null ; StackMarker [ ] result = new StackMarker [ length ] ; this . stackMarkers . toArray ( result ) ; return result ; } public boolean hasFramePositions ( ) { return this . framePositions . size ( ) != <NUM_LIT:0> ; } public void init ( ClassFile targetClassFile ) { super . init ( targetClassFile ) ; this . stateIndexesCounter = <NUM_LIT:0> ; if ( this . framePositions != null ) { this . framePositions . clear ( ) ; } if ( this . exceptionMarkers != null ) { this . exceptionMarkers . clear ( ) ; } if ( this . stackDepthMarkers != null ) { this . stackDepthMarkers . clear ( ) ; } if ( this . stackMarkers != null ) { this . stackMarkers . clear ( ) ; } } public void initializeMaxLocals ( MethodBinding methodBinding ) { super . initializeMaxLocals ( methodBinding ) ; if ( this . framePositions == null ) { this . framePositions = new HashMap ( ) ; } else { this . framePositions . clear ( ) ; } } public void popStateIndex ( ) { this . stateIndexesCounter -- ; } public void pushStateIndex ( int naturalExitMergeInitStateIndex ) { if ( this . stateIndexes == null ) { this . stateIndexes = new int [ <NUM_LIT:3> ] ; } int length = this . stateIndexes . length ; if ( length == this . stateIndexesCounter ) { System . arraycopy ( this . stateIndexes , <NUM_LIT:0> , ( this . stateIndexes = new int [ length * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . stateIndexes [ this . stateIndexesCounter ++ ] = naturalExitMergeInitStateIndex ; } public void removeNotDefinitelyAssignedVariables ( Scope scope , int initStateIndex ) { int index = this . visibleLocalsCount ; loop : for ( int i = <NUM_LIT:0> ; i < index ; i ++ ) { LocalVariableBinding localBinding = this . visibleLocals [ i ] ; if ( localBinding != null && localBinding . initializationCount > <NUM_LIT:0> ) { boolean isDefinitelyAssigned = isDefinitelyAssigned ( scope , initStateIndex , localBinding ) ; if ( ! isDefinitelyAssigned ) { if ( this . stateIndexes != null ) { for ( int j = <NUM_LIT:0> , max = this . stateIndexesCounter ; j < max ; j ++ ) { if ( isDefinitelyAssigned ( scope , this . stateIndexes [ j ] , localBinding ) ) { continue loop ; } } } localBinding . recordInitializationEndPC ( this . position ) ; } } } } public void reset ( ClassFile givenClassFile ) { super . reset ( givenClassFile ) ; this . stateIndexesCounter = <NUM_LIT:0> ; if ( this . framePositions != null ) { this . framePositions . clear ( ) ; } if ( this . exceptionMarkers != null ) { this . exceptionMarkers . clear ( ) ; } if ( this . stackDepthMarkers != null ) { this . stackDepthMarkers . clear ( ) ; } if ( this . stackMarkers != null ) { this . stackMarkers . clear ( ) ; } } protected void writePosition ( BranchLabel label ) { super . writePosition ( label ) ; addFramePosition ( label . position ) ; } protected void writePosition ( BranchLabel label , int forwardReference ) { super . writePosition ( label , forwardReference ) ; addFramePosition ( label . position ) ; } protected void writeSignedWord ( int pos , int value ) { super . writeSignedWord ( pos , value ) ; addFramePosition ( this . position ) ; } protected void writeWidePosition ( BranchLabel label ) { super . writeWidePosition ( label ) ; addFramePosition ( label . position ) ; } public void areturn ( ) { super . areturn ( ) ; addFramePosition ( this . position ) ; } public void ireturn ( ) { super . ireturn ( ) ; addFramePosition ( this . position ) ; } public void lreturn ( ) { super . lreturn ( ) ; addFramePosition ( this . position ) ; } public void freturn ( ) { super . freturn ( ) ; addFramePosition ( this . position ) ; } public void dreturn ( ) { super . dreturn ( ) ; addFramePosition ( this . position ) ; } public void return_ ( ) { super . return_ ( ) ; addFramePosition ( this . position ) ; } public void athrow ( ) { super . athrow ( ) ; addFramePosition ( this . position ) ; } public void pushOnStack ( TypeBinding binding ) { super . pushOnStack ( binding ) ; addStackDepthMarker ( this . position , <NUM_LIT:1> , binding ) ; } public void pushExceptionOnStack ( TypeBinding binding ) { super . pushExceptionOnStack ( binding ) ; addExceptionMarker ( this . position , binding ) ; } public void goto_ ( BranchLabel label ) { super . goto_ ( label ) ; addFramePosition ( this . position ) ; } public void goto_w ( BranchLabel label ) { super . goto_w ( label ) ; addFramePosition ( this . position ) ; } public void resetInWideMode ( ) { this . resetSecretLocals ( ) ; super . resetInWideMode ( ) ; } public void resetSecretLocals ( ) { for ( int i = <NUM_LIT:0> , max = this . locals . length ; i < max ; i ++ ) { LocalVariableBinding localVariableBinding = this . locals [ i ] ; if ( localVariableBinding != null && localVariableBinding . isSecret ( ) ) { localVariableBinding . resetInitializations ( ) ; } } } } </s>
<s> package org . eclipse . jdt . internal . compiler . codegen ; public class LongCache { public long keyTable [ ] ; public int valueTable [ ] ; int elementSize ; int threshold ; public LongCache ( ) { this ( <NUM_LIT> ) ; } public LongCache ( int initialCapacity ) { this . elementSize = <NUM_LIT:0> ; this . threshold = ( int ) ( initialCapacity * <NUM_LIT> ) ; this . keyTable = new long [ initialCapacity ] ; this . valueTable = new int [ initialCapacity ] ; } public void clear ( ) { for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) { this . keyTable [ i ] = <NUM_LIT:0> ; this . valueTable [ i ] = <NUM_LIT:0> ; } this . elementSize = <NUM_LIT:0> ; } public boolean containsKey ( long key ) { int index = hash ( key ) , length = this . keyTable . length ; while ( ( this . keyTable [ index ] != <NUM_LIT:0> ) || ( ( this . keyTable [ index ] == <NUM_LIT:0> ) && ( this . valueTable [ index ] != <NUM_LIT:0> ) ) ) { if ( this . keyTable [ index ] == key ) return true ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return false ; } public int hash ( long key ) { return ( ( int ) key & <NUM_LIT> ) % this . keyTable . length ; } public int put ( long key , int value ) { int index = hash ( key ) , length = this . keyTable . length ; while ( ( this . keyTable [ index ] != <NUM_LIT:0> ) || ( ( this . keyTable [ index ] == <NUM_LIT:0> ) && ( this . valueTable [ index ] != <NUM_LIT:0> ) ) ) { if ( this . keyTable [ index ] == key ) return this . valueTable [ index ] = value ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } this . keyTable [ index ] = key ; this . valueTable [ index ] = value ; if ( ++ this . elementSize > this . threshold ) { rehash ( ) ; } return value ; } public int putIfAbsent ( long key , int value ) { int index = hash ( key ) , length = this . keyTable . length ; while ( ( this . keyTable [ index ] != <NUM_LIT:0> ) || ( ( this . keyTable [ index ] == <NUM_LIT:0> ) && ( this . valueTable [ index ] != <NUM_LIT:0> ) ) ) { if ( this . keyTable [ index ] == key ) return this . valueTable [ index ] ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } this . keyTable [ index ] = key ; this . valueTable [ index ] = value ; if ( ++ this . elementSize > this . threshold ) { rehash ( ) ; } return - value ; } private void rehash ( ) { LongCache newHashtable = new LongCache ( this . keyTable . length * <NUM_LIT:2> ) ; for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) { long key = this . keyTable [ i ] ; int value = this . valueTable [ i ] ; if ( ( key != <NUM_LIT:0> ) || ( ( key == <NUM_LIT:0> ) && ( value != <NUM_LIT:0> ) ) ) { newHashtable . put ( key , value ) ; } } this . keyTable = newHashtable . keyTable ; this . valueTable = newHashtable . valueTable ; this . threshold = newHashtable . threshold ; } public int size ( ) { return this . elementSize ; } public String toString ( ) { int max = size ( ) ; StringBuffer buf = new StringBuffer ( ) ; buf . append ( "<STR_LIT:{>" ) ; for ( int i = <NUM_LIT:0> ; i < max ; ++ i ) { if ( ( this . keyTable [ i ] != <NUM_LIT:0> ) || ( ( this . keyTable [ i ] == <NUM_LIT:0> ) && ( this . valueTable [ i ] != <NUM_LIT:0> ) ) ) { buf . append ( this . keyTable [ i ] ) . append ( "<STR_LIT>" ) . append ( this . valueTable [ i ] ) ; } if ( i < max ) { buf . append ( "<STR_LIT:U+002CU+0020>" ) ; } } buf . append ( "<STR_LIT:}>" ) ; return buf . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . codegen ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ClassFile ; import org . eclipse . jdt . internal . compiler . CompilationResult ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . AbstractMethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . AllocationExpression ; import org . eclipse . jdt . internal . compiler . ast . ExplicitConstructorCall ; import org . eclipse . jdt . internal . compiler . ast . Expression ; import org . eclipse . jdt . internal . compiler . ast . OperatorIds ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . flow . UnconditionalFlowInfo ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . * ; import org . eclipse . jdt . internal . compiler . problem . AbortMethod ; import org . eclipse . jdt . internal . compiler . util . Util ; public class CodeStream { public static FieldBinding [ ] ImplicitThis = new FieldBinding [ ] { } ; public static final int LABELS_INCREMENT = <NUM_LIT:5> ; public static final int LOCALS_INCREMENT = <NUM_LIT:10> ; static ExceptionLabel [ ] noExceptionHandlers = new ExceptionLabel [ LABELS_INCREMENT ] ; static BranchLabel [ ] noLabels = new BranchLabel [ LABELS_INCREMENT ] ; static LocalVariableBinding [ ] noLocals = new LocalVariableBinding [ LOCALS_INCREMENT ] ; static LocalVariableBinding [ ] noVisibleLocals = new LocalVariableBinding [ LOCALS_INCREMENT ] ; public static final CompilationResult RESTART_IN_WIDE_MODE = new CompilationResult ( ( char [ ] ) null , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ) ; public int allLocalsCounter ; public byte [ ] bCodeStream ; public ClassFile classFile ; public int classFileOffset ; public ConstantPool constantPool ; public int countLabels ; public ExceptionLabel [ ] exceptionLabels = new ExceptionLabel [ LABELS_INCREMENT ] ; public int exceptionLabelsCounter ; public int generateAttributes ; static final int L_UNKNOWN = <NUM_LIT:0> , L_OPTIMIZABLE = <NUM_LIT:2> , L_CANNOT_OPTIMIZE = <NUM_LIT:4> ; public BranchLabel [ ] labels = new BranchLabel [ LABELS_INCREMENT ] ; public int lastEntryPC ; public int lastAbruptCompletion ; public int [ ] lineSeparatorPositions ; public int lineNumberStart ; public int lineNumberEnd ; public LocalVariableBinding [ ] locals = new LocalVariableBinding [ LOCALS_INCREMENT ] ; public int maxFieldCount ; public int maxLocals ; public AbstractMethodDeclaration methodDeclaration ; public int [ ] pcToSourceMap = new int [ <NUM_LIT:24> ] ; public int pcToSourceMapSize ; public int position ; public boolean preserveUnusedLocals ; public int stackDepth ; public int stackMax ; public int startingClassFileOffset ; protected long targetLevel ; public LocalVariableBinding [ ] visibleLocals = new LocalVariableBinding [ LOCALS_INCREMENT ] ; int visibleLocalsCount ; public boolean wideMode = false ; public CodeStream ( ClassFile givenClassFile ) { this . targetLevel = givenClassFile . targetJDK ; this . generateAttributes = givenClassFile . produceAttributes ; if ( ( givenClassFile . produceAttributes & ClassFileConstants . ATTR_LINES ) != <NUM_LIT:0> ) { this . lineSeparatorPositions = givenClassFile . referenceBinding . scope . referenceCompilationUnit ( ) . compilationResult . getLineSeparatorPositions ( ) ; } } public static int insertionIndex ( int [ ] pcToSourceMap , int length , int pc ) { int g = <NUM_LIT:0> ; int d = length - <NUM_LIT:2> ; int m = <NUM_LIT:0> ; while ( g <= d ) { m = ( g + d ) / <NUM_LIT:2> ; if ( ( m & <NUM_LIT:1> ) != <NUM_LIT:0> ) m -- ; int currentPC = pcToSourceMap [ m ] ; if ( pc < currentPC ) { d = m - <NUM_LIT:2> ; } else if ( pc > currentPC ) { g = m + <NUM_LIT:2> ; } else { return - <NUM_LIT:1> ; } } if ( pc < pcToSourceMap [ m ] ) return m ; return m + <NUM_LIT:2> ; } public static final void sort ( int [ ] tab , int lo0 , int hi0 , int [ ] result ) { int lo = lo0 ; int hi = hi0 ; int mid ; if ( hi0 > lo0 ) { mid = tab [ lo0 + ( hi0 - lo0 ) / <NUM_LIT:2> ] ; while ( lo <= hi ) { while ( ( lo < hi0 ) && ( tab [ lo ] < mid ) ) ++ lo ; while ( ( hi > lo0 ) && ( tab [ hi ] > mid ) ) -- hi ; if ( lo <= hi ) { swap ( tab , lo , hi , result ) ; ++ lo ; -- hi ; } } if ( lo0 < hi ) sort ( tab , lo0 , hi , result ) ; if ( lo < hi0 ) sort ( tab , lo , hi0 , result ) ; } } private static final void swap ( int a [ ] , int i , int j , int result [ ] ) { int T ; T = a [ i ] ; a [ i ] = a [ j ] ; a [ j ] = T ; T = result [ j ] ; result [ j ] = result [ i ] ; result [ i ] = T ; } public void aaload ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_aaload ; } public void aastore ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:3> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_aastore ; } public void aconst_null ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) { this . stackMax = this . stackDepth ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_aconst_null ; } public void addDefinitelyAssignedVariables ( Scope scope , int initStateIndex ) { if ( ( this . generateAttributes & ( ClassFileConstants . ATTR_VARS | ClassFileConstants . ATTR_STACK_MAP_TABLE | ClassFileConstants . ATTR_STACK_MAP ) ) == <NUM_LIT:0> ) return ; for ( int i = <NUM_LIT:0> ; i < this . visibleLocalsCount ; i ++ ) { LocalVariableBinding localBinding = this . visibleLocals [ i ] ; if ( localBinding != null ) { if ( isDefinitelyAssigned ( scope , initStateIndex , localBinding ) ) { if ( ( localBinding . initializationCount == <NUM_LIT:0> ) || ( localBinding . initializationPCs [ ( ( localBinding . initializationCount - <NUM_LIT:1> ) << <NUM_LIT:1> ) + <NUM_LIT:1> ] != - <NUM_LIT:1> ) ) { localBinding . recordInitializationStartPC ( this . position ) ; } } } } } public void addLabel ( BranchLabel aLabel ) { if ( this . countLabels == this . labels . length ) System . arraycopy ( this . labels , <NUM_LIT:0> , this . labels = new BranchLabel [ this . countLabels + LABELS_INCREMENT ] , <NUM_LIT:0> , this . countLabels ) ; this . labels [ this . countLabels ++ ] = aLabel ; } public void addVariable ( LocalVariableBinding localBinding ) { } public void addVisibleLocalVariable ( LocalVariableBinding localBinding ) { if ( ( this . generateAttributes & ( ClassFileConstants . ATTR_VARS | ClassFileConstants . ATTR_STACK_MAP_TABLE | ClassFileConstants . ATTR_STACK_MAP ) ) == <NUM_LIT:0> ) return ; if ( this . visibleLocalsCount >= this . visibleLocals . length ) System . arraycopy ( this . visibleLocals , <NUM_LIT:0> , this . visibleLocals = new LocalVariableBinding [ this . visibleLocalsCount * <NUM_LIT:2> ] , <NUM_LIT:0> , this . visibleLocalsCount ) ; this . visibleLocals [ this . visibleLocalsCount ++ ] = localBinding ; } public void aload ( int iArg ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . maxLocals <= iArg ) { this . maxLocals = iArg + <NUM_LIT:1> ; } if ( iArg > <NUM_LIT:255> ) { if ( this . classFileOffset + <NUM_LIT:3> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_wide ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_aload ; writeUnsignedShort ( iArg ) ; } else { if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_aload ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) iArg ; } } public void aload_0 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) { this . stackMax = this . stackDepth ; } if ( this . maxLocals == <NUM_LIT:0> ) { this . maxLocals = <NUM_LIT:1> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_aload_0 ; } public void aload_1 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . maxLocals <= <NUM_LIT:1> ) { this . maxLocals = <NUM_LIT:2> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_aload_1 ; } public void aload_2 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . maxLocals <= <NUM_LIT:2> ) { this . maxLocals = <NUM_LIT:3> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_aload_2 ; } public void aload_3 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . maxLocals <= <NUM_LIT:3> ) { this . maxLocals = <NUM_LIT:4> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_aload_3 ; } public void anewarray ( TypeBinding typeBinding ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_anewarray ; writeUnsignedShort ( this . constantPool . literalIndexForType ( typeBinding ) ) ; } public void areturn ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_areturn ; this . lastAbruptCompletion = this . position ; } public void arrayAt ( int typeBindingID ) { switch ( typeBindingID ) { case TypeIds . T_int : iaload ( ) ; break ; case TypeIds . T_byte : case TypeIds . T_boolean : baload ( ) ; break ; case TypeIds . T_short : saload ( ) ; break ; case TypeIds . T_char : caload ( ) ; break ; case TypeIds . T_long : laload ( ) ; break ; case TypeIds . T_float : faload ( ) ; break ; case TypeIds . T_double : daload ( ) ; break ; default : aaload ( ) ; } } public void arrayAtPut ( int elementTypeID , boolean valueRequired ) { switch ( elementTypeID ) { case TypeIds . T_int : if ( valueRequired ) dup_x2 ( ) ; iastore ( ) ; break ; case TypeIds . T_byte : case TypeIds . T_boolean : if ( valueRequired ) dup_x2 ( ) ; bastore ( ) ; break ; case TypeIds . T_short : if ( valueRequired ) dup_x2 ( ) ; sastore ( ) ; break ; case TypeIds . T_char : if ( valueRequired ) dup_x2 ( ) ; castore ( ) ; break ; case TypeIds . T_long : if ( valueRequired ) dup2_x2 ( ) ; lastore ( ) ; break ; case TypeIds . T_float : if ( valueRequired ) dup_x2 ( ) ; fastore ( ) ; break ; case TypeIds . T_double : if ( valueRequired ) dup2_x2 ( ) ; dastore ( ) ; break ; default : if ( valueRequired ) dup_x2 ( ) ; aastore ( ) ; } } public void arraylength ( ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_arraylength ; } public void astore ( int iArg ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . maxLocals <= iArg ) { this . maxLocals = iArg + <NUM_LIT:1> ; } if ( iArg > <NUM_LIT:255> ) { if ( this . classFileOffset + <NUM_LIT:3> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_wide ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_astore ; writeUnsignedShort ( iArg ) ; } else { if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_astore ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) iArg ; } } public void astore_0 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . maxLocals == <NUM_LIT:0> ) { this . maxLocals = <NUM_LIT:1> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_astore_0 ; } public void astore_1 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . maxLocals <= <NUM_LIT:1> ) { this . maxLocals = <NUM_LIT:2> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_astore_1 ; } public void astore_2 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . maxLocals <= <NUM_LIT:2> ) { this . maxLocals = <NUM_LIT:3> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_astore_2 ; } public void astore_3 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . maxLocals <= <NUM_LIT:3> ) { this . maxLocals = <NUM_LIT:4> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_astore_3 ; } public void athrow ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_athrow ; this . lastAbruptCompletion = this . position ; } public void baload ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_baload ; } public void bastore ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:3> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_bastore ; } public void bipush ( byte b ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_bipush ; this . bCodeStream [ this . classFileOffset ++ ] = b ; } public void caload ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_caload ; } public void castore ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:3> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_castore ; } public void checkcast ( int baseId ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_checkcast ; switch ( baseId ) { case TypeIds . T_byte : writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangByteConstantPoolName ) ) ; break ; case TypeIds . T_short : writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangShortConstantPoolName ) ) ; break ; case TypeIds . T_char : writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangCharacterConstantPoolName ) ) ; break ; case TypeIds . T_int : writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangIntegerConstantPoolName ) ) ; break ; case TypeIds . T_long : writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangLongConstantPoolName ) ) ; break ; case TypeIds . T_float : writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangFloatConstantPoolName ) ) ; break ; case TypeIds . T_double : writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangDoubleConstantPoolName ) ) ; break ; case TypeIds . T_boolean : writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangBooleanConstantPoolName ) ) ; } } public void checkcast ( TypeBinding typeBinding ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_checkcast ; writeUnsignedShort ( this . constantPool . literalIndexForType ( typeBinding ) ) ; } public void d2f ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_d2f ; } public void d2i ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_d2i ; } public void d2l ( ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_d2l ; } public void dadd ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dadd ; } public void daload ( ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_daload ; } public void dastore ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:4> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dastore ; } public void dcmpg ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:3> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dcmpg ; } public void dcmpl ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:3> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dcmpl ; } public void dconst_0 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += <NUM_LIT:2> ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dconst_0 ; } public void dconst_1 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += <NUM_LIT:2> ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dconst_1 ; } public void ddiv ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ddiv ; } public void decrStackSize ( int offset ) { this . stackDepth -= offset ; } public void dload ( int iArg ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += <NUM_LIT:2> ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . maxLocals < iArg + <NUM_LIT:2> ) { this . maxLocals = iArg + <NUM_LIT:2> ; } if ( iArg > <NUM_LIT:255> ) { if ( this . classFileOffset + <NUM_LIT:3> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_wide ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dload ; writeUnsignedShort ( iArg ) ; } else { if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dload ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) iArg ; } } public void dload_0 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += <NUM_LIT:2> ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . maxLocals < <NUM_LIT:2> ) { this . maxLocals = <NUM_LIT:2> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dload_0 ; } public void dload_1 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += <NUM_LIT:2> ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . maxLocals < <NUM_LIT:3> ) { this . maxLocals = <NUM_LIT:3> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dload_1 ; } public void dload_2 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += <NUM_LIT:2> ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . maxLocals < <NUM_LIT:4> ) { this . maxLocals = <NUM_LIT:4> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dload_2 ; } public void dload_3 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += <NUM_LIT:2> ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . maxLocals < <NUM_LIT:5> ) { this . maxLocals = <NUM_LIT:5> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dload_3 ; } public void dmul ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dmul ; } public void dneg ( ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dneg ; } public void drem ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_drem ; } public void dreturn ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dreturn ; this . lastAbruptCompletion = this . position ; } public void dstore ( int iArg ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . maxLocals <= iArg + <NUM_LIT:1> ) { this . maxLocals = iArg + <NUM_LIT:2> ; } if ( iArg > <NUM_LIT:255> ) { if ( this . classFileOffset + <NUM_LIT:3> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_wide ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dstore ; writeUnsignedShort ( iArg ) ; } else { if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dstore ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) iArg ; } } public void dstore_0 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . maxLocals < <NUM_LIT:2> ) { this . maxLocals = <NUM_LIT:2> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dstore_0 ; } public void dstore_1 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . maxLocals < <NUM_LIT:3> ) { this . maxLocals = <NUM_LIT:3> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dstore_1 ; } public void dstore_2 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . maxLocals < <NUM_LIT:4> ) { this . maxLocals = <NUM_LIT:4> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dstore_2 ; } public void dstore_3 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . maxLocals < <NUM_LIT:5> ) { this . maxLocals = <NUM_LIT:5> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dstore_3 ; } public void dsub ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dsub ; } public void dup ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) { this . stackMax = this . stackDepth ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dup ; } public void dup_x1 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dup_x1 ; } public void dup_x2 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dup_x2 ; } public void dup2 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += <NUM_LIT:2> ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dup2 ; } public void dup2_x1 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += <NUM_LIT:2> ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dup2_x1 ; } public void dup2_x2 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += <NUM_LIT:2> ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dup2_x2 ; } public void exitUserScope ( BlockScope currentScope ) { if ( ( this . generateAttributes & ( ClassFileConstants . ATTR_VARS | ClassFileConstants . ATTR_STACK_MAP_TABLE | ClassFileConstants . ATTR_STACK_MAP ) ) == <NUM_LIT:0> ) return ; int index = this . visibleLocalsCount - <NUM_LIT:1> ; while ( index >= <NUM_LIT:0> ) { LocalVariableBinding visibleLocal = this . visibleLocals [ index ] ; if ( visibleLocal == null || visibleLocal . declaringScope != currentScope ) { index -- ; continue ; } if ( visibleLocal . initializationCount > <NUM_LIT:0> ) { visibleLocal . recordInitializationEndPC ( this . position ) ; } this . visibleLocals [ index -- ] = null ; } } public void exitUserScope ( BlockScope currentScope , LocalVariableBinding binding ) { if ( ( this . generateAttributes & ( ClassFileConstants . ATTR_VARS | ClassFileConstants . ATTR_STACK_MAP_TABLE | ClassFileConstants . ATTR_STACK_MAP ) ) == <NUM_LIT:0> ) return ; int index = this . visibleLocalsCount - <NUM_LIT:1> ; while ( index >= <NUM_LIT:0> ) { LocalVariableBinding visibleLocal = this . visibleLocals [ index ] ; if ( visibleLocal == null || visibleLocal . declaringScope != currentScope || visibleLocal == binding ) { index -- ; continue ; } if ( visibleLocal . initializationCount > <NUM_LIT:0> ) { visibleLocal . recordInitializationEndPC ( this . position ) ; } this . visibleLocals [ index -- ] = null ; } } public void f2d ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_f2d ; } public void f2i ( ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_f2i ; } public void f2l ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_f2l ; } public void fadd ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fadd ; } public void faload ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_faload ; } public void fastore ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:3> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fastore ; } public void fcmpg ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fcmpg ; } public void fcmpl ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fcmpl ; } public void fconst_0 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fconst_0 ; } public void fconst_1 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fconst_1 ; } public void fconst_2 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fconst_2 ; } public void fdiv ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fdiv ; } public void fieldAccess ( byte opcode , FieldBinding fieldBinding , TypeBinding declaringClass ) { if ( declaringClass == null ) declaringClass = fieldBinding . declaringClass ; if ( ( declaringClass . tagBits & TagBits . ContainsNestedTypeReferences ) != <NUM_LIT:0> ) { Util . recordNestedType ( this . classFile , declaringClass ) ; } TypeBinding returnType = fieldBinding . type ; int returnTypeSize ; switch ( returnType . id ) { case TypeIds . T_long : case TypeIds . T_double : returnTypeSize = <NUM_LIT:2> ; break ; default : returnTypeSize = <NUM_LIT:1> ; break ; } this . fieldAccess ( opcode , returnTypeSize , declaringClass . constantPoolName ( ) , fieldBinding . name , returnType . signature ( ) ) ; } private void fieldAccess ( byte opcode , int returnTypeSize , char [ ] declaringClass , char [ ] fieldName , char [ ] signature ) { this . countLabels = <NUM_LIT:0> ; switch ( opcode ) { case Opcodes . OPC_getfield : if ( returnTypeSize == <NUM_LIT:2> ) { this . stackDepth ++ ; } break ; case Opcodes . OPC_getstatic : if ( returnTypeSize == <NUM_LIT:2> ) { this . stackDepth += <NUM_LIT:2> ; } else { this . stackDepth ++ ; } break ; case Opcodes . OPC_putfield : if ( returnTypeSize == <NUM_LIT:2> ) { this . stackDepth -= <NUM_LIT:3> ; } else { this . stackDepth -= <NUM_LIT:2> ; } break ; case Opcodes . OPC_putstatic : if ( returnTypeSize == <NUM_LIT:2> ) { this . stackDepth -= <NUM_LIT:2> ; } else { this . stackDepth -- ; } } if ( this . stackDepth > this . stackMax ) { this . stackMax = this . stackDepth ; } if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = opcode ; writeUnsignedShort ( this . constantPool . literalIndexForField ( declaringClass , fieldName , signature ) ) ; } public void fload ( int iArg ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . maxLocals <= iArg ) { this . maxLocals = iArg + <NUM_LIT:1> ; } if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( iArg > <NUM_LIT:255> ) { if ( this . classFileOffset + <NUM_LIT:3> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_wide ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fload ; writeUnsignedShort ( iArg ) ; } else { if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fload ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) iArg ; } } public void fload_0 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . maxLocals == <NUM_LIT:0> ) { this . maxLocals = <NUM_LIT:1> ; } if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fload_0 ; } public void fload_1 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . maxLocals <= <NUM_LIT:1> ) { this . maxLocals = <NUM_LIT:2> ; } if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fload_1 ; } public void fload_2 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . maxLocals <= <NUM_LIT:2> ) { this . maxLocals = <NUM_LIT:3> ; } if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fload_2 ; } public void fload_3 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . maxLocals <= <NUM_LIT:3> ) { this . maxLocals = <NUM_LIT:4> ; } if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fload_3 ; } public void fmul ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fmul ; } public void fneg ( ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fneg ; } public void frem ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_frem ; } public void freturn ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_freturn ; this . lastAbruptCompletion = this . position ; } public void fstore ( int iArg ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . maxLocals <= iArg ) { this . maxLocals = iArg + <NUM_LIT:1> ; } if ( iArg > <NUM_LIT:255> ) { if ( this . classFileOffset + <NUM_LIT:3> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_wide ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fstore ; writeUnsignedShort ( iArg ) ; } else { if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fstore ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) iArg ; } } public void fstore_0 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . maxLocals == <NUM_LIT:0> ) { this . maxLocals = <NUM_LIT:1> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fstore_0 ; } public void fstore_1 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . maxLocals <= <NUM_LIT:1> ) { this . maxLocals = <NUM_LIT:2> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fstore_1 ; } public void fstore_2 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . maxLocals <= <NUM_LIT:2> ) { this . maxLocals = <NUM_LIT:3> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fstore_2 ; } public void fstore_3 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . maxLocals <= <NUM_LIT:3> ) { this . maxLocals = <NUM_LIT:4> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fstore_3 ; } public void fsub ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fsub ; } public void generateBoxingConversion ( int unboxedTypeID ) { switch ( unboxedTypeID ) { case TypeIds . T_byte : if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { invoke ( Opcodes . OPC_invokestatic , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangByteConstantPoolName , ConstantPool . ValueOf , ConstantPool . byteByteSignature ) ; } else { newWrapperFor ( unboxedTypeID ) ; dup_x1 ( ) ; swap ( ) ; invoke ( Opcodes . OPC_invokespecial , <NUM_LIT:2> , <NUM_LIT:0> , ConstantPool . JavaLangByteConstantPoolName , ConstantPool . Init , ConstantPool . ByteConstrSignature ) ; } break ; case TypeIds . T_short : if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { invoke ( Opcodes . OPC_invokestatic , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangShortConstantPoolName , ConstantPool . ValueOf , ConstantPool . shortShortSignature ) ; } else { newWrapperFor ( unboxedTypeID ) ; dup_x1 ( ) ; swap ( ) ; invoke ( Opcodes . OPC_invokespecial , <NUM_LIT:2> , <NUM_LIT:0> , ConstantPool . JavaLangShortConstantPoolName , ConstantPool . Init , ConstantPool . ShortConstrSignature ) ; } break ; case TypeIds . T_char : if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { invoke ( Opcodes . OPC_invokestatic , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangCharacterConstantPoolName , ConstantPool . ValueOf , ConstantPool . charCharacterSignature ) ; } else { newWrapperFor ( unboxedTypeID ) ; dup_x1 ( ) ; swap ( ) ; invoke ( Opcodes . OPC_invokespecial , <NUM_LIT:2> , <NUM_LIT:0> , ConstantPool . JavaLangCharacterConstantPoolName , ConstantPool . Init , ConstantPool . CharConstrSignature ) ; } break ; case TypeIds . T_int : if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { invoke ( Opcodes . OPC_invokestatic , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangIntegerConstantPoolName , ConstantPool . ValueOf , ConstantPool . IntIntegerSignature ) ; } else { newWrapperFor ( unboxedTypeID ) ; dup_x1 ( ) ; swap ( ) ; invoke ( Opcodes . OPC_invokespecial , <NUM_LIT:2> , <NUM_LIT:0> , ConstantPool . JavaLangIntegerConstantPoolName , ConstantPool . Init , ConstantPool . IntConstrSignature ) ; } break ; case TypeIds . T_long : if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { invoke ( Opcodes . OPC_invokestatic , <NUM_LIT:2> , <NUM_LIT:1> , ConstantPool . JavaLangLongConstantPoolName , ConstantPool . ValueOf , ConstantPool . longLongSignature ) ; } else { newWrapperFor ( unboxedTypeID ) ; dup_x2 ( ) ; dup_x2 ( ) ; pop ( ) ; invoke ( Opcodes . OPC_invokespecial , <NUM_LIT:3> , <NUM_LIT:0> , ConstantPool . JavaLangLongConstantPoolName , ConstantPool . Init , ConstantPool . LongConstrSignature ) ; } break ; case TypeIds . T_float : if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { invoke ( Opcodes . OPC_invokestatic , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangFloatConstantPoolName , ConstantPool . ValueOf , ConstantPool . floatFloatSignature ) ; } else { newWrapperFor ( unboxedTypeID ) ; dup_x1 ( ) ; swap ( ) ; invoke ( Opcodes . OPC_invokespecial , <NUM_LIT:2> , <NUM_LIT:0> , ConstantPool . JavaLangFloatConstantPoolName , ConstantPool . Init , ConstantPool . FloatConstrSignature ) ; } break ; case TypeIds . T_double : if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { invoke ( Opcodes . OPC_invokestatic , <NUM_LIT:2> , <NUM_LIT:1> , ConstantPool . JavaLangDoubleConstantPoolName , ConstantPool . ValueOf , ConstantPool . doubleDoubleSignature ) ; } else { newWrapperFor ( unboxedTypeID ) ; dup_x2 ( ) ; dup_x2 ( ) ; pop ( ) ; invoke ( Opcodes . OPC_invokespecial , <NUM_LIT:3> , <NUM_LIT:0> , ConstantPool . JavaLangDoubleConstantPoolName , ConstantPool . Init , ConstantPool . DoubleConstrSignature ) ; } break ; case TypeIds . T_boolean : if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { invoke ( Opcodes . OPC_invokestatic , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangBooleanConstantPoolName , ConstantPool . ValueOf , ConstantPool . booleanBooleanSignature ) ; } else { newWrapperFor ( unboxedTypeID ) ; dup_x1 ( ) ; swap ( ) ; invoke ( Opcodes . OPC_invokespecial , <NUM_LIT:2> , <NUM_LIT:0> , ConstantPool . JavaLangBooleanConstantPoolName , ConstantPool . Init , ConstantPool . BooleanConstrSignature ) ; } } } public void generateClassLiteralAccessForType ( TypeBinding accessedType , FieldBinding syntheticFieldBinding ) { if ( accessedType . isBaseType ( ) && accessedType != TypeBinding . NULL ) { getTYPE ( accessedType . id ) ; return ; } if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { this . ldc ( accessedType ) ; } else { BranchLabel endLabel = new BranchLabel ( this ) ; if ( syntheticFieldBinding != null ) { fieldAccess ( Opcodes . OPC_getstatic , syntheticFieldBinding , null ) ; dup ( ) ; ifnonnull ( endLabel ) ; pop ( ) ; } ExceptionLabel classNotFoundExceptionHandler = new ExceptionLabel ( this , TypeBinding . NULL ) ; classNotFoundExceptionHandler . placeStart ( ) ; this . ldc ( accessedType == TypeBinding . NULL ? "<STR_LIT>" : String . valueOf ( accessedType . constantPoolName ( ) ) . replace ( '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ) ; invokeClassForName ( ) ; classNotFoundExceptionHandler . placeEnd ( ) ; if ( syntheticFieldBinding != null ) { dup ( ) ; fieldAccess ( Opcodes . OPC_putstatic , syntheticFieldBinding , null ) ; } goto_ ( endLabel ) ; int savedStackDepth = this . stackDepth ; pushExceptionOnStack ( TypeBinding . NULL ) ; classNotFoundExceptionHandler . place ( ) ; newNoClassDefFoundError ( ) ; dup_x1 ( ) ; this . swap ( ) ; invokeThrowableGetMessage ( ) ; invokeNoClassDefFoundErrorStringConstructor ( ) ; athrow ( ) ; endLabel . place ( ) ; this . stackDepth = savedStackDepth ; } } final public void generateCodeAttributeForProblemMethod ( String problemMessage ) { newJavaLangError ( ) ; dup ( ) ; ldc ( problemMessage ) ; invokeJavaLangErrorConstructor ( ) ; athrow ( ) ; } public void generateConstant ( Constant constant , int implicitConversionCode ) { int targetTypeID = ( implicitConversionCode & TypeIds . IMPLICIT_CONVERSION_MASK ) > > <NUM_LIT:4> ; if ( targetTypeID == <NUM_LIT:0> ) targetTypeID = constant . typeID ( ) ; switch ( targetTypeID ) { case TypeIds . T_boolean : generateInlinedValue ( constant . booleanValue ( ) ) ; break ; case TypeIds . T_char : generateInlinedValue ( constant . charValue ( ) ) ; break ; case TypeIds . T_byte : generateInlinedValue ( constant . byteValue ( ) ) ; break ; case TypeIds . T_short : generateInlinedValue ( constant . shortValue ( ) ) ; break ; case TypeIds . T_int : generateInlinedValue ( constant . intValue ( ) ) ; break ; case TypeIds . T_long : generateInlinedValue ( constant . longValue ( ) ) ; break ; case TypeIds . T_float : generateInlinedValue ( constant . floatValue ( ) ) ; break ; case TypeIds . T_double : generateInlinedValue ( constant . doubleValue ( ) ) ; break ; case TypeIds . T_JavaLangString : ldc ( constant . stringValue ( ) ) ; } if ( ( implicitConversionCode & TypeIds . BOXING ) != <NUM_LIT:0> ) { generateBoxingConversion ( targetTypeID ) ; } } public void generateEmulatedReadAccessForField ( FieldBinding fieldBinding ) { generateEmulationForField ( fieldBinding ) ; this . swap ( ) ; invokeJavaLangReflectFieldGetter ( fieldBinding . type . id ) ; if ( ! fieldBinding . type . isBaseType ( ) ) { this . checkcast ( fieldBinding . type ) ; } } public void generateEmulatedWriteAccessForField ( FieldBinding fieldBinding ) { invokeJavaLangReflectFieldSetter ( fieldBinding . type . id ) ; } public void generateEmulationForConstructor ( Scope scope , MethodBinding methodBinding ) { this . ldc ( String . valueOf ( methodBinding . declaringClass . constantPoolName ( ) ) . replace ( '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ) ; invokeClassForName ( ) ; int paramLength = methodBinding . parameters . length ; this . generateInlinedValue ( paramLength ) ; newArray ( scope . createArrayType ( scope . getType ( TypeConstants . JAVA_LANG_CLASS , <NUM_LIT:3> ) , <NUM_LIT:1> ) ) ; if ( paramLength > <NUM_LIT:0> ) { dup ( ) ; for ( int i = <NUM_LIT:0> ; i < paramLength ; i ++ ) { this . generateInlinedValue ( i ) ; TypeBinding parameter = methodBinding . parameters [ i ] ; if ( parameter . isBaseType ( ) ) { getTYPE ( parameter . id ) ; } else if ( parameter . isArrayType ( ) ) { ArrayBinding array = ( ArrayBinding ) parameter ; if ( array . leafComponentType . isBaseType ( ) ) { getTYPE ( array . leafComponentType . id ) ; } else { this . ldc ( String . valueOf ( array . leafComponentType . constantPoolName ( ) ) . replace ( '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ) ; invokeClassForName ( ) ; } int dimensions = array . dimensions ; this . generateInlinedValue ( dimensions ) ; newarray ( TypeIds . T_int ) ; invokeArrayNewInstance ( ) ; invokeObjectGetClass ( ) ; } else { this . ldc ( String . valueOf ( methodBinding . declaringClass . constantPoolName ( ) ) . replace ( '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ) ; invokeClassForName ( ) ; } aastore ( ) ; if ( i < paramLength - <NUM_LIT:1> ) { dup ( ) ; } } } invokeClassGetDeclaredConstructor ( ) ; dup ( ) ; iconst_1 ( ) ; invokeAccessibleObjectSetAccessible ( ) ; } public void generateEmulationForField ( FieldBinding fieldBinding ) { this . ldc ( String . valueOf ( fieldBinding . declaringClass . constantPoolName ( ) ) . replace ( '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ) ; invokeClassForName ( ) ; this . ldc ( String . valueOf ( fieldBinding . name ) ) ; invokeClassGetDeclaredField ( ) ; dup ( ) ; iconst_1 ( ) ; invokeAccessibleObjectSetAccessible ( ) ; } public void generateEmulationForMethod ( Scope scope , MethodBinding methodBinding ) { this . ldc ( String . valueOf ( methodBinding . declaringClass . constantPoolName ( ) ) . replace ( '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ) ; invokeClassForName ( ) ; this . ldc ( String . valueOf ( methodBinding . selector ) ) ; int paramLength = methodBinding . parameters . length ; this . generateInlinedValue ( paramLength ) ; newArray ( scope . createArrayType ( scope . getType ( TypeConstants . JAVA_LANG_CLASS , <NUM_LIT:3> ) , <NUM_LIT:1> ) ) ; if ( paramLength > <NUM_LIT:0> ) { dup ( ) ; for ( int i = <NUM_LIT:0> ; i < paramLength ; i ++ ) { this . generateInlinedValue ( i ) ; TypeBinding parameter = methodBinding . parameters [ i ] ; if ( parameter . isBaseType ( ) ) { getTYPE ( parameter . id ) ; } else if ( parameter . isArrayType ( ) ) { ArrayBinding array = ( ArrayBinding ) parameter ; if ( array . leafComponentType . isBaseType ( ) ) { getTYPE ( array . leafComponentType . id ) ; } else { this . ldc ( String . valueOf ( array . leafComponentType . constantPoolName ( ) ) . replace ( '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ) ; invokeClassForName ( ) ; } int dimensions = array . dimensions ; this . generateInlinedValue ( dimensions ) ; newarray ( TypeIds . T_int ) ; invokeArrayNewInstance ( ) ; invokeObjectGetClass ( ) ; } else { this . ldc ( String . valueOf ( methodBinding . declaringClass . constantPoolName ( ) ) . replace ( '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ) ; invokeClassForName ( ) ; } aastore ( ) ; if ( i < paramLength - <NUM_LIT:1> ) { dup ( ) ; } } } invokeClassGetDeclaredMethod ( ) ; dup ( ) ; iconst_1 ( ) ; invokeAccessibleObjectSetAccessible ( ) ; } public void generateImplicitConversion ( int implicitConversionCode ) { if ( ( implicitConversionCode & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { final int typeId = implicitConversionCode & TypeIds . COMPILE_TYPE_MASK ; generateUnboxingConversion ( typeId ) ; } switch ( implicitConversionCode & TypeIds . IMPLICIT_CONVERSION_MASK ) { case TypeIds . Float2Char : f2i ( ) ; i2c ( ) ; break ; case TypeIds . Double2Char : d2i ( ) ; i2c ( ) ; break ; case TypeIds . Int2Char : case TypeIds . Short2Char : case TypeIds . Byte2Char : i2c ( ) ; break ; case TypeIds . Long2Char : l2i ( ) ; i2c ( ) ; break ; case TypeIds . Char2Float : case TypeIds . Short2Float : case TypeIds . Int2Float : case TypeIds . Byte2Float : i2f ( ) ; break ; case TypeIds . Double2Float : d2f ( ) ; break ; case TypeIds . Long2Float : l2f ( ) ; break ; case TypeIds . Float2Byte : f2i ( ) ; i2b ( ) ; break ; case TypeIds . Double2Byte : d2i ( ) ; i2b ( ) ; break ; case TypeIds . Int2Byte : case TypeIds . Short2Byte : case TypeIds . Char2Byte : i2b ( ) ; break ; case TypeIds . Long2Byte : l2i ( ) ; i2b ( ) ; break ; case TypeIds . Byte2Double : case TypeIds . Char2Double : case TypeIds . Short2Double : case TypeIds . Int2Double : i2d ( ) ; break ; case TypeIds . Float2Double : f2d ( ) ; break ; case TypeIds . Long2Double : l2d ( ) ; break ; case TypeIds . Byte2Short : case TypeIds . Char2Short : case TypeIds . Int2Short : i2s ( ) ; break ; case TypeIds . Double2Short : d2i ( ) ; i2s ( ) ; break ; case TypeIds . Long2Short : l2i ( ) ; i2s ( ) ; break ; case TypeIds . Float2Short : f2i ( ) ; i2s ( ) ; break ; case TypeIds . Double2Int : d2i ( ) ; break ; case TypeIds . Float2Int : f2i ( ) ; break ; case TypeIds . Long2Int : l2i ( ) ; break ; case TypeIds . Int2Long : case TypeIds . Char2Long : case TypeIds . Byte2Long : case TypeIds . Short2Long : i2l ( ) ; break ; case TypeIds . Double2Long : d2l ( ) ; break ; case TypeIds . Float2Long : f2l ( ) ; } if ( ( implicitConversionCode & TypeIds . BOXING ) != <NUM_LIT:0> ) { final int typeId = ( implicitConversionCode & TypeIds . IMPLICIT_CONVERSION_MASK ) > > <NUM_LIT:4> ; generateBoxingConversion ( typeId ) ; } } public void generateInlinedValue ( boolean inlinedValue ) { if ( inlinedValue ) iconst_1 ( ) ; else iconst_0 ( ) ; } public void generateInlinedValue ( byte inlinedValue ) { switch ( inlinedValue ) { case - <NUM_LIT:1> : iconst_m1 ( ) ; break ; case <NUM_LIT:0> : iconst_0 ( ) ; break ; case <NUM_LIT:1> : iconst_1 ( ) ; break ; case <NUM_LIT:2> : iconst_2 ( ) ; break ; case <NUM_LIT:3> : iconst_3 ( ) ; break ; case <NUM_LIT:4> : iconst_4 ( ) ; break ; case <NUM_LIT:5> : iconst_5 ( ) ; break ; default : if ( ( - <NUM_LIT> <= inlinedValue ) && ( inlinedValue <= <NUM_LIT> ) ) { bipush ( inlinedValue ) ; return ; } } } public void generateInlinedValue ( char inlinedValue ) { switch ( inlinedValue ) { case <NUM_LIT:0> : iconst_0 ( ) ; break ; case <NUM_LIT:1> : iconst_1 ( ) ; break ; case <NUM_LIT:2> : iconst_2 ( ) ; break ; case <NUM_LIT:3> : iconst_3 ( ) ; break ; case <NUM_LIT:4> : iconst_4 ( ) ; break ; case <NUM_LIT:5> : iconst_5 ( ) ; break ; default : if ( ( <NUM_LIT:6> <= inlinedValue ) && ( inlinedValue <= <NUM_LIT> ) ) { bipush ( ( byte ) inlinedValue ) ; return ; } if ( ( <NUM_LIT> <= inlinedValue ) && ( inlinedValue <= <NUM_LIT> ) ) { sipush ( inlinedValue ) ; return ; } this . ldc ( inlinedValue ) ; } } public void generateInlinedValue ( double inlinedValue ) { if ( inlinedValue == <NUM_LIT:0.0> ) { if ( Double . doubleToLongBits ( inlinedValue ) != <NUM_LIT> ) this . ldc2_w ( inlinedValue ) ; else dconst_0 ( ) ; return ; } if ( inlinedValue == <NUM_LIT:1.0> ) { dconst_1 ( ) ; return ; } this . ldc2_w ( inlinedValue ) ; } public void generateInlinedValue ( float inlinedValue ) { if ( inlinedValue == <NUM_LIT:0.0f> ) { if ( Float . floatToIntBits ( inlinedValue ) != <NUM_LIT:0> ) this . ldc ( inlinedValue ) ; else fconst_0 ( ) ; return ; } if ( inlinedValue == <NUM_LIT:1.0f> ) { fconst_1 ( ) ; return ; } if ( inlinedValue == <NUM_LIT> ) { fconst_2 ( ) ; return ; } this . ldc ( inlinedValue ) ; } public void generateInlinedValue ( int inlinedValue ) { switch ( inlinedValue ) { case - <NUM_LIT:1> : iconst_m1 ( ) ; break ; case <NUM_LIT:0> : iconst_0 ( ) ; break ; case <NUM_LIT:1> : iconst_1 ( ) ; break ; case <NUM_LIT:2> : iconst_2 ( ) ; break ; case <NUM_LIT:3> : iconst_3 ( ) ; break ; case <NUM_LIT:4> : iconst_4 ( ) ; break ; case <NUM_LIT:5> : iconst_5 ( ) ; break ; default : if ( ( - <NUM_LIT> <= inlinedValue ) && ( inlinedValue <= <NUM_LIT> ) ) { bipush ( ( byte ) inlinedValue ) ; return ; } if ( ( - <NUM_LIT> <= inlinedValue ) && ( inlinedValue <= <NUM_LIT> ) ) { sipush ( inlinedValue ) ; return ; } this . ldc ( inlinedValue ) ; } } public void generateInlinedValue ( long inlinedValue ) { if ( inlinedValue == <NUM_LIT:0> ) { lconst_0 ( ) ; return ; } if ( inlinedValue == <NUM_LIT:1> ) { lconst_1 ( ) ; return ; } this . ldc2_w ( inlinedValue ) ; } public void generateInlinedValue ( short inlinedValue ) { switch ( inlinedValue ) { case - <NUM_LIT:1> : iconst_m1 ( ) ; break ; case <NUM_LIT:0> : iconst_0 ( ) ; break ; case <NUM_LIT:1> : iconst_1 ( ) ; break ; case <NUM_LIT:2> : iconst_2 ( ) ; break ; case <NUM_LIT:3> : iconst_3 ( ) ; break ; case <NUM_LIT:4> : iconst_4 ( ) ; break ; case <NUM_LIT:5> : iconst_5 ( ) ; break ; default : if ( ( - <NUM_LIT> <= inlinedValue ) && ( inlinedValue <= <NUM_LIT> ) ) { bipush ( ( byte ) inlinedValue ) ; return ; } sipush ( inlinedValue ) ; } } public void generateOuterAccess ( Object [ ] mappingSequence , ASTNode invocationSite , Binding target , Scope scope ) { if ( mappingSequence == null ) { if ( target instanceof LocalVariableBinding ) { scope . problemReporter ( ) . needImplementation ( invocationSite ) ; } else { scope . problemReporter ( ) . noSuchEnclosingInstance ( ( ReferenceBinding ) target , invocationSite , false ) ; } return ; } if ( mappingSequence == BlockScope . NoEnclosingInstanceInConstructorCall ) { scope . problemReporter ( ) . noSuchEnclosingInstance ( ( ReferenceBinding ) target , invocationSite , true ) ; return ; } else if ( mappingSequence == BlockScope . NoEnclosingInstanceInStaticContext ) { scope . problemReporter ( ) . noSuchEnclosingInstance ( ( ReferenceBinding ) target , invocationSite , false ) ; return ; } if ( mappingSequence == BlockScope . EmulationPathToImplicitThis ) { aload_0 ( ) ; return ; } else if ( mappingSequence [ <NUM_LIT:0> ] instanceof FieldBinding ) { FieldBinding fieldBinding = ( FieldBinding ) mappingSequence [ <NUM_LIT:0> ] ; aload_0 ( ) ; fieldAccess ( Opcodes . OPC_getfield , fieldBinding , null ) ; } else { load ( ( LocalVariableBinding ) mappingSequence [ <NUM_LIT:0> ] ) ; } for ( int i = <NUM_LIT:1> , length = mappingSequence . length ; i < length ; i ++ ) { if ( mappingSequence [ i ] instanceof FieldBinding ) { FieldBinding fieldBinding = ( FieldBinding ) mappingSequence [ i ] ; fieldAccess ( Opcodes . OPC_getfield , fieldBinding , null ) ; } else { invoke ( Opcodes . OPC_invokestatic , ( MethodBinding ) mappingSequence [ i ] , null ) ; } } } public void generateReturnBytecode ( Expression expression ) { if ( expression == null ) { return_ ( ) ; } else { final int implicitConversion = expression . implicitConversion ; if ( ( implicitConversion & TypeIds . BOXING ) != <NUM_LIT:0> ) { areturn ( ) ; return ; } int runtimeType = ( implicitConversion & TypeIds . IMPLICIT_CONVERSION_MASK ) > > <NUM_LIT:4> ; switch ( runtimeType ) { case TypeIds . T_boolean : case TypeIds . T_int : ireturn ( ) ; break ; case TypeIds . T_float : freturn ( ) ; break ; case TypeIds . T_long : lreturn ( ) ; break ; case TypeIds . T_double : dreturn ( ) ; break ; default : areturn ( ) ; } } } public void generateStringConcatenationAppend ( BlockScope blockScope , Expression oper1 , Expression oper2 ) { int pc ; if ( oper1 == null ) { newStringContatenation ( ) ; dup_x1 ( ) ; this . swap ( ) ; invokeStringValueOf ( TypeIds . T_JavaLangObject ) ; invokeStringConcatenationStringConstructor ( ) ; } else { pc = this . position ; oper1 . generateOptimizedStringConcatenationCreation ( blockScope , this , oper1 . implicitConversion & TypeIds . COMPILE_TYPE_MASK ) ; this . recordPositionsFrom ( pc , oper1 . sourceStart ) ; } pc = this . position ; oper2 . generateOptimizedStringConcatenation ( blockScope , this , oper2 . implicitConversion & TypeIds . COMPILE_TYPE_MASK ) ; this . recordPositionsFrom ( pc , oper2 . sourceStart ) ; invokeStringConcatenationToString ( ) ; } public void generateSyntheticBodyForConstructorAccess ( SyntheticMethodBinding accessBinding ) { initializeMaxLocals ( accessBinding ) ; MethodBinding constructorBinding = accessBinding . targetMethod ; TypeBinding [ ] parameters = constructorBinding . parameters ; int length = parameters . length ; int resolvedPosition = <NUM_LIT:1> ; aload_0 ( ) ; TypeBinding declaringClass = constructorBinding . declaringClass ; if ( declaringClass . erasure ( ) . id == TypeIds . T_JavaLangEnum || declaringClass . isEnum ( ) ) { aload_1 ( ) ; iload_2 ( ) ; resolvedPosition += <NUM_LIT:2> ; } if ( declaringClass . isNestedType ( ) ) { NestedTypeBinding nestedType = ( NestedTypeBinding ) declaringClass ; SyntheticArgumentBinding [ ] syntheticArguments = nestedType . syntheticEnclosingInstances ( ) ; for ( int i = <NUM_LIT:0> ; i < ( syntheticArguments == null ? <NUM_LIT:0> : syntheticArguments . length ) ; i ++ ) { TypeBinding type ; load ( ( type = syntheticArguments [ i ] . type ) , resolvedPosition ) ; switch ( type . id ) { case TypeIds . T_long : case TypeIds . T_double : resolvedPosition += <NUM_LIT:2> ; break ; default : resolvedPosition ++ ; break ; } } } for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeBinding parameter ; load ( parameter = parameters [ i ] , resolvedPosition ) ; switch ( parameter . id ) { case TypeIds . T_long : case TypeIds . T_double : resolvedPosition += <NUM_LIT:2> ; break ; default : resolvedPosition ++ ; break ; } } if ( declaringClass . isNestedType ( ) ) { NestedTypeBinding nestedType = ( NestedTypeBinding ) declaringClass ; SyntheticArgumentBinding [ ] syntheticArguments = nestedType . syntheticOuterLocalVariables ( ) ; for ( int i = <NUM_LIT:0> ; i < ( syntheticArguments == null ? <NUM_LIT:0> : syntheticArguments . length ) ; i ++ ) { TypeBinding type ; load ( type = syntheticArguments [ i ] . type , resolvedPosition ) ; switch ( type . id ) { case TypeIds . T_long : case TypeIds . T_double : resolvedPosition += <NUM_LIT:2> ; break ; default : resolvedPosition ++ ; break ; } } } invoke ( Opcodes . OPC_invokespecial , constructorBinding , null ) ; return_ ( ) ; } public void generateSyntheticBodyForEnumValueOf ( SyntheticMethodBinding methodBinding ) { initializeMaxLocals ( methodBinding ) ; final ReferenceBinding declaringClass = methodBinding . declaringClass ; generateClassLiteralAccessForType ( declaringClass , null ) ; aload_0 ( ) ; invokeJavaLangEnumvalueOf ( declaringClass ) ; this . checkcast ( declaringClass ) ; areturn ( ) ; } public void generateSyntheticBodyForEnumValues ( SyntheticMethodBinding methodBinding ) { ClassScope scope = ( ( SourceTypeBinding ) methodBinding . declaringClass ) . scope ; initializeMaxLocals ( methodBinding ) ; TypeBinding enumArray = methodBinding . returnType ; fieldAccess ( Opcodes . OPC_getstatic , scope . referenceContext . enumValuesSyntheticfield , null ) ; dup ( ) ; astore_0 ( ) ; iconst_0 ( ) ; aload_0 ( ) ; arraylength ( ) ; dup ( ) ; istore_1 ( ) ; newArray ( ( ArrayBinding ) enumArray ) ; dup ( ) ; astore_2 ( ) ; iconst_0 ( ) ; iload_1 ( ) ; invokeSystemArraycopy ( ) ; aload_2 ( ) ; areturn ( ) ; } public void generateSyntheticBodyForFieldReadAccess ( SyntheticMethodBinding accessMethod ) { initializeMaxLocals ( accessMethod ) ; FieldBinding fieldBinding = accessMethod . targetReadField ; TypeBinding declaringClass = accessMethod . purpose == SyntheticMethodBinding . SuperFieldReadAccess ? accessMethod . declaringClass . superclass ( ) : accessMethod . declaringClass ; if ( fieldBinding . isStatic ( ) ) { fieldAccess ( Opcodes . OPC_getstatic , fieldBinding , declaringClass ) ; } else { aload_0 ( ) ; fieldAccess ( Opcodes . OPC_getfield , fieldBinding , declaringClass ) ; } switch ( fieldBinding . type . id ) { case TypeIds . T_boolean : case TypeIds . T_byte : case TypeIds . T_char : case TypeIds . T_short : case TypeIds . T_int : ireturn ( ) ; break ; case TypeIds . T_long : lreturn ( ) ; break ; case TypeIds . T_float : freturn ( ) ; break ; case TypeIds . T_double : dreturn ( ) ; break ; default : areturn ( ) ; } } public void generateSyntheticBodyForFieldWriteAccess ( SyntheticMethodBinding accessMethod ) { initializeMaxLocals ( accessMethod ) ; FieldBinding fieldBinding = accessMethod . targetWriteField ; TypeBinding declaringClass = accessMethod . purpose == SyntheticMethodBinding . SuperFieldWriteAccess ? accessMethod . declaringClass . superclass ( ) : accessMethod . declaringClass ; if ( fieldBinding . isStatic ( ) ) { load ( fieldBinding . type , <NUM_LIT:0> ) ; fieldAccess ( Opcodes . OPC_putstatic , fieldBinding , declaringClass ) ; } else { aload_0 ( ) ; load ( fieldBinding . type , <NUM_LIT:1> ) ; fieldAccess ( Opcodes . OPC_putfield , fieldBinding , declaringClass ) ; } return_ ( ) ; } public void generateSyntheticBodyForMethodAccess ( SyntheticMethodBinding accessMethod ) { initializeMaxLocals ( accessMethod ) ; MethodBinding targetMethod = accessMethod . targetMethod ; TypeBinding [ ] parameters = targetMethod . parameters ; int length = parameters . length ; TypeBinding [ ] arguments = accessMethod . purpose == SyntheticMethodBinding . BridgeMethod ? accessMethod . parameters : null ; int resolvedPosition ; if ( targetMethod . isStatic ( ) ) resolvedPosition = <NUM_LIT:0> ; else { aload_0 ( ) ; resolvedPosition = <NUM_LIT:1> ; } for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeBinding parameter = parameters [ i ] ; if ( arguments != null ) { TypeBinding argument = arguments [ i ] ; load ( argument , resolvedPosition ) ; if ( argument != parameter ) checkcast ( parameter ) ; } else { load ( parameter , resolvedPosition ) ; } switch ( parameter . id ) { case TypeIds . T_long : case TypeIds . T_double : resolvedPosition += <NUM_LIT:2> ; break ; default : resolvedPosition ++ ; break ; } } if ( targetMethod . isStatic ( ) ) invoke ( Opcodes . OPC_invokestatic , targetMethod , accessMethod . declaringClass ) ; else { if ( targetMethod . isConstructor ( ) || targetMethod . isPrivate ( ) || accessMethod . purpose == SyntheticMethodBinding . SuperMethodAccess ) { TypeBinding declaringClass = accessMethod . purpose == SyntheticMethodBinding . SuperMethodAccess ? accessMethod . declaringClass . superclass ( ) : accessMethod . declaringClass ; invoke ( Opcodes . OPC_invokespecial , targetMethod , declaringClass ) ; } else { if ( targetMethod . declaringClass . isInterface ( ) ) { invoke ( Opcodes . OPC_invokeinterface , targetMethod , null ) ; } else { invoke ( Opcodes . OPC_invokevirtual , targetMethod , accessMethod . declaringClass ) ; } } } switch ( targetMethod . returnType . id ) { case TypeIds . T_void : return_ ( ) ; break ; case TypeIds . T_boolean : case TypeIds . T_byte : case TypeIds . T_char : case TypeIds . T_short : case TypeIds . T_int : ireturn ( ) ; break ; case TypeIds . T_long : lreturn ( ) ; break ; case TypeIds . T_float : freturn ( ) ; break ; case TypeIds . T_double : dreturn ( ) ; break ; default : TypeBinding accessErasure = accessMethod . returnType . erasure ( ) ; TypeBinding match = targetMethod . returnType . findSuperTypeOriginatingFrom ( accessErasure ) ; if ( match == null ) { this . checkcast ( accessErasure ) ; } areturn ( ) ; } } public void generateSyntheticBodyForSwitchTable ( SyntheticMethodBinding methodBinding ) { ClassScope scope = ( ( SourceTypeBinding ) methodBinding . declaringClass ) . scope ; initializeMaxLocals ( methodBinding ) ; final BranchLabel nullLabel = new BranchLabel ( this ) ; FieldBinding syntheticFieldBinding = methodBinding . targetReadField ; fieldAccess ( Opcodes . OPC_getstatic , syntheticFieldBinding , null ) ; dup ( ) ; ifnull ( nullLabel ) ; areturn ( ) ; pushOnStack ( syntheticFieldBinding . type ) ; nullLabel . place ( ) ; pop ( ) ; ReferenceBinding enumBinding = ( ReferenceBinding ) methodBinding . targetEnumType ; ArrayBinding arrayBinding = scope . createArrayType ( enumBinding , <NUM_LIT:1> ) ; invokeJavaLangEnumValues ( enumBinding , arrayBinding ) ; arraylength ( ) ; newarray ( ClassFileConstants . INT_ARRAY ) ; astore_0 ( ) ; LocalVariableBinding localVariableBinding = new LocalVariableBinding ( "<STR_LIT>" . toCharArray ( ) , scope . createArrayType ( TypeBinding . INT , <NUM_LIT:1> ) , <NUM_LIT:0> , false ) ; addVariable ( localVariableBinding ) ; final FieldBinding [ ] fields = enumBinding . fields ( ) ; if ( fields != null ) { for ( int i = <NUM_LIT:0> , max = fields . length ; i < max ; i ++ ) { FieldBinding fieldBinding = fields [ i ] ; if ( ( fieldBinding . getAccessFlags ( ) & ClassFileConstants . AccEnum ) != <NUM_LIT:0> ) { final BranchLabel endLabel = new BranchLabel ( this ) ; final ExceptionLabel anyExceptionHandler = new ExceptionLabel ( this , TypeBinding . LONG ) ; anyExceptionHandler . placeStart ( ) ; aload_0 ( ) ; fieldAccess ( Opcodes . OPC_getstatic , fieldBinding , null ) ; invokeEnumOrdinal ( enumBinding . constantPoolName ( ) ) ; this . generateInlinedValue ( fieldBinding . id + <NUM_LIT:1> ) ; iastore ( ) ; anyExceptionHandler . placeEnd ( ) ; goto_ ( endLabel ) ; pushExceptionOnStack ( TypeBinding . LONG ) ; anyExceptionHandler . place ( ) ; pop ( ) ; endLabel . place ( ) ; } } } aload_0 ( ) ; dup ( ) ; fieldAccess ( Opcodes . OPC_putstatic , syntheticFieldBinding , null ) ; areturn ( ) ; removeVariable ( localVariableBinding ) ; } public void generateSyntheticEnclosingInstanceValues ( BlockScope currentScope , ReferenceBinding targetType , Expression enclosingInstance , ASTNode invocationSite ) { ReferenceBinding checkedTargetType = targetType . isAnonymousType ( ) ? ( ReferenceBinding ) targetType . superclass ( ) . erasure ( ) : targetType ; boolean hasExtraEnclosingInstance = enclosingInstance != null ; if ( hasExtraEnclosingInstance && ( ! checkedTargetType . isNestedType ( ) || checkedTargetType . isStatic ( ) ) ) { currentScope . problemReporter ( ) . unnecessaryEnclosingInstanceSpecification ( enclosingInstance , checkedTargetType ) ; return ; } ReferenceBinding [ ] syntheticArgumentTypes ; if ( ( syntheticArgumentTypes = targetType . syntheticEnclosingInstanceTypes ( ) ) != null ) { ReferenceBinding targetEnclosingType = checkedTargetType . enclosingType ( ) ; long compliance = currentScope . compilerOptions ( ) . complianceLevel ; boolean denyEnclosingArgInConstructorCall ; if ( compliance <= ClassFileConstants . JDK1_3 ) { denyEnclosingArgInConstructorCall = invocationSite instanceof AllocationExpression ; } else if ( compliance == ClassFileConstants . JDK1_4 ) { denyEnclosingArgInConstructorCall = invocationSite instanceof AllocationExpression || invocationSite instanceof ExplicitConstructorCall && ( ( ExplicitConstructorCall ) invocationSite ) . isSuperAccess ( ) ; } else { denyEnclosingArgInConstructorCall = ( invocationSite instanceof AllocationExpression || invocationSite instanceof ExplicitConstructorCall && ( ( ExplicitConstructorCall ) invocationSite ) . isSuperAccess ( ) ) && ! targetType . isLocalType ( ) ; } boolean complyTo14 = compliance >= ClassFileConstants . JDK1_4 ; for ( int i = <NUM_LIT:0> , max = syntheticArgumentTypes . length ; i < max ; i ++ ) { ReferenceBinding syntheticArgType = syntheticArgumentTypes [ i ] ; if ( hasExtraEnclosingInstance && syntheticArgType == targetEnclosingType ) { hasExtraEnclosingInstance = false ; enclosingInstance . generateCode ( currentScope , this , true ) ; if ( complyTo14 ) { dup ( ) ; invokeObjectGetClass ( ) ; pop ( ) ; } } else { Object [ ] emulationPath = currentScope . getEmulationPath ( syntheticArgType , false , denyEnclosingArgInConstructorCall ) ; generateOuterAccess ( emulationPath , invocationSite , syntheticArgType , currentScope ) ; } } if ( hasExtraEnclosingInstance ) { currentScope . problemReporter ( ) . unnecessaryEnclosingInstanceSpecification ( enclosingInstance , checkedTargetType ) ; } } } public void generateSyntheticOuterArgumentValues ( BlockScope currentScope , ReferenceBinding targetType , ASTNode invocationSite ) { SyntheticArgumentBinding syntheticArguments [ ] ; if ( ( syntheticArguments = targetType . syntheticOuterLocalVariables ( ) ) != null ) { for ( int i = <NUM_LIT:0> , max = syntheticArguments . length ; i < max ; i ++ ) { LocalVariableBinding targetVariable = syntheticArguments [ i ] . actualOuterLocalVariable ; VariableBinding [ ] emulationPath = currentScope . getEmulationPath ( targetVariable ) ; generateOuterAccess ( emulationPath , invocationSite , targetVariable , currentScope ) ; } } } public void generateUnboxingConversion ( int unboxedTypeID ) { switch ( unboxedTypeID ) { case TypeIds . T_byte : invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangByteConstantPoolName , ConstantPool . BYTEVALUE_BYTE_METHOD_NAME , ConstantPool . BYTEVALUE_BYTE_METHOD_SIGNATURE ) ; break ; case TypeIds . T_short : invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangShortConstantPoolName , ConstantPool . SHORTVALUE_SHORT_METHOD_NAME , ConstantPool . SHORTVALUE_SHORT_METHOD_SIGNATURE ) ; break ; case TypeIds . T_char : invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangCharacterConstantPoolName , ConstantPool . CHARVALUE_CHARACTER_METHOD_NAME , ConstantPool . CHARVALUE_CHARACTER_METHOD_SIGNATURE ) ; break ; case TypeIds . T_int : invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangIntegerConstantPoolName , ConstantPool . INTVALUE_INTEGER_METHOD_NAME , ConstantPool . INTVALUE_INTEGER_METHOD_SIGNATURE ) ; break ; case TypeIds . T_long : invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:2> , ConstantPool . JavaLangLongConstantPoolName , ConstantPool . LONGVALUE_LONG_METHOD_NAME , ConstantPool . LONGVALUE_LONG_METHOD_SIGNATURE ) ; break ; case TypeIds . T_float : invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangFloatConstantPoolName , ConstantPool . FLOATVALUE_FLOAT_METHOD_NAME , ConstantPool . FLOATVALUE_FLOAT_METHOD_SIGNATURE ) ; break ; case TypeIds . T_double : invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:2> , ConstantPool . JavaLangDoubleConstantPoolName , ConstantPool . DOUBLEVALUE_DOUBLE_METHOD_NAME , ConstantPool . DOUBLEVALUE_DOUBLE_METHOD_SIGNATURE ) ; break ; case TypeIds . T_boolean : invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangBooleanConstantPoolName , ConstantPool . BOOLEANVALUE_BOOLEAN_METHOD_NAME , ConstantPool . BOOLEANVALUE_BOOLEAN_METHOD_SIGNATURE ) ; } } public void generateWideRevertedConditionalBranch ( byte revertedOpcode , BranchLabel wideTarget ) { BranchLabel intermediate = new BranchLabel ( this ) ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = revertedOpcode ; intermediate . branch ( ) ; goto_w ( wideTarget ) ; intermediate . place ( ) ; } public void getBaseTypeValue ( int baseTypeID ) { switch ( baseTypeID ) { case TypeIds . T_byte : invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangByteConstantPoolName , ConstantPool . BYTEVALUE_BYTE_METHOD_NAME , ConstantPool . BYTEVALUE_BYTE_METHOD_SIGNATURE ) ; break ; case TypeIds . T_short : invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangShortConstantPoolName , ConstantPool . SHORTVALUE_SHORT_METHOD_NAME , ConstantPool . SHORTVALUE_SHORT_METHOD_SIGNATURE ) ; break ; case TypeIds . T_char : invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangCharacterConstantPoolName , ConstantPool . CHARVALUE_CHARACTER_METHOD_NAME , ConstantPool . CHARVALUE_CHARACTER_METHOD_SIGNATURE ) ; break ; case TypeIds . T_int : invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangIntegerConstantPoolName , ConstantPool . INTVALUE_INTEGER_METHOD_NAME , ConstantPool . INTVALUE_INTEGER_METHOD_SIGNATURE ) ; break ; case TypeIds . T_long : invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:2> , ConstantPool . JavaLangLongConstantPoolName , ConstantPool . LONGVALUE_LONG_METHOD_NAME , ConstantPool . LONGVALUE_LONG_METHOD_SIGNATURE ) ; break ; case TypeIds . T_float : invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangFloatConstantPoolName , ConstantPool . FLOATVALUE_FLOAT_METHOD_NAME , ConstantPool . FLOATVALUE_FLOAT_METHOD_SIGNATURE ) ; break ; case TypeIds . T_double : invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:2> , ConstantPool . JavaLangDoubleConstantPoolName , ConstantPool . DOUBLEVALUE_DOUBLE_METHOD_NAME , ConstantPool . DOUBLEVALUE_DOUBLE_METHOD_SIGNATURE ) ; break ; case TypeIds . T_boolean : invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangBooleanConstantPoolName , ConstantPool . BOOLEANVALUE_BOOLEAN_METHOD_NAME , ConstantPool . BOOLEANVALUE_BOOLEAN_METHOD_SIGNATURE ) ; } } final public byte [ ] getContents ( ) { byte [ ] contents ; System . arraycopy ( this . bCodeStream , <NUM_LIT:0> , contents = new byte [ this . position ] , <NUM_LIT:0> , this . position ) ; return contents ; } public static TypeBinding getConstantPoolDeclaringClass ( Scope currentScope , FieldBinding codegenBinding , TypeBinding actualReceiverType , boolean isImplicitThisReceiver ) { ReferenceBinding constantPoolDeclaringClass = codegenBinding . declaringClass ; if ( constantPoolDeclaringClass != actualReceiverType . erasure ( ) && ! actualReceiverType . isArrayType ( ) && constantPoolDeclaringClass != null && codegenBinding . constant ( ) == Constant . NotAConstant ) { CompilerOptions options = currentScope . compilerOptions ( ) ; if ( ( options . targetJDK >= ClassFileConstants . JDK1_2 && ( options . complianceLevel >= ClassFileConstants . JDK1_4 || ! ( isImplicitThisReceiver && codegenBinding . isStatic ( ) ) ) && constantPoolDeclaringClass . id != TypeIds . T_JavaLangObject ) || ! constantPoolDeclaringClass . canBeSeenBy ( currentScope ) ) { return actualReceiverType . erasure ( ) ; } } return constantPoolDeclaringClass ; } public static TypeBinding getConstantPoolDeclaringClass ( Scope currentScope , MethodBinding codegenBinding , TypeBinding actualReceiverType , boolean isImplicitThisReceiver ) { TypeBinding constantPoolDeclaringClass = codegenBinding . declaringClass ; if ( codegenBinding == currentScope . environment ( ) . arrayClone ) { CompilerOptions options = currentScope . compilerOptions ( ) ; if ( options . sourceLevel > ClassFileConstants . JDK1_4 ) { constantPoolDeclaringClass = actualReceiverType . erasure ( ) ; } } else { if ( constantPoolDeclaringClass != actualReceiverType . erasure ( ) && ! actualReceiverType . isArrayType ( ) ) { CompilerOptions options = currentScope . compilerOptions ( ) ; if ( ( options . targetJDK >= ClassFileConstants . JDK1_2 && ( options . complianceLevel >= ClassFileConstants . JDK1_4 || ! ( isImplicitThisReceiver && codegenBinding . isStatic ( ) ) ) && codegenBinding . declaringClass . id != TypeIds . T_JavaLangObject ) || ! codegenBinding . declaringClass . canBeSeenBy ( currentScope ) ) { constantPoolDeclaringClass = actualReceiverType . erasure ( ) ; } } } return constantPoolDeclaringClass ; } protected int getPosition ( ) { return this . position ; } public void getTYPE ( int baseTypeID ) { this . countLabels = <NUM_LIT:0> ; switch ( baseTypeID ) { case TypeIds . T_byte : fieldAccess ( Opcodes . OPC_getstatic , <NUM_LIT:1> , ConstantPool . JavaLangByteConstantPoolName , ConstantPool . TYPE , ConstantPool . JavaLangClassSignature ) ; break ; case TypeIds . T_short : fieldAccess ( Opcodes . OPC_getstatic , <NUM_LIT:1> , ConstantPool . JavaLangShortConstantPoolName , ConstantPool . TYPE , ConstantPool . JavaLangClassSignature ) ; break ; case TypeIds . T_char : fieldAccess ( Opcodes . OPC_getstatic , <NUM_LIT:1> , ConstantPool . JavaLangCharacterConstantPoolName , ConstantPool . TYPE , ConstantPool . JavaLangClassSignature ) ; break ; case TypeIds . T_int : fieldAccess ( Opcodes . OPC_getstatic , <NUM_LIT:1> , ConstantPool . JavaLangIntegerConstantPoolName , ConstantPool . TYPE , ConstantPool . JavaLangClassSignature ) ; break ; case TypeIds . T_long : fieldAccess ( Opcodes . OPC_getstatic , <NUM_LIT:1> , ConstantPool . JavaLangLongConstantPoolName , ConstantPool . TYPE , ConstantPool . JavaLangClassSignature ) ; break ; case TypeIds . T_float : fieldAccess ( Opcodes . OPC_getstatic , <NUM_LIT:1> , ConstantPool . JavaLangFloatConstantPoolName , ConstantPool . TYPE , ConstantPool . JavaLangClassSignature ) ; break ; case TypeIds . T_double : fieldAccess ( Opcodes . OPC_getstatic , <NUM_LIT:1> , ConstantPool . JavaLangDoubleConstantPoolName , ConstantPool . TYPE , ConstantPool . JavaLangClassSignature ) ; break ; case TypeIds . T_boolean : fieldAccess ( Opcodes . OPC_getstatic , <NUM_LIT:1> , ConstantPool . JavaLangBooleanConstantPoolName , ConstantPool . TYPE , ConstantPool . JavaLangClassSignature ) ; break ; case TypeIds . T_void : fieldAccess ( Opcodes . OPC_getstatic , <NUM_LIT:1> , ConstantPool . JavaLangVoidConstantPoolName , ConstantPool . TYPE , ConstantPool . JavaLangClassSignature ) ; break ; } } public void goto_ ( BranchLabel label ) { if ( this . wideMode ) { goto_w ( label ) ; return ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } boolean chained = inlineForwardReferencesFromLabelsTargeting ( label , this . position ) ; if ( chained && this . lastAbruptCompletion == this . position ) { if ( label . position != Label . POS_NOT_SET ) { int [ ] forwardRefs = label . forwardReferences ( ) ; for ( int i = <NUM_LIT:0> , max = label . forwardReferenceCount ( ) ; i < max ; i ++ ) { this . writePosition ( label , forwardRefs [ i ] ) ; } this . countLabels = <NUM_LIT:0> ; } return ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_goto ; label . branch ( ) ; this . lastAbruptCompletion = this . position ; } public void goto_w ( BranchLabel label ) { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_goto_w ; label . branchWide ( ) ; this . lastAbruptCompletion = this . position ; } public void i2b ( ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_i2b ; } public void i2c ( ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_i2c ; } public void i2d ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_i2d ; } public void i2f ( ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_i2f ; } public void i2l ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_i2l ; } public void i2s ( ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_i2s ; } public void iadd ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iadd ; } public void iaload ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iaload ; } public void iand ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iand ; } public void iastore ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:3> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iastore ; } public void iconst_0 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iconst_0 ; } public void iconst_1 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iconst_1 ; } public void iconst_2 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iconst_2 ; } public void iconst_3 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iconst_3 ; } public void iconst_4 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iconst_4 ; } public void iconst_5 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iconst_5 ; } public void iconst_m1 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iconst_m1 ; } public void idiv ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_idiv ; } public void if_acmpeq ( BranchLabel lbl ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . wideMode ) { generateWideRevertedConditionalBranch ( Opcodes . OPC_if_acmpne , lbl ) ; } else { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_if_acmpeq ; lbl . branch ( ) ; } } public void if_acmpne ( BranchLabel lbl ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . wideMode ) { generateWideRevertedConditionalBranch ( Opcodes . OPC_if_acmpeq , lbl ) ; } else { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_if_acmpne ; lbl . branch ( ) ; } } public void if_icmpeq ( BranchLabel lbl ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . wideMode ) { generateWideRevertedConditionalBranch ( Opcodes . OPC_if_icmpne , lbl ) ; } else { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_if_icmpeq ; lbl . branch ( ) ; } } public void if_icmpge ( BranchLabel lbl ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . wideMode ) { generateWideRevertedConditionalBranch ( Opcodes . OPC_if_icmplt , lbl ) ; } else { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_if_icmpge ; lbl . branch ( ) ; } } public void if_icmpgt ( BranchLabel lbl ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . wideMode ) { generateWideRevertedConditionalBranch ( Opcodes . OPC_if_icmple , lbl ) ; } else { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_if_icmpgt ; lbl . branch ( ) ; } } public void if_icmple ( BranchLabel lbl ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . wideMode ) { generateWideRevertedConditionalBranch ( Opcodes . OPC_if_icmpgt , lbl ) ; } else { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_if_icmple ; lbl . branch ( ) ; } } public void if_icmplt ( BranchLabel lbl ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . wideMode ) { generateWideRevertedConditionalBranch ( Opcodes . OPC_if_icmpge , lbl ) ; } else { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_if_icmplt ; lbl . branch ( ) ; } } public void if_icmpne ( BranchLabel lbl ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . wideMode ) { generateWideRevertedConditionalBranch ( Opcodes . OPC_if_icmpeq , lbl ) ; } else { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_if_icmpne ; lbl . branch ( ) ; } } public void ifeq ( BranchLabel lbl ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . wideMode ) { generateWideRevertedConditionalBranch ( Opcodes . OPC_ifne , lbl ) ; } else { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ifeq ; lbl . branch ( ) ; } } public void ifge ( BranchLabel lbl ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . wideMode ) { generateWideRevertedConditionalBranch ( Opcodes . OPC_iflt , lbl ) ; } else { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ifge ; lbl . branch ( ) ; } } public void ifgt ( BranchLabel lbl ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . wideMode ) { generateWideRevertedConditionalBranch ( Opcodes . OPC_ifle , lbl ) ; } else { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ifgt ; lbl . branch ( ) ; } } public void ifle ( BranchLabel lbl ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . wideMode ) { generateWideRevertedConditionalBranch ( Opcodes . OPC_ifgt , lbl ) ; } else { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ifle ; lbl . branch ( ) ; } } public void iflt ( BranchLabel lbl ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . wideMode ) { generateWideRevertedConditionalBranch ( Opcodes . OPC_ifge , lbl ) ; } else { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iflt ; lbl . branch ( ) ; } } public void ifne ( BranchLabel lbl ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . wideMode ) { generateWideRevertedConditionalBranch ( Opcodes . OPC_ifeq , lbl ) ; } else { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ifne ; lbl . branch ( ) ; } } public void ifnonnull ( BranchLabel lbl ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . wideMode ) { generateWideRevertedConditionalBranch ( Opcodes . OPC_ifnull , lbl ) ; } else { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ifnonnull ; lbl . branch ( ) ; } } public void ifnull ( BranchLabel lbl ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . wideMode ) { generateWideRevertedConditionalBranch ( Opcodes . OPC_ifnonnull , lbl ) ; } else { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ifnull ; lbl . branch ( ) ; } } final public void iinc ( int index , int value ) { this . countLabels = <NUM_LIT:0> ; if ( ( index > <NUM_LIT:255> ) || ( value < - <NUM_LIT> || value > <NUM_LIT> ) ) { if ( this . classFileOffset + <NUM_LIT:3> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_wide ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iinc ; writeUnsignedShort ( index ) ; writeSignedShort ( value ) ; } else { if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:3> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iinc ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) index ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) value ; } } public void iload ( int iArg ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . maxLocals <= iArg ) { this . maxLocals = iArg + <NUM_LIT:1> ; } if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( iArg > <NUM_LIT:255> ) { if ( this . classFileOffset + <NUM_LIT:3> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_wide ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iload ; writeUnsignedShort ( iArg ) ; } else { if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iload ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) iArg ; } } public void iload_0 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . maxLocals <= <NUM_LIT:0> ) { this . maxLocals = <NUM_LIT:1> ; } if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iload_0 ; } public void iload_1 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . maxLocals <= <NUM_LIT:1> ) { this . maxLocals = <NUM_LIT:2> ; } if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iload_1 ; } public void iload_2 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . maxLocals <= <NUM_LIT:2> ) { this . maxLocals = <NUM_LIT:3> ; } if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iload_2 ; } public void iload_3 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . maxLocals <= <NUM_LIT:3> ) { this . maxLocals = <NUM_LIT:4> ; } if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iload_3 ; } public void imul ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_imul ; } public int indexOfSameLineEntrySincePC ( int pc , int line ) { for ( int index = pc , max = this . pcToSourceMapSize ; index < max ; index += <NUM_LIT:2> ) { if ( this . pcToSourceMap [ index + <NUM_LIT:1> ] == line ) return index ; } return - <NUM_LIT:1> ; } public void ineg ( ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ineg ; } public void init ( ClassFile targetClassFile ) { this . classFile = targetClassFile ; this . constantPool = targetClassFile . constantPool ; this . bCodeStream = targetClassFile . contents ; this . classFileOffset = targetClassFile . contentsOffset ; this . startingClassFileOffset = this . classFileOffset ; this . pcToSourceMapSize = <NUM_LIT:0> ; this . lastEntryPC = <NUM_LIT:0> ; int length = this . visibleLocals . length ; if ( noVisibleLocals . length < length ) { noVisibleLocals = new LocalVariableBinding [ length ] ; } System . arraycopy ( noVisibleLocals , <NUM_LIT:0> , this . visibleLocals , <NUM_LIT:0> , length ) ; this . visibleLocalsCount = <NUM_LIT:0> ; length = this . locals . length ; if ( noLocals . length < length ) { noLocals = new LocalVariableBinding [ length ] ; } System . arraycopy ( noLocals , <NUM_LIT:0> , this . locals , <NUM_LIT:0> , length ) ; this . allLocalsCounter = <NUM_LIT:0> ; length = this . exceptionLabels . length ; if ( noExceptionHandlers . length < length ) { noExceptionHandlers = new ExceptionLabel [ length ] ; } System . arraycopy ( noExceptionHandlers , <NUM_LIT:0> , this . exceptionLabels , <NUM_LIT:0> , length ) ; this . exceptionLabelsCounter = <NUM_LIT:0> ; length = this . labels . length ; if ( noLabels . length < length ) { noLabels = new BranchLabel [ length ] ; } System . arraycopy ( noLabels , <NUM_LIT:0> , this . labels , <NUM_LIT:0> , length ) ; this . countLabels = <NUM_LIT:0> ; this . lastAbruptCompletion = - <NUM_LIT:1> ; this . stackMax = <NUM_LIT:0> ; this . stackDepth = <NUM_LIT:0> ; this . maxLocals = <NUM_LIT:0> ; this . position = <NUM_LIT:0> ; } public void initializeMaxLocals ( MethodBinding methodBinding ) { if ( methodBinding == null ) { this . maxLocals = <NUM_LIT:0> ; return ; } this . maxLocals = methodBinding . isStatic ( ) ? <NUM_LIT:0> : <NUM_LIT:1> ; ReferenceBinding declaringClass = methodBinding . declaringClass ; if ( methodBinding . isConstructor ( ) && declaringClass . isEnum ( ) ) { this . maxLocals += <NUM_LIT:2> ; } if ( methodBinding . isConstructor ( ) && declaringClass . isNestedType ( ) ) { this . maxLocals += declaringClass . getEnclosingInstancesSlotSize ( ) ; this . maxLocals += declaringClass . getOuterLocalVariablesSlotSize ( ) ; } TypeBinding [ ] parameterTypes ; if ( ( parameterTypes = methodBinding . parameters ) != null ) { for ( int i = <NUM_LIT:0> , max = parameterTypes . length ; i < max ; i ++ ) { switch ( parameterTypes [ i ] . id ) { case TypeIds . T_long : case TypeIds . T_double : this . maxLocals += <NUM_LIT:2> ; break ; default : this . maxLocals ++ ; } } } } public boolean inlineForwardReferencesFromLabelsTargeting ( BranchLabel targetLabel , int gotoLocation ) { if ( targetLabel . delegate != null ) return false ; int chaining = L_UNKNOWN ; for ( int i = this . countLabels - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) { BranchLabel currentLabel = this . labels [ i ] ; if ( currentLabel . position != gotoLocation ) break ; if ( currentLabel == targetLabel ) { chaining |= L_CANNOT_OPTIMIZE ; continue ; } if ( currentLabel . isStandardLabel ( ) ) { if ( currentLabel . delegate != null ) continue ; targetLabel . becomeDelegateFor ( currentLabel ) ; chaining |= L_OPTIMIZABLE ; continue ; } chaining |= L_CANNOT_OPTIMIZE ; } return ( chaining & ( L_OPTIMIZABLE | L_CANNOT_OPTIMIZE ) ) == L_OPTIMIZABLE ; } public void instance_of ( TypeBinding typeBinding ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_instanceof ; writeUnsignedShort ( this . constantPool . literalIndexForType ( typeBinding ) ) ; } protected void invoke ( byte opcode , int receiverAndArgsSize , int returnTypeSize , char [ ] declaringClass , char [ ] selector , char [ ] signature ) { this . countLabels = <NUM_LIT:0> ; if ( opcode == Opcodes . OPC_invokeinterface ) { if ( this . classFileOffset + <NUM_LIT:4> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:3> ; this . bCodeStream [ this . classFileOffset ++ ] = opcode ; writeUnsignedShort ( this . constantPool . literalIndexForMethod ( declaringClass , selector , signature , true ) ) ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) receiverAndArgsSize ; this . bCodeStream [ this . classFileOffset ++ ] = <NUM_LIT:0> ; } else { if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = opcode ; writeUnsignedShort ( this . constantPool . literalIndexForMethod ( declaringClass , selector , signature , false ) ) ; } this . stackDepth += returnTypeSize - receiverAndArgsSize ; if ( this . stackDepth > this . stackMax ) { this . stackMax = this . stackDepth ; } } public void invoke ( byte opcode , MethodBinding methodBinding , TypeBinding declaringClass ) { if ( declaringClass == null ) declaringClass = methodBinding . declaringClass ; if ( ( declaringClass . tagBits & TagBits . ContainsNestedTypeReferences ) != <NUM_LIT:0> ) { Util . recordNestedType ( this . classFile , declaringClass ) ; } int receiverAndArgsSize ; switch ( opcode ) { case Opcodes . OPC_invokestatic : receiverAndArgsSize = <NUM_LIT:0> ; break ; case Opcodes . OPC_invokeinterface : case Opcodes . OPC_invokevirtual : receiverAndArgsSize = <NUM_LIT:1> ; break ; case Opcodes . OPC_invokespecial : receiverAndArgsSize = <NUM_LIT:1> ; if ( methodBinding . isConstructor ( ) ) { if ( declaringClass . isNestedType ( ) ) { ReferenceBinding nestedType = ( ReferenceBinding ) declaringClass ; receiverAndArgsSize += nestedType . getEnclosingInstancesSlotSize ( ) ; SyntheticArgumentBinding [ ] syntheticArguments = nestedType . syntheticOuterLocalVariables ( ) ; if ( syntheticArguments != null ) { for ( int i = <NUM_LIT:0> , max = syntheticArguments . length ; i < max ; i ++ ) { switch ( syntheticArguments [ i ] . id ) { case TypeIds . T_double : case TypeIds . T_long : receiverAndArgsSize += <NUM_LIT:2> ; break ; default : receiverAndArgsSize ++ ; break ; } } } } if ( declaringClass . isEnum ( ) ) { receiverAndArgsSize += <NUM_LIT:2> ; } } break ; default : return ; } for ( int i = methodBinding . parameters . length - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) { switch ( methodBinding . parameters [ i ] . id ) { case TypeIds . T_double : case TypeIds . T_long : receiverAndArgsSize += <NUM_LIT:2> ; break ; default : receiverAndArgsSize ++ ; break ; } } int returnTypeSize ; switch ( methodBinding . returnType . id ) { case TypeIds . T_double : case TypeIds . T_long : returnTypeSize = <NUM_LIT:2> ; break ; case TypeIds . T_void : returnTypeSize = <NUM_LIT:0> ; break ; default : returnTypeSize = <NUM_LIT:1> ; break ; } invoke ( opcode , receiverAndArgsSize , returnTypeSize , declaringClass . constantPoolName ( ) , methodBinding . selector , methodBinding . signature ( this . classFile ) ) ; } protected void invokeAccessibleObjectSetAccessible ( ) { invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:2> , <NUM_LIT:0> , ConstantPool . JAVALANGREFLECTACCESSIBLEOBJECT_CONSTANTPOOLNAME , ConstantPool . SETACCESSIBLE_NAME , ConstantPool . SETACCESSIBLE_SIGNATURE ) ; } protected void invokeArrayNewInstance ( ) { invoke ( Opcodes . OPC_invokestatic , <NUM_LIT:2> , <NUM_LIT:1> , ConstantPool . JAVALANGREFLECTARRAY_CONSTANTPOOLNAME , ConstantPool . NewInstance , ConstantPool . NewInstanceSignature ) ; } public void invokeClassForName ( ) { invoke ( Opcodes . OPC_invokestatic , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangClassConstantPoolName , ConstantPool . ForName , ConstantPool . ForNameSignature ) ; } protected void invokeClassGetDeclaredConstructor ( ) { invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:2> , <NUM_LIT:1> , ConstantPool . JavaLangClassConstantPoolName , ConstantPool . GETDECLAREDCONSTRUCTOR_NAME , ConstantPool . GETDECLAREDCONSTRUCTOR_SIGNATURE ) ; } protected void invokeClassGetDeclaredField ( ) { invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:2> , <NUM_LIT:1> , ConstantPool . JavaLangClassConstantPoolName , ConstantPool . GETDECLAREDFIELD_NAME , ConstantPool . GETDECLAREDFIELD_SIGNATURE ) ; } protected void invokeClassGetDeclaredMethod ( ) { invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:3> , <NUM_LIT:1> , ConstantPool . JavaLangClassConstantPoolName , ConstantPool . GETDECLAREDMETHOD_NAME , ConstantPool . GETDECLAREDMETHOD_SIGNATURE ) ; } public void invokeEnumOrdinal ( char [ ] enumTypeConstantPoolName ) { invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , enumTypeConstantPoolName , ConstantPool . Ordinal , ConstantPool . OrdinalSignature ) ; } public void invokeIterableIterator ( TypeBinding iterableReceiverType ) { if ( ( iterableReceiverType . tagBits & TagBits . ContainsNestedTypeReferences ) != <NUM_LIT:0> ) { Util . recordNestedType ( this . classFile , iterableReceiverType ) ; } invoke ( iterableReceiverType . isInterface ( ) ? Opcodes . OPC_invokeinterface : Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , iterableReceiverType . constantPoolName ( ) , ConstantPool . ITERATOR_NAME , ConstantPool . ITERATOR_SIGNATURE ) ; } public void invokeJavaLangAssertionErrorConstructor ( int typeBindingID ) { int receiverAndArgsSize ; char [ ] signature ; switch ( typeBindingID ) { case TypeIds . T_int : case TypeIds . T_byte : case TypeIds . T_short : signature = ConstantPool . IntConstrSignature ; receiverAndArgsSize = <NUM_LIT:2> ; break ; case TypeIds . T_long : signature = ConstantPool . LongConstrSignature ; receiverAndArgsSize = <NUM_LIT:3> ; break ; case TypeIds . T_float : signature = ConstantPool . FloatConstrSignature ; receiverAndArgsSize = <NUM_LIT:2> ; break ; case TypeIds . T_double : signature = ConstantPool . DoubleConstrSignature ; receiverAndArgsSize = <NUM_LIT:3> ; break ; case TypeIds . T_char : signature = ConstantPool . CharConstrSignature ; receiverAndArgsSize = <NUM_LIT:2> ; break ; case TypeIds . T_boolean : signature = ConstantPool . BooleanConstrSignature ; receiverAndArgsSize = <NUM_LIT:2> ; break ; case TypeIds . T_JavaLangObject : case TypeIds . T_JavaLangString : case TypeIds . T_null : signature = ConstantPool . ObjectConstrSignature ; receiverAndArgsSize = <NUM_LIT:2> ; break ; default : return ; } invoke ( Opcodes . OPC_invokespecial , receiverAndArgsSize , <NUM_LIT:0> , ConstantPool . JavaLangAssertionErrorConstantPoolName , ConstantPool . Init , signature ) ; } public void invokeJavaLangAssertionErrorDefaultConstructor ( ) { invoke ( Opcodes . OPC_invokespecial , <NUM_LIT:1> , <NUM_LIT:0> , ConstantPool . JavaLangAssertionErrorConstantPoolName , ConstantPool . Init , ConstantPool . DefaultConstructorSignature ) ; } public void invokeJavaLangClassDesiredAssertionStatus ( ) { invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangClassConstantPoolName , ConstantPool . DesiredAssertionStatus , ConstantPool . DesiredAssertionStatusSignature ) ; } public void invokeJavaLangEnumvalueOf ( ReferenceBinding binding ) { invoke ( Opcodes . OPC_invokestatic , <NUM_LIT:2> , <NUM_LIT:1> , ConstantPool . JavaLangEnumConstantPoolName , ConstantPool . ValueOf , ConstantPool . ValueOfStringClassSignature ) ; } public void invokeJavaLangEnumValues ( TypeBinding enumBinding , ArrayBinding arrayBinding ) { char [ ] signature = "<STR_LIT>" . toCharArray ( ) ; signature = CharOperation . concat ( signature , arrayBinding . constantPoolName ( ) ) ; invoke ( Opcodes . OPC_invokestatic , <NUM_LIT:0> , <NUM_LIT:1> , enumBinding . constantPoolName ( ) , TypeConstants . VALUES , signature ) ; } public void invokeJavaLangErrorConstructor ( ) { invoke ( Opcodes . OPC_invokespecial , <NUM_LIT:2> , <NUM_LIT:0> , ConstantPool . JavaLangErrorConstantPoolName , ConstantPool . Init , ConstantPool . StringConstructorSignature ) ; } public void invokeJavaLangReflectConstructorNewInstance ( ) { invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:2> , <NUM_LIT:1> , ConstantPool . JavaLangReflectConstructorConstantPoolName , ConstantPool . NewInstance , ConstantPool . JavaLangReflectConstructorNewInstanceSignature ) ; } protected void invokeJavaLangReflectFieldGetter ( int typeID ) { char [ ] selector ; char [ ] signature ; int returnTypeSize ; switch ( typeID ) { case TypeIds . T_int : selector = ConstantPool . GET_INT_METHOD_NAME ; signature = ConstantPool . GET_INT_METHOD_SIGNATURE ; returnTypeSize = <NUM_LIT:1> ; break ; case TypeIds . T_byte : selector = ConstantPool . GET_BYTE_METHOD_NAME ; signature = ConstantPool . GET_BYTE_METHOD_SIGNATURE ; returnTypeSize = <NUM_LIT:1> ; break ; case TypeIds . T_short : selector = ConstantPool . GET_SHORT_METHOD_NAME ; signature = ConstantPool . GET_SHORT_METHOD_SIGNATURE ; returnTypeSize = <NUM_LIT:1> ; break ; case TypeIds . T_long : selector = ConstantPool . GET_LONG_METHOD_NAME ; signature = ConstantPool . GET_LONG_METHOD_SIGNATURE ; returnTypeSize = <NUM_LIT:2> ; break ; case TypeIds . T_float : selector = ConstantPool . GET_FLOAT_METHOD_NAME ; signature = ConstantPool . GET_FLOAT_METHOD_SIGNATURE ; returnTypeSize = <NUM_LIT:1> ; break ; case TypeIds . T_double : selector = ConstantPool . GET_DOUBLE_METHOD_NAME ; signature = ConstantPool . GET_DOUBLE_METHOD_SIGNATURE ; returnTypeSize = <NUM_LIT:2> ; break ; case TypeIds . T_char : selector = ConstantPool . GET_CHAR_METHOD_NAME ; signature = ConstantPool . GET_CHAR_METHOD_SIGNATURE ; returnTypeSize = <NUM_LIT:1> ; break ; case TypeIds . T_boolean : selector = ConstantPool . GET_BOOLEAN_METHOD_NAME ; signature = ConstantPool . GET_BOOLEAN_METHOD_SIGNATURE ; returnTypeSize = <NUM_LIT:1> ; break ; default : selector = ConstantPool . GET_OBJECT_METHOD_NAME ; signature = ConstantPool . GET_OBJECT_METHOD_SIGNATURE ; returnTypeSize = <NUM_LIT:1> ; break ; } invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:2> , returnTypeSize , ConstantPool . JAVALANGREFLECTFIELD_CONSTANTPOOLNAME , selector , signature ) ; } protected void invokeJavaLangReflectFieldSetter ( int typeID ) { char [ ] selector ; char [ ] signature ; int receiverAndArgsSize ; switch ( typeID ) { case TypeIds . T_int : selector = ConstantPool . SET_INT_METHOD_NAME ; signature = ConstantPool . SET_INT_METHOD_SIGNATURE ; receiverAndArgsSize = <NUM_LIT:3> ; break ; case TypeIds . T_byte : selector = ConstantPool . SET_BYTE_METHOD_NAME ; signature = ConstantPool . SET_BYTE_METHOD_SIGNATURE ; receiverAndArgsSize = <NUM_LIT:3> ; break ; case TypeIds . T_short : selector = ConstantPool . SET_SHORT_METHOD_NAME ; signature = ConstantPool . SET_SHORT_METHOD_SIGNATURE ; receiverAndArgsSize = <NUM_LIT:3> ; break ; case TypeIds . T_long : selector = ConstantPool . SET_LONG_METHOD_NAME ; signature = ConstantPool . SET_LONG_METHOD_SIGNATURE ; receiverAndArgsSize = <NUM_LIT:4> ; break ; case TypeIds . T_float : selector = ConstantPool . SET_FLOAT_METHOD_NAME ; signature = ConstantPool . SET_FLOAT_METHOD_SIGNATURE ; receiverAndArgsSize = <NUM_LIT:3> ; break ; case TypeIds . T_double : selector = ConstantPool . SET_DOUBLE_METHOD_NAME ; signature = ConstantPool . SET_DOUBLE_METHOD_SIGNATURE ; receiverAndArgsSize = <NUM_LIT:4> ; break ; case TypeIds . T_char : selector = ConstantPool . SET_CHAR_METHOD_NAME ; signature = ConstantPool . SET_CHAR_METHOD_SIGNATURE ; receiverAndArgsSize = <NUM_LIT:3> ; break ; case TypeIds . T_boolean : selector = ConstantPool . SET_BOOLEAN_METHOD_NAME ; signature = ConstantPool . SET_BOOLEAN_METHOD_SIGNATURE ; receiverAndArgsSize = <NUM_LIT:3> ; break ; default : selector = ConstantPool . SET_OBJECT_METHOD_NAME ; signature = ConstantPool . SET_OBJECT_METHOD_SIGNATURE ; receiverAndArgsSize = <NUM_LIT:3> ; break ; } invoke ( Opcodes . OPC_invokevirtual , receiverAndArgsSize , <NUM_LIT:0> , ConstantPool . JAVALANGREFLECTFIELD_CONSTANTPOOLNAME , selector , signature ) ; } public void invokeJavaLangReflectMethodInvoke ( ) { invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:3> , <NUM_LIT:1> , ConstantPool . JAVALANGREFLECTMETHOD_CONSTANTPOOLNAME , ConstantPool . INVOKE_METHOD_METHOD_NAME , ConstantPool . INVOKE_METHOD_METHOD_SIGNATURE ) ; } public void invokeJavaUtilIteratorHasNext ( ) { invoke ( Opcodes . OPC_invokeinterface , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaUtilIteratorConstantPoolName , ConstantPool . HasNext , ConstantPool . HasNextSignature ) ; } public void invokeJavaUtilIteratorNext ( ) { invoke ( Opcodes . OPC_invokeinterface , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaUtilIteratorConstantPoolName , ConstantPool . Next , ConstantPool . NextSignature ) ; } public void invokeNoClassDefFoundErrorStringConstructor ( ) { invoke ( Opcodes . OPC_invokespecial , <NUM_LIT:2> , <NUM_LIT:0> , ConstantPool . JavaLangNoClassDefFoundErrorConstantPoolName , ConstantPool . Init , ConstantPool . StringConstructorSignature ) ; } public void invokeObjectGetClass ( ) { invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangObjectConstantPoolName , ConstantPool . GetClass , ConstantPool . GetClassSignature ) ; } public void invokeStringConcatenationAppendForType ( int typeID ) { int receiverAndArgsSize ; char [ ] declaringClass = null ; char [ ] selector = ConstantPool . Append ; char [ ] signature = null ; switch ( typeID ) { case TypeIds . T_int : case TypeIds . T_byte : case TypeIds . T_short : if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { declaringClass = ConstantPool . JavaLangStringBuilderConstantPoolName ; signature = ConstantPool . StringBuilderAppendIntSignature ; } else { declaringClass = ConstantPool . JavaLangStringBufferConstantPoolName ; signature = ConstantPool . StringBufferAppendIntSignature ; } receiverAndArgsSize = <NUM_LIT:2> ; break ; case TypeIds . T_long : if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { declaringClass = ConstantPool . JavaLangStringBuilderConstantPoolName ; signature = ConstantPool . StringBuilderAppendLongSignature ; } else { declaringClass = ConstantPool . JavaLangStringBufferConstantPoolName ; signature = ConstantPool . StringBufferAppendLongSignature ; } receiverAndArgsSize = <NUM_LIT:3> ; break ; case TypeIds . T_float : if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { declaringClass = ConstantPool . JavaLangStringBuilderConstantPoolName ; signature = ConstantPool . StringBuilderAppendFloatSignature ; } else { declaringClass = ConstantPool . JavaLangStringBufferConstantPoolName ; signature = ConstantPool . StringBufferAppendFloatSignature ; } receiverAndArgsSize = <NUM_LIT:2> ; break ; case TypeIds . T_double : if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { declaringClass = ConstantPool . JavaLangStringBuilderConstantPoolName ; signature = ConstantPool . StringBuilderAppendDoubleSignature ; } else { declaringClass = ConstantPool . JavaLangStringBufferConstantPoolName ; signature = ConstantPool . StringBufferAppendDoubleSignature ; } receiverAndArgsSize = <NUM_LIT:3> ; break ; case TypeIds . T_char : if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { declaringClass = ConstantPool . JavaLangStringBuilderConstantPoolName ; signature = ConstantPool . StringBuilderAppendCharSignature ; } else { declaringClass = ConstantPool . JavaLangStringBufferConstantPoolName ; signature = ConstantPool . StringBufferAppendCharSignature ; } receiverAndArgsSize = <NUM_LIT:2> ; break ; case TypeIds . T_boolean : if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { declaringClass = ConstantPool . JavaLangStringBuilderConstantPoolName ; signature = ConstantPool . StringBuilderAppendBooleanSignature ; } else { declaringClass = ConstantPool . JavaLangStringBufferConstantPoolName ; signature = ConstantPool . StringBufferAppendBooleanSignature ; } receiverAndArgsSize = <NUM_LIT:2> ; break ; case TypeIds . T_JavaLangString : if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { declaringClass = ConstantPool . JavaLangStringBuilderConstantPoolName ; signature = ConstantPool . StringBuilderAppendStringSignature ; } else { declaringClass = ConstantPool . JavaLangStringBufferConstantPoolName ; signature = ConstantPool . StringBufferAppendStringSignature ; } receiverAndArgsSize = <NUM_LIT:2> ; break ; default : if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { declaringClass = ConstantPool . JavaLangStringBuilderConstantPoolName ; signature = ConstantPool . StringBuilderAppendObjectSignature ; } else { declaringClass = ConstantPool . JavaLangStringBufferConstantPoolName ; signature = ConstantPool . StringBufferAppendObjectSignature ; } receiverAndArgsSize = <NUM_LIT:2> ; break ; } invoke ( Opcodes . OPC_invokevirtual , receiverAndArgsSize , <NUM_LIT:1> , declaringClass , selector , signature ) ; } public void invokeStringConcatenationDefaultConstructor ( ) { char [ ] declaringClass ; if ( this . targetLevel < ClassFileConstants . JDK1_5 ) { declaringClass = ConstantPool . JavaLangStringBufferConstantPoolName ; } else { declaringClass = ConstantPool . JavaLangStringBuilderConstantPoolName ; } invoke ( Opcodes . OPC_invokespecial , <NUM_LIT:1> , <NUM_LIT:0> , declaringClass , ConstantPool . Init , ConstantPool . DefaultConstructorSignature ) ; } public void invokeStringConcatenationStringConstructor ( ) { char [ ] declaringClass ; if ( this . targetLevel < ClassFileConstants . JDK1_5 ) { declaringClass = ConstantPool . JavaLangStringBufferConstantPoolName ; } else { declaringClass = ConstantPool . JavaLangStringBuilderConstantPoolName ; } invoke ( Opcodes . OPC_invokespecial , <NUM_LIT:2> , <NUM_LIT:0> , declaringClass , ConstantPool . Init , ConstantPool . StringConstructorSignature ) ; } public void invokeStringConcatenationToString ( ) { char [ ] declaringClass ; if ( this . targetLevel < ClassFileConstants . JDK1_5 ) { declaringClass = ConstantPool . JavaLangStringBufferConstantPoolName ; } else { declaringClass = ConstantPool . JavaLangStringBuilderConstantPoolName ; } invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , declaringClass , ConstantPool . ToString , ConstantPool . ToStringSignature ) ; } public void invokeStringIntern ( ) { invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangStringConstantPoolName , ConstantPool . Intern , ConstantPool . InternSignature ) ; } public void invokeStringValueOf ( int typeID ) { char [ ] signature ; int receiverAndArgsSize ; switch ( typeID ) { case TypeIds . T_int : case TypeIds . T_byte : case TypeIds . T_short : signature = ConstantPool . ValueOfIntSignature ; receiverAndArgsSize = <NUM_LIT:1> ; break ; case TypeIds . T_long : signature = ConstantPool . ValueOfLongSignature ; receiverAndArgsSize = <NUM_LIT:2> ; break ; case TypeIds . T_float : signature = ConstantPool . ValueOfFloatSignature ; receiverAndArgsSize = <NUM_LIT:1> ; break ; case TypeIds . T_double : signature = ConstantPool . ValueOfDoubleSignature ; receiverAndArgsSize = <NUM_LIT:2> ; break ; case TypeIds . T_char : signature = ConstantPool . ValueOfCharSignature ; receiverAndArgsSize = <NUM_LIT:1> ; break ; case TypeIds . T_boolean : signature = ConstantPool . ValueOfBooleanSignature ; receiverAndArgsSize = <NUM_LIT:1> ; break ; case TypeIds . T_JavaLangObject : case TypeIds . T_JavaLangString : case TypeIds . T_null : case TypeIds . T_undefined : signature = ConstantPool . ValueOfObjectSignature ; receiverAndArgsSize = <NUM_LIT:1> ; break ; default : return ; } invoke ( Opcodes . OPC_invokestatic , receiverAndArgsSize , <NUM_LIT:1> , ConstantPool . JavaLangStringConstantPoolName , ConstantPool . ValueOf , signature ) ; } public void invokeSystemArraycopy ( ) { invoke ( Opcodes . OPC_invokestatic , <NUM_LIT:5> , <NUM_LIT:0> , ConstantPool . JavaLangSystemConstantPoolName , ConstantPool . ArrayCopy , ConstantPool . ArrayCopySignature ) ; } public void invokeThrowableGetMessage ( ) { invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangThrowableConstantPoolName , ConstantPool . GetMessage , ConstantPool . GetMessageSignature ) ; } public void ior ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ior ; } public void irem ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_irem ; } public void ireturn ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ireturn ; this . lastAbruptCompletion = this . position ; } public boolean isDefinitelyAssigned ( Scope scope , int initStateIndex , LocalVariableBinding local ) { if ( ( local . tagBits & TagBits . IsArgument ) != <NUM_LIT:0> ) { return true ; } if ( initStateIndex == - <NUM_LIT:1> ) return false ; int localPosition = local . id + this . maxFieldCount ; MethodScope methodScope = scope . methodScope ( ) ; if ( localPosition < UnconditionalFlowInfo . BitCacheSize ) { return ( methodScope . definiteInits [ initStateIndex ] & ( <NUM_LIT:1L> << localPosition ) ) != <NUM_LIT:0> ; } long [ ] extraInits = methodScope . extraDefiniteInits [ initStateIndex ] ; if ( extraInits == null ) return false ; int vectorIndex ; if ( ( vectorIndex = ( localPosition / UnconditionalFlowInfo . BitCacheSize ) - <NUM_LIT:1> ) >= extraInits . length ) return false ; return ( ( extraInits [ vectorIndex ] ) & ( <NUM_LIT:1L> << ( localPosition % UnconditionalFlowInfo . BitCacheSize ) ) ) != <NUM_LIT:0> ; } public void ishl ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ishl ; } public void ishr ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ishr ; } public void istore ( int iArg ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . maxLocals <= iArg ) { this . maxLocals = iArg + <NUM_LIT:1> ; } if ( iArg > <NUM_LIT:255> ) { if ( this . classFileOffset + <NUM_LIT:3> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_wide ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_istore ; writeUnsignedShort ( iArg ) ; } else { if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_istore ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) iArg ; } } public void istore_0 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . maxLocals == <NUM_LIT:0> ) { this . maxLocals = <NUM_LIT:1> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_istore_0 ; } public void istore_1 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . maxLocals <= <NUM_LIT:1> ) { this . maxLocals = <NUM_LIT:2> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_istore_1 ; } public void istore_2 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . maxLocals <= <NUM_LIT:2> ) { this . maxLocals = <NUM_LIT:3> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_istore_2 ; } public void istore_3 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . maxLocals <= <NUM_LIT:3> ) { this . maxLocals = <NUM_LIT:4> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_istore_3 ; } public void isub ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_isub ; } public void iushr ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iushr ; } public void ixor ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ixor ; } final public void jsr ( BranchLabel lbl ) { if ( this . wideMode ) { jsr_w ( lbl ) ; return ; } this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_jsr ; lbl . branch ( ) ; } final public void jsr_w ( BranchLabel lbl ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_jsr_w ; lbl . branchWide ( ) ; } public void l2d ( ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_l2d ; } public void l2f ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_l2f ; } public void l2i ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_l2i ; } public void ladd ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ladd ; } public void laload ( ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_laload ; } public void land ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_land ; } public void lastore ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:4> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lastore ; } public void lcmp ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:3> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lcmp ; } public void lconst_0 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += <NUM_LIT:2> ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lconst_0 ; } public void lconst_1 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += <NUM_LIT:2> ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lconst_1 ; } public void ldc ( float constant ) { this . countLabels = <NUM_LIT:0> ; int index = this . constantPool . literalIndex ( constant ) ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( index > <NUM_LIT:255> ) { if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ldc_w ; writeUnsignedShort ( index ) ; } else { if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ldc ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) index ; } } public void ldc ( int constant ) { this . countLabels = <NUM_LIT:0> ; int index = this . constantPool . literalIndex ( constant ) ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( index > <NUM_LIT:255> ) { if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ldc_w ; writeUnsignedShort ( index ) ; } else { if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ldc ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) index ; } } public void ldc ( String constant ) { this . countLabels = <NUM_LIT:0> ; int currentCodeStreamPosition = this . position ; char [ ] constantChars = constant . toCharArray ( ) ; int index = this . constantPool . literalIndexForLdc ( constantChars ) ; if ( index > <NUM_LIT:0> ) { ldcForIndex ( index ) ; } else { this . position = currentCodeStreamPosition ; int i = <NUM_LIT:0> ; int length = <NUM_LIT:0> ; int constantLength = constant . length ( ) ; byte [ ] utf8encoding = new byte [ Math . min ( constantLength + <NUM_LIT:100> , <NUM_LIT> ) ] ; int utf8encodingLength = <NUM_LIT:0> ; while ( ( length < <NUM_LIT> ) && ( i < constantLength ) ) { char current = constantChars [ i ] ; if ( length + <NUM_LIT:3> > ( utf8encodingLength = utf8encoding . length ) ) { System . arraycopy ( utf8encoding , <NUM_LIT:0> , utf8encoding = new byte [ Math . min ( utf8encodingLength + <NUM_LIT:100> , <NUM_LIT> ) ] , <NUM_LIT:0> , length ) ; } if ( ( current >= <NUM_LIT> ) && ( current <= <NUM_LIT> ) ) { utf8encoding [ length ++ ] = ( byte ) current ; } else { if ( current > <NUM_LIT> ) { utf8encoding [ length ++ ] = ( byte ) ( <NUM_LIT> | ( ( current > > <NUM_LIT:12> ) & <NUM_LIT> ) ) ; utf8encoding [ length ++ ] = ( byte ) ( <NUM_LIT> | ( ( current > > <NUM_LIT:6> ) & <NUM_LIT> ) ) ; utf8encoding [ length ++ ] = ( byte ) ( <NUM_LIT> | ( current & <NUM_LIT> ) ) ; } else { utf8encoding [ length ++ ] = ( byte ) ( <NUM_LIT> | ( ( current > > <NUM_LIT:6> ) & <NUM_LIT> ) ) ; utf8encoding [ length ++ ] = ( byte ) ( <NUM_LIT> | ( current & <NUM_LIT> ) ) ; } } i ++ ; } newStringContatenation ( ) ; dup ( ) ; char [ ] subChars = new char [ i ] ; System . arraycopy ( constantChars , <NUM_LIT:0> , subChars , <NUM_LIT:0> , i ) ; System . arraycopy ( utf8encoding , <NUM_LIT:0> , utf8encoding = new byte [ length ] , <NUM_LIT:0> , length ) ; index = this . constantPool . literalIndex ( subChars , utf8encoding ) ; ldcForIndex ( index ) ; invokeStringConcatenationStringConstructor ( ) ; while ( i < constantLength ) { length = <NUM_LIT:0> ; utf8encoding = new byte [ Math . min ( constantLength - i + <NUM_LIT:100> , <NUM_LIT> ) ] ; int startIndex = i ; while ( ( length < <NUM_LIT> ) && ( i < constantLength ) ) { char current = constantChars [ i ] ; if ( length + <NUM_LIT:3> > ( utf8encodingLength = utf8encoding . length ) ) { System . arraycopy ( utf8encoding , <NUM_LIT:0> , utf8encoding = new byte [ Math . min ( utf8encodingLength + <NUM_LIT:100> , <NUM_LIT> ) ] , <NUM_LIT:0> , length ) ; } if ( ( current >= <NUM_LIT> ) && ( current <= <NUM_LIT> ) ) { utf8encoding [ length ++ ] = ( byte ) current ; } else { if ( current > <NUM_LIT> ) { utf8encoding [ length ++ ] = ( byte ) ( <NUM_LIT> | ( ( current > > <NUM_LIT:12> ) & <NUM_LIT> ) ) ; utf8encoding [ length ++ ] = ( byte ) ( <NUM_LIT> | ( ( current > > <NUM_LIT:6> ) & <NUM_LIT> ) ) ; utf8encoding [ length ++ ] = ( byte ) ( <NUM_LIT> | ( current & <NUM_LIT> ) ) ; } else { utf8encoding [ length ++ ] = ( byte ) ( <NUM_LIT> | ( ( current > > <NUM_LIT:6> ) & <NUM_LIT> ) ) ; utf8encoding [ length ++ ] = ( byte ) ( <NUM_LIT> | ( current & <NUM_LIT> ) ) ; } } i ++ ; } int newCharLength = i - startIndex ; subChars = new char [ newCharLength ] ; System . arraycopy ( constantChars , startIndex , subChars , <NUM_LIT:0> , newCharLength ) ; System . arraycopy ( utf8encoding , <NUM_LIT:0> , utf8encoding = new byte [ length ] , <NUM_LIT:0> , length ) ; index = this . constantPool . literalIndex ( subChars , utf8encoding ) ; ldcForIndex ( index ) ; invokeStringConcatenationAppendForType ( TypeIds . T_JavaLangString ) ; } invokeStringConcatenationToString ( ) ; invokeStringIntern ( ) ; } } public void ldc ( TypeBinding typeBinding ) { this . countLabels = <NUM_LIT:0> ; int index = this . constantPool . literalIndexForType ( typeBinding ) ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( index > <NUM_LIT:255> ) { if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ldc_w ; writeUnsignedShort ( index ) ; } else { if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ldc ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) index ; } } public void ldc2_w ( double constant ) { this . countLabels = <NUM_LIT:0> ; int index = this . constantPool . literalIndex ( constant ) ; this . stackDepth += <NUM_LIT:2> ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ldc2_w ; writeUnsignedShort ( index ) ; } public void ldc2_w ( long constant ) { this . countLabels = <NUM_LIT:0> ; int index = this . constantPool . literalIndex ( constant ) ; this . stackDepth += <NUM_LIT:2> ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ldc2_w ; writeUnsignedShort ( index ) ; } public void ldcForIndex ( int index ) { this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) { this . stackMax = this . stackDepth ; } if ( index > <NUM_LIT:255> ) { if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ldc_w ; writeUnsignedShort ( index ) ; } else { if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ldc ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) index ; } } public void ldiv ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ldiv ; } public void lload ( int iArg ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += <NUM_LIT:2> ; if ( this . maxLocals <= iArg + <NUM_LIT:1> ) { this . maxLocals = iArg + <NUM_LIT:2> ; } if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( iArg > <NUM_LIT:255> ) { if ( this . classFileOffset + <NUM_LIT:3> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_wide ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lload ; writeUnsignedShort ( iArg ) ; } else { if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lload ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) iArg ; } } public void lload_0 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += <NUM_LIT:2> ; if ( this . maxLocals < <NUM_LIT:2> ) { this . maxLocals = <NUM_LIT:2> ; } if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lload_0 ; } public void lload_1 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += <NUM_LIT:2> ; if ( this . maxLocals < <NUM_LIT:3> ) { this . maxLocals = <NUM_LIT:3> ; } if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lload_1 ; } public void lload_2 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += <NUM_LIT:2> ; if ( this . maxLocals < <NUM_LIT:4> ) { this . maxLocals = <NUM_LIT:4> ; } if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lload_2 ; } public void lload_3 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += <NUM_LIT:2> ; if ( this . maxLocals < <NUM_LIT:5> ) { this . maxLocals = <NUM_LIT:5> ; } if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lload_3 ; } public void lmul ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lmul ; } public void lneg ( ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lneg ; } public final void load ( LocalVariableBinding localBinding ) { load ( localBinding . type , localBinding . resolvedPosition ) ; } protected final void load ( TypeBinding typeBinding , int resolvedPosition ) { this . countLabels = <NUM_LIT:0> ; switch ( typeBinding . id ) { case TypeIds . T_int : case TypeIds . T_byte : case TypeIds . T_char : case TypeIds . T_boolean : case TypeIds . T_short : switch ( resolvedPosition ) { case <NUM_LIT:0> : iload_0 ( ) ; break ; case <NUM_LIT:1> : iload_1 ( ) ; break ; case <NUM_LIT:2> : iload_2 ( ) ; break ; case <NUM_LIT:3> : iload_3 ( ) ; break ; default : iload ( resolvedPosition ) ; } break ; case TypeIds . T_float : switch ( resolvedPosition ) { case <NUM_LIT:0> : fload_0 ( ) ; break ; case <NUM_LIT:1> : fload_1 ( ) ; break ; case <NUM_LIT:2> : fload_2 ( ) ; break ; case <NUM_LIT:3> : fload_3 ( ) ; break ; default : fload ( resolvedPosition ) ; } break ; case TypeIds . T_long : switch ( resolvedPosition ) { case <NUM_LIT:0> : lload_0 ( ) ; break ; case <NUM_LIT:1> : lload_1 ( ) ; break ; case <NUM_LIT:2> : lload_2 ( ) ; break ; case <NUM_LIT:3> : lload_3 ( ) ; break ; default : lload ( resolvedPosition ) ; } break ; case TypeIds . T_double : switch ( resolvedPosition ) { case <NUM_LIT:0> : dload_0 ( ) ; break ; case <NUM_LIT:1> : dload_1 ( ) ; break ; case <NUM_LIT:2> : dload_2 ( ) ; break ; case <NUM_LIT:3> : dload_3 ( ) ; break ; default : dload ( resolvedPosition ) ; } break ; default : switch ( resolvedPosition ) { case <NUM_LIT:0> : aload_0 ( ) ; break ; case <NUM_LIT:1> : aload_1 ( ) ; break ; case <NUM_LIT:2> : aload_2 ( ) ; break ; case <NUM_LIT:3> : aload_3 ( ) ; break ; default : aload ( resolvedPosition ) ; } } } public void lookupswitch ( CaseLabel defaultLabel , int [ ] keys , int [ ] sortedIndexes , CaseLabel [ ] casesLabel ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; int length = keys . length ; int pos = this . position ; defaultLabel . placeInstruction ( ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { casesLabel [ i ] . placeInstruction ( ) ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lookupswitch ; for ( int i = ( <NUM_LIT:3> - ( pos & <NUM_LIT:3> ) ) ; i > <NUM_LIT:0> ; i -- ) { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = <NUM_LIT:0> ; } defaultLabel . branch ( ) ; writeSignedWord ( length ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { writeSignedWord ( keys [ sortedIndexes [ i ] ] ) ; casesLabel [ sortedIndexes [ i ] ] . branch ( ) ; } } public void lor ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lor ; } public void lrem ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lrem ; } public void lreturn ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lreturn ; this . lastAbruptCompletion = this . position ; } public void lshl ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lshl ; } public void lshr ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lshr ; } public void lstore ( int iArg ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . maxLocals <= iArg + <NUM_LIT:1> ) { this . maxLocals = iArg + <NUM_LIT:2> ; } if ( iArg > <NUM_LIT:255> ) { if ( this . classFileOffset + <NUM_LIT:3> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_wide ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lstore ; writeUnsignedShort ( iArg ) ; } else { if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lstore ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) iArg ; } } public void lstore_0 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . maxLocals < <NUM_LIT:2> ) { this . maxLocals = <NUM_LIT:2> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lstore_0 ; } public void lstore_1 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . maxLocals < <NUM_LIT:3> ) { this . maxLocals = <NUM_LIT:3> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lstore_1 ; } public void lstore_2 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . maxLocals < <NUM_LIT:4> ) { this . maxLocals = <NUM_LIT:4> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lstore_2 ; } public void lstore_3 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . maxLocals < <NUM_LIT:5> ) { this . maxLocals = <NUM_LIT:5> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lstore_3 ; } public void lsub ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lsub ; } public void lushr ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lushr ; } public void lxor ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lxor ; } public void monitorenter ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_monitorenter ; } public void monitorexit ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_monitorexit ; } public void multianewarray ( TypeBinding typeBinding , int dimensions ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += ( <NUM_LIT:1> - dimensions ) ; if ( this . classFileOffset + <NUM_LIT:3> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_multianewarray ; writeUnsignedShort ( this . constantPool . literalIndexForType ( typeBinding ) ) ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) dimensions ; } public void new_ ( TypeBinding typeBinding ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_new ; writeUnsignedShort ( this . constantPool . literalIndexForType ( typeBinding ) ) ; } public void newarray ( int array_Type ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_newarray ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) array_Type ; } public void newArray ( ArrayBinding arrayBinding ) { TypeBinding component = arrayBinding . elementsType ( ) ; switch ( component . id ) { case TypeIds . T_int : newarray ( ClassFileConstants . INT_ARRAY ) ; break ; case TypeIds . T_byte : newarray ( ClassFileConstants . BYTE_ARRAY ) ; break ; case TypeIds . T_boolean : newarray ( ClassFileConstants . BOOLEAN_ARRAY ) ; break ; case TypeIds . T_short : newarray ( ClassFileConstants . SHORT_ARRAY ) ; break ; case TypeIds . T_char : newarray ( ClassFileConstants . CHAR_ARRAY ) ; break ; case TypeIds . T_long : newarray ( ClassFileConstants . LONG_ARRAY ) ; break ; case TypeIds . T_float : newarray ( ClassFileConstants . FLOAT_ARRAY ) ; break ; case TypeIds . T_double : newarray ( ClassFileConstants . DOUBLE_ARRAY ) ; break ; default : anewarray ( component ) ; } } public void newJavaLangAssertionError ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_new ; writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangAssertionErrorConstantPoolName ) ) ; } public void newJavaLangError ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_new ; writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangErrorConstantPoolName ) ) ; } public void newNoClassDefFoundError ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_new ; writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangNoClassDefFoundErrorConstantPoolName ) ) ; } public void newStringContatenation ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) { this . stackMax = this . stackDepth ; } if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_new ; if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangStringBuilderConstantPoolName ) ) ; } else { writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangStringBufferConstantPoolName ) ) ; } } public void newWrapperFor ( int typeID ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_new ; switch ( typeID ) { case TypeIds . T_int : writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangIntegerConstantPoolName ) ) ; break ; case TypeIds . T_boolean : writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangBooleanConstantPoolName ) ) ; break ; case TypeIds . T_byte : writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangByteConstantPoolName ) ) ; break ; case TypeIds . T_char : writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangCharacterConstantPoolName ) ) ; break ; case TypeIds . T_float : writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangFloatConstantPoolName ) ) ; break ; case TypeIds . T_double : writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangDoubleConstantPoolName ) ) ; break ; case TypeIds . T_short : writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangShortConstantPoolName ) ) ; break ; case TypeIds . T_long : writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangLongConstantPoolName ) ) ; break ; case TypeIds . T_void : writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangVoidConstantPoolName ) ) ; } } public void nop ( ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_nop ; } public void optimizeBranch ( int oldPosition , BranchLabel lbl ) { for ( int i = <NUM_LIT:0> ; i < this . countLabels ; i ++ ) { BranchLabel label = this . labels [ i ] ; if ( oldPosition == label . position ) { label . position = this . position ; if ( label instanceof CaseLabel ) { int offset = this . position - ( ( CaseLabel ) label ) . instructionPosition ; int [ ] forwardRefs = label . forwardReferences ( ) ; for ( int j = <NUM_LIT:0> , length = label . forwardReferenceCount ( ) ; j < length ; j ++ ) { int forwardRef = forwardRefs [ j ] ; this . writeSignedWord ( forwardRef , offset ) ; } } else { int [ ] forwardRefs = label . forwardReferences ( ) ; for ( int j = <NUM_LIT:0> , length = label . forwardReferenceCount ( ) ; j < length ; j ++ ) { final int forwardRef = forwardRefs [ j ] ; this . writePosition ( lbl , forwardRef ) ; } } } } } public void pop ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_pop ; } public void pop2 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_pop2 ; } public void pushExceptionOnStack ( TypeBinding binding ) { this . stackDepth = <NUM_LIT:1> ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; } public void pushOnStack ( TypeBinding binding ) { if ( ++ this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; } public void record ( LocalVariableBinding local ) { if ( ( this . generateAttributes & ( ClassFileConstants . ATTR_VARS | ClassFileConstants . ATTR_STACK_MAP_TABLE | ClassFileConstants . ATTR_STACK_MAP ) ) == <NUM_LIT:0> ) return ; if ( this . allLocalsCounter == this . locals . length ) { System . arraycopy ( this . locals , <NUM_LIT:0> , this . locals = new LocalVariableBinding [ this . allLocalsCounter + LOCALS_INCREMENT ] , <NUM_LIT:0> , this . allLocalsCounter ) ; } this . locals [ this . allLocalsCounter ++ ] = local ; local . initializationPCs = new int [ <NUM_LIT:4> ] ; local . initializationCount = <NUM_LIT:0> ; } public void recordExpressionType ( TypeBinding typeBinding ) { } public void recordPositionsFrom ( int startPC , int sourcePos ) { this . recordPositionsFrom ( startPC , sourcePos , false ) ; } public void recordPositionsFrom ( int startPC , int sourcePos , boolean widen ) { if ( ( this . generateAttributes & ClassFileConstants . ATTR_LINES ) == <NUM_LIT:0> || sourcePos == <NUM_LIT:0> || ( startPC == this . position && ! widen ) ) return ; if ( this . pcToSourceMapSize + <NUM_LIT:4> > this . pcToSourceMap . length ) { System . arraycopy ( this . pcToSourceMap , <NUM_LIT:0> , this . pcToSourceMap = new int [ this . pcToSourceMapSize << <NUM_LIT:1> ] , <NUM_LIT:0> , this . pcToSourceMapSize ) ; } if ( this . pcToSourceMapSize > <NUM_LIT:0> ) { int lineNumber ; int previousLineNumber = this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:1> ] ; if ( this . lineNumberStart == this . lineNumberEnd ) { lineNumber = this . lineNumberStart ; } else { int [ ] lineSeparatorPositions2 = this . lineSeparatorPositions ; int length = lineSeparatorPositions2 . length ; if ( previousLineNumber == <NUM_LIT:1> ) { if ( sourcePos < lineSeparatorPositions2 [ <NUM_LIT:0> ] ) { lineNumber = <NUM_LIT:1> ; if ( startPC < this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:2> ] ) { int insertionIndex = insertionIndex ( this . pcToSourceMap , this . pcToSourceMapSize , startPC ) ; if ( insertionIndex != - <NUM_LIT:1> ) { if ( ! ( ( insertionIndex > <NUM_LIT:1> ) && ( this . pcToSourceMap [ insertionIndex - <NUM_LIT:1> ] == lineNumber ) ) ) { if ( ( this . pcToSourceMapSize > <NUM_LIT:4> ) && ( this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:4> ] > startPC ) ) { System . arraycopy ( this . pcToSourceMap , insertionIndex , this . pcToSourceMap , insertionIndex + <NUM_LIT:2> , this . pcToSourceMapSize - <NUM_LIT:2> - insertionIndex ) ; this . pcToSourceMap [ insertionIndex ++ ] = startPC ; this . pcToSourceMap [ insertionIndex ] = lineNumber ; } else { this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:2> ] = startPC ; } } } } this . lastEntryPC = this . position ; return ; } else if ( length == <NUM_LIT:1> || sourcePos < lineSeparatorPositions2 [ <NUM_LIT:1> ] ) { lineNumber = <NUM_LIT:2> ; if ( startPC <= this . lastEntryPC ) { int insertionIndex = insertionIndex ( this . pcToSourceMap , this . pcToSourceMapSize , startPC ) ; if ( insertionIndex != - <NUM_LIT:1> ) { int existingEntryIndex = indexOfSameLineEntrySincePC ( startPC , lineNumber ) ; if ( existingEntryIndex != - <NUM_LIT:1> ) { this . pcToSourceMap [ existingEntryIndex ] = startPC ; } else if ( insertionIndex < <NUM_LIT:1> || this . pcToSourceMap [ insertionIndex - <NUM_LIT:1> ] != lineNumber ) { System . arraycopy ( this . pcToSourceMap , insertionIndex , this . pcToSourceMap , insertionIndex + <NUM_LIT:2> , this . pcToSourceMapSize - insertionIndex ) ; this . pcToSourceMap [ insertionIndex ++ ] = startPC ; this . pcToSourceMap [ insertionIndex ] = lineNumber ; this . pcToSourceMapSize += <NUM_LIT:2> ; } } else if ( this . position != this . lastEntryPC ) { if ( this . lastEntryPC == startPC || this . lastEntryPC == this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:2> ] ) { this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:1> ] = lineNumber ; } else { this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = this . lastEntryPC ; this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = lineNumber ; } } else if ( this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:1> ] < lineNumber && widen ) { this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:1> ] = lineNumber ; } } else { this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = startPC ; this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = lineNumber ; } this . lastEntryPC = this . position ; return ; } else { lineNumber = Util . getLineNumber ( sourcePos , this . lineSeparatorPositions , this . lineNumberStart - <NUM_LIT:1> , this . lineNumberEnd - <NUM_LIT:1> ) ; } } else if ( previousLineNumber < length ) { if ( lineSeparatorPositions2 [ previousLineNumber - <NUM_LIT:2> ] < sourcePos ) { if ( sourcePos < lineSeparatorPositions2 [ previousLineNumber - <NUM_LIT:1> ] ) { lineNumber = previousLineNumber ; if ( startPC < this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:2> ] ) { int insertionIndex = insertionIndex ( this . pcToSourceMap , this . pcToSourceMapSize , startPC ) ; if ( insertionIndex != - <NUM_LIT:1> ) { if ( ! ( ( insertionIndex > <NUM_LIT:1> ) && ( this . pcToSourceMap [ insertionIndex - <NUM_LIT:1> ] == lineNumber ) ) ) { if ( ( this . pcToSourceMapSize > <NUM_LIT:4> ) && ( this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:4> ] > startPC ) ) { System . arraycopy ( this . pcToSourceMap , insertionIndex , this . pcToSourceMap , insertionIndex + <NUM_LIT:2> , this . pcToSourceMapSize - <NUM_LIT:2> - insertionIndex ) ; this . pcToSourceMap [ insertionIndex ++ ] = startPC ; this . pcToSourceMap [ insertionIndex ] = lineNumber ; } else { this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:2> ] = startPC ; } } } } this . lastEntryPC = this . position ; return ; } else if ( sourcePos < lineSeparatorPositions2 [ previousLineNumber ] ) { lineNumber = previousLineNumber + <NUM_LIT:1> ; if ( startPC <= this . lastEntryPC ) { int insertionIndex = insertionIndex ( this . pcToSourceMap , this . pcToSourceMapSize , startPC ) ; if ( insertionIndex != - <NUM_LIT:1> ) { int existingEntryIndex = indexOfSameLineEntrySincePC ( startPC , lineNumber ) ; if ( existingEntryIndex != - <NUM_LIT:1> ) { this . pcToSourceMap [ existingEntryIndex ] = startPC ; } else if ( insertionIndex < <NUM_LIT:1> || this . pcToSourceMap [ insertionIndex - <NUM_LIT:1> ] != lineNumber ) { System . arraycopy ( this . pcToSourceMap , insertionIndex , this . pcToSourceMap , insertionIndex + <NUM_LIT:2> , this . pcToSourceMapSize - insertionIndex ) ; this . pcToSourceMap [ insertionIndex ++ ] = startPC ; this . pcToSourceMap [ insertionIndex ] = lineNumber ; this . pcToSourceMapSize += <NUM_LIT:2> ; } } else if ( this . position != this . lastEntryPC ) { if ( this . lastEntryPC == startPC || this . lastEntryPC == this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:2> ] ) { this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:1> ] = lineNumber ; } else { this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = this . lastEntryPC ; this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = lineNumber ; } } else if ( this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:1> ] < lineNumber && widen ) { this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:1> ] = lineNumber ; } } else { this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = startPC ; this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = lineNumber ; } this . lastEntryPC = this . position ; return ; } else { lineNumber = Util . getLineNumber ( sourcePos , this . lineSeparatorPositions , this . lineNumberStart - <NUM_LIT:1> , this . lineNumberEnd - <NUM_LIT:1> ) ; } } else { lineNumber = Util . getLineNumber ( sourcePos , this . lineSeparatorPositions , this . lineNumberStart - <NUM_LIT:1> , this . lineNumberEnd - <NUM_LIT:1> ) ; } } else if ( lineSeparatorPositions2 [ length - <NUM_LIT:1> ] < sourcePos ) { lineNumber = length + <NUM_LIT:1> ; if ( startPC <= this . lastEntryPC ) { int insertionIndex = insertionIndex ( this . pcToSourceMap , this . pcToSourceMapSize , startPC ) ; if ( insertionIndex != - <NUM_LIT:1> ) { int existingEntryIndex = indexOfSameLineEntrySincePC ( startPC , lineNumber ) ; if ( existingEntryIndex != - <NUM_LIT:1> ) { this . pcToSourceMap [ existingEntryIndex ] = startPC ; } else if ( insertionIndex < <NUM_LIT:1> || this . pcToSourceMap [ insertionIndex - <NUM_LIT:1> ] != lineNumber ) { System . arraycopy ( this . pcToSourceMap , insertionIndex , this . pcToSourceMap , insertionIndex + <NUM_LIT:2> , this . pcToSourceMapSize - insertionIndex ) ; this . pcToSourceMap [ insertionIndex ++ ] = startPC ; this . pcToSourceMap [ insertionIndex ] = lineNumber ; this . pcToSourceMapSize += <NUM_LIT:2> ; } } else if ( this . position != this . lastEntryPC ) { if ( this . lastEntryPC == startPC || this . lastEntryPC == this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:2> ] ) { this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:1> ] = lineNumber ; } else { this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = this . lastEntryPC ; this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = lineNumber ; } } else if ( this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:1> ] < lineNumber && widen ) { this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:1> ] = lineNumber ; } } else { this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = startPC ; this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = lineNumber ; } this . lastEntryPC = this . position ; return ; } else { lineNumber = Util . getLineNumber ( sourcePos , this . lineSeparatorPositions , this . lineNumberStart - <NUM_LIT:1> , this . lineNumberEnd - <NUM_LIT:1> ) ; } } if ( previousLineNumber != lineNumber ) { if ( startPC <= this . lastEntryPC ) { int insertionIndex = insertionIndex ( this . pcToSourceMap , this . pcToSourceMapSize , startPC ) ; if ( insertionIndex != - <NUM_LIT:1> ) { int existingEntryIndex = indexOfSameLineEntrySincePC ( startPC , lineNumber ) ; if ( existingEntryIndex != - <NUM_LIT:1> ) { this . pcToSourceMap [ existingEntryIndex ] = startPC ; } else if ( insertionIndex < <NUM_LIT:1> || this . pcToSourceMap [ insertionIndex - <NUM_LIT:1> ] != lineNumber ) { System . arraycopy ( this . pcToSourceMap , insertionIndex , this . pcToSourceMap , insertionIndex + <NUM_LIT:2> , this . pcToSourceMapSize - insertionIndex ) ; this . pcToSourceMap [ insertionIndex ++ ] = startPC ; this . pcToSourceMap [ insertionIndex ] = lineNumber ; this . pcToSourceMapSize += <NUM_LIT:2> ; } } else if ( this . position != this . lastEntryPC ) { if ( this . lastEntryPC == startPC || this . lastEntryPC == this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:2> ] ) { this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:1> ] = lineNumber ; } else { this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = this . lastEntryPC ; this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = lineNumber ; } } else if ( this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:1> ] < lineNumber && widen ) { this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:1> ] = lineNumber ; } } else { this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = startPC ; this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = lineNumber ; } } else { if ( startPC < this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:2> ] ) { int insertionIndex = insertionIndex ( this . pcToSourceMap , this . pcToSourceMapSize , startPC ) ; if ( insertionIndex != - <NUM_LIT:1> ) { if ( ! ( ( insertionIndex > <NUM_LIT:1> ) && ( this . pcToSourceMap [ insertionIndex - <NUM_LIT:1> ] == lineNumber ) ) ) { if ( ( this . pcToSourceMapSize > <NUM_LIT:4> ) && ( this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:4> ] > startPC ) ) { System . arraycopy ( this . pcToSourceMap , insertionIndex , this . pcToSourceMap , insertionIndex + <NUM_LIT:2> , this . pcToSourceMapSize - <NUM_LIT:2> - insertionIndex ) ; this . pcToSourceMap [ insertionIndex ++ ] = startPC ; this . pcToSourceMap [ insertionIndex ] = lineNumber ; } else { this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:2> ] = startPC ; } } } } } this . lastEntryPC = this . position ; } else { int lineNumber = <NUM_LIT:0> ; if ( this . lineNumberStart == this . lineNumberEnd ) { lineNumber = this . lineNumberStart ; } else { lineNumber = Util . getLineNumber ( sourcePos , this . lineSeparatorPositions , this . lineNumberStart - <NUM_LIT:1> , this . lineNumberEnd - <NUM_LIT:1> ) ; } this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = startPC ; this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = lineNumber ; this . lastEntryPC = this . position ; } } public void registerExceptionHandler ( ExceptionLabel anExceptionLabel ) { int length ; if ( this . exceptionLabelsCounter == ( length = this . exceptionLabels . length ) ) { System . arraycopy ( this . exceptionLabels , <NUM_LIT:0> , this . exceptionLabels = new ExceptionLabel [ length + LABELS_INCREMENT ] , <NUM_LIT:0> , length ) ; } this . exceptionLabels [ this . exceptionLabelsCounter ++ ] = anExceptionLabel ; } public void removeNotDefinitelyAssignedVariables ( Scope scope , int initStateIndex ) { if ( ( this . generateAttributes & ( ClassFileConstants . ATTR_VARS | ClassFileConstants . ATTR_STACK_MAP_TABLE | ClassFileConstants . ATTR_STACK_MAP ) ) == <NUM_LIT:0> ) return ; for ( int i = <NUM_LIT:0> ; i < this . visibleLocalsCount ; i ++ ) { LocalVariableBinding localBinding = this . visibleLocals [ i ] ; if ( localBinding != null && ! isDefinitelyAssigned ( scope , initStateIndex , localBinding ) && localBinding . initializationCount > <NUM_LIT:0> ) { localBinding . recordInitializationEndPC ( this . position ) ; } } } public void removeUnusedPcToSourceMapEntries ( ) { if ( this . pcToSourceMapSize != <NUM_LIT:0> ) { while ( this . pcToSourceMapSize >= <NUM_LIT:2> && this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:2> ] > this . position ) { this . pcToSourceMapSize -= <NUM_LIT:2> ; } } } public void removeVariable ( LocalVariableBinding localBinding ) { if ( localBinding == null ) return ; if ( localBinding . initializationCount > <NUM_LIT:0> ) { localBinding . recordInitializationEndPC ( this . position ) ; } for ( int i = this . visibleLocalsCount - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) { LocalVariableBinding visibleLocal = this . visibleLocals [ i ] ; if ( visibleLocal == localBinding ) { this . visibleLocals [ i ] = null ; return ; } } } public void reset ( AbstractMethodDeclaration referenceMethod , ClassFile targetClassFile ) { init ( targetClassFile ) ; this . methodDeclaration = referenceMethod ; int [ ] lineSeparatorPositions2 = this . lineSeparatorPositions ; if ( lineSeparatorPositions2 != null ) { int length = lineSeparatorPositions2 . length ; int lineSeparatorPositionsEnd = length - <NUM_LIT:1> ; if ( referenceMethod . isClinit ( ) || referenceMethod . isConstructor ( ) ) { this . lineNumberStart = <NUM_LIT:1> ; this . lineNumberEnd = length == <NUM_LIT:0> ? <NUM_LIT:1> : length ; } else { int start = Util . getLineNumber ( referenceMethod . bodyStart , lineSeparatorPositions2 , <NUM_LIT:0> , lineSeparatorPositionsEnd ) ; this . lineNumberStart = start ; if ( start > lineSeparatorPositionsEnd ) { this . lineNumberEnd = start ; } else { int end = Util . getLineNumber ( referenceMethod . bodyEnd , lineSeparatorPositions2 , start - <NUM_LIT:1> , lineSeparatorPositionsEnd ) ; if ( end >= lineSeparatorPositionsEnd ) { end = length ; } this . lineNumberEnd = end == <NUM_LIT:0> ? <NUM_LIT:1> : end ; } } } this . preserveUnusedLocals = referenceMethod . scope . compilerOptions ( ) . preserveAllLocalVariables ; initializeMaxLocals ( referenceMethod . binding ) ; } public void reset ( ClassFile givenClassFile ) { this . targetLevel = givenClassFile . targetJDK ; int produceAttributes = givenClassFile . produceAttributes ; this . generateAttributes = produceAttributes ; if ( ( produceAttributes & ClassFileConstants . ATTR_LINES ) != <NUM_LIT:0> ) { this . lineSeparatorPositions = givenClassFile . referenceBinding . scope . referenceCompilationUnit ( ) . compilationResult . getLineSeparatorPositions ( ) ; } else { this . lineSeparatorPositions = null ; } } public void resetForProblemClinit ( ClassFile targetClassFile ) { init ( targetClassFile ) ; initializeMaxLocals ( null ) ; } public void resetInWideMode ( ) { this . wideMode = true ; } private final void resizeByteArray ( ) { int length = this . bCodeStream . length ; int requiredSize = length + length ; if ( this . classFileOffset >= requiredSize ) { requiredSize = this . classFileOffset + length ; } System . arraycopy ( this . bCodeStream , <NUM_LIT:0> , this . bCodeStream = new byte [ requiredSize ] , <NUM_LIT:0> , length ) ; } final public void ret ( int index ) { this . countLabels = <NUM_LIT:0> ; if ( index > <NUM_LIT:255> ) { if ( this . classFileOffset + <NUM_LIT:3> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_wide ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ret ; writeUnsignedShort ( index ) ; } else { if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ret ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) index ; } } public void return_ ( ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_return ; this . lastAbruptCompletion = this . position ; } public void saload ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_saload ; } public void sastore ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:3> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_sastore ; } public void sendOperator ( int operatorConstant , int type_ID ) { switch ( type_ID ) { case TypeIds . T_int : case TypeIds . T_boolean : case TypeIds . T_char : case TypeIds . T_byte : case TypeIds . T_short : switch ( operatorConstant ) { case OperatorIds . PLUS : iadd ( ) ; break ; case OperatorIds . MINUS : isub ( ) ; break ; case OperatorIds . MULTIPLY : imul ( ) ; break ; case OperatorIds . DIVIDE : idiv ( ) ; break ; case OperatorIds . REMAINDER : irem ( ) ; break ; case OperatorIds . LEFT_SHIFT : ishl ( ) ; break ; case OperatorIds . RIGHT_SHIFT : ishr ( ) ; break ; case OperatorIds . UNSIGNED_RIGHT_SHIFT : iushr ( ) ; break ; case OperatorIds . AND : iand ( ) ; break ; case OperatorIds . OR : ior ( ) ; break ; case OperatorIds . XOR : ixor ( ) ; break ; } break ; case TypeIds . T_long : switch ( operatorConstant ) { case OperatorIds . PLUS : ladd ( ) ; break ; case OperatorIds . MINUS : lsub ( ) ; break ; case OperatorIds . MULTIPLY : lmul ( ) ; break ; case OperatorIds . DIVIDE : ldiv ( ) ; break ; case OperatorIds . REMAINDER : lrem ( ) ; break ; case OperatorIds . LEFT_SHIFT : lshl ( ) ; break ; case OperatorIds . RIGHT_SHIFT : lshr ( ) ; break ; case OperatorIds . UNSIGNED_RIGHT_SHIFT : lushr ( ) ; break ; case OperatorIds . AND : land ( ) ; break ; case OperatorIds . OR : lor ( ) ; break ; case OperatorIds . XOR : lxor ( ) ; break ; } break ; case TypeIds . T_float : switch ( operatorConstant ) { case OperatorIds . PLUS : fadd ( ) ; break ; case OperatorIds . MINUS : fsub ( ) ; break ; case OperatorIds . MULTIPLY : fmul ( ) ; break ; case OperatorIds . DIVIDE : fdiv ( ) ; break ; case OperatorIds . REMAINDER : frem ( ) ; } break ; case TypeIds . T_double : switch ( operatorConstant ) { case OperatorIds . PLUS : dadd ( ) ; break ; case OperatorIds . MINUS : dsub ( ) ; break ; case OperatorIds . MULTIPLY : dmul ( ) ; break ; case OperatorIds . DIVIDE : ddiv ( ) ; break ; case OperatorIds . REMAINDER : drem ( ) ; } } } public void sipush ( int s ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_sipush ; writeSignedShort ( s ) ; } public void store ( LocalVariableBinding localBinding , boolean valueRequired ) { int localPosition = localBinding . resolvedPosition ; switch ( localBinding . type . id ) { case TypeIds . T_int : case TypeIds . T_char : case TypeIds . T_byte : case TypeIds . T_short : case TypeIds . T_boolean : if ( valueRequired ) dup ( ) ; switch ( localPosition ) { case <NUM_LIT:0> : istore_0 ( ) ; break ; case <NUM_LIT:1> : istore_1 ( ) ; break ; case <NUM_LIT:2> : istore_2 ( ) ; break ; case <NUM_LIT:3> : istore_3 ( ) ; break ; default : istore ( localPosition ) ; } break ; case TypeIds . T_float : if ( valueRequired ) dup ( ) ; switch ( localPosition ) { case <NUM_LIT:0> : fstore_0 ( ) ; break ; case <NUM_LIT:1> : fstore_1 ( ) ; break ; case <NUM_LIT:2> : fstore_2 ( ) ; break ; case <NUM_LIT:3> : fstore_3 ( ) ; break ; default : fstore ( localPosition ) ; } break ; case TypeIds . T_double : if ( valueRequired ) dup2 ( ) ; switch ( localPosition ) { case <NUM_LIT:0> : dstore_0 ( ) ; break ; case <NUM_LIT:1> : dstore_1 ( ) ; break ; case <NUM_LIT:2> : dstore_2 ( ) ; break ; case <NUM_LIT:3> : dstore_3 ( ) ; break ; default : dstore ( localPosition ) ; } break ; case TypeIds . T_long : if ( valueRequired ) dup2 ( ) ; switch ( localPosition ) { case <NUM_LIT:0> : lstore_0 ( ) ; break ; case <NUM_LIT:1> : lstore_1 ( ) ; break ; case <NUM_LIT:2> : lstore_2 ( ) ; break ; case <NUM_LIT:3> : lstore_3 ( ) ; break ; default : lstore ( localPosition ) ; } break ; default : if ( valueRequired ) dup ( ) ; switch ( localPosition ) { case <NUM_LIT:0> : astore_0 ( ) ; break ; case <NUM_LIT:1> : astore_1 ( ) ; break ; case <NUM_LIT:2> : astore_2 ( ) ; break ; case <NUM_LIT:3> : astore_3 ( ) ; break ; default : astore ( localPosition ) ; } } } public void swap ( ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_swap ; } public void tableswitch ( CaseLabel defaultLabel , int low , int high , int [ ] keys , int [ ] sortedIndexes , CaseLabel [ ] casesLabel ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; int length = casesLabel . length ; int pos = this . position ; defaultLabel . placeInstruction ( ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) casesLabel [ i ] . placeInstruction ( ) ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_tableswitch ; for ( int i = ( <NUM_LIT:3> - ( pos & <NUM_LIT:3> ) ) ; i > <NUM_LIT:0> ; i -- ) { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = <NUM_LIT:0> ; } defaultLabel . branch ( ) ; writeSignedWord ( low ) ; writeSignedWord ( high ) ; int i = low , j = low ; while ( true ) { int index ; int key = keys [ index = sortedIndexes [ j - low ] ] ; if ( key == i ) { casesLabel [ index ] . branch ( ) ; j ++ ; if ( i == high ) break ; } else { defaultLabel . branch ( ) ; } i ++ ; } } public void throwAnyException ( LocalVariableBinding anyExceptionVariable ) { this . load ( anyExceptionVariable ) ; athrow ( ) ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( "<STR_LIT>" ) ; buffer . append ( this . position ) ; buffer . append ( "<STR_LIT>" ) ; buffer . append ( this . stackDepth ) ; buffer . append ( "<STR_LIT>" ) ; buffer . append ( this . stackMax ) ; buffer . append ( "<STR_LIT>" ) ; buffer . append ( this . maxLocals ) ; buffer . append ( "<STR_LIT:)>" ) ; return buffer . toString ( ) ; } public void updateLastRecordedEndPC ( Scope scope , int pos ) { if ( ( this . generateAttributes & ClassFileConstants . ATTR_LINES ) != <NUM_LIT:0> ) { this . lastEntryPC = pos ; } if ( ( this . generateAttributes & ( ClassFileConstants . ATTR_VARS | ClassFileConstants . ATTR_STACK_MAP_TABLE | ClassFileConstants . ATTR_STACK_MAP ) ) != <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> , max = this . locals . length ; i < max ; i ++ ) { LocalVariableBinding local = this . locals [ i ] ; if ( local != null && local . declaringScope == scope && local . initializationCount > <NUM_LIT:0> ) { if ( local . initializationPCs [ ( ( local . initializationCount - <NUM_LIT:1> ) << <NUM_LIT:1> ) + <NUM_LIT:1> ] == pos ) { local . initializationPCs [ ( ( local . initializationCount - <NUM_LIT:1> ) << <NUM_LIT:1> ) + <NUM_LIT:1> ] = this . position ; } } } } } protected void writePosition ( BranchLabel label ) { int offset = label . position - this . position + <NUM_LIT:1> ; if ( Math . abs ( offset ) > <NUM_LIT> && ! this . wideMode ) { throw new AbortMethod ( CodeStream . RESTART_IN_WIDE_MODE , null ) ; } this . writeSignedShort ( offset ) ; int [ ] forwardRefs = label . forwardReferences ( ) ; for ( int i = <NUM_LIT:0> , max = label . forwardReferenceCount ( ) ; i < max ; i ++ ) { this . writePosition ( label , forwardRefs [ i ] ) ; } } protected void writePosition ( BranchLabel label , int forwardReference ) { final int offset = label . position - forwardReference + <NUM_LIT:1> ; if ( Math . abs ( offset ) > <NUM_LIT> && ! this . wideMode ) { throw new AbortMethod ( CodeStream . RESTART_IN_WIDE_MODE , null ) ; } if ( this . wideMode ) { if ( ( label . tagBits & BranchLabel . WIDE ) != <NUM_LIT:0> ) { this . writeSignedWord ( forwardReference , offset ) ; } else { this . writeSignedShort ( forwardReference , offset ) ; } } else { this . writeSignedShort ( forwardReference , offset ) ; } } private final void writeSignedShort ( int value ) { if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) ( value > > <NUM_LIT:8> ) ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) value ; } private final void writeSignedShort ( int pos , int value ) { int currentOffset = this . startingClassFileOffset + pos ; if ( currentOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . bCodeStream [ currentOffset ] = ( byte ) ( value > > <NUM_LIT:8> ) ; this . bCodeStream [ currentOffset + <NUM_LIT:1> ] = ( byte ) value ; } protected final void writeSignedWord ( int value ) { if ( this . classFileOffset + <NUM_LIT:3> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:4> ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) ( ( value & <NUM_LIT> ) > > <NUM_LIT:24> ) ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) ( ( value & <NUM_LIT> ) > > <NUM_LIT:16> ) ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) ( ( value & <NUM_LIT> ) > > <NUM_LIT:8> ) ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) ( value & <NUM_LIT> ) ; } protected void writeSignedWord ( int pos , int value ) { int currentOffset = this . startingClassFileOffset + pos ; if ( currentOffset + <NUM_LIT:3> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . bCodeStream [ currentOffset ++ ] = ( byte ) ( ( value & <NUM_LIT> ) > > <NUM_LIT:24> ) ; this . bCodeStream [ currentOffset ++ ] = ( byte ) ( ( value & <NUM_LIT> ) > > <NUM_LIT:16> ) ; this . bCodeStream [ currentOffset ++ ] = ( byte ) ( ( value & <NUM_LIT> ) > > <NUM_LIT:8> ) ; this . bCodeStream [ currentOffset ++ ] = ( byte ) ( value & <NUM_LIT> ) ; } private final void writeUnsignedShort ( int value ) { this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) ( value > > > <NUM_LIT:8> ) ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) value ; } protected void writeWidePosition ( BranchLabel label ) { int labelPos = label . position ; int offset = labelPos - this . position + <NUM_LIT:1> ; this . writeSignedWord ( offset ) ; int [ ] forwardRefs = label . forwardReferences ( ) ; for ( int i = <NUM_LIT:0> , max = label . forwardReferenceCount ( ) ; i < max ; i ++ ) { int forward = forwardRefs [ i ] ; offset = labelPos - forward + <NUM_LIT:1> ; this . writeSignedWord ( forward , offset ) ; } } } </s>
<s> package org . eclipse . jdt . internal . compiler . codegen ; public class CaseLabel extends BranchLabel { public int instructionPosition = POS_NOT_SET ; public CaseLabel ( CodeStream codeStream ) { super ( codeStream ) ; } void branch ( ) { if ( this . position == POS_NOT_SET ) { addForwardReference ( this . codeStream . position ) ; this . codeStream . position += <NUM_LIT:4> ; this . codeStream . classFileOffset += <NUM_LIT:4> ; } else { this . codeStream . writeSignedWord ( this . position - this . instructionPosition ) ; } } void branchWide ( ) { branch ( ) ; } public boolean isCaseLabel ( ) { return true ; } public boolean isStandardLabel ( ) { return false ; } public void place ( ) { if ( ( this . tagBits & USED ) != <NUM_LIT:0> ) { this . position = this . codeStream . getPosition ( ) ; } else { this . position = this . codeStream . position ; } if ( this . instructionPosition != POS_NOT_SET ) { int offset = this . position - this . instructionPosition ; int [ ] forwardRefs = forwardReferences ( ) ; for ( int i = <NUM_LIT:0> , length = forwardReferenceCount ( ) ; i < length ; i ++ ) { this . codeStream . writeSignedWord ( forwardRefs [ i ] , offset ) ; } this . codeStream . addLabel ( this ) ; } } void placeInstruction ( ) { if ( this . instructionPosition == POS_NOT_SET ) { this . instructionPosition = this . codeStream . position ; } } } </s>
<s> package org . eclipse . jdt . internal . compiler . codegen ; public class CachedIndexEntry { public char [ ] signature ; public int index ; public CachedIndexEntry ( char [ ] signature , int index ) { this . signature = signature ; this . index = index ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . codegen ; public interface Opcodes { public static final byte OPC_nop = <NUM_LIT:0> ; public static final byte OPC_aconst_null = <NUM_LIT:1> ; public static final byte OPC_iconst_m1 = <NUM_LIT:2> ; public static final byte OPC_iconst_0 = <NUM_LIT:3> ; public static final byte OPC_iconst_1 = <NUM_LIT:4> ; public static final byte OPC_iconst_2 = <NUM_LIT:5> ; public static final byte OPC_iconst_3 = <NUM_LIT:6> ; public static final byte OPC_iconst_4 = <NUM_LIT:7> ; public static final byte OPC_iconst_5 = <NUM_LIT:8> ; public static final byte OPC_lconst_0 = <NUM_LIT:9> ; public static final byte OPC_lconst_1 = <NUM_LIT:10> ; public static final byte OPC_fconst_0 = <NUM_LIT:11> ; public static final byte OPC_fconst_1 = <NUM_LIT:12> ; public static final byte OPC_fconst_2 = <NUM_LIT> ; public static final byte OPC_dconst_0 = <NUM_LIT> ; public static final byte OPC_dconst_1 = <NUM_LIT:15> ; public static final byte OPC_bipush = <NUM_LIT:16> ; public static final byte OPC_sipush = <NUM_LIT> ; public static final byte OPC_ldc = <NUM_LIT> ; public static final byte OPC_ldc_w = <NUM_LIT> ; public static final byte OPC_ldc2_w = <NUM_LIT:20> ; public static final byte OPC_iload = <NUM_LIT> ; public static final byte OPC_lload = <NUM_LIT> ; public static final byte OPC_fload = <NUM_LIT> ; public static final byte OPC_dload = <NUM_LIT:24> ; public static final byte OPC_aload = <NUM_LIT> ; public static final byte OPC_iload_0 = <NUM_LIT> ; public static final byte OPC_iload_1 = <NUM_LIT> ; public static final byte OPC_iload_2 = <NUM_LIT> ; public static final byte OPC_iload_3 = <NUM_LIT> ; public static final byte OPC_lload_0 = <NUM_LIT:30> ; public static final byte OPC_lload_1 = <NUM_LIT:31> ; public static final byte OPC_lload_2 = <NUM_LIT:32> ; public static final byte OPC_lload_3 = <NUM_LIT> ; public static final byte OPC_fload_0 = <NUM_LIT> ; public static final byte OPC_fload_1 = <NUM_LIT> ; public static final byte OPC_fload_2 = <NUM_LIT> ; public static final byte OPC_fload_3 = <NUM_LIT> ; public static final byte OPC_dload_0 = <NUM_LIT> ; public static final byte OPC_dload_1 = <NUM_LIT> ; public static final byte OPC_dload_2 = <NUM_LIT> ; public static final byte OPC_dload_3 = <NUM_LIT> ; public static final byte OPC_aload_0 = <NUM_LIT> ; public static final byte OPC_aload_1 = <NUM_LIT> ; public static final byte OPC_aload_2 = <NUM_LIT> ; public static final byte OPC_aload_3 = <NUM_LIT> ; public static final byte OPC_iaload = <NUM_LIT> ; public static final byte OPC_laload = <NUM_LIT> ; public static final byte OPC_faload = <NUM_LIT> ; public static final byte OPC_daload = <NUM_LIT> ; public static final byte OPC_aaload = <NUM_LIT> ; public static final byte OPC_baload = <NUM_LIT> ; public static final byte OPC_caload = <NUM_LIT> ; public static final byte OPC_saload = <NUM_LIT> ; public static final byte OPC_istore = <NUM_LIT> ; public static final byte OPC_lstore = <NUM_LIT> ; public static final byte OPC_fstore = <NUM_LIT> ; public static final byte OPC_dstore = <NUM_LIT> ; public static final byte OPC_astore = <NUM_LIT> ; public static final byte OPC_istore_0 = <NUM_LIT> ; public static final byte OPC_istore_1 = <NUM_LIT> ; public static final byte OPC_istore_2 = <NUM_LIT> ; public static final byte OPC_istore_3 = <NUM_LIT> ; public static final byte OPC_lstore_0 = <NUM_LIT> ; public static final byte OPC_lstore_1 = <NUM_LIT> ; public static final byte OPC_lstore_2 = <NUM_LIT> ; public static final byte OPC_lstore_3 = <NUM_LIT> ; public static final byte OPC_fstore_0 = <NUM_LIT> ; public static final byte OPC_fstore_1 = <NUM_LIT> ; public static final byte OPC_fstore_2 = <NUM_LIT> ; public static final byte OPC_fstore_3 = <NUM_LIT> ; public static final byte OPC_dstore_0 = <NUM_LIT> ; public static final byte OPC_dstore_1 = <NUM_LIT> ; public static final byte OPC_dstore_2 = <NUM_LIT> ; public static final byte OPC_dstore_3 = <NUM_LIT> ; public static final byte OPC_astore_0 = <NUM_LIT> ; public static final byte OPC_astore_1 = <NUM_LIT> ; public static final byte OPC_astore_2 = <NUM_LIT> ; public static final byte OPC_astore_3 = <NUM_LIT> ; public static final byte OPC_iastore = <NUM_LIT> ; public static final byte OPC_lastore = <NUM_LIT> ; public static final byte OPC_fastore = <NUM_LIT> ; public static final byte OPC_dastore = <NUM_LIT> ; public static final byte OPC_aastore = <NUM_LIT> ; public static final byte OPC_bastore = <NUM_LIT> ; public static final byte OPC_castore = <NUM_LIT> ; public static final byte OPC_sastore = <NUM_LIT> ; public static final byte OPC_pop = <NUM_LIT> ; public static final byte OPC_pop2 = <NUM_LIT> ; public static final byte OPC_dup = <NUM_LIT> ; public static final byte OPC_dup_x1 = <NUM_LIT> ; public static final byte OPC_dup_x2 = <NUM_LIT> ; public static final byte OPC_dup2 = <NUM_LIT> ; public static final byte OPC_dup2_x1 = <NUM_LIT> ; public static final byte OPC_dup2_x2 = <NUM_LIT> ; public static final byte OPC_swap = <NUM_LIT> ; public static final byte OPC_iadd = <NUM_LIT> ; public static final byte OPC_ladd = <NUM_LIT> ; public static final byte OPC_fadd = <NUM_LIT> ; public static final byte OPC_dadd = <NUM_LIT> ; public static final byte OPC_isub = <NUM_LIT:100> ; public static final byte OPC_lsub = <NUM_LIT> ; public static final byte OPC_fsub = <NUM_LIT> ; public static final byte OPC_dsub = <NUM_LIT> ; public static final byte OPC_imul = <NUM_LIT> ; public static final byte OPC_lmul = <NUM_LIT> ; public static final byte OPC_fmul = <NUM_LIT> ; public static final byte OPC_dmul = <NUM_LIT> ; public static final byte OPC_idiv = <NUM_LIT> ; public static final byte OPC_ldiv = <NUM_LIT> ; public static final byte OPC_fdiv = <NUM_LIT> ; public static final byte OPC_ddiv = <NUM_LIT> ; public static final byte OPC_irem = <NUM_LIT> ; public static final byte OPC_lrem = <NUM_LIT> ; public static final byte OPC_frem = <NUM_LIT> ; public static final byte OPC_drem = <NUM_LIT> ; public static final byte OPC_ineg = <NUM_LIT> ; public static final byte OPC_lneg = <NUM_LIT> ; public static final byte OPC_fneg = <NUM_LIT> ; public static final byte OPC_dneg = <NUM_LIT> ; public static final byte OPC_ishl = <NUM_LIT> ; public static final byte OPC_lshl = <NUM_LIT> ; public static final byte OPC_ishr = <NUM_LIT> ; public static final byte OPC_lshr = <NUM_LIT> ; public static final byte OPC_iushr = <NUM_LIT> ; public static final byte OPC_lushr = <NUM_LIT> ; public static final byte OPC_iand = <NUM_LIT> ; public static final byte OPC_land = <NUM_LIT> ; public static final byte OPC_ior = ( byte ) <NUM_LIT> ; public static final byte OPC_lor = ( byte ) <NUM_LIT> ; public static final byte OPC_ixor = ( byte ) <NUM_LIT> ; public static final byte OPC_lxor = ( byte ) <NUM_LIT> ; public static final byte OPC_iinc = ( byte ) <NUM_LIT> ; public static final byte OPC_i2l = ( byte ) <NUM_LIT> ; public static final byte OPC_i2f = ( byte ) <NUM_LIT> ; public static final byte OPC_i2d = ( byte ) <NUM_LIT> ; public static final byte OPC_l2i = ( byte ) <NUM_LIT> ; public static final byte OPC_l2f = ( byte ) <NUM_LIT> ; public static final byte OPC_l2d = ( byte ) <NUM_LIT> ; public static final byte OPC_f2i = ( byte ) <NUM_LIT> ; public static final byte OPC_f2l = ( byte ) <NUM_LIT> ; public static final byte OPC_f2d = ( byte ) <NUM_LIT> ; public static final byte OPC_d2i = ( byte ) <NUM_LIT> ; public static final byte OPC_d2l = ( byte ) <NUM_LIT> ; public static final byte OPC_d2f = ( byte ) <NUM_LIT> ; public static final byte OPC_i2b = ( byte ) <NUM_LIT> ; public static final byte OPC_i2c = ( byte ) <NUM_LIT> ; public static final byte OPC_i2s = ( byte ) <NUM_LIT> ; public static final byte OPC_lcmp = ( byte ) <NUM_LIT> ; public static final byte OPC_fcmpl = ( byte ) <NUM_LIT> ; public static final byte OPC_fcmpg = ( byte ) <NUM_LIT> ; public static final byte OPC_dcmpl = ( byte ) <NUM_LIT> ; public static final byte OPC_dcmpg = ( byte ) <NUM_LIT> ; public static final byte OPC_ifeq = ( byte ) <NUM_LIT> ; public static final byte OPC_ifne = ( byte ) <NUM_LIT> ; public static final byte OPC_iflt = ( byte ) <NUM_LIT> ; public static final byte OPC_ifge = ( byte ) <NUM_LIT> ; public static final byte OPC_ifgt = ( byte ) <NUM_LIT> ; public static final byte OPC_ifle = ( byte ) <NUM_LIT> ; public static final byte OPC_if_icmpeq = ( byte ) <NUM_LIT> ; public static final byte OPC_if_icmpne = ( byte ) <NUM_LIT> ; public static final byte OPC_if_icmplt = ( byte ) <NUM_LIT> ; public static final byte OPC_if_icmpge = ( byte ) <NUM_LIT> ; public static final byte OPC_if_icmpgt = ( byte ) <NUM_LIT> ; public static final byte OPC_if_icmple = ( byte ) <NUM_LIT> ; public static final byte OPC_if_acmpeq = ( byte ) <NUM_LIT> ; public static final byte OPC_if_acmpne = ( byte ) <NUM_LIT> ; public static final byte OPC_goto = ( byte ) <NUM_LIT> ; public static final byte OPC_jsr = ( byte ) <NUM_LIT> ; public static final byte OPC_ret = ( byte ) <NUM_LIT> ; public static final byte OPC_tableswitch = ( byte ) <NUM_LIT> ; public static final byte OPC_lookupswitch = ( byte ) <NUM_LIT> ; public static final byte OPC_ireturn = ( byte ) <NUM_LIT> ; public static final byte OPC_lreturn = ( byte ) <NUM_LIT> ; public static final byte OPC_freturn = ( byte ) <NUM_LIT> ; public static final byte OPC_dreturn = ( byte ) <NUM_LIT> ; public static final byte OPC_areturn = ( byte ) <NUM_LIT> ; public static final byte OPC_return = ( byte ) <NUM_LIT> ; public static final byte OPC_getstatic = ( byte ) <NUM_LIT> ; public static final byte OPC_putstatic = ( byte ) <NUM_LIT> ; public static final byte OPC_getfield = ( byte ) <NUM_LIT> ; public static final byte OPC_putfield = ( byte ) <NUM_LIT> ; public static final byte OPC_invokevirtual = ( byte ) <NUM_LIT> ; public static final byte OPC_invokespecial = ( byte ) <NUM_LIT> ; public static final byte OPC_invokestatic = ( byte ) <NUM_LIT> ; public static final byte OPC_invokeinterface = ( byte ) <NUM_LIT> ; public static final byte OPC_new = ( byte ) <NUM_LIT> ; public static final byte OPC_newarray = ( byte ) <NUM_LIT> ; public static final byte OPC_anewarray = ( byte ) <NUM_LIT> ; public static final byte OPC_arraylength = ( byte ) <NUM_LIT> ; public static final byte OPC_athrow = ( byte ) <NUM_LIT> ; public static final byte OPC_checkcast = ( byte ) <NUM_LIT> ; public static final byte OPC_instanceof = ( byte ) <NUM_LIT> ; public static final byte OPC_monitorenter = ( byte ) <NUM_LIT> ; public static final byte OPC_monitorexit = ( byte ) <NUM_LIT> ; public static final byte OPC_wide = ( byte ) <NUM_LIT> ; public static final byte OPC_multianewarray = ( byte ) <NUM_LIT> ; public static final byte OPC_ifnull = ( byte ) <NUM_LIT> ; public static final byte OPC_ifnonnull = ( byte ) <NUM_LIT> ; public static final byte OPC_goto_w = ( byte ) <NUM_LIT> ; public static final byte OPC_jsr_w = ( byte ) <NUM_LIT> ; } </s>
<s> package org . eclipse . jdt . internal . compiler . codegen ; import java . util . Arrays ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . lookup . LocalVariableBinding ; public class BranchLabel extends Label { private int [ ] forwardReferences = new int [ <NUM_LIT:10> ] ; private int forwardReferenceCount = <NUM_LIT:0> ; BranchLabel delegate ; public int tagBits ; public final static int WIDE = <NUM_LIT:1> ; public final static int USED = <NUM_LIT:2> ; public BranchLabel ( ) { } public BranchLabel ( CodeStream codeStream ) { super ( codeStream ) ; } void addForwardReference ( int pos ) { if ( this . delegate != null ) { this . delegate . addForwardReference ( pos ) ; return ; } final int count = this . forwardReferenceCount ; if ( count >= <NUM_LIT:1> ) { int previousValue = this . forwardReferences [ count - <NUM_LIT:1> ] ; if ( previousValue < pos ) { int length ; if ( count >= ( length = this . forwardReferences . length ) ) System . arraycopy ( this . forwardReferences , <NUM_LIT:0> , ( this . forwardReferences = new int [ <NUM_LIT:2> * length ] ) , <NUM_LIT:0> , length ) ; this . forwardReferences [ this . forwardReferenceCount ++ ] = pos ; } else if ( previousValue > pos ) { int [ ] refs = this . forwardReferences ; for ( int i = <NUM_LIT:0> , max = this . forwardReferenceCount ; i < max ; i ++ ) { if ( refs [ i ] == pos ) return ; } int length ; if ( count >= ( length = refs . length ) ) System . arraycopy ( refs , <NUM_LIT:0> , ( this . forwardReferences = new int [ <NUM_LIT:2> * length ] ) , <NUM_LIT:0> , length ) ; this . forwardReferences [ this . forwardReferenceCount ++ ] = pos ; Arrays . sort ( this . forwardReferences , <NUM_LIT:0> , this . forwardReferenceCount ) ; } } else { int length ; if ( count >= ( length = this . forwardReferences . length ) ) System . arraycopy ( this . forwardReferences , <NUM_LIT:0> , ( this . forwardReferences = new int [ <NUM_LIT:2> * length ] ) , <NUM_LIT:0> , length ) ; this . forwardReferences [ this . forwardReferenceCount ++ ] = pos ; } } public void becomeDelegateFor ( BranchLabel otherLabel ) { otherLabel . delegate = this ; final int otherCount = otherLabel . forwardReferenceCount ; if ( otherCount == <NUM_LIT:0> ) return ; int [ ] mergedForwardReferences = new int [ this . forwardReferenceCount + otherCount ] ; int indexInMerge = <NUM_LIT:0> ; int j = <NUM_LIT:0> ; int i = <NUM_LIT:0> ; int max = this . forwardReferenceCount ; int max2 = otherLabel . forwardReferenceCount ; loop1 : for ( ; i < max ; i ++ ) { final int value1 = this . forwardReferences [ i ] ; for ( ; j < max2 ; j ++ ) { final int value2 = otherLabel . forwardReferences [ j ] ; if ( value1 < value2 ) { mergedForwardReferences [ indexInMerge ++ ] = value1 ; continue loop1 ; } else if ( value1 == value2 ) { mergedForwardReferences [ indexInMerge ++ ] = value1 ; j ++ ; continue loop1 ; } else { mergedForwardReferences [ indexInMerge ++ ] = value2 ; } } mergedForwardReferences [ indexInMerge ++ ] = value1 ; } for ( ; j < max2 ; j ++ ) { mergedForwardReferences [ indexInMerge ++ ] = otherLabel . forwardReferences [ j ] ; } this . forwardReferences = mergedForwardReferences ; this . forwardReferenceCount = indexInMerge ; } void branch ( ) { this . tagBits |= BranchLabel . USED ; if ( this . delegate != null ) { this . delegate . branch ( ) ; return ; } if ( this . position == Label . POS_NOT_SET ) { addForwardReference ( this . codeStream . position ) ; this . codeStream . position += <NUM_LIT:2> ; this . codeStream . classFileOffset += <NUM_LIT:2> ; } else { this . codeStream . writePosition ( this ) ; } } void branchWide ( ) { this . tagBits |= BranchLabel . USED ; if ( this . delegate != null ) { this . delegate . branchWide ( ) ; return ; } if ( this . position == Label . POS_NOT_SET ) { addForwardReference ( this . codeStream . position ) ; this . tagBits |= BranchLabel . WIDE ; this . codeStream . position += <NUM_LIT:4> ; this . codeStream . classFileOffset += <NUM_LIT:4> ; } else { this . codeStream . writeWidePosition ( this ) ; } } public int forwardReferenceCount ( ) { if ( this . delegate != null ) this . delegate . forwardReferenceCount ( ) ; return this . forwardReferenceCount ; } public int [ ] forwardReferences ( ) { if ( this . delegate != null ) this . delegate . forwardReferences ( ) ; return this . forwardReferences ; } public void initialize ( CodeStream stream ) { this . codeStream = stream ; this . position = Label . POS_NOT_SET ; this . forwardReferenceCount = <NUM_LIT:0> ; this . delegate = null ; } public boolean isCaseLabel ( ) { return false ; } public boolean isStandardLabel ( ) { return true ; } public void place ( ) { if ( this . position == Label . POS_NOT_SET ) { this . position = this . codeStream . position ; this . codeStream . addLabel ( this ) ; int oldPosition = this . position ; boolean isOptimizedBranch = false ; if ( this . forwardReferenceCount != <NUM_LIT:0> ) { isOptimizedBranch = ( this . forwardReferences [ this . forwardReferenceCount - <NUM_LIT:1> ] + <NUM_LIT:2> == this . position ) && ( this . codeStream . bCodeStream [ this . codeStream . classFileOffset - <NUM_LIT:3> ] == Opcodes . OPC_goto ) ; if ( isOptimizedBranch ) { if ( this . codeStream . lastAbruptCompletion == this . position ) { this . codeStream . lastAbruptCompletion = - <NUM_LIT:1> ; } this . codeStream . position = ( this . position -= <NUM_LIT:3> ) ; this . codeStream . classFileOffset -= <NUM_LIT:3> ; this . forwardReferenceCount -- ; if ( this . codeStream . lastEntryPC == oldPosition ) { this . codeStream . lastEntryPC = this . position ; } if ( ( this . codeStream . generateAttributes & ( ClassFileConstants . ATTR_VARS | ClassFileConstants . ATTR_STACK_MAP_TABLE | ClassFileConstants . ATTR_STACK_MAP ) ) != <NUM_LIT:0> ) { LocalVariableBinding locals [ ] = this . codeStream . locals ; for ( int i = <NUM_LIT:0> , max = locals . length ; i < max ; i ++ ) { LocalVariableBinding local = locals [ i ] ; if ( ( local != null ) && ( local . initializationCount > <NUM_LIT:0> ) ) { if ( local . initializationPCs [ ( ( local . initializationCount - <NUM_LIT:1> ) << <NUM_LIT:1> ) + <NUM_LIT:1> ] == oldPosition ) { local . initializationPCs [ ( ( local . initializationCount - <NUM_LIT:1> ) << <NUM_LIT:1> ) + <NUM_LIT:1> ] = this . position ; } if ( local . initializationPCs [ ( local . initializationCount - <NUM_LIT:1> ) << <NUM_LIT:1> ] == oldPosition ) { local . initializationPCs [ ( local . initializationCount - <NUM_LIT:1> ) << <NUM_LIT:1> ] = this . position ; } } } } if ( ( this . codeStream . generateAttributes & ClassFileConstants . ATTR_LINES ) != <NUM_LIT:0> ) { this . codeStream . removeUnusedPcToSourceMapEntries ( ) ; } } } for ( int i = <NUM_LIT:0> ; i < this . forwardReferenceCount ; i ++ ) { this . codeStream . writePosition ( this , this . forwardReferences [ i ] ) ; } if ( isOptimizedBranch ) { this . codeStream . optimizeBranch ( oldPosition , this ) ; } } } public String toString ( ) { String basic = getClass ( ) . getName ( ) ; basic = basic . substring ( basic . lastIndexOf ( '<CHAR_LIT:.>' ) + <NUM_LIT:1> ) ; StringBuffer buffer = new StringBuffer ( basic ) ; buffer . append ( '<CHAR_LIT>' ) . append ( Integer . toHexString ( hashCode ( ) ) ) ; buffer . append ( "<STR_LIT>" ) . append ( this . position ) ; if ( this . delegate != null ) buffer . append ( "<STR_LIT>" ) . append ( this . delegate ) ; buffer . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> ; i < this . forwardReferenceCount - <NUM_LIT:1> ; i ++ ) buffer . append ( this . forwardReferences [ i ] + "<STR_LIT:U+002CU+0020>" ) ; if ( this . forwardReferenceCount >= <NUM_LIT:1> ) buffer . append ( this . forwardReferences [ this . forwardReferenceCount - <NUM_LIT:1> ] ) ; buffer . append ( "<STR_LIT>" ) ; return buffer . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . codegen ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; public class ExceptionLabel extends Label { public int ranges [ ] = { POS_NOT_SET , POS_NOT_SET } ; public int count = <NUM_LIT:0> ; public TypeBinding exceptionType ; public ExceptionLabel ( CodeStream codeStream , TypeBinding exceptionType ) { super ( codeStream ) ; this . exceptionType = exceptionType ; } public void place ( ) { this . codeStream . registerExceptionHandler ( this ) ; this . position = this . codeStream . getPosition ( ) ; } public void placeEnd ( ) { int endPosition = this . codeStream . position ; if ( this . ranges [ this . count - <NUM_LIT:1> ] == endPosition ) { this . count -- ; } else { this . ranges [ this . count ++ ] = endPosition ; } } public void placeStart ( ) { int startPosition = this . codeStream . position ; if ( this . count > <NUM_LIT:0> && this . ranges [ this . count - <NUM_LIT:1> ] == startPosition ) { this . count -- ; return ; } int length ; if ( this . count == ( length = this . ranges . length ) ) { System . arraycopy ( this . ranges , <NUM_LIT:0> , this . ranges = new int [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; } this . ranges [ this . count ++ ] = startPosition ; } public String toString ( ) { String basic = getClass ( ) . getName ( ) ; basic = basic . substring ( basic . lastIndexOf ( '<CHAR_LIT:.>' ) + <NUM_LIT:1> ) ; StringBuffer buffer = new StringBuffer ( basic ) ; buffer . append ( '<CHAR_LIT>' ) . append ( Integer . toHexString ( hashCode ( ) ) ) ; buffer . append ( "<STR_LIT>" ) . append ( this . exceptionType == null ? CharOperation . NO_CHAR : this . exceptionType . readableName ( ) ) ; buffer . append ( "<STR_LIT>" ) . append ( this . position ) ; buffer . append ( "<STR_LIT>" ) ; if ( this . count == <NUM_LIT:0> ) { buffer . append ( "<STR_LIT:[]>" ) ; } else { for ( int i = <NUM_LIT:0> ; i < this . count ; i ++ ) { if ( ( i & <NUM_LIT:1> ) == <NUM_LIT:0> ) { buffer . append ( "<STR_LIT:[>" ) . append ( this . ranges [ i ] ) ; } else { buffer . append ( "<STR_LIT:U+002C>" ) . append ( this . ranges [ i ] ) . append ( "<STR_LIT:]>" ) ; } } if ( ( this . count & <NUM_LIT:1> ) == <NUM_LIT:1> ) { buffer . append ( "<STR_LIT>" ) ; } } buffer . append ( '<CHAR_LIT:)>' ) ; return buffer . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . codegen ; public interface AttributeNamesConstants { final char [ ] SyntheticName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] ConstantValueName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] LineNumberTableName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] LocalVariableTableName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] InnerClassName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] CodeName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] ExceptionsName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] SourceName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] DeprecatedName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] SignatureName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] LocalVariableTypeTableName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] EnclosingMethodName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] AnnotationDefaultName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] RuntimeInvisibleAnnotationsName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] RuntimeVisibleAnnotationsName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] RuntimeInvisibleParameterAnnotationsName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] RuntimeVisibleParameterAnnotationsName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] StackMapTableName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] InconsistentHierarchy = "<STR_LIT>" . toCharArray ( ) ; final char [ ] VarargsName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] StackMapName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] MissingTypesName = "<STR_LIT>" . toCharArray ( ) ; } </s>
<s> package org . eclipse . jdt . internal . compiler ; public class DefaultErrorHandlingPolicies { public static IErrorHandlingPolicy exitAfterAllProblems ( ) { return new IErrorHandlingPolicy ( ) { public boolean stopOnFirstError ( ) { return false ; } public boolean proceedOnErrors ( ) { return false ; } } ; } public static IErrorHandlingPolicy exitOnFirstError ( ) { return new IErrorHandlingPolicy ( ) { public boolean stopOnFirstError ( ) { return true ; } public boolean proceedOnErrors ( ) { return false ; } } ; } public static IErrorHandlingPolicy proceedOnFirstError ( ) { return new IErrorHandlingPolicy ( ) { public boolean stopOnFirstError ( ) { return true ; } public boolean proceedOnErrors ( ) { return true ; } } ; } public static IErrorHandlingPolicy proceedWithAllProblems ( ) { return new IErrorHandlingPolicy ( ) { public boolean stopOnFirstError ( ) { return false ; } public boolean proceedOnErrors ( ) { return true ; } } ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import java . util . List ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . Wildcard ; abstract public class TypeBinding extends Binding { public int id = TypeIds . NoId ; public long tagBits = <NUM_LIT:0> ; public final static BaseTypeBinding INT = new BaseTypeBinding ( TypeIds . T_int , TypeConstants . INT , new char [ ] { '<CHAR_LIT>' } ) ; public final static BaseTypeBinding BYTE = new BaseTypeBinding ( TypeIds . T_byte , TypeConstants . BYTE , new char [ ] { '<CHAR_LIT>' } ) ; public final static BaseTypeBinding SHORT = new BaseTypeBinding ( TypeIds . T_short , TypeConstants . SHORT , new char [ ] { '<CHAR_LIT>' } ) ; public final static BaseTypeBinding CHAR = new BaseTypeBinding ( TypeIds . T_char , TypeConstants . CHAR , new char [ ] { '<CHAR_LIT>' } ) ; public final static BaseTypeBinding LONG = new BaseTypeBinding ( TypeIds . T_long , TypeConstants . LONG , new char [ ] { '<CHAR_LIT>' } ) ; public final static BaseTypeBinding FLOAT = new BaseTypeBinding ( TypeIds . T_float , TypeConstants . FLOAT , new char [ ] { '<CHAR_LIT>' } ) ; public final static BaseTypeBinding DOUBLE = new BaseTypeBinding ( TypeIds . T_double , TypeConstants . DOUBLE , new char [ ] { '<CHAR_LIT>' } ) ; public final static BaseTypeBinding BOOLEAN = new BaseTypeBinding ( TypeIds . T_boolean , TypeConstants . BOOLEAN , new char [ ] { '<CHAR_LIT:Z>' } ) ; public final static BaseTypeBinding NULL = new BaseTypeBinding ( TypeIds . T_null , TypeConstants . NULL , new char [ ] { '<CHAR_LIT>' } ) ; public final static BaseTypeBinding VOID = new BaseTypeBinding ( TypeIds . T_void , TypeConstants . VOID , new char [ ] { '<CHAR_LIT>' } ) ; public static final TypeBinding wellKnownType ( Scope scope , int id ) { switch ( id ) { case TypeIds . T_boolean : return TypeBinding . BOOLEAN ; case TypeIds . T_byte : return TypeBinding . BYTE ; case TypeIds . T_char : return TypeBinding . CHAR ; case TypeIds . T_short : return TypeBinding . SHORT ; case TypeIds . T_double : return TypeBinding . DOUBLE ; case TypeIds . T_float : return TypeBinding . FLOAT ; case TypeIds . T_int : return TypeBinding . INT ; case TypeIds . T_long : return TypeBinding . LONG ; case TypeIds . T_JavaLangObject : return scope . getJavaLangObject ( ) ; case TypeIds . T_JavaLangString : return scope . getJavaLangString ( ) ; default : return null ; } } public boolean canBeInstantiated ( ) { return ! isBaseType ( ) ; } public TypeBinding capture ( Scope scope , int position ) { return this ; } public TypeBinding closestMatch ( ) { return this ; } public List collectMissingTypes ( List missingTypes ) { return missingTypes ; } public void collectSubstitutes ( Scope scope , TypeBinding actualType , InferenceContext inferenceContext , int constraint ) { } public abstract char [ ] constantPoolName ( ) ; public String debugName ( ) { return new String ( readableName ( ) ) ; } public int dimensions ( ) { return <NUM_LIT:0> ; } public ReferenceBinding enclosingType ( ) { return null ; } public TypeBinding erasure ( ) { return this ; } public ReferenceBinding findSuperTypeOriginatingFrom ( int wellKnownOriginalID , boolean originalIsClass ) { if ( ! ( this instanceof ReferenceBinding ) ) return null ; ReferenceBinding reference = ( ReferenceBinding ) this ; if ( reference . id == wellKnownOriginalID || ( original ( ) . id == wellKnownOriginalID ) ) return reference ; ReferenceBinding currentType = reference ; if ( originalIsClass ) { while ( ( currentType = currentType . superclass ( ) ) != null ) { if ( currentType . id == wellKnownOriginalID ) return currentType ; if ( currentType . original ( ) . id == wellKnownOriginalID ) return currentType ; } return null ; } ReferenceBinding [ ] interfacesToVisit = null ; int nextPosition = <NUM_LIT:0> ; do { ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { if ( interfacesToVisit == null ) { interfacesToVisit = itsInterfaces ; nextPosition = interfacesToVisit . length ; } else { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } } while ( ( currentType = currentType . superclass ( ) ) != null ) ; for ( int i = <NUM_LIT:0> ; i < nextPosition ; i ++ ) { currentType = interfacesToVisit [ i ] ; if ( currentType . id == wellKnownOriginalID ) return currentType ; if ( currentType . original ( ) . id == wellKnownOriginalID ) return currentType ; ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } return null ; } public TypeBinding findSuperTypeOriginatingFrom ( TypeBinding otherType ) { if ( this == otherType ) return this ; if ( otherType == null ) return null ; switch ( kind ( ) ) { case Binding . ARRAY_TYPE : ArrayBinding arrayType = ( ArrayBinding ) this ; int otherDim = otherType . dimensions ( ) ; if ( arrayType . dimensions != otherDim ) { switch ( otherType . id ) { case TypeIds . T_JavaLangObject : case TypeIds . T_JavaIoSerializable : case TypeIds . T_JavaLangCloneable : return otherType ; } if ( otherDim < arrayType . dimensions && otherType . leafComponentType ( ) . id == TypeIds . T_JavaLangObject ) { return otherType ; } return null ; } if ( ! ( arrayType . leafComponentType instanceof ReferenceBinding ) ) return null ; TypeBinding leafSuperType = arrayType . leafComponentType . findSuperTypeOriginatingFrom ( otherType . leafComponentType ( ) ) ; if ( leafSuperType == null ) return null ; return arrayType . environment ( ) . createArrayType ( leafSuperType , arrayType . dimensions ) ; case Binding . TYPE_PARAMETER : if ( isCapture ( ) ) { CaptureBinding capture = ( CaptureBinding ) this ; TypeBinding captureBound = capture . firstBound ; if ( captureBound instanceof ArrayBinding ) { TypeBinding match = captureBound . findSuperTypeOriginatingFrom ( otherType ) ; if ( match != null ) return match ; } } case Binding . TYPE : case Binding . PARAMETERIZED_TYPE : case Binding . GENERIC_TYPE : case Binding . RAW_TYPE : case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : otherType = otherType . original ( ) ; if ( this == otherType ) return this ; if ( original ( ) == otherType ) return this ; ReferenceBinding currentType = ( ReferenceBinding ) this ; if ( ! otherType . isInterface ( ) ) { while ( ( currentType = currentType . superclass ( ) ) != null ) { if ( currentType == otherType ) return currentType ; if ( currentType . original ( ) == otherType ) return currentType ; } return null ; } ReferenceBinding [ ] interfacesToVisit = null ; int nextPosition = <NUM_LIT:0> ; do { ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { if ( interfacesToVisit == null ) { interfacesToVisit = itsInterfaces ; nextPosition = interfacesToVisit . length ; } else { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } } while ( ( currentType = currentType . superclass ( ) ) != null ) ; for ( int i = <NUM_LIT:0> ; i < nextPosition ; i ++ ) { currentType = interfacesToVisit [ i ] ; if ( currentType == otherType ) return currentType ; if ( currentType . original ( ) == otherType ) return currentType ; ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } } return null ; } public TypeBinding genericCast ( TypeBinding targetType ) { if ( this == targetType ) return null ; TypeBinding targetErasure = targetType . erasure ( ) ; if ( erasure ( ) . findSuperTypeOriginatingFrom ( targetErasure ) != null ) return null ; return targetErasure ; } public char [ ] genericTypeSignature ( ) { return signature ( ) ; } public TypeBinding getErasureCompatibleType ( TypeBinding declaringClass ) { switch ( kind ( ) ) { case Binding . TYPE_PARAMETER : TypeVariableBinding variable = ( TypeVariableBinding ) this ; if ( variable . erasure ( ) . findSuperTypeOriginatingFrom ( declaringClass ) != null ) { return this ; } if ( variable . superclass != null && variable . superclass . findSuperTypeOriginatingFrom ( declaringClass ) != null ) { return variable . superclass . getErasureCompatibleType ( declaringClass ) ; } for ( int i = <NUM_LIT:0> , otherLength = variable . superInterfaces . length ; i < otherLength ; i ++ ) { ReferenceBinding superInterface = variable . superInterfaces [ i ] ; if ( superInterface . findSuperTypeOriginatingFrom ( declaringClass ) != null ) { return superInterface . getErasureCompatibleType ( declaringClass ) ; } } return this ; case Binding . INTERSECTION_TYPE : WildcardBinding intersection = ( WildcardBinding ) this ; if ( intersection . erasure ( ) . findSuperTypeOriginatingFrom ( declaringClass ) != null ) { return this ; } if ( intersection . superclass != null && intersection . superclass . findSuperTypeOriginatingFrom ( declaringClass ) != null ) { return intersection . superclass . getErasureCompatibleType ( declaringClass ) ; } for ( int i = <NUM_LIT:0> , otherLength = intersection . superInterfaces . length ; i < otherLength ; i ++ ) { ReferenceBinding superInterface = intersection . superInterfaces [ i ] ; if ( superInterface . findSuperTypeOriginatingFrom ( declaringClass ) != null ) { return superInterface . getErasureCompatibleType ( declaringClass ) ; } } return this ; default : return this ; } } public abstract PackageBinding getPackage ( ) ; void initializeForStaticImports ( ) { } public boolean isAnnotationType ( ) { return false ; } public final boolean isAnonymousType ( ) { return ( this . tagBits & TagBits . IsAnonymousType ) != <NUM_LIT:0> ; } public final boolean isArrayType ( ) { return ( this . tagBits & TagBits . IsArrayType ) != <NUM_LIT:0> ; } public final boolean isBaseType ( ) { return ( this . tagBits & TagBits . IsBaseType ) != <NUM_LIT:0> ; } public boolean isBoundParameterizedType ( ) { return ( this . tagBits & TagBits . IsBoundParameterizedType ) != <NUM_LIT:0> ; } public boolean isCapture ( ) { return false ; } public boolean isClass ( ) { return false ; } public abstract boolean isCompatibleWith ( TypeBinding right ) ; public boolean isEnum ( ) { return false ; } public boolean isEquivalentTo ( TypeBinding otherType ) { if ( this == otherType ) return true ; if ( otherType == null ) return false ; switch ( otherType . kind ( ) ) { case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : return ( ( WildcardBinding ) otherType ) . boundCheck ( this ) ; } return false ; } public boolean isGenericType ( ) { return false ; } public final boolean isHierarchyInconsistent ( ) { return ( this . tagBits & TagBits . HierarchyHasProblems ) != <NUM_LIT:0> ; } public boolean isInterface ( ) { return false ; } public boolean isIntersectionType ( ) { return false ; } public final boolean isLocalType ( ) { return ( this . tagBits & TagBits . IsLocalType ) != <NUM_LIT:0> ; } public final boolean isMemberType ( ) { return ( this . tagBits & TagBits . IsMemberType ) != <NUM_LIT:0> ; } public final boolean isNestedType ( ) { return ( this . tagBits & TagBits . IsNestedType ) != <NUM_LIT:0> ; } public final boolean isNumericType ( ) { switch ( this . id ) { case TypeIds . T_int : case TypeIds . T_float : case TypeIds . T_double : case TypeIds . T_short : case TypeIds . T_byte : case TypeIds . T_long : case TypeIds . T_char : return true ; default : return false ; } } public final boolean isParameterizedType ( ) { return kind ( ) == Binding . PARAMETERIZED_TYPE ; } public final boolean isParameterizedTypeWithActualArguments ( ) { return ( kind ( ) == Binding . PARAMETERIZED_TYPE ) && ( ( ParameterizedTypeBinding ) this ) . arguments != null ; } public boolean isParameterizedWithOwnVariables ( ) { if ( kind ( ) != Binding . PARAMETERIZED_TYPE ) return false ; ParameterizedTypeBinding paramType = ( ParameterizedTypeBinding ) this ; if ( paramType . arguments == null ) return false ; TypeVariableBinding [ ] variables = erasure ( ) . typeVariables ( ) ; for ( int i = <NUM_LIT:0> , length = variables . length ; i < length ; i ++ ) { if ( variables [ i ] != paramType . arguments [ i ] ) return false ; } ReferenceBinding enclosing = paramType . enclosingType ( ) ; if ( enclosing != null && enclosing . erasure ( ) . isGenericType ( ) && ! enclosing . isParameterizedWithOwnVariables ( ) ) { return false ; } return true ; } private boolean isProvableDistinctSubType ( TypeBinding otherType ) { if ( otherType . isInterface ( ) ) { if ( isInterface ( ) ) return false ; if ( isArrayType ( ) || ( ( this instanceof ReferenceBinding ) && ( ( ReferenceBinding ) this ) . isFinal ( ) ) || ( isTypeVariable ( ) && ( ( TypeVariableBinding ) this ) . superclass ( ) . isFinal ( ) ) ) { return ! isCompatibleWith ( otherType ) ; } return false ; } else { if ( isInterface ( ) ) { if ( otherType . isArrayType ( ) || ( ( otherType instanceof ReferenceBinding ) && ( ( ReferenceBinding ) otherType ) . isFinal ( ) ) || ( otherType . isTypeVariable ( ) && ( ( TypeVariableBinding ) otherType ) . superclass ( ) . isFinal ( ) ) ) { return ! isCompatibleWith ( otherType ) ; } } else { if ( ! isTypeVariable ( ) && ! otherType . isTypeVariable ( ) ) { return ! isCompatibleWith ( otherType ) ; } } } return false ; } public boolean isProvablyDistinct ( TypeBinding otherType ) { if ( this == otherType ) return false ; if ( otherType == null ) return true ; switch ( kind ( ) ) { case Binding . PARAMETERIZED_TYPE : ParameterizedTypeBinding paramType = ( ParameterizedTypeBinding ) this ; switch ( otherType . kind ( ) ) { case Binding . PARAMETERIZED_TYPE : ParameterizedTypeBinding otherParamType = ( ParameterizedTypeBinding ) otherType ; if ( paramType . genericType ( ) != otherParamType . genericType ( ) ) return true ; if ( ! paramType . isStatic ( ) ) { ReferenceBinding enclosing = enclosingType ( ) ; if ( enclosing != null ) { ReferenceBinding otherEnclosing = otherParamType . enclosingType ( ) ; if ( otherEnclosing == null ) return true ; if ( ( otherEnclosing . tagBits & TagBits . HasDirectWildcard ) == <NUM_LIT:0> ) { if ( enclosing . isProvablyDistinct ( otherEnclosing ) ) return true ; } else { if ( ! enclosing . isEquivalentTo ( otherParamType . enclosingType ( ) ) ) return true ; } } } int length = paramType . arguments == null ? <NUM_LIT:0> : paramType . arguments . length ; TypeBinding [ ] otherArguments = otherParamType . arguments ; int otherLength = otherArguments == null ? <NUM_LIT:0> : otherArguments . length ; if ( otherLength != length ) return true ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( paramType . arguments [ i ] . isProvablyDistinctTypeArgument ( otherArguments [ i ] , paramType , i ) ) return true ; } return false ; case Binding . GENERIC_TYPE : SourceTypeBinding otherGenericType = ( SourceTypeBinding ) otherType ; if ( paramType . genericType ( ) != otherGenericType ) return true ; if ( ! paramType . isStatic ( ) ) { ReferenceBinding enclosing = enclosingType ( ) ; if ( enclosing != null ) { ReferenceBinding otherEnclosing = otherGenericType . enclosingType ( ) ; if ( otherEnclosing == null ) return true ; if ( ( otherEnclosing . tagBits & TagBits . HasDirectWildcard ) == <NUM_LIT:0> ) { if ( enclosing != otherEnclosing ) return true ; } else { if ( ! enclosing . isEquivalentTo ( otherGenericType . enclosingType ( ) ) ) return true ; } } } length = paramType . arguments == null ? <NUM_LIT:0> : paramType . arguments . length ; otherArguments = otherGenericType . typeVariables ( ) ; otherLength = otherArguments == null ? <NUM_LIT:0> : otherArguments . length ; if ( otherLength != length ) return true ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( paramType . arguments [ i ] . isProvablyDistinctTypeArgument ( otherArguments [ i ] , paramType , i ) ) return true ; } return false ; case Binding . RAW_TYPE : return erasure ( ) != otherType . erasure ( ) ; } return true ; case Binding . RAW_TYPE : switch ( otherType . kind ( ) ) { case Binding . GENERIC_TYPE : case Binding . PARAMETERIZED_TYPE : case Binding . RAW_TYPE : return erasure ( ) != otherType . erasure ( ) ; } return true ; default : break ; } return true ; } private boolean isProvablyDistinctTypeArgument ( TypeBinding otherArgument , final ParameterizedTypeBinding paramType , final int rank ) { if ( this == otherArgument ) return false ; TypeBinding upperBound1 = null ; TypeBinding lowerBound1 = null ; switch ( kind ( ) ) { case Binding . WILDCARD_TYPE : WildcardBinding wildcard = ( WildcardBinding ) this ; switch ( wildcard . boundKind ) { case Wildcard . EXTENDS : upperBound1 = wildcard . bound ; break ; case Wildcard . SUPER : lowerBound1 = wildcard . bound ; break ; case Wildcard . UNBOUND : return false ; } break ; case Binding . INTERSECTION_TYPE : break ; case Binding . TYPE_PARAMETER : final TypeVariableBinding variable = ( TypeVariableBinding ) this ; if ( variable . isCapture ( ) ) { CaptureBinding capture = ( CaptureBinding ) variable ; switch ( capture . wildcard . boundKind ) { case Wildcard . EXTENDS : upperBound1 = capture . wildcard . bound ; break ; case Wildcard . SUPER : lowerBound1 = capture . wildcard . bound ; break ; case Wildcard . UNBOUND : return false ; } break ; } if ( variable . firstBound == null ) return false ; TypeBinding eliminatedType = Scope . convertEliminatingTypeVariables ( variable , paramType . genericType ( ) , rank , null ) ; switch ( eliminatedType . kind ( ) ) { case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : wildcard = ( WildcardBinding ) eliminatedType ; switch ( wildcard . boundKind ) { case Wildcard . EXTENDS : upperBound1 = wildcard . bound ; break ; case Wildcard . SUPER : lowerBound1 = wildcard . bound ; break ; case Wildcard . UNBOUND : return false ; } break ; } break ; } TypeBinding upperBound2 = null ; TypeBinding lowerBound2 = null ; switch ( otherArgument . kind ( ) ) { case Binding . WILDCARD_TYPE : WildcardBinding otherWildcard = ( WildcardBinding ) otherArgument ; switch ( otherWildcard . boundKind ) { case Wildcard . EXTENDS : upperBound2 = otherWildcard . bound ; break ; case Wildcard . SUPER : lowerBound2 = otherWildcard . bound ; break ; case Wildcard . UNBOUND : return false ; } break ; case Binding . INTERSECTION_TYPE : break ; case Binding . TYPE_PARAMETER : TypeVariableBinding otherVariable = ( TypeVariableBinding ) otherArgument ; if ( otherVariable . isCapture ( ) ) { CaptureBinding otherCapture = ( CaptureBinding ) otherVariable ; switch ( otherCapture . wildcard . boundKind ) { case Wildcard . EXTENDS : upperBound2 = otherCapture . wildcard . bound ; break ; case Wildcard . SUPER : lowerBound2 = otherCapture . wildcard . bound ; break ; case Wildcard . UNBOUND : return false ; } break ; } if ( otherVariable . firstBound == null ) return false ; TypeBinding otherEliminatedType = Scope . convertEliminatingTypeVariables ( otherVariable , paramType . genericType ( ) , rank , null ) ; switch ( otherEliminatedType . kind ( ) ) { case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : otherWildcard = ( WildcardBinding ) otherEliminatedType ; switch ( otherWildcard . boundKind ) { case Wildcard . EXTENDS : upperBound2 = otherWildcard . bound ; break ; case Wildcard . SUPER : lowerBound2 = otherWildcard . bound ; break ; case Wildcard . UNBOUND : return false ; } break ; } break ; } if ( lowerBound1 != null ) { if ( lowerBound2 != null ) { return false ; } else if ( upperBound2 != null ) { if ( lowerBound1 . isTypeVariable ( ) || upperBound2 . isTypeVariable ( ) ) { return false ; } return ! lowerBound1 . isCompatibleWith ( upperBound2 ) ; } else { if ( lowerBound1 . isTypeVariable ( ) || otherArgument . isTypeVariable ( ) ) { return false ; } return ! lowerBound1 . isCompatibleWith ( otherArgument ) ; } } else if ( upperBound1 != null ) { if ( lowerBound2 != null ) { return ! lowerBound2 . isCompatibleWith ( upperBound1 ) ; } else if ( upperBound2 != null ) { return upperBound1 . isProvableDistinctSubType ( upperBound2 ) && upperBound2 . isProvableDistinctSubType ( upperBound1 ) ; } else { return otherArgument . isProvableDistinctSubType ( upperBound1 ) ; } } else { if ( lowerBound2 != null ) { if ( lowerBound2 . isTypeVariable ( ) || isTypeVariable ( ) ) { return false ; } return ! lowerBound2 . isCompatibleWith ( this ) ; } else if ( upperBound2 != null ) { return isProvableDistinctSubType ( upperBound2 ) ; } else { return true ; } } } public final boolean isRawType ( ) { return kind ( ) == Binding . RAW_TYPE ; } public boolean isReifiable ( ) { TypeBinding leafType = leafComponentType ( ) ; if ( ! ( leafType instanceof ReferenceBinding ) ) return true ; ReferenceBinding current = ( ReferenceBinding ) leafType ; do { switch ( current . kind ( ) ) { case Binding . TYPE_PARAMETER : case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : case Binding . GENERIC_TYPE : return false ; case Binding . PARAMETERIZED_TYPE : if ( current . isBoundParameterizedType ( ) ) return false ; break ; case Binding . RAW_TYPE : return true ; } if ( current . isStatic ( ) ) { return true ; } if ( current . isLocalType ( ) ) { LocalTypeBinding localTypeBinding = ( LocalTypeBinding ) current . erasure ( ) ; MethodBinding enclosingMethod = localTypeBinding . enclosingMethod ; if ( enclosingMethod != null && enclosingMethod . isStatic ( ) ) { return true ; } } } while ( ( current = current . enclosingType ( ) ) != null ) ; return true ; } public boolean isThrowable ( ) { return false ; } public boolean isTypeArgumentContainedBy ( TypeBinding otherType ) { if ( this == otherType ) return true ; switch ( otherType . kind ( ) ) { case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : TypeBinding lowerBound = this ; TypeBinding upperBound = this ; switch ( kind ( ) ) { case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : WildcardBinding wildcard = ( WildcardBinding ) this ; switch ( wildcard . boundKind ) { case Wildcard . EXTENDS : if ( wildcard . otherBounds != null ) break ; upperBound = wildcard . bound ; lowerBound = null ; break ; case Wildcard . SUPER : upperBound = wildcard ; lowerBound = wildcard . bound ; break ; case Wildcard . UNBOUND : upperBound = wildcard ; lowerBound = null ; } break ; case Binding . TYPE_PARAMETER : if ( isCapture ( ) ) { CaptureBinding capture = ( CaptureBinding ) this ; if ( capture . lowerBound != null ) lowerBound = capture . lowerBound ; } } WildcardBinding otherWildcard = ( WildcardBinding ) otherType ; if ( otherWildcard . otherBounds != null ) return false ; TypeBinding otherBound = otherWildcard . bound ; switch ( otherWildcard . boundKind ) { case Wildcard . EXTENDS : if ( otherBound == this ) return true ; if ( upperBound == null ) return false ; TypeBinding match = upperBound . findSuperTypeOriginatingFrom ( otherBound ) ; if ( match != null && ( match = match . leafComponentType ( ) ) . isRawType ( ) ) { return match == otherBound . leafComponentType ( ) ; } return upperBound . isCompatibleWith ( otherBound ) ; case Wildcard . SUPER : if ( otherBound == this ) return true ; if ( lowerBound == null ) return false ; match = otherBound . findSuperTypeOriginatingFrom ( lowerBound ) ; if ( match != null && ( match = match . leafComponentType ( ) ) . isRawType ( ) ) { return match == lowerBound . leafComponentType ( ) ; } return otherBound . isCompatibleWith ( lowerBound ) ; case Wildcard . UNBOUND : default : return true ; } case Binding . PARAMETERIZED_TYPE : if ( ! isParameterizedType ( ) ) return false ; ParameterizedTypeBinding paramType = ( ParameterizedTypeBinding ) this ; ParameterizedTypeBinding otherParamType = ( ParameterizedTypeBinding ) otherType ; if ( paramType . actualType ( ) != otherParamType . actualType ( ) ) return false ; if ( ! paramType . isStatic ( ) ) { ReferenceBinding enclosing = enclosingType ( ) ; if ( enclosing != null ) { ReferenceBinding otherEnclosing = otherParamType . enclosingType ( ) ; if ( otherEnclosing == null ) return false ; if ( ( otherEnclosing . tagBits & TagBits . HasDirectWildcard ) == <NUM_LIT:0> ) { if ( enclosing != otherEnclosing ) return false ; } else { if ( ! enclosing . isEquivalentTo ( otherParamType . enclosingType ( ) ) ) return false ; } } } int length = paramType . arguments == null ? <NUM_LIT:0> : paramType . arguments . length ; TypeBinding [ ] otherArguments = otherParamType . arguments ; int otherLength = otherArguments == null ? <NUM_LIT:0> : otherArguments . length ; if ( otherLength != length ) return false ; nextArgument : for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeBinding argument = paramType . arguments [ i ] ; TypeBinding otherArgument = otherArguments [ i ] ; if ( argument == otherArgument ) continue nextArgument ; int kind = argument . kind ( ) ; if ( otherArgument . kind ( ) != kind ) return false ; switch ( kind ) { case Binding . PARAMETERIZED_TYPE : if ( argument . isTypeArgumentContainedBy ( otherArgument ) ) continue nextArgument ; break ; case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : WildcardBinding wildcard = ( WildcardBinding ) argument ; otherWildcard = ( WildcardBinding ) otherArgument ; switch ( wildcard . boundKind ) { case Wildcard . EXTENDS : if ( otherWildcard . boundKind == Wildcard . UNBOUND && wildcard . bound == wildcard . typeVariable ( ) . upperBound ( ) ) continue nextArgument ; break ; case Wildcard . SUPER : break ; case Wildcard . UNBOUND : if ( otherWildcard . boundKind == Wildcard . EXTENDS && otherWildcard . bound == otherWildcard . typeVariable ( ) . upperBound ( ) ) continue nextArgument ; break ; } break ; } return false ; } return true ; } if ( otherType . id == TypeIds . T_JavaLangObject ) { switch ( kind ( ) ) { case Binding . WILDCARD_TYPE : WildcardBinding wildcard = ( WildcardBinding ) this ; if ( wildcard . boundKind == Wildcard . SUPER && wildcard . bound . id == TypeIds . T_JavaLangObject ) { return true ; } break ; } } return false ; } public boolean isTypeVariable ( ) { return false ; } public boolean isUnboundWildcard ( ) { return false ; } public boolean isUncheckedException ( boolean includeSupertype ) { return false ; } public boolean isWildcard ( ) { return false ; } public int kind ( ) { return Binding . TYPE ; } public TypeBinding leafComponentType ( ) { return this ; } public boolean needsUncheckedConversion ( TypeBinding targetType ) { if ( this == targetType ) return false ; targetType = targetType . leafComponentType ( ) ; if ( ! ( targetType instanceof ReferenceBinding ) ) return false ; TypeBinding currentType = leafComponentType ( ) ; TypeBinding match = currentType . findSuperTypeOriginatingFrom ( targetType ) ; if ( ! ( match instanceof ReferenceBinding ) ) return false ; ReferenceBinding compatible = ( ReferenceBinding ) match ; while ( compatible . isRawType ( ) ) { if ( targetType . isBoundParameterizedType ( ) ) return true ; if ( compatible . isStatic ( ) ) break ; if ( ( compatible = compatible . enclosingType ( ) ) == null ) break ; if ( ( targetType = targetType . enclosingType ( ) ) == null ) break ; } return false ; } public TypeBinding original ( ) { switch ( kind ( ) ) { case Binding . PARAMETERIZED_TYPE : case Binding . RAW_TYPE : case Binding . ARRAY_TYPE : return erasure ( ) ; default : return this ; } } public char [ ] qualifiedPackageName ( ) { PackageBinding packageBinding = getPackage ( ) ; return packageBinding == null || packageBinding . compoundName == CharOperation . NO_CHAR_CHAR ? CharOperation . NO_CHAR : packageBinding . readableName ( ) ; } public abstract char [ ] qualifiedSourceName ( ) ; public char [ ] signature ( ) { return constantPoolName ( ) ; } public abstract char [ ] sourceName ( ) ; public void swapUnresolved ( UnresolvedReferenceBinding unresolvedType , ReferenceBinding resolvedType , LookupEnvironment environment ) { } public TypeVariableBinding [ ] typeVariables ( ) { return Binding . NO_TYPE_VARIABLES ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . AbstractMethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . FieldDeclaration ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; public class SyntheticMethodBinding extends MethodBinding { public FieldBinding targetReadField ; public FieldBinding targetWriteField ; public MethodBinding targetMethod ; public TypeBinding targetEnumType ; public int purpose ; public final static int FieldReadAccess = <NUM_LIT:1> ; public final static int FieldWriteAccess = <NUM_LIT:2> ; public final static int SuperFieldReadAccess = <NUM_LIT:3> ; public final static int SuperFieldWriteAccess = <NUM_LIT:4> ; public final static int MethodAccess = <NUM_LIT:5> ; public final static int ConstructorAccess = <NUM_LIT:6> ; public final static int SuperMethodAccess = <NUM_LIT:7> ; public final static int BridgeMethod = <NUM_LIT:8> ; public final static int EnumValues = <NUM_LIT:9> ; public final static int EnumValueOf = <NUM_LIT:10> ; public final static int SwitchTable = <NUM_LIT:11> ; public int sourceStart = <NUM_LIT:0> ; public int index ; public SyntheticMethodBinding ( FieldBinding targetField , boolean isReadAccess , boolean isSuperAccess , ReferenceBinding declaringClass ) { this . modifiers = ClassFileConstants . AccDefault | ClassFileConstants . AccStatic | ClassFileConstants . AccSynthetic ; this . tagBits |= ( TagBits . AnnotationResolved | TagBits . DeprecatedAnnotationResolved ) ; SourceTypeBinding declaringSourceType = ( SourceTypeBinding ) declaringClass ; SyntheticMethodBinding [ ] knownAccessMethods = declaringSourceType . syntheticMethods ( ) ; int methodId = knownAccessMethods == null ? <NUM_LIT:0> : knownAccessMethods . length ; this . index = methodId ; this . selector = CharOperation . concat ( TypeConstants . SYNTHETIC_ACCESS_METHOD_PREFIX , String . valueOf ( methodId ) . toCharArray ( ) ) ; if ( isReadAccess ) { this . returnType = targetField . type ; if ( targetField . isStatic ( ) ) { this . parameters = Binding . NO_PARAMETERS ; } else { this . parameters = new TypeBinding [ <NUM_LIT:1> ] ; this . parameters [ <NUM_LIT:0> ] = declaringSourceType ; } this . targetReadField = targetField ; this . purpose = isSuperAccess ? SyntheticMethodBinding . SuperFieldReadAccess : SyntheticMethodBinding . FieldReadAccess ; } else { this . returnType = TypeBinding . VOID ; if ( targetField . isStatic ( ) ) { this . parameters = new TypeBinding [ <NUM_LIT:1> ] ; this . parameters [ <NUM_LIT:0> ] = targetField . type ; } else { this . parameters = new TypeBinding [ <NUM_LIT:2> ] ; this . parameters [ <NUM_LIT:0> ] = declaringSourceType ; this . parameters [ <NUM_LIT:1> ] = targetField . type ; } this . targetWriteField = targetField ; this . purpose = isSuperAccess ? SyntheticMethodBinding . SuperFieldWriteAccess : SyntheticMethodBinding . FieldWriteAccess ; } this . thrownExceptions = Binding . NO_EXCEPTIONS ; this . declaringClass = declaringSourceType ; boolean needRename ; do { check : { needRename = false ; long range ; MethodBinding [ ] methods = declaringSourceType . methods ( ) ; if ( ( range = ReferenceBinding . binarySearch ( this . selector , methods ) ) >= <NUM_LIT:0> ) { int paramCount = this . parameters . length ; nextMethod : for ( int imethod = ( int ) range , end = ( int ) ( range > > <NUM_LIT:32> ) ; imethod <= end ; imethod ++ ) { MethodBinding method = methods [ imethod ] ; if ( method . parameters . length == paramCount ) { TypeBinding [ ] toMatch = method . parameters ; for ( int i = <NUM_LIT:0> ; i < paramCount ; i ++ ) { if ( toMatch [ i ] != this . parameters [ i ] ) { continue nextMethod ; } } needRename = true ; break check ; } } } if ( knownAccessMethods != null ) { for ( int i = <NUM_LIT:0> , length = knownAccessMethods . length ; i < length ; i ++ ) { if ( knownAccessMethods [ i ] == null ) continue ; if ( CharOperation . equals ( this . selector , knownAccessMethods [ i ] . selector ) && areParametersEqual ( methods [ i ] ) ) { needRename = true ; break check ; } } } } if ( needRename ) { setSelector ( CharOperation . concat ( TypeConstants . SYNTHETIC_ACCESS_METHOD_PREFIX , String . valueOf ( ++ methodId ) . toCharArray ( ) ) ) ; } } while ( needRename ) ; FieldDeclaration [ ] fieldDecls = declaringSourceType . scope . referenceContext . fields ; if ( fieldDecls != null ) { for ( int i = <NUM_LIT:0> , max = fieldDecls . length ; i < max ; i ++ ) { if ( fieldDecls [ i ] . binding == targetField ) { this . sourceStart = fieldDecls [ i ] . sourceStart ; return ; } } } this . sourceStart = declaringSourceType . scope . referenceContext . sourceStart ; } public SyntheticMethodBinding ( FieldBinding targetField , ReferenceBinding declaringClass , TypeBinding enumBinding , char [ ] selector ) { this . modifiers = ClassFileConstants . AccDefault | ClassFileConstants . AccStatic | ClassFileConstants . AccSynthetic ; this . tagBits |= ( TagBits . AnnotationResolved | TagBits . DeprecatedAnnotationResolved ) ; SourceTypeBinding declaringSourceType = ( SourceTypeBinding ) declaringClass ; SyntheticMethodBinding [ ] knownAccessMethods = declaringSourceType . syntheticMethods ( ) ; int methodId = knownAccessMethods == null ? <NUM_LIT:0> : knownAccessMethods . length ; this . index = methodId ; this . selector = selector ; this . returnType = declaringSourceType . scope . createArrayType ( TypeBinding . INT , <NUM_LIT:1> ) ; this . parameters = Binding . NO_PARAMETERS ; this . targetReadField = targetField ; this . targetEnumType = enumBinding ; this . purpose = SyntheticMethodBinding . SwitchTable ; this . thrownExceptions = Binding . NO_EXCEPTIONS ; this . declaringClass = declaringSourceType ; if ( declaringSourceType . isStrictfp ( ) ) { this . modifiers |= ClassFileConstants . AccStrictfp ; } boolean needRename ; do { check : { needRename = false ; long range ; MethodBinding [ ] methods = declaringSourceType . methods ( ) ; if ( ( range = ReferenceBinding . binarySearch ( this . selector , methods ) ) >= <NUM_LIT:0> ) { int paramCount = this . parameters . length ; nextMethod : for ( int imethod = ( int ) range , end = ( int ) ( range > > <NUM_LIT:32> ) ; imethod <= end ; imethod ++ ) { MethodBinding method = methods [ imethod ] ; if ( method . parameters . length == paramCount ) { TypeBinding [ ] toMatch = method . parameters ; for ( int i = <NUM_LIT:0> ; i < paramCount ; i ++ ) { if ( toMatch [ i ] != this . parameters [ i ] ) { continue nextMethod ; } } needRename = true ; break check ; } } } if ( knownAccessMethods != null ) { for ( int i = <NUM_LIT:0> , length = knownAccessMethods . length ; i < length ; i ++ ) { if ( knownAccessMethods [ i ] == null ) continue ; if ( CharOperation . equals ( this . selector , knownAccessMethods [ i ] . selector ) && areParametersEqual ( methods [ i ] ) ) { needRename = true ; break check ; } } } } if ( needRename ) { setSelector ( CharOperation . concat ( selector , String . valueOf ( ++ methodId ) . toCharArray ( ) ) ) ; } } while ( needRename ) ; this . sourceStart = declaringSourceType . scope . referenceContext . sourceStart ; } public SyntheticMethodBinding ( MethodBinding targetMethod , boolean isSuperAccess , ReferenceBinding declaringClass ) { if ( targetMethod . isConstructor ( ) ) { initializeConstructorAccessor ( targetMethod ) ; } else { initializeMethodAccessor ( targetMethod , isSuperAccess , declaringClass ) ; } } public SyntheticMethodBinding ( MethodBinding overridenMethodToBridge , MethodBinding targetMethod , SourceTypeBinding declaringClass ) { this . declaringClass = declaringClass ; this . selector = overridenMethodToBridge . selector ; this . modifiers = ( targetMethod . modifiers | ClassFileConstants . AccBridge | ClassFileConstants . AccSynthetic ) & ~ ( ClassFileConstants . AccAbstract | ClassFileConstants . AccNative | ClassFileConstants . AccFinal | ExtraCompilerModifiers . AccGenericSignature ) ; this . tagBits |= ( TagBits . AnnotationResolved | TagBits . DeprecatedAnnotationResolved ) ; this . returnType = overridenMethodToBridge . returnType ; this . parameters = overridenMethodToBridge . parameters ; this . thrownExceptions = overridenMethodToBridge . thrownExceptions ; this . targetMethod = targetMethod ; this . purpose = SyntheticMethodBinding . BridgeMethod ; SyntheticMethodBinding [ ] knownAccessMethods = declaringClass . syntheticMethods ( ) ; int methodId = knownAccessMethods == null ? <NUM_LIT:0> : knownAccessMethods . length ; this . index = methodId ; } public SyntheticMethodBinding ( SourceTypeBinding declaringEnum , char [ ] selector ) { this . declaringClass = declaringEnum ; this . selector = selector ; this . modifiers = ClassFileConstants . AccPublic | ClassFileConstants . AccStatic ; this . tagBits |= ( TagBits . AnnotationResolved | TagBits . DeprecatedAnnotationResolved ) ; LookupEnvironment environment = declaringEnum . scope . environment ( ) ; this . thrownExceptions = Binding . NO_EXCEPTIONS ; if ( selector == TypeConstants . VALUES ) { this . returnType = environment . createArrayType ( environment . convertToParameterizedType ( declaringEnum ) , <NUM_LIT:1> ) ; this . parameters = Binding . NO_PARAMETERS ; this . purpose = SyntheticMethodBinding . EnumValues ; } else if ( selector == TypeConstants . VALUEOF ) { this . returnType = environment . convertToParameterizedType ( declaringEnum ) ; this . parameters = new TypeBinding [ ] { declaringEnum . scope . getJavaLangString ( ) } ; this . purpose = SyntheticMethodBinding . EnumValueOf ; } SyntheticMethodBinding [ ] knownAccessMethods = ( ( SourceTypeBinding ) this . declaringClass ) . syntheticMethods ( ) ; int methodId = knownAccessMethods == null ? <NUM_LIT:0> : knownAccessMethods . length ; this . index = methodId ; if ( declaringEnum . isStrictfp ( ) ) { this . modifiers |= ClassFileConstants . AccStrictfp ; } } public SyntheticMethodBinding ( MethodBinding overridenMethodToBridge , SourceTypeBinding declaringClass ) { this . declaringClass = declaringClass ; this . selector = overridenMethodToBridge . selector ; this . modifiers = ( overridenMethodToBridge . modifiers | ClassFileConstants . AccBridge | ClassFileConstants . AccSynthetic ) & ~ ( ClassFileConstants . AccAbstract | ClassFileConstants . AccNative | ClassFileConstants . AccFinal | ExtraCompilerModifiers . AccGenericSignature ) ; this . tagBits |= ( TagBits . AnnotationResolved | TagBits . DeprecatedAnnotationResolved ) ; this . returnType = overridenMethodToBridge . returnType ; this . parameters = overridenMethodToBridge . parameters ; this . thrownExceptions = overridenMethodToBridge . thrownExceptions ; this . targetMethod = overridenMethodToBridge ; this . purpose = SyntheticMethodBinding . SuperMethodAccess ; SyntheticMethodBinding [ ] knownAccessMethods = declaringClass . syntheticMethods ( ) ; int methodId = knownAccessMethods == null ? <NUM_LIT:0> : knownAccessMethods . length ; this . index = methodId ; } public void initializeConstructorAccessor ( MethodBinding accessedConstructor ) { this . targetMethod = accessedConstructor ; this . modifiers = ClassFileConstants . AccDefault | ClassFileConstants . AccSynthetic ; this . tagBits |= ( TagBits . AnnotationResolved | TagBits . DeprecatedAnnotationResolved ) ; SourceTypeBinding sourceType = ( SourceTypeBinding ) accessedConstructor . declaringClass ; SyntheticMethodBinding [ ] knownSyntheticMethods = sourceType . syntheticMethods ( ) ; this . index = knownSyntheticMethods == null ? <NUM_LIT:0> : knownSyntheticMethods . length ; this . selector = accessedConstructor . selector ; this . returnType = accessedConstructor . returnType ; this . purpose = SyntheticMethodBinding . ConstructorAccess ; this . parameters = new TypeBinding [ accessedConstructor . parameters . length + <NUM_LIT:1> ] ; System . arraycopy ( accessedConstructor . parameters , <NUM_LIT:0> , this . parameters , <NUM_LIT:0> , accessedConstructor . parameters . length ) ; this . parameters [ accessedConstructor . parameters . length ] = accessedConstructor . declaringClass ; this . thrownExceptions = accessedConstructor . thrownExceptions ; this . declaringClass = sourceType ; boolean needRename ; do { check : { needRename = false ; MethodBinding [ ] methods = sourceType . methods ( ) ; for ( int i = <NUM_LIT:0> , length = methods . length ; i < length ; i ++ ) { if ( CharOperation . equals ( this . selector , methods [ i ] . selector ) && areParameterErasuresEqual ( methods [ i ] ) ) { needRename = true ; break check ; } } if ( knownSyntheticMethods != null ) { for ( int i = <NUM_LIT:0> , length = knownSyntheticMethods . length ; i < length ; i ++ ) { if ( knownSyntheticMethods [ i ] == null ) continue ; if ( CharOperation . equals ( this . selector , knownSyntheticMethods [ i ] . selector ) && areParameterErasuresEqual ( knownSyntheticMethods [ i ] ) ) { needRename = true ; break check ; } } } } if ( needRename ) { int length = this . parameters . length ; System . arraycopy ( this . parameters , <NUM_LIT:0> , this . parameters = new TypeBinding [ length + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; this . parameters [ length ] = this . declaringClass ; } } while ( needRename ) ; AbstractMethodDeclaration [ ] methodDecls = sourceType . scope . referenceContext . methods ; if ( methodDecls != null ) { for ( int i = <NUM_LIT:0> , length = methodDecls . length ; i < length ; i ++ ) { if ( methodDecls [ i ] . binding == accessedConstructor ) { this . sourceStart = methodDecls [ i ] . sourceStart ; return ; } } } } public void initializeMethodAccessor ( MethodBinding accessedMethod , boolean isSuperAccess , ReferenceBinding receiverType ) { this . targetMethod = accessedMethod ; this . modifiers = ClassFileConstants . AccDefault | ClassFileConstants . AccStatic | ClassFileConstants . AccSynthetic ; this . tagBits |= ( TagBits . AnnotationResolved | TagBits . DeprecatedAnnotationResolved ) ; SourceTypeBinding declaringSourceType = ( SourceTypeBinding ) receiverType ; SyntheticMethodBinding [ ] knownAccessMethods = declaringSourceType . syntheticMethods ( ) ; int methodId = knownAccessMethods == null ? <NUM_LIT:0> : knownAccessMethods . length ; this . index = methodId ; this . selector = CharOperation . concat ( TypeConstants . SYNTHETIC_ACCESS_METHOD_PREFIX , String . valueOf ( methodId ) . toCharArray ( ) ) ; this . returnType = accessedMethod . returnType ; this . purpose = isSuperAccess ? SyntheticMethodBinding . SuperMethodAccess : SyntheticMethodBinding . MethodAccess ; if ( accessedMethod . isStatic ( ) ) { this . parameters = accessedMethod . parameters ; } else { this . parameters = new TypeBinding [ accessedMethod . parameters . length + <NUM_LIT:1> ] ; this . parameters [ <NUM_LIT:0> ] = declaringSourceType ; System . arraycopy ( accessedMethod . parameters , <NUM_LIT:0> , this . parameters , <NUM_LIT:1> , accessedMethod . parameters . length ) ; } this . thrownExceptions = accessedMethod . thrownExceptions ; this . declaringClass = declaringSourceType ; boolean needRename ; do { check : { needRename = false ; MethodBinding [ ] methods = declaringSourceType . methods ( ) ; for ( int i = <NUM_LIT:0> , length = methods . length ; i < length ; i ++ ) { if ( CharOperation . equals ( this . selector , methods [ i ] . selector ) && areParameterErasuresEqual ( methods [ i ] ) ) { needRename = true ; break check ; } } if ( knownAccessMethods != null ) { for ( int i = <NUM_LIT:0> , length = knownAccessMethods . length ; i < length ; i ++ ) { if ( knownAccessMethods [ i ] == null ) continue ; if ( CharOperation . equals ( this . selector , knownAccessMethods [ i ] . selector ) && areParameterErasuresEqual ( knownAccessMethods [ i ] ) ) { needRename = true ; break check ; } } } } if ( needRename ) { setSelector ( CharOperation . concat ( TypeConstants . SYNTHETIC_ACCESS_METHOD_PREFIX , String . valueOf ( ++ methodId ) . toCharArray ( ) ) ) ; } } while ( needRename ) ; AbstractMethodDeclaration [ ] methodDecls = declaringSourceType . scope . referenceContext . methods ; if ( methodDecls != null ) { for ( int i = <NUM_LIT:0> , length = methodDecls . length ; i < length ; i ++ ) { if ( methodDecls [ i ] . binding == accessedMethod ) { this . sourceStart = methodDecls [ i ] . sourceStart ; return ; } } } } protected boolean isConstructorRelated ( ) { return this . purpose == SyntheticMethodBinding . ConstructorAccess ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . CompilationUnitDeclaration ; import org . eclipse . jdt . internal . compiler . ast . ImportReference ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; import org . eclipse . jdt . internal . compiler . ast . TypeReference ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . env . AccessRestriction ; import org . eclipse . jdt . internal . compiler . problem . ProblemReporter ; import org . eclipse . jdt . internal . compiler . util . CompoundNameVector ; import org . eclipse . jdt . internal . compiler . util . HashtableOfObject ; import org . eclipse . jdt . internal . compiler . util . HashtableOfType ; import org . eclipse . jdt . internal . compiler . util . ObjectVector ; import org . eclipse . jdt . internal . compiler . util . SimpleNameVector ; public class CompilationUnitScope extends Scope { public LookupEnvironment environment ; public CompilationUnitDeclaration referenceContext ; public char [ ] [ ] currentPackageName ; public PackageBinding fPackage ; public ImportBinding [ ] imports ; public HashtableOfObject typeOrPackageCache ; public SourceTypeBinding [ ] topLevelTypes ; private CompoundNameVector qualifiedReferences ; private SimpleNameVector simpleNameReferences ; private SimpleNameVector rootReferences ; private ObjectVector referencedTypes ; private ObjectVector referencedSuperTypes ; HashtableOfType constantPoolNameUsage ; private int captureID = <NUM_LIT:1> ; public CompilationUnitScope ( CompilationUnitDeclaration unit , LookupEnvironment environment ) { super ( COMPILATION_UNIT_SCOPE , null ) ; this . environment = environment ; this . referenceContext = unit ; unit . scope = this ; this . currentPackageName = unit . currentPackage == null ? CharOperation . NO_CHAR_CHAR : unit . currentPackage . tokens ; if ( compilerOptions ( ) . produceReferenceInfo ) { this . qualifiedReferences = new CompoundNameVector ( ) ; this . simpleNameReferences = new SimpleNameVector ( ) ; this . rootReferences = new SimpleNameVector ( ) ; this . referencedTypes = new ObjectVector ( ) ; this . referencedSuperTypes = new ObjectVector ( ) ; } else { this . qualifiedReferences = null ; this . simpleNameReferences = null ; this . rootReferences = null ; this . referencedTypes = null ; this . referencedSuperTypes = null ; } } void buildFieldsAndMethods ( ) { for ( int i = <NUM_LIT:0> , length = this . topLevelTypes . length ; i < length ; i ++ ) this . topLevelTypes [ i ] . scope . buildFieldsAndMethods ( ) ; } protected boolean reportPackageIsNotExpectedPackage ( CompilationUnitDeclaration referenceContext ) { problemReporter ( ) . packageIsNotExpectedPackage ( referenceContext ) ; return true ; } void buildTypeBindings ( AccessRestriction accessRestriction ) { this . topLevelTypes = new SourceTypeBinding [ <NUM_LIT:0> ] ; boolean firstIsSynthetic = false ; if ( this . referenceContext . compilationResult . compilationUnit != null ) { char [ ] [ ] expectedPackageName = this . referenceContext . compilationResult . compilationUnit . getPackageName ( ) ; if ( expectedPackageName != null && ! CharOperation . equals ( this . currentPackageName , expectedPackageName ) ) { boolean errorReported = true ; if ( this . referenceContext . currentPackage != null || this . referenceContext . types != null || this . referenceContext . imports != null ) { errorReported = reportPackageIsNotExpectedPackage ( this . referenceContext ) ; } if ( errorReported ) { this . currentPackageName = expectedPackageName . length == <NUM_LIT:0> ? CharOperation . NO_CHAR_CHAR : expectedPackageName ; } } } if ( this . currentPackageName == CharOperation . NO_CHAR_CHAR ) { if ( ( this . fPackage = this . environment . defaultPackage ) == null ) { problemReporter ( ) . mustSpecifyPackage ( this . referenceContext ) ; return ; } } else { if ( ( this . fPackage = this . environment . createPackage ( this . currentPackageName ) ) == null ) { if ( this . referenceContext . currentPackage != null ) problemReporter ( ) . packageCollidesWithType ( this . referenceContext ) ; return ; } else if ( this . referenceContext . isPackageInfo ( ) ) { if ( this . referenceContext . types == null || this . referenceContext . types . length == <NUM_LIT:0> ) { this . referenceContext . types = new TypeDeclaration [ <NUM_LIT:1> ] ; this . referenceContext . createPackageInfoType ( ) ; firstIsSynthetic = true ; } if ( this . referenceContext . currentPackage != null ) this . referenceContext . types [ <NUM_LIT:0> ] . annotations = this . referenceContext . currentPackage . annotations ; } recordQualifiedReference ( this . currentPackageName ) ; } TypeDeclaration [ ] types = this . referenceContext . types ; int typeLength = ( types == null ) ? <NUM_LIT:0> : types . length ; this . topLevelTypes = new SourceTypeBinding [ typeLength ] ; int count = <NUM_LIT:0> ; nextType : for ( int i = <NUM_LIT:0> ; i < typeLength ; i ++ ) { TypeDeclaration typeDecl = types [ i ] ; if ( this . environment . isProcessingAnnotations && this . environment . isMissingType ( typeDecl . name ) ) throw new SourceTypeCollisionException ( ) ; ReferenceBinding typeBinding = this . fPackage . getType0 ( typeDecl . name ) ; recordSimpleReference ( typeDecl . name ) ; if ( typeBinding != null && typeBinding . isValidBinding ( ) && ! ( typeBinding instanceof UnresolvedReferenceBinding ) ) { if ( this . environment . isProcessingAnnotations ) throw new SourceTypeCollisionException ( ) ; problemReporter ( ) . duplicateTypes ( this . referenceContext , typeDecl ) ; continue nextType ; } if ( this . fPackage != this . environment . defaultPackage && this . fPackage . getPackage ( typeDecl . name ) != null ) { problemReporter ( ) . typeCollidesWithPackage ( this . referenceContext , typeDecl ) ; } checkPublicTypeNameMatchesFilename ( typeDecl ) ; ClassScope child = buildClassScope ( this , typeDecl ) ; SourceTypeBinding type = child . buildType ( null , this . fPackage , accessRestriction ) ; if ( firstIsSynthetic && i == <NUM_LIT:0> ) type . modifiers |= ClassFileConstants . AccSynthetic ; if ( type != null ) this . topLevelTypes [ count ++ ] = type ; } if ( count != this . topLevelTypes . length ) System . arraycopy ( this . topLevelTypes , <NUM_LIT:0> , this . topLevelTypes = new SourceTypeBinding [ count ] , <NUM_LIT:0> , count ) ; } protected void checkPublicTypeNameMatchesFilename ( TypeDeclaration typeDecl ) { if ( ( typeDecl . modifiers & ClassFileConstants . AccPublic ) != <NUM_LIT:0> ) { char [ ] mainTypeName ; if ( ( mainTypeName = referenceContext . getMainTypeName ( ) ) != null && ! CharOperation . equals ( mainTypeName , typeDecl . name ) ) { problemReporter ( ) . publicClassMustMatchFileName ( referenceContext , typeDecl ) ; } } } protected ClassScope buildClassScope ( Scope parent , TypeDeclaration typeDecl ) { return new ClassScope ( parent , typeDecl ) ; } void checkAndSetImports ( ) { if ( this . referenceContext . imports == null ) { this . imports = getDefaultImports ( ) ; return ; } int numberOfStatements = this . referenceContext . imports . length ; int numberOfImports = numberOfStatements + <NUM_LIT:1> ; for ( int i = <NUM_LIT:0> ; i < numberOfStatements ; i ++ ) { ImportReference importReference = this . referenceContext . imports [ i ] ; if ( ( ( importReference . bits & ASTNode . OnDemand ) != <NUM_LIT:0> ) && CharOperation . equals ( TypeConstants . JAVA_LANG , importReference . tokens ) && ! importReference . isStatic ( ) ) { numberOfImports -- ; break ; } } ImportBinding [ ] resolvedImports = null ; int index = - <NUM_LIT:1> ; ImportBinding [ ] defaultImportBindings = getDefaultImports ( ) ; if ( defaultImportBindings . length == <NUM_LIT:1> ) { resolvedImports = new ImportBinding [ numberOfImports ] ; resolvedImports [ <NUM_LIT:0> ] = getDefaultImports ( ) [ <NUM_LIT:0> ] ; index = <NUM_LIT:1> ; } else { resolvedImports = new ImportBinding [ numberOfImports + defaultImportBindings . length - <NUM_LIT:1> ] ; index = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < defaultImportBindings . length ; i ++ ) { resolvedImports [ index ++ ] = defaultImportBindings [ i ] ; } } nextImport : for ( int i = <NUM_LIT:0> ; i < numberOfStatements ; i ++ ) { ImportReference importReference = this . referenceContext . imports [ i ] ; char [ ] [ ] compoundName = importReference . tokens ; for ( int j = <NUM_LIT:0> ; j < index ; j ++ ) { ImportBinding resolved = resolvedImports [ j ] ; if ( resolved . onDemand == ( ( importReference . bits & ASTNode . OnDemand ) != <NUM_LIT:0> ) && resolved . isStatic ( ) == importReference . isStatic ( ) ) if ( CharOperation . equals ( compoundName , resolvedImports [ j ] . compoundName ) ) continue nextImport ; } if ( ( importReference . bits & ASTNode . OnDemand ) != <NUM_LIT:0> ) { if ( CharOperation . equals ( compoundName , this . currentPackageName ) ) continue nextImport ; Binding importBinding = findImport ( compoundName , compoundName . length ) ; if ( ! importBinding . isValidBinding ( ) || ( importReference . isStatic ( ) && importBinding instanceof PackageBinding ) ) continue nextImport ; resolvedImports [ index ++ ] = new ImportBinding ( compoundName , true , importBinding , importReference ) ; } else { resolvedImports [ index ++ ] = new ImportBinding ( compoundName , false , null , importReference ) ; } } if ( resolvedImports . length > index ) System . arraycopy ( resolvedImports , <NUM_LIT:0> , resolvedImports = new ImportBinding [ index ] , <NUM_LIT:0> , index ) ; this . imports = resolvedImports ; } protected void checkParameterizedTypes ( ) { if ( compilerOptions ( ) . sourceLevel < ClassFileConstants . JDK1_5 ) return ; for ( int i = <NUM_LIT:0> , length = this . topLevelTypes . length ; i < length ; i ++ ) { ClassScope scope = this . topLevelTypes [ i ] . scope ; scope . checkParameterizedTypeBounds ( ) ; scope . checkParameterizedSuperTypeCollisions ( ) ; } } public char [ ] computeConstantPoolName ( LocalTypeBinding localType ) { if ( localType . constantPoolName != null ) { return localType . constantPoolName ; } if ( this . constantPoolNameUsage == null ) this . constantPoolNameUsage = new HashtableOfType ( ) ; ReferenceBinding outerMostEnclosingType = localType . scope . outerMostClassScope ( ) . enclosingSourceType ( ) ; int index = <NUM_LIT:0> ; char [ ] candidateName ; boolean isCompliant15 = compilerOptions ( ) . complianceLevel >= ClassFileConstants . JDK1_5 ; while ( true ) { if ( localType . isMemberType ( ) ) { if ( index == <NUM_LIT:0> ) { candidateName = CharOperation . concat ( localType . enclosingType ( ) . constantPoolName ( ) , localType . sourceName , '<CHAR_LIT>' ) ; } else { candidateName = CharOperation . concat ( localType . enclosingType ( ) . constantPoolName ( ) , '<CHAR_LIT>' , String . valueOf ( index ) . toCharArray ( ) , '<CHAR_LIT>' , localType . sourceName ) ; } } else if ( localType . isAnonymousType ( ) ) { if ( isCompliant15 ) { candidateName = CharOperation . concat ( localType . enclosingType . constantPoolName ( ) , String . valueOf ( index + <NUM_LIT:1> ) . toCharArray ( ) , '<CHAR_LIT>' ) ; } else { candidateName = CharOperation . concat ( outerMostEnclosingType . constantPoolName ( ) , String . valueOf ( index + <NUM_LIT:1> ) . toCharArray ( ) , '<CHAR_LIT>' ) ; } } else { if ( isCompliant15 ) { candidateName = CharOperation . concat ( CharOperation . concat ( localType . enclosingType ( ) . constantPoolName ( ) , String . valueOf ( index + <NUM_LIT:1> ) . toCharArray ( ) , '<CHAR_LIT>' ) , localType . sourceName ) ; } else { candidateName = CharOperation . concat ( outerMostEnclosingType . constantPoolName ( ) , '<CHAR_LIT>' , String . valueOf ( index + <NUM_LIT:1> ) . toCharArray ( ) , '<CHAR_LIT>' , localType . sourceName ) ; } } if ( this . constantPoolNameUsage . get ( candidateName ) != null ) { index ++ ; } else { this . constantPoolNameUsage . put ( candidateName , localType ) ; break ; } } return candidateName ; } void connectTypeHierarchy ( ) { for ( int i = <NUM_LIT:0> , length = this . topLevelTypes . length ; i < length ; i ++ ) this . topLevelTypes [ i ] . scope . connectTypeHierarchy ( ) ; } protected void faultInImports ( ) { if ( this . typeOrPackageCache != null ) return ; if ( this . referenceContext . imports == null ) { this . typeOrPackageCache = new HashtableOfObject ( <NUM_LIT:1> ) ; return ; } int numberOfStatements = this . referenceContext . imports . length ; HashtableOfType typesBySimpleNames = null ; for ( int i = <NUM_LIT:0> ; i < numberOfStatements ; i ++ ) { if ( ( this . referenceContext . imports [ i ] . bits & ASTNode . OnDemand ) == <NUM_LIT:0> ) { typesBySimpleNames = new HashtableOfType ( this . topLevelTypes . length + numberOfStatements ) ; for ( int j = <NUM_LIT:0> , length = this . topLevelTypes . length ; j < length ; j ++ ) typesBySimpleNames . put ( this . topLevelTypes [ j ] . sourceName , this . topLevelTypes [ j ] ) ; break ; } } int numberOfImports = numberOfStatements + <NUM_LIT:1> ; for ( int i = <NUM_LIT:0> ; i < numberOfStatements ; i ++ ) { ImportReference importReference = this . referenceContext . imports [ i ] ; if ( ( ( importReference . bits & ASTNode . OnDemand ) != <NUM_LIT:0> ) && CharOperation . equals ( TypeConstants . JAVA_LANG , importReference . tokens ) && ! importReference . isStatic ( ) ) { numberOfImports -- ; break ; } } ImportBinding [ ] resolvedImports = null ; int index = - <NUM_LIT:1> ; ImportBinding [ ] defaultImportBindings = getDefaultImports ( ) ; if ( defaultImportBindings . length == <NUM_LIT:1> ) { resolvedImports = new ImportBinding [ numberOfImports ] ; resolvedImports [ <NUM_LIT:0> ] = getDefaultImports ( ) [ <NUM_LIT:0> ] ; index = <NUM_LIT:1> ; } else { resolvedImports = new ImportBinding [ numberOfImports + defaultImportBindings . length - <NUM_LIT:1> ] ; index = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < defaultImportBindings . length ; i ++ ) { resolvedImports [ index ++ ] = defaultImportBindings [ i ] ; } } nextImport : for ( int i = <NUM_LIT:0> ; i < numberOfStatements ; i ++ ) { ImportReference importReference = this . referenceContext . imports [ i ] ; char [ ] [ ] compoundName = importReference . tokens ; for ( int j = <NUM_LIT:0> ; j < index ; j ++ ) { ImportBinding resolved = resolvedImports [ j ] ; if ( resolved . onDemand == ( ( importReference . bits & ASTNode . OnDemand ) != <NUM_LIT:0> ) && resolved . isStatic ( ) == importReference . isStatic ( ) ) { if ( CharOperation . equals ( compoundName , resolved . compoundName ) ) { problemReporter ( ) . unusedImport ( importReference ) ; continue nextImport ; } } } if ( ( importReference . bits & ASTNode . OnDemand ) != <NUM_LIT:0> ) { if ( CharOperation . equals ( compoundName , this . currentPackageName ) ) { problemReporter ( ) . unusedImport ( importReference ) ; continue nextImport ; } Binding importBinding = findImport ( compoundName , compoundName . length ) ; if ( ! importBinding . isValidBinding ( ) ) { reportImportProblem ( importReference , importBinding ) ; continue nextImport ; } if ( importReference . isStatic ( ) && importBinding instanceof PackageBinding ) { problemReporter ( ) . cannotImportPackage ( importReference ) ; continue nextImport ; } resolvedImports [ index ++ ] = new ImportBinding ( compoundName , true , importBinding , importReference ) ; } else { Binding importBinding = findSingleImport ( compoundName , Binding . TYPE | Binding . FIELD | Binding . METHOD , importReference . isStatic ( ) ) ; if ( ! importBinding . isValidBinding ( ) ) { if ( importBinding . problemId ( ) == ProblemReasons . Ambiguous ) { } else { recordImportProblem ( importReference , importBinding ) ; continue nextImport ; } } if ( importBinding instanceof PackageBinding ) { problemReporter ( ) . cannotImportPackage ( importReference ) ; continue nextImport ; } ReferenceBinding conflictingType = null ; if ( importBinding instanceof MethodBinding ) { conflictingType = ( ReferenceBinding ) getType ( compoundName , compoundName . length ) ; if ( ! conflictingType . isValidBinding ( ) || ( importReference . isStatic ( ) && ! conflictingType . isStatic ( ) ) ) conflictingType = null ; } if ( importBinding instanceof ReferenceBinding || conflictingType != null ) { ReferenceBinding referenceBinding = conflictingType == null ? ( ReferenceBinding ) importBinding : conflictingType ; ReferenceBinding typeToCheck = referenceBinding . problemId ( ) == ProblemReasons . Ambiguous ? ( ( ProblemReferenceBinding ) referenceBinding ) . closestMatch : referenceBinding ; if ( importReference . isTypeUseDeprecated ( typeToCheck , this ) ) problemReporter ( ) . deprecatedType ( typeToCheck , importReference ) ; ReferenceBinding existingType = typesBySimpleNames . get ( importReference . getSimpleName ( ) ) ; if ( existingType != null ) { if ( existingType == referenceBinding ) { for ( int j = <NUM_LIT:0> ; j < index ; j ++ ) { ImportBinding resolved = resolvedImports [ j ] ; if ( resolved instanceof ImportConflictBinding ) { ImportConflictBinding importConflictBinding = ( ImportConflictBinding ) resolved ; if ( importConflictBinding . conflictingTypeBinding == referenceBinding ) { if ( ! importReference . isStatic ( ) ) { problemReporter ( ) . duplicateImport ( importReference ) ; resolvedImports [ index ++ ] = new ImportBinding ( compoundName , false , importBinding , importReference ) ; } } } else if ( resolved . resolvedImport == referenceBinding ) { if ( importReference . isStatic ( ) != resolved . isStatic ( ) ) { problemReporter ( ) . duplicateImport ( importReference ) ; resolvedImports [ index ++ ] = new ImportBinding ( compoundName , false , importBinding , importReference ) ; } } } continue nextImport ; } for ( int j = <NUM_LIT:0> , length = this . topLevelTypes . length ; j < length ; j ++ ) { if ( CharOperation . equals ( this . topLevelTypes [ j ] . sourceName , existingType . sourceName ) ) { problemReporter ( ) . conflictingImport ( importReference ) ; continue nextImport ; } } problemReporter ( ) . duplicateImport ( importReference ) ; continue nextImport ; } typesBySimpleNames . put ( importReference . getSimpleName ( ) , referenceBinding ) ; } else if ( importBinding instanceof FieldBinding ) { for ( int j = <NUM_LIT:0> ; j < index ; j ++ ) { ImportBinding resolved = resolvedImports [ j ] ; if ( resolved . isStatic ( ) && resolved . resolvedImport instanceof FieldBinding && importBinding != resolved . resolvedImport ) { if ( CharOperation . equals ( compoundName [ compoundName . length - <NUM_LIT:1> ] , resolved . compoundName [ resolved . compoundName . length - <NUM_LIT:1> ] ) ) { problemReporter ( ) . duplicateImport ( importReference ) ; continue nextImport ; } } } } resolvedImports [ index ++ ] = conflictingType == null ? new ImportBinding ( compoundName , false , importBinding , importReference ) : new ImportConflictBinding ( compoundName , importBinding , conflictingType , importReference ) ; } } if ( resolvedImports . length > index ) System . arraycopy ( resolvedImports , <NUM_LIT:0> , resolvedImports = new ImportBinding [ index ] , <NUM_LIT:0> , index ) ; this . imports = resolvedImports ; int length = this . imports . length ; this . typeOrPackageCache = new HashtableOfObject ( length ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { ImportBinding binding = this . imports [ i ] ; if ( ! binding . onDemand && binding . resolvedImport instanceof ReferenceBinding || binding instanceof ImportConflictBinding ) this . typeOrPackageCache . put ( getSimpleName ( binding ) , binding ) ; } } public void faultInTypes ( ) { faultInImports ( ) ; for ( int i = <NUM_LIT:0> , length = this . topLevelTypes . length ; i < length ; i ++ ) this . topLevelTypes [ i ] . faultInTypesForFieldsAndMethods ( ) ; } protected void recordImportProblem ( ImportReference importReference , Binding importBinding ) { problemReporter ( ) . importProblem ( importReference , importBinding ) ; } public Binding findImport ( char [ ] [ ] compoundName , boolean findStaticImports , boolean onDemand ) { if ( onDemand ) { return findImport ( compoundName , compoundName . length ) ; } else { return findSingleImport ( compoundName , Binding . TYPE | Binding . FIELD | Binding . METHOD , findStaticImports ) ; } } private Binding findImport ( char [ ] [ ] compoundName , int length ) { recordQualifiedReference ( compoundName ) ; Binding binding = this . environment . getTopLevelPackage ( compoundName [ <NUM_LIT:0> ] ) ; int i = <NUM_LIT:1> ; foundNothingOrType : if ( binding != null ) { PackageBinding packageBinding = ( PackageBinding ) binding ; while ( i < length ) { binding = packageBinding . getTypeOrPackage ( compoundName [ i ++ ] ) ; if ( binding == null || ! binding . isValidBinding ( ) ) { binding = null ; break foundNothingOrType ; } if ( ! ( binding instanceof PackageBinding ) ) break foundNothingOrType ; packageBinding = ( PackageBinding ) binding ; } return packageBinding ; } ReferenceBinding type ; if ( binding == null ) { if ( this . environment . defaultPackage == null || compilerOptions ( ) . complianceLevel >= ClassFileConstants . JDK1_4 ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , i ) , null , ProblemReasons . NotFound ) ; type = findType ( compoundName [ <NUM_LIT:0> ] , this . environment . defaultPackage , this . environment . defaultPackage ) ; if ( type == null || ! type . isValidBinding ( ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , i ) , null , ProblemReasons . NotFound ) ; i = <NUM_LIT:1> ; } else { type = ( ReferenceBinding ) binding ; } while ( i < length ) { type = ( ReferenceBinding ) this . environment . convertToRawType ( type , false ) ; if ( ! type . canBeSeenBy ( this . fPackage ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , i ) , type , ProblemReasons . NotVisible ) ; char [ ] name = compoundName [ i ++ ] ; type = type . getMemberType ( name ) ; if ( type == null ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , i ) , null , ProblemReasons . NotFound ) ; } if ( ! canBeSeenBy ( type , fPackage ) ) return new ProblemReferenceBinding ( compoundName , type , ProblemReasons . NotVisible ) ; return type ; } protected boolean canBeSeenBy ( ReferenceBinding type , PackageBinding fPackage ) { return type . canBeSeenBy ( fPackage ) ; } protected Binding findSingleImport ( char [ ] [ ] compoundName , int mask , boolean findStaticImports ) { if ( compoundName . length == <NUM_LIT:1> ) { if ( this . environment . defaultPackage == null || compilerOptions ( ) . complianceLevel >= ClassFileConstants . JDK1_4 ) return new ProblemReferenceBinding ( compoundName , null , ProblemReasons . NotFound ) ; ReferenceBinding typeBinding = findType ( compoundName [ <NUM_LIT:0> ] , this . environment . defaultPackage , this . fPackage ) ; if ( typeBinding == null ) return new ProblemReferenceBinding ( compoundName , null , ProblemReasons . NotFound ) ; return typeBinding ; } if ( findStaticImports ) return findSingleStaticImport ( compoundName , mask ) ; return findImport ( compoundName , compoundName . length ) ; } private Binding findSingleStaticImport ( char [ ] [ ] compoundName , int mask ) { Binding binding = findImport ( compoundName , compoundName . length - <NUM_LIT:1> ) ; if ( ! binding . isValidBinding ( ) ) return binding ; char [ ] name = compoundName [ compoundName . length - <NUM_LIT:1> ] ; if ( binding instanceof PackageBinding ) { Binding temp = ( ( PackageBinding ) binding ) . getTypeOrPackage ( name ) ; if ( temp != null && temp instanceof ReferenceBinding ) return new ProblemReferenceBinding ( compoundName , ( ReferenceBinding ) temp , ProblemReasons . InvalidTypeForStaticImport ) ; return binding ; } ReferenceBinding type = ( ReferenceBinding ) binding ; FieldBinding field = ( mask & Binding . FIELD ) != <NUM_LIT:0> ? findField ( type , name , null , true ) : null ; if ( field != null ) { if ( field . problemId ( ) == ProblemReasons . Ambiguous && ( ( ProblemFieldBinding ) field ) . closestMatch . isStatic ( ) ) return field ; if ( field . isValidBinding ( ) && field . isStatic ( ) && field . canBeSeenBy ( type , null , this ) ) return field ; } MethodBinding method = ( mask & Binding . METHOD ) != <NUM_LIT:0> ? findStaticMethod ( type , name ) : null ; if ( method != null ) return method ; type = findMemberType ( name , type ) ; if ( type == null || ! type . isStatic ( ) ) { if ( field != null && ! field . isValidBinding ( ) && field . problemId ( ) != ProblemReasons . NotFound ) return field ; return new ProblemReferenceBinding ( compoundName , type , ProblemReasons . NotFound ) ; } if ( type . isValidBinding ( ) && ! type . canBeSeenBy ( this . fPackage ) ) return new ProblemReferenceBinding ( compoundName , type , ProblemReasons . NotVisible ) ; if ( type . problemId ( ) == ProblemReasons . NotVisible ) return new ProblemReferenceBinding ( compoundName , ( ( ProblemReferenceBinding ) type ) . closestMatch , ProblemReasons . NotVisible ) ; return type ; } private MethodBinding findStaticMethod ( ReferenceBinding currentType , char [ ] selector ) { if ( ! currentType . canBeSeenBy ( this ) ) return null ; do { currentType . initializeForStaticImports ( ) ; MethodBinding [ ] methods = currentType . getMethods ( selector ) ; if ( methods != Binding . NO_METHODS ) { for ( int i = methods . length ; -- i >= <NUM_LIT:0> ; ) { MethodBinding method = methods [ i ] ; if ( method . isStatic ( ) && method . canBeSeenBy ( this . fPackage ) ) return method ; } } } while ( ( currentType = currentType . superclass ( ) ) != null ) ; return null ; } protected ImportBinding [ ] getDefaultImports ( ) { if ( this . environment . defaultImports != null ) return this . environment . defaultImports ; Binding importBinding = this . environment . getTopLevelPackage ( TypeConstants . JAVA ) ; if ( importBinding != null ) importBinding = ( ( PackageBinding ) importBinding ) . getTypeOrPackage ( TypeConstants . JAVA_LANG [ <NUM_LIT:1> ] ) ; if ( importBinding == null || ! importBinding . isValidBinding ( ) ) { problemReporter ( ) . isClassPathCorrect ( TypeConstants . JAVA_LANG_OBJECT , this . referenceContext , this . environment . missingClassFileLocation ) ; BinaryTypeBinding missingObject = this . environment . createMissingType ( null , TypeConstants . JAVA_LANG_OBJECT ) ; importBinding = missingObject . fPackage ; } return this . environment . defaultImports = new ImportBinding [ ] { new ImportBinding ( TypeConstants . JAVA_LANG , true , importBinding , null ) } ; } public final Binding getImport ( char [ ] [ ] compoundName , boolean onDemand , boolean isStaticImport ) { if ( onDemand ) return findImport ( compoundName , compoundName . length ) ; return findSingleImport ( compoundName , Binding . TYPE | Binding . FIELD | Binding . METHOD , isStaticImport ) ; } public int nextCaptureID ( ) { return this . captureID ++ ; } public ProblemReporter problemReporter ( ) { ProblemReporter problemReporter = this . referenceContext . problemReporter ; problemReporter . referenceContext = this . referenceContext ; return problemReporter ; } public void recordQualifiedReference ( char [ ] [ ] qualifiedName ) { if ( this . qualifiedReferences == null ) return ; int length = qualifiedName . length ; if ( length > <NUM_LIT:1> ) { recordRootReference ( qualifiedName [ <NUM_LIT:0> ] ) ; while ( ! this . qualifiedReferences . contains ( qualifiedName ) ) { this . qualifiedReferences . add ( qualifiedName ) ; if ( length == <NUM_LIT:2> ) { recordSimpleReference ( qualifiedName [ <NUM_LIT:0> ] ) ; recordSimpleReference ( qualifiedName [ <NUM_LIT:1> ] ) ; return ; } length -- ; recordSimpleReference ( qualifiedName [ length ] ) ; System . arraycopy ( qualifiedName , <NUM_LIT:0> , qualifiedName = new char [ length ] [ ] , <NUM_LIT:0> , length ) ; } } else if ( length == <NUM_LIT:1> ) { recordRootReference ( qualifiedName [ <NUM_LIT:0> ] ) ; recordSimpleReference ( qualifiedName [ <NUM_LIT:0> ] ) ; } } void recordReference ( char [ ] [ ] qualifiedEnclosingName , char [ ] simpleName ) { recordQualifiedReference ( qualifiedEnclosingName ) ; if ( qualifiedEnclosingName . length == <NUM_LIT:0> ) recordRootReference ( simpleName ) ; recordSimpleReference ( simpleName ) ; } void recordReference ( ReferenceBinding type , char [ ] simpleName ) { ReferenceBinding actualType = typeToRecord ( type ) ; if ( actualType != null ) recordReference ( actualType . compoundName , simpleName ) ; } void recordRootReference ( char [ ] simpleName ) { if ( this . rootReferences == null ) return ; if ( ! this . rootReferences . contains ( simpleName ) ) this . rootReferences . add ( simpleName ) ; } public void recordSimpleReference ( char [ ] simpleName ) { if ( this . simpleNameReferences == null ) return ; if ( ! this . simpleNameReferences . contains ( simpleName ) ) this . simpleNameReferences . add ( simpleName ) ; } void recordSuperTypeReference ( TypeBinding type ) { if ( this . referencedSuperTypes == null ) return ; ReferenceBinding actualType = typeToRecord ( type ) ; if ( actualType != null && ! this . referencedSuperTypes . containsIdentical ( actualType ) ) this . referencedSuperTypes . add ( actualType ) ; } public void recordTypeConversion ( TypeBinding superType , TypeBinding subType ) { recordSuperTypeReference ( subType ) ; } void recordTypeReference ( TypeBinding type ) { if ( this . referencedTypes == null ) return ; ReferenceBinding actualType = typeToRecord ( type ) ; if ( actualType != null && ! this . referencedTypes . containsIdentical ( actualType ) ) this . referencedTypes . add ( actualType ) ; } void recordTypeReferences ( TypeBinding [ ] types ) { if ( this . referencedTypes == null ) return ; if ( types == null || types . length == <NUM_LIT:0> ) return ; for ( int i = <NUM_LIT:0> , max = types . length ; i < max ; i ++ ) { ReferenceBinding actualType = typeToRecord ( types [ i ] ) ; if ( actualType != null && ! this . referencedTypes . containsIdentical ( actualType ) ) this . referencedTypes . add ( actualType ) ; } } Binding resolveSingleImport ( ImportBinding importBinding , int mask ) { if ( importBinding . resolvedImport == null ) { importBinding . resolvedImport = findSingleImport ( importBinding . compoundName , mask , importBinding . isStatic ( ) ) ; if ( ! importBinding . resolvedImport . isValidBinding ( ) || importBinding . resolvedImport instanceof PackageBinding ) { if ( importBinding . resolvedImport . problemId ( ) == ProblemReasons . Ambiguous ) return importBinding . resolvedImport ; if ( this . imports != null ) { ImportBinding [ ] newImports = new ImportBinding [ this . imports . length - <NUM_LIT:1> ] ; for ( int i = <NUM_LIT:0> , n = <NUM_LIT:0> , max = this . imports . length ; i < max ; i ++ ) if ( this . imports [ i ] != importBinding ) newImports [ n ++ ] = this . imports [ i ] ; this . imports = newImports ; } return null ; } } return importBinding . resolvedImport ; } public void storeDependencyInfo ( ) { for ( int i = <NUM_LIT:0> ; i < this . referencedSuperTypes . size ; i ++ ) { ReferenceBinding type = ( ReferenceBinding ) this . referencedSuperTypes . elementAt ( i ) ; if ( ! this . referencedTypes . containsIdentical ( type ) ) this . referencedTypes . add ( type ) ; if ( ! type . isLocalType ( ) ) { ReferenceBinding enclosing = type . enclosingType ( ) ; if ( enclosing != null ) recordSuperTypeReference ( enclosing ) ; } ReferenceBinding superclass = type . superclass ( ) ; if ( superclass != null ) recordSuperTypeReference ( superclass ) ; ReferenceBinding [ ] interfaces = type . superInterfaces ( ) ; if ( interfaces != null ) for ( int j = <NUM_LIT:0> , length = interfaces . length ; j < length ; j ++ ) recordSuperTypeReference ( interfaces [ j ] ) ; } for ( int i = <NUM_LIT:0> , l = this . referencedTypes . size ; i < l ; i ++ ) { ReferenceBinding type = ( ReferenceBinding ) this . referencedTypes . elementAt ( i ) ; if ( ! type . isLocalType ( ) ) recordQualifiedReference ( type . isMemberType ( ) ? CharOperation . splitOn ( '<CHAR_LIT:.>' , type . readableName ( ) ) : type . compoundName ) ; } int size = this . qualifiedReferences . size ; char [ ] [ ] [ ] qualifiedRefs = new char [ size ] [ ] [ ] ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) qualifiedRefs [ i ] = this . qualifiedReferences . elementAt ( i ) ; this . referenceContext . compilationResult . qualifiedReferences = qualifiedRefs ; size = this . simpleNameReferences . size ; char [ ] [ ] simpleRefs = new char [ size ] [ ] ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) simpleRefs [ i ] = this . simpleNameReferences . elementAt ( i ) ; this . referenceContext . compilationResult . simpleNameReferences = simpleRefs ; size = this . rootReferences . size ; char [ ] [ ] rootRefs = new char [ size ] [ ] ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) rootRefs [ i ] = this . rootReferences . elementAt ( i ) ; this . referenceContext . compilationResult . rootReferences = rootRefs ; } public String toString ( ) { return "<STR_LIT>" + new String ( this . referenceContext . getFileName ( ) ) ; } private ReferenceBinding typeToRecord ( TypeBinding type ) { if ( type . isArrayType ( ) ) type = ( ( ArrayBinding ) type ) . leafComponentType ; switch ( type . kind ( ) ) { case Binding . BASE_TYPE : case Binding . TYPE_PARAMETER : case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : return null ; case Binding . PARAMETERIZED_TYPE : case Binding . RAW_TYPE : type = type . erasure ( ) ; } ReferenceBinding refType = ( ReferenceBinding ) type ; if ( refType . isLocalType ( ) ) return null ; return refType ; } public void verifyMethods ( MethodVerifier verifier ) { for ( int i = <NUM_LIT:0> , length = this . topLevelTypes . length ; i < length ; i ++ ) this . topLevelTypes [ i ] . verifyMethods ( verifier ) ; } public void augmentTypeHierarchy ( ) { } public boolean checkTargetCompatibility ( ) { return true ; } public boolean scannerAvailable ( ) { return true ; } public boolean reportInvalidType ( TypeReference typeReference , TypeBinding resolvedType ) { return true ; } protected void reportImportProblem ( ImportReference importReference , Binding importBinding ) { problemReporter ( ) . importProblem ( importReference , importBinding ) ; } public boolean canSeeEverything ( ) { return false ; } public ReferenceBinding selectBinding ( ReferenceBinding temp , ReferenceBinding type , boolean isDeclaredImport ) { return null ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; public class UnresolvedReferenceBinding extends ReferenceBinding { ReferenceBinding resolvedType ; TypeBinding [ ] wrappers ; UnresolvedReferenceBinding ( char [ ] [ ] compoundName , PackageBinding packageBinding ) { this . compoundName = compoundName ; this . sourceName = compoundName [ compoundName . length - <NUM_LIT:1> ] ; this . fPackage = packageBinding ; this . wrappers = null ; } void addWrapper ( TypeBinding wrapper , LookupEnvironment environment ) { if ( this . resolvedType != null ) { wrapper . swapUnresolved ( this , this . resolvedType , environment ) ; return ; } if ( this . wrappers == null ) { this . wrappers = new TypeBinding [ ] { wrapper } ; } else { int length = this . wrappers . length ; System . arraycopy ( this . wrappers , <NUM_LIT:0> , this . wrappers = new TypeBinding [ length + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; this . wrappers [ length ] = wrapper ; } } public String debugName ( ) { return toString ( ) ; } ReferenceBinding resolve ( LookupEnvironment environment , boolean convertGenericToRawType ) { ReferenceBinding targetType = this . resolvedType ; if ( targetType == null ) { targetType = this . fPackage . getType0 ( this . compoundName [ this . compoundName . length - <NUM_LIT:1> ] ) ; if ( targetType == this ) { targetType = environment . askForType ( this . compoundName ) ; } if ( targetType == null || targetType == this ) { if ( ( this . tagBits & TagBits . HasMissingType ) == <NUM_LIT:0> ) { environment . problemReporter . isClassPathCorrect ( this . compoundName , environment . unitBeingCompleted , environment . missingClassFileLocation ) ; } targetType = environment . createMissingType ( null , this . compoundName ) ; } setResolvedType ( targetType , environment ) ; } if ( convertGenericToRawType ) { targetType = ( ReferenceBinding ) environment . convertUnresolvedBinaryToRawType ( targetType ) ; } return targetType ; } void setResolvedType ( ReferenceBinding targetType , LookupEnvironment environment ) { if ( this . resolvedType == targetType ) return ; this . resolvedType = targetType ; if ( this . wrappers != null ) for ( int i = <NUM_LIT:0> , l = this . wrappers . length ; i < l ; i ++ ) this . wrappers [ i ] . swapUnresolved ( this , targetType , environment ) ; environment . updateCaches ( this , targetType ) ; } public String toString ( ) { return "<STR_LIT>" + ( ( this . compoundName != null ) ? CharOperation . toString ( this . compoundName ) : "<STR_LIT>" ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; public class ParameterizedGenericMethodBinding extends ParameterizedMethodBinding implements Substitution { public TypeBinding [ ] typeArguments ; private LookupEnvironment environment ; public boolean inferredReturnType ; public boolean wasInferred ; public boolean isRaw ; private MethodBinding tiebreakMethod ; public static MethodBinding computeCompatibleMethod ( MethodBinding originalMethod , TypeBinding [ ] arguments , Scope scope , InvocationSite invocationSite ) { ParameterizedGenericMethodBinding methodSubstitute ; TypeVariableBinding [ ] typeVariables = originalMethod . typeVariables ; TypeBinding [ ] substitutes = invocationSite . genericTypeArguments ( ) ; TypeBinding [ ] uncheckedArguments = null ; computeSubstitutes : { if ( substitutes != null ) { if ( substitutes . length != typeVariables . length ) { return new ProblemMethodBinding ( originalMethod , originalMethod . selector , substitutes , ProblemReasons . TypeParameterArityMismatch ) ; } methodSubstitute = scope . environment ( ) . createParameterizedGenericMethod ( originalMethod , substitutes ) ; break computeSubstitutes ; } TypeBinding [ ] parameters = originalMethod . parameters ; InferenceContext inferenceContext = new InferenceContext ( originalMethod ) ; methodSubstitute = inferFromArgumentTypes ( scope , originalMethod , arguments , parameters , inferenceContext ) ; if ( methodSubstitute == null ) return null ; if ( inferenceContext . hasUnresolvedTypeArgument ( ) ) { if ( inferenceContext . isUnchecked ) { int length = inferenceContext . substitutes . length ; System . arraycopy ( inferenceContext . substitutes , <NUM_LIT:0> , uncheckedArguments = new TypeBinding [ length ] , <NUM_LIT:0> , length ) ; } if ( methodSubstitute . returnType != TypeBinding . VOID ) { TypeBinding expectedType = invocationSite . expectedType ( ) ; if ( expectedType != null ) { inferenceContext . hasExplicitExpectedType = true ; } else { expectedType = scope . getJavaLangObject ( ) ; } inferenceContext . expectedType = expectedType ; } methodSubstitute = methodSubstitute . inferFromExpectedType ( scope , inferenceContext ) ; if ( methodSubstitute == null ) return null ; } } for ( int i = <NUM_LIT:0> , length = typeVariables . length ; i < length ; i ++ ) { TypeVariableBinding typeVariable = typeVariables [ i ] ; TypeBinding substitute = methodSubstitute . typeArguments [ i ] ; if ( uncheckedArguments != null && uncheckedArguments [ i ] == null ) continue ; switch ( typeVariable . boundCheck ( methodSubstitute , substitute ) ) { case TypeConstants . MISMATCH : int argLength = arguments . length ; TypeBinding [ ] augmentedArguments = new TypeBinding [ argLength + <NUM_LIT:2> ] ; System . arraycopy ( arguments , <NUM_LIT:0> , augmentedArguments , <NUM_LIT:0> , argLength ) ; augmentedArguments [ argLength ] = substitute ; augmentedArguments [ argLength + <NUM_LIT:1> ] = typeVariable ; return new ProblemMethodBinding ( methodSubstitute , originalMethod . selector , augmentedArguments , ProblemReasons . ParameterBoundMismatch ) ; case TypeConstants . UNCHECKED : methodSubstitute . tagBits |= TagBits . HasUncheckedTypeArgumentForBoundCheck ; break ; } } return methodSubstitute ; } private static ParameterizedGenericMethodBinding inferFromArgumentTypes ( Scope scope , MethodBinding originalMethod , TypeBinding [ ] arguments , TypeBinding [ ] parameters , InferenceContext inferenceContext ) { if ( originalMethod . isVarargs ( ) ) { int paramLength = parameters . length ; int minArgLength = paramLength - <NUM_LIT:1> ; int argLength = arguments . length ; for ( int i = <NUM_LIT:0> ; i < minArgLength ; i ++ ) { parameters [ i ] . collectSubstitutes ( scope , arguments [ i ] , inferenceContext , TypeConstants . CONSTRAINT_EXTENDS ) ; if ( inferenceContext . status == InferenceContext . FAILED ) return null ; } if ( minArgLength < argLength ) { TypeBinding varargType = parameters [ minArgLength ] ; TypeBinding lastArgument = arguments [ minArgLength ] ; checkVarargDimension : { if ( paramLength == argLength ) { if ( lastArgument == TypeBinding . NULL ) break checkVarargDimension ; switch ( lastArgument . dimensions ( ) ) { case <NUM_LIT:0> : break ; case <NUM_LIT:1> : if ( ! lastArgument . leafComponentType ( ) . isBaseType ( ) ) break checkVarargDimension ; break ; default : break checkVarargDimension ; } } varargType = ( ( ArrayBinding ) varargType ) . elementsType ( ) ; } for ( int i = minArgLength ; i < argLength ; i ++ ) { varargType . collectSubstitutes ( scope , arguments [ i ] , inferenceContext , TypeConstants . CONSTRAINT_EXTENDS ) ; if ( inferenceContext . status == InferenceContext . FAILED ) return null ; } } } else { int paramLength = parameters . length ; for ( int i = <NUM_LIT:0> ; i < paramLength ; i ++ ) { parameters [ i ] . collectSubstitutes ( scope , arguments [ i ] , inferenceContext , TypeConstants . CONSTRAINT_EXTENDS ) ; if ( inferenceContext . status == InferenceContext . FAILED ) return null ; } } TypeVariableBinding [ ] originalVariables = originalMethod . typeVariables ; if ( ! resolveSubstituteConstraints ( scope , originalVariables , inferenceContext , false ) ) return null ; TypeBinding [ ] inferredSustitutes = inferenceContext . substitutes ; TypeBinding [ ] actualSubstitutes = inferredSustitutes ; for ( int i = <NUM_LIT:0> , varLength = originalVariables . length ; i < varLength ; i ++ ) { if ( inferredSustitutes [ i ] == null ) { if ( actualSubstitutes == inferredSustitutes ) { System . arraycopy ( inferredSustitutes , <NUM_LIT:0> , actualSubstitutes = new TypeBinding [ varLength ] , <NUM_LIT:0> , i ) ; } actualSubstitutes [ i ] = originalVariables [ i ] ; } else if ( actualSubstitutes != inferredSustitutes ) { actualSubstitutes [ i ] = inferredSustitutes [ i ] ; } } ParameterizedGenericMethodBinding paramMethod = scope . environment ( ) . createParameterizedGenericMethod ( originalMethod , actualSubstitutes ) ; return paramMethod ; } private static boolean resolveSubstituteConstraints ( Scope scope , TypeVariableBinding [ ] typeVariables , InferenceContext inferenceContext , boolean considerEXTENDSConstraints ) { TypeBinding [ ] substitutes = inferenceContext . substitutes ; int varLength = typeVariables . length ; nextTypeParameter : for ( int i = <NUM_LIT:0> ; i < varLength ; i ++ ) { TypeVariableBinding current = typeVariables [ i ] ; TypeBinding substitute = substitutes [ i ] ; if ( substitute != null ) continue nextTypeParameter ; TypeBinding [ ] equalSubstitutes = inferenceContext . getSubstitutes ( current , TypeConstants . CONSTRAINT_EQUAL ) ; if ( equalSubstitutes != null ) { nextConstraint : for ( int j = <NUM_LIT:0> , equalLength = equalSubstitutes . length ; j < equalLength ; j ++ ) { TypeBinding equalSubstitute = equalSubstitutes [ j ] ; if ( equalSubstitute == null ) continue nextConstraint ; if ( equalSubstitute == current ) { for ( int k = j + <NUM_LIT:1> ; k < equalLength ; k ++ ) { equalSubstitute = equalSubstitutes [ k ] ; if ( equalSubstitute != current && equalSubstitute != null ) { substitutes [ i ] = equalSubstitute ; continue nextTypeParameter ; } } substitutes [ i ] = current ; continue nextTypeParameter ; } substitutes [ i ] = equalSubstitute ; continue nextTypeParameter ; } } } if ( inferenceContext . hasUnresolvedTypeArgument ( ) ) { nextTypeParameter : for ( int i = <NUM_LIT:0> ; i < varLength ; i ++ ) { TypeVariableBinding current = typeVariables [ i ] ; TypeBinding substitute = substitutes [ i ] ; if ( substitute != null ) continue nextTypeParameter ; TypeBinding [ ] bounds = inferenceContext . getSubstitutes ( current , TypeConstants . CONSTRAINT_SUPER ) ; if ( bounds == null ) continue nextTypeParameter ; TypeBinding mostSpecificSubstitute = scope . lowerUpperBound ( bounds ) ; if ( mostSpecificSubstitute == null ) { return false ; } if ( mostSpecificSubstitute != TypeBinding . VOID ) { substitutes [ i ] = mostSpecificSubstitute ; } } } if ( considerEXTENDSConstraints && inferenceContext . hasUnresolvedTypeArgument ( ) ) { nextTypeParameter : for ( int i = <NUM_LIT:0> ; i < varLength ; i ++ ) { TypeVariableBinding current = typeVariables [ i ] ; TypeBinding substitute = substitutes [ i ] ; if ( substitute != null ) continue nextTypeParameter ; TypeBinding [ ] bounds = inferenceContext . getSubstitutes ( current , TypeConstants . CONSTRAINT_EXTENDS ) ; if ( bounds == null ) continue nextTypeParameter ; TypeBinding [ ] glb = Scope . greaterLowerBound ( bounds ) ; TypeBinding mostSpecificSubstitute = null ; if ( glb != null ) mostSpecificSubstitute = glb [ <NUM_LIT:0> ] ; if ( mostSpecificSubstitute != null ) { substitutes [ i ] = mostSpecificSubstitute ; } } } return true ; } public ParameterizedGenericMethodBinding ( MethodBinding originalMethod , RawTypeBinding rawType , LookupEnvironment environment ) { TypeVariableBinding [ ] originalVariables = originalMethod . typeVariables ; int length = originalVariables . length ; TypeBinding [ ] rawArguments = new TypeBinding [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { rawArguments [ i ] = environment . convertToRawType ( originalVariables [ i ] . erasure ( ) , false ) ; } this . isRaw = true ; this . tagBits = originalMethod . tagBits ; this . environment = environment ; this . modifiers = originalMethod . modifiers ; this . selector = originalMethod . selector ; this . declaringClass = rawType == null ? originalMethod . declaringClass : rawType ; this . typeVariables = Binding . NO_TYPE_VARIABLES ; this . typeArguments = rawArguments ; this . originalMethod = originalMethod ; boolean ignoreRawTypeSubstitution = rawType == null || originalMethod . isStatic ( ) ; this . parameters = Scope . substitute ( this , ignoreRawTypeSubstitution ? originalMethod . parameters : Scope . substitute ( rawType , originalMethod . parameters ) ) ; this . thrownExceptions = Scope . substitute ( this , ignoreRawTypeSubstitution ? originalMethod . thrownExceptions : Scope . substitute ( rawType , originalMethod . thrownExceptions ) ) ; if ( this . thrownExceptions == null ) this . thrownExceptions = Binding . NO_EXCEPTIONS ; this . returnType = Scope . substitute ( this , ignoreRawTypeSubstitution ? originalMethod . returnType : Scope . substitute ( rawType , originalMethod . returnType ) ) ; this . wasInferred = false ; } public ParameterizedGenericMethodBinding ( MethodBinding originalMethod , TypeBinding [ ] typeArguments , LookupEnvironment environment ) { this . environment = environment ; this . modifiers = originalMethod . modifiers ; this . selector = originalMethod . selector ; this . declaringClass = originalMethod . declaringClass ; this . typeVariables = Binding . NO_TYPE_VARIABLES ; this . typeArguments = typeArguments ; this . isRaw = false ; this . tagBits = originalMethod . tagBits ; this . originalMethod = originalMethod ; this . parameters = Scope . substitute ( this , originalMethod . parameters ) ; this . returnType = Scope . substitute ( this , originalMethod . returnType ) ; this . thrownExceptions = Scope . substitute ( this , originalMethod . thrownExceptions ) ; if ( this . thrownExceptions == null ) this . thrownExceptions = Binding . NO_EXCEPTIONS ; checkMissingType : { if ( ( this . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) break checkMissingType ; if ( ( this . returnType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . HasMissingType ; break checkMissingType ; } for ( int i = <NUM_LIT:0> , max = this . parameters . length ; i < max ; i ++ ) { if ( ( this . parameters [ i ] . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . HasMissingType ; break checkMissingType ; } } for ( int i = <NUM_LIT:0> , max = this . thrownExceptions . length ; i < max ; i ++ ) { if ( ( this . thrownExceptions [ i ] . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . HasMissingType ; break checkMissingType ; } } } this . wasInferred = true ; } public char [ ] computeUniqueKey ( boolean isLeaf ) { StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( this . originalMethod . computeUniqueKey ( false ) ) ; buffer . append ( '<CHAR_LIT>' ) ; buffer . append ( '<CHAR_LIT>' ) ; if ( ! this . isRaw ) { int length = this . typeArguments . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeBinding typeArgument = this . typeArguments [ i ] ; buffer . append ( typeArgument . computeUniqueKey ( false ) ) ; } } buffer . append ( '<CHAR_LIT:>>' ) ; int resultLength = buffer . length ( ) ; char [ ] result = new char [ resultLength ] ; buffer . getChars ( <NUM_LIT:0> , resultLength , result , <NUM_LIT:0> ) ; return result ; } public LookupEnvironment environment ( ) { return this . environment ; } public boolean hasSubstitutedParameters ( ) { if ( this . wasInferred ) return this . originalMethod . hasSubstitutedParameters ( ) ; return super . hasSubstitutedParameters ( ) ; } public boolean hasSubstitutedReturnType ( ) { if ( this . inferredReturnType ) return this . originalMethod . hasSubstitutedReturnType ( ) ; return super . hasSubstitutedReturnType ( ) ; } private ParameterizedGenericMethodBinding inferFromExpectedType ( Scope scope , InferenceContext inferenceContext ) { TypeVariableBinding [ ] originalVariables = this . originalMethod . typeVariables ; int varLength = originalVariables . length ; if ( inferenceContext . expectedType != null ) { this . returnType . collectSubstitutes ( scope , inferenceContext . expectedType , inferenceContext , TypeConstants . CONSTRAINT_SUPER ) ; if ( inferenceContext . status == InferenceContext . FAILED ) return null ; } for ( int i = <NUM_LIT:0> ; i < varLength ; i ++ ) { TypeVariableBinding originalVariable = originalVariables [ i ] ; TypeBinding argument = this . typeArguments [ i ] ; boolean argAlreadyInferred = argument != originalVariable ; if ( originalVariable . firstBound == originalVariable . superclass ) { TypeBinding substitutedBound = Scope . substitute ( this , originalVariable . superclass ) ; argument . collectSubstitutes ( scope , substitutedBound , inferenceContext , TypeConstants . CONSTRAINT_SUPER ) ; if ( inferenceContext . status == InferenceContext . FAILED ) return null ; if ( argAlreadyInferred ) { substitutedBound . collectSubstitutes ( scope , argument , inferenceContext , TypeConstants . CONSTRAINT_EXTENDS ) ; if ( inferenceContext . status == InferenceContext . FAILED ) return null ; } } for ( int j = <NUM_LIT:0> , max = originalVariable . superInterfaces . length ; j < max ; j ++ ) { TypeBinding substitutedBound = Scope . substitute ( this , originalVariable . superInterfaces [ j ] ) ; argument . collectSubstitutes ( scope , substitutedBound , inferenceContext , TypeConstants . CONSTRAINT_SUPER ) ; if ( inferenceContext . status == InferenceContext . FAILED ) return null ; if ( argAlreadyInferred ) { substitutedBound . collectSubstitutes ( scope , argument , inferenceContext , TypeConstants . CONSTRAINT_EXTENDS ) ; if ( inferenceContext . status == InferenceContext . FAILED ) return null ; } } } if ( ! resolveSubstituteConstraints ( scope , originalVariables , inferenceContext , true ) ) return null ; for ( int i = <NUM_LIT:0> ; i < varLength ; i ++ ) { TypeBinding substitute = inferenceContext . substitutes [ i ] ; if ( substitute != null ) { this . typeArguments [ i ] = inferenceContext . substitutes [ i ] ; } else { this . typeArguments [ i ] = originalVariables [ i ] . upperBound ( ) ; } } this . typeArguments = Scope . substitute ( this , this . typeArguments ) ; TypeBinding oldReturnType = this . returnType ; this . returnType = Scope . substitute ( this , this . returnType ) ; this . inferredReturnType = inferenceContext . hasExplicitExpectedType && this . returnType != oldReturnType ; this . parameters = Scope . substitute ( this , this . parameters ) ; this . thrownExceptions = Scope . substitute ( this , this . thrownExceptions ) ; if ( this . thrownExceptions == null ) this . thrownExceptions = Binding . NO_EXCEPTIONS ; checkMissingType : { if ( ( this . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) break checkMissingType ; if ( ( this . returnType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . HasMissingType ; break checkMissingType ; } for ( int i = <NUM_LIT:0> , max = this . parameters . length ; i < max ; i ++ ) { if ( ( this . parameters [ i ] . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . HasMissingType ; break checkMissingType ; } } for ( int i = <NUM_LIT:0> , max = this . thrownExceptions . length ; i < max ; i ++ ) { if ( ( this . thrownExceptions [ i ] . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . HasMissingType ; break checkMissingType ; } } } return this ; } public boolean isRawSubstitution ( ) { return this . isRaw ; } public TypeBinding substitute ( TypeVariableBinding originalVariable ) { TypeVariableBinding [ ] variables = this . originalMethod . typeVariables ; int length = variables . length ; if ( originalVariable . rank < length && variables [ originalVariable . rank ] == originalVariable ) { return this . typeArguments [ originalVariable . rank ] ; } return originalVariable ; } public MethodBinding tiebreakMethod ( ) { if ( this . tiebreakMethod == null ) this . tiebreakMethod = this . originalMethod . asRawMethod ( this . environment ) ; return this . tiebreakMethod ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; public class AnnotationHolder { AnnotationBinding [ ] annotations ; static AnnotationHolder storeAnnotations ( AnnotationBinding [ ] annotations , AnnotationBinding [ ] [ ] parameterAnnotations , Object defaultValue , LookupEnvironment optionalEnv ) { if ( parameterAnnotations != null ) { boolean isEmpty = true ; for ( int i = parameterAnnotations . length ; isEmpty && -- i >= <NUM_LIT:0> ; ) if ( parameterAnnotations [ i ] != null && parameterAnnotations [ i ] . length > <NUM_LIT:0> ) isEmpty = false ; if ( isEmpty ) parameterAnnotations = null ; } if ( defaultValue != null ) return new AnnotationMethodHolder ( annotations , parameterAnnotations , defaultValue , optionalEnv ) ; if ( parameterAnnotations != null ) return new MethodHolder ( annotations , parameterAnnotations ) ; return new AnnotationHolder ( ) . setAnnotations ( annotations ) ; } AnnotationBinding [ ] getAnnotations ( ) { return this . annotations ; } Object getDefaultValue ( ) { return null ; } public AnnotationBinding [ ] [ ] getParameterAnnotations ( ) { return null ; } AnnotationBinding [ ] getParameterAnnotations ( int paramIndex ) { return Binding . NO_ANNOTATIONS ; } AnnotationHolder setAnnotations ( AnnotationBinding [ ] annotations ) { if ( annotations == null || annotations . length == <NUM_LIT:0> ) return null ; this . annotations = annotations ; return this ; } static class MethodHolder extends AnnotationHolder { AnnotationBinding [ ] [ ] parameterAnnotations ; MethodHolder ( AnnotationBinding [ ] annotations , AnnotationBinding [ ] [ ] parameterAnnotations ) { super ( ) ; setAnnotations ( annotations ) ; this . parameterAnnotations = parameterAnnotations ; } public AnnotationBinding [ ] [ ] getParameterAnnotations ( ) { return this . parameterAnnotations ; } AnnotationBinding [ ] getParameterAnnotations ( int paramIndex ) { AnnotationBinding [ ] result = this . parameterAnnotations == null ? null : this . parameterAnnotations [ paramIndex ] ; return result == null ? Binding . NO_ANNOTATIONS : result ; } AnnotationHolder setAnnotations ( AnnotationBinding [ ] annotations ) { this . annotations = annotations == null || annotations . length == <NUM_LIT:0> ? Binding . NO_ANNOTATIONS : annotations ; return this ; } } static class AnnotationMethodHolder extends MethodHolder { Object defaultValue ; LookupEnvironment env ; AnnotationMethodHolder ( AnnotationBinding [ ] annotations , AnnotationBinding [ ] [ ] parameterAnnotations , Object defaultValue , LookupEnvironment optionalEnv ) { super ( annotations , parameterAnnotations ) ; this . defaultValue = defaultValue ; this . env = optionalEnv ; } Object getDefaultValue ( ) { if ( this . defaultValue instanceof UnresolvedReferenceBinding ) { if ( this . env == null ) throw new IllegalStateException ( ) ; this . defaultValue = ( ( UnresolvedReferenceBinding ) this . defaultValue ) . resolve ( this . env , false ) ; } return this . defaultValue ; } } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . * ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . codegen . CodeStream ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . problem . ProblemReporter ; public class BlockScope extends Scope { public LocalVariableBinding [ ] locals ; public int localIndex ; public int startIndex ; public int offset ; public int maxOffset ; public BlockScope [ ] shiftScopes ; public Scope [ ] subscopes = new Scope [ <NUM_LIT:1> ] ; public int subscopeCount = <NUM_LIT:0> ; public CaseStatement enclosingCase ; public final static VariableBinding [ ] EmulationPathToImplicitThis = { } ; public final static VariableBinding [ ] NoEnclosingInstanceInConstructorCall = { } ; public final static VariableBinding [ ] NoEnclosingInstanceInStaticContext = { } ; public BlockScope ( BlockScope parent ) { this ( parent , true ) ; } public BlockScope ( BlockScope parent , boolean addToParentScope ) { this ( Scope . BLOCK_SCOPE , parent ) ; this . locals = new LocalVariableBinding [ <NUM_LIT:5> ] ; if ( addToParentScope ) parent . addSubscope ( this ) ; this . startIndex = parent . localIndex ; } public BlockScope ( BlockScope parent , int variableCount ) { this ( Scope . BLOCK_SCOPE , parent ) ; this . locals = new LocalVariableBinding [ variableCount ] ; parent . addSubscope ( this ) ; this . startIndex = parent . localIndex ; } protected BlockScope ( int kind , Scope parent ) { super ( kind , parent ) ; } public final void addAnonymousType ( TypeDeclaration anonymousType , ReferenceBinding superBinding ) { ClassScope anonymousClassScope = new ClassScope ( this , anonymousType ) ; anonymousClassScope . buildAnonymousTypeBinding ( enclosingSourceType ( ) , superBinding ) ; } public final void addLocalType ( TypeDeclaration localType ) { ClassScope localTypeScope = new ClassScope ( this , localType ) ; addSubscope ( localTypeScope ) ; localTypeScope . buildLocalTypeBinding ( enclosingSourceType ( ) ) ; } public final void addLocalVariable ( LocalVariableBinding binding ) { checkAndSetModifiersForVariable ( binding ) ; if ( this . localIndex == this . locals . length ) System . arraycopy ( this . locals , <NUM_LIT:0> , ( this . locals = new LocalVariableBinding [ this . localIndex * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . localIndex ) ; this . locals [ this . localIndex ++ ] = binding ; binding . declaringScope = this ; binding . id = outerMostMethodScope ( ) . analysisIndex ++ ; } public void addSubscope ( Scope childScope ) { if ( this . subscopeCount == this . subscopes . length ) System . arraycopy ( this . subscopes , <NUM_LIT:0> , ( this . subscopes = new Scope [ this . subscopeCount * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . subscopeCount ) ; this . subscopes [ this . subscopeCount ++ ] = childScope ; } public final boolean allowBlankFinalFieldAssignment ( FieldBinding binding ) { if ( enclosingReceiverType ( ) != binding . declaringClass ) return false ; MethodScope methodScope = methodScope ( ) ; if ( methodScope . isStatic != binding . isStatic ( ) ) return false ; return methodScope . isInsideInitializer ( ) || ( ( AbstractMethodDeclaration ) methodScope . referenceContext ) . isInitializationMethod ( ) ; } String basicToString ( int tab ) { String newLine = "<STR_LIT:n>" ; for ( int i = tab ; -- i >= <NUM_LIT:0> ; ) newLine += "<STR_LIT:t>" ; String s = newLine + "<STR_LIT>" ; newLine += "<STR_LIT:t>" ; s += newLine + "<STR_LIT>" ; for ( int i = <NUM_LIT:0> ; i < this . localIndex ; i ++ ) s += newLine + "<STR_LIT:t>" + this . locals [ i ] . toString ( ) ; s += newLine + "<STR_LIT>" + this . startIndex ; return s ; } private void checkAndSetModifiersForVariable ( LocalVariableBinding varBinding ) { int modifiers = varBinding . modifiers ; if ( ( modifiers & ExtraCompilerModifiers . AccAlternateModifierProblem ) != <NUM_LIT:0> && varBinding . declaration != null ) { problemReporter ( ) . duplicateModifierForVariable ( varBinding . declaration , this instanceof MethodScope ) ; } int realModifiers = modifiers & ExtraCompilerModifiers . AccJustFlag ; int unexpectedModifiers = ~ ClassFileConstants . AccFinal ; if ( ( realModifiers & unexpectedModifiers ) != <NUM_LIT:0> && varBinding . declaration != null ) { problemReporter ( ) . illegalModifierForVariable ( varBinding . declaration , this instanceof MethodScope ) ; } varBinding . modifiers = modifiers ; } void computeLocalVariablePositions ( int ilocal , int initOffset , CodeStream codeStream ) { this . offset = initOffset ; this . maxOffset = initOffset ; int maxLocals = this . localIndex ; boolean hasMoreVariables = ilocal < maxLocals ; int iscope = <NUM_LIT:0> , maxScopes = this . subscopeCount ; boolean hasMoreScopes = maxScopes > <NUM_LIT:0> ; while ( hasMoreVariables || hasMoreScopes ) { if ( hasMoreScopes && ( ! hasMoreVariables || ( this . subscopes [ iscope ] . startIndex ( ) <= ilocal ) ) ) { if ( this . subscopes [ iscope ] instanceof BlockScope ) { BlockScope subscope = ( BlockScope ) this . subscopes [ iscope ] ; int subOffset = subscope . shiftScopes == null ? this . offset : subscope . maxShiftedOffset ( ) ; subscope . computeLocalVariablePositions ( <NUM_LIT:0> , subOffset , codeStream ) ; if ( subscope . maxOffset > this . maxOffset ) this . maxOffset = subscope . maxOffset ; } hasMoreScopes = ++ iscope < maxScopes ; } else { LocalVariableBinding local = this . locals [ ilocal ] ; boolean generateCurrentLocalVar = ( local . useFlag != LocalVariableBinding . UNUSED && local . constant ( ) == Constant . NotAConstant ) ; if ( local . useFlag == LocalVariableBinding . UNUSED && ( local . declaration != null ) && ( ( local . declaration . bits & ASTNode . IsLocalDeclarationReachable ) != <NUM_LIT:0> ) ) { if ( ! ( local . declaration instanceof Argument ) ) problemReporter ( ) . unusedLocalVariable ( local . declaration ) ; } if ( ! generateCurrentLocalVar ) { if ( local . declaration != null && compilerOptions ( ) . preserveAllLocalVariables ) { generateCurrentLocalVar = true ; local . useFlag = LocalVariableBinding . USED ; } } if ( generateCurrentLocalVar ) { if ( local . declaration != null ) { codeStream . record ( local ) ; } local . resolvedPosition = this . offset ; if ( ( local . type == TypeBinding . LONG ) || ( local . type == TypeBinding . DOUBLE ) ) { this . offset += <NUM_LIT:2> ; } else { this . offset ++ ; } if ( this . offset > <NUM_LIT> ) { problemReporter ( ) . noMoreAvailableSpaceForLocal ( local , local . declaration == null ? ( ASTNode ) methodScope ( ) . referenceContext : local . declaration ) ; } } else { local . resolvedPosition = - <NUM_LIT:1> ; } hasMoreVariables = ++ ilocal < maxLocals ; } } if ( this . offset > this . maxOffset ) this . maxOffset = this . offset ; } public void emulateOuterAccess ( LocalVariableBinding outerLocalVariable ) { BlockScope outerVariableScope = outerLocalVariable . declaringScope ; if ( outerVariableScope == null ) return ; MethodScope currentMethodScope = methodScope ( ) ; if ( outerVariableScope . methodScope ( ) != currentMethodScope ) { NestedTypeBinding currentType = ( NestedTypeBinding ) enclosingSourceType ( ) ; if ( ! currentType . isLocalType ( ) ) { return ; } if ( ! currentMethodScope . isInsideInitializerOrConstructor ( ) ) { currentType . addSyntheticArgumentAndField ( outerLocalVariable ) ; } else { currentType . addSyntheticArgument ( outerLocalVariable ) ; } } } public final ReferenceBinding findLocalType ( char [ ] name ) { long compliance = compilerOptions ( ) . complianceLevel ; for ( int i = this . subscopeCount - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) { if ( this . subscopes [ i ] instanceof ClassScope ) { LocalTypeBinding sourceType = ( LocalTypeBinding ) ( ( ClassScope ) this . subscopes [ i ] ) . referenceContext . binding ; if ( compliance >= ClassFileConstants . JDK1_4 && sourceType . enclosingCase != null ) { if ( ! isInsideCase ( sourceType . enclosingCase ) ) { continue ; } } if ( CharOperation . equals ( sourceType . sourceName ( ) , name ) ) return sourceType ; } } return null ; } public LocalDeclaration [ ] findLocalVariableDeclarations ( int position ) { int ilocal = <NUM_LIT:0> , maxLocals = this . localIndex ; boolean hasMoreVariables = maxLocals > <NUM_LIT:0> ; LocalDeclaration [ ] localDeclarations = null ; int declPtr = <NUM_LIT:0> ; int iscope = <NUM_LIT:0> , maxScopes = this . subscopeCount ; boolean hasMoreScopes = maxScopes > <NUM_LIT:0> ; while ( hasMoreVariables || hasMoreScopes ) { if ( hasMoreScopes && ( ! hasMoreVariables || ( this . subscopes [ iscope ] . startIndex ( ) <= ilocal ) ) ) { Scope subscope = this . subscopes [ iscope ] ; if ( subscope . kind == Scope . BLOCK_SCOPE ) { localDeclarations = ( ( BlockScope ) subscope ) . findLocalVariableDeclarations ( position ) ; if ( localDeclarations != null ) { return localDeclarations ; } } hasMoreScopes = ++ iscope < maxScopes ; } else { LocalVariableBinding local = this . locals [ ilocal ] ; if ( local != null ) { LocalDeclaration localDecl = local . declaration ; if ( localDecl != null ) { if ( localDecl . declarationSourceStart <= position ) { if ( position <= localDecl . declarationSourceEnd ) { if ( localDeclarations == null ) { localDeclarations = new LocalDeclaration [ maxLocals ] ; } localDeclarations [ declPtr ++ ] = localDecl ; } } else { return localDeclarations ; } } } hasMoreVariables = ++ ilocal < maxLocals ; if ( ! hasMoreVariables && localDeclarations != null ) { return localDeclarations ; } } } return null ; } public LocalVariableBinding findVariable ( char [ ] variableName ) { int varLength = variableName . length ; for ( int i = this . localIndex - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) { LocalVariableBinding local ; char [ ] localName ; if ( ( localName = ( local = this . locals [ i ] ) . name ) . length == varLength && CharOperation . equals ( localName , variableName ) ) return local ; } return null ; } public Binding getBinding ( char [ ] [ ] compoundName , int mask , InvocationSite invocationSite , boolean needResolve ) { Binding binding = getBinding ( compoundName [ <NUM_LIT:0> ] , mask | Binding . TYPE | Binding . PACKAGE , invocationSite , needResolve ) ; invocationSite . setFieldIndex ( <NUM_LIT:1> ) ; if ( binding instanceof VariableBinding ) return binding ; CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( compoundName ) ; if ( ! binding . isValidBinding ( ) ) return binding ; int length = compoundName . length ; int currentIndex = <NUM_LIT:1> ; foundType : if ( binding instanceof PackageBinding ) { PackageBinding packageBinding = ( PackageBinding ) binding ; while ( currentIndex < length ) { unitScope . recordReference ( packageBinding . compoundName , compoundName [ currentIndex ] ) ; binding = packageBinding . getTypeOrPackage ( compoundName [ currentIndex ++ ] ) ; invocationSite . setFieldIndex ( currentIndex ) ; if ( binding == null ) { if ( currentIndex == length ) { return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , null , ProblemReasons . NotFound ) ; } return new ProblemBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , ProblemReasons . NotFound ) ; } if ( binding instanceof ReferenceBinding ) { if ( ! binding . isValidBinding ( ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , ( ReferenceBinding ) ( ( ReferenceBinding ) binding ) . closestMatch ( ) , binding . problemId ( ) ) ; if ( ! ( ( ReferenceBinding ) binding ) . canBeSeenBy ( this ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , ( ReferenceBinding ) binding , ProblemReasons . NotVisible ) ; break foundType ; } packageBinding = ( PackageBinding ) binding ; } return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , null , ProblemReasons . NotFound ) ; } ReferenceBinding referenceBinding = ( ReferenceBinding ) binding ; binding = environment ( ) . convertToRawType ( referenceBinding , false ) ; if ( invocationSite instanceof ASTNode ) { ASTNode invocationNode = ( ASTNode ) invocationSite ; if ( invocationNode . isTypeUseDeprecated ( referenceBinding , this ) ) { problemReporter ( ) . deprecatedType ( referenceBinding , invocationNode ) ; } } while ( currentIndex < length ) { referenceBinding = ( ReferenceBinding ) binding ; char [ ] nextName = compoundName [ currentIndex ++ ] ; invocationSite . setFieldIndex ( currentIndex ) ; invocationSite . setActualReceiverType ( referenceBinding ) ; if ( ( mask & Binding . FIELD ) != <NUM_LIT:0> && ( binding = findField ( referenceBinding , nextName , invocationSite , true ) ) != null ) { if ( ! binding . isValidBinding ( ) ) { return new ProblemFieldBinding ( ( ( ProblemFieldBinding ) binding ) . closestMatch , ( ( ProblemFieldBinding ) binding ) . declaringClass , CharOperation . concatWith ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , '<CHAR_LIT:.>' ) , binding . problemId ( ) ) ; } break ; } if ( ( binding = findMemberType ( nextName , referenceBinding ) ) == null ) { if ( ( mask & Binding . FIELD ) != <NUM_LIT:0> ) { return new ProblemFieldBinding ( null , referenceBinding , nextName , ProblemReasons . NotFound ) ; } else if ( ( mask & Binding . VARIABLE ) != <NUM_LIT:0> ) { return new ProblemBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , referenceBinding , ProblemReasons . NotFound ) ; } return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , referenceBinding , ProblemReasons . NotFound ) ; } if ( ! binding . isValidBinding ( ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , ( ReferenceBinding ) ( ( ReferenceBinding ) binding ) . closestMatch ( ) , binding . problemId ( ) ) ; if ( invocationSite instanceof ASTNode ) { referenceBinding = ( ReferenceBinding ) binding ; ASTNode invocationNode = ( ASTNode ) invocationSite ; if ( invocationNode . isTypeUseDeprecated ( referenceBinding , this ) ) { problemReporter ( ) . deprecatedType ( referenceBinding , invocationNode ) ; } } } if ( ( mask & Binding . FIELD ) != <NUM_LIT:0> && ( binding instanceof FieldBinding ) ) { FieldBinding field = ( FieldBinding ) binding ; if ( ! field . isStatic ( ) ) return new ProblemFieldBinding ( field , field . declaringClass , CharOperation . concatWith ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , '<CHAR_LIT:.>' ) , ProblemReasons . NonStaticReferenceInStaticContext ) ; return binding ; } if ( ( mask & Binding . TYPE ) != <NUM_LIT:0> && ( binding instanceof ReferenceBinding ) ) { return binding ; } return new ProblemBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , ProblemReasons . NotFound ) ; } public final Binding getBinding ( char [ ] [ ] compoundName , InvocationSite invocationSite ) { int currentIndex = <NUM_LIT:0> ; int length = compoundName . length ; Binding binding = getBinding ( compoundName [ currentIndex ++ ] , Binding . VARIABLE | Binding . TYPE | Binding . PACKAGE , invocationSite , true ) ; if ( ! binding . isValidBinding ( ) ) return binding ; foundType : if ( binding instanceof PackageBinding ) { while ( currentIndex < length ) { PackageBinding packageBinding = ( PackageBinding ) binding ; binding = packageBinding . getTypeOrPackage ( compoundName [ currentIndex ++ ] ) ; if ( binding == null ) { if ( currentIndex == length ) { return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , null , ProblemReasons . NotFound ) ; } return new ProblemBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , ProblemReasons . NotFound ) ; } if ( binding instanceof ReferenceBinding ) { if ( ! binding . isValidBinding ( ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , ( ReferenceBinding ) ( ( ReferenceBinding ) binding ) . closestMatch ( ) , binding . problemId ( ) ) ; if ( ! ( ( ReferenceBinding ) binding ) . canBeSeenBy ( this ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , ( ReferenceBinding ) binding , ProblemReasons . NotVisible ) ; break foundType ; } } return binding ; } foundField : if ( binding instanceof ReferenceBinding ) { while ( currentIndex < length ) { ReferenceBinding typeBinding = ( ReferenceBinding ) binding ; char [ ] nextName = compoundName [ currentIndex ++ ] ; TypeBinding receiverType = typeBinding . capture ( this , invocationSite . sourceEnd ( ) ) ; if ( ( binding = findField ( receiverType , nextName , invocationSite , true ) ) != null ) { if ( ! binding . isValidBinding ( ) ) { return new ProblemFieldBinding ( ( FieldBinding ) binding , ( ( FieldBinding ) binding ) . declaringClass , CharOperation . concatWith ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , '<CHAR_LIT:.>' ) , binding . problemId ( ) ) ; } if ( ! ( ( FieldBinding ) binding ) . isStatic ( ) ) return new ProblemFieldBinding ( ( FieldBinding ) binding , ( ( FieldBinding ) binding ) . declaringClass , CharOperation . concatWith ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , '<CHAR_LIT:.>' ) , ProblemReasons . NonStaticReferenceInStaticContext ) ; break foundField ; } if ( ( binding = findMemberType ( nextName , typeBinding ) ) == null ) { return new ProblemBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , typeBinding , ProblemReasons . NotFound ) ; } if ( ! binding . isValidBinding ( ) ) { return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , ( ReferenceBinding ) ( ( ReferenceBinding ) binding ) . closestMatch ( ) , binding . problemId ( ) ) ; } } return binding ; } VariableBinding variableBinding = ( VariableBinding ) binding ; while ( currentIndex < length ) { TypeBinding typeBinding = variableBinding . type ; if ( typeBinding == null ) { return new ProblemFieldBinding ( null , null , CharOperation . concatWith ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , '<CHAR_LIT:.>' ) , ProblemReasons . NotFound ) ; } TypeBinding receiverType = typeBinding . capture ( this , invocationSite . sourceEnd ( ) ) ; variableBinding = findField ( receiverType , compoundName [ currentIndex ++ ] , invocationSite , true ) ; if ( variableBinding == null ) { return new ProblemFieldBinding ( null , receiverType instanceof ReferenceBinding ? ( ReferenceBinding ) receiverType : null , CharOperation . concatWith ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , '<CHAR_LIT:.>' ) , ProblemReasons . NotFound ) ; } if ( ! variableBinding . isValidBinding ( ) ) return variableBinding ; } return variableBinding ; } public VariableBinding [ ] getEmulationPath ( LocalVariableBinding outerLocalVariable ) { MethodScope currentMethodScope = methodScope ( ) ; SourceTypeBinding sourceType = currentMethodScope . enclosingSourceType ( ) ; BlockScope variableScope = outerLocalVariable . declaringScope ; if ( variableScope == null || currentMethodScope == variableScope . methodScope ( ) ) { return new VariableBinding [ ] { outerLocalVariable } ; } if ( currentMethodScope . isInsideInitializerOrConstructor ( ) && ( sourceType . isNestedType ( ) ) ) { SyntheticArgumentBinding syntheticArg ; if ( ( syntheticArg = ( ( NestedTypeBinding ) sourceType ) . getSyntheticArgument ( outerLocalVariable ) ) != null ) { return new VariableBinding [ ] { syntheticArg } ; } } if ( ! currentMethodScope . isStatic ) { FieldBinding syntheticField ; if ( ( syntheticField = sourceType . getSyntheticField ( outerLocalVariable ) ) != null ) { return new VariableBinding [ ] { syntheticField } ; } } return null ; } public Object [ ] getEmulationPath ( ReferenceBinding targetEnclosingType , boolean onlyExactMatch , boolean denyEnclosingArgInConstructorCall ) { MethodScope currentMethodScope = methodScope ( ) ; SourceTypeBinding sourceType = currentMethodScope . enclosingSourceType ( ) ; if ( ! currentMethodScope . isStatic && ! currentMethodScope . isConstructorCall ) { if ( sourceType == targetEnclosingType || ( ! onlyExactMatch && sourceType . findSuperTypeOriginatingFrom ( targetEnclosingType ) != null ) ) { return BlockScope . EmulationPathToImplicitThis ; } } if ( ! sourceType . isNestedType ( ) || sourceType . isStatic ( ) ) { if ( currentMethodScope . isConstructorCall ) { return BlockScope . NoEnclosingInstanceInConstructorCall ; } else if ( currentMethodScope . isStatic ) { return BlockScope . NoEnclosingInstanceInStaticContext ; } return null ; } boolean insideConstructor = currentMethodScope . isInsideInitializerOrConstructor ( ) ; if ( insideConstructor ) { SyntheticArgumentBinding syntheticArg ; if ( ( syntheticArg = ( ( NestedTypeBinding ) sourceType ) . getSyntheticArgument ( targetEnclosingType , onlyExactMatch ) ) != null ) { if ( denyEnclosingArgInConstructorCall && currentMethodScope . isConstructorCall && ( sourceType == targetEnclosingType || ( ! onlyExactMatch && sourceType . findSuperTypeOriginatingFrom ( targetEnclosingType ) != null ) ) ) { return BlockScope . NoEnclosingInstanceInConstructorCall ; } return new Object [ ] { syntheticArg } ; } } if ( currentMethodScope . isStatic ) { return BlockScope . NoEnclosingInstanceInStaticContext ; } if ( sourceType . isAnonymousType ( ) ) { ReferenceBinding enclosingType = sourceType . enclosingType ( ) ; if ( enclosingType . isNestedType ( ) ) { NestedTypeBinding nestedEnclosingType = ( NestedTypeBinding ) enclosingType ; SyntheticArgumentBinding enclosingArgument = nestedEnclosingType . getSyntheticArgument ( nestedEnclosingType . enclosingType ( ) , onlyExactMatch ) ; if ( enclosingArgument != null ) { FieldBinding syntheticField = sourceType . getSyntheticField ( enclosingArgument ) ; if ( syntheticField != null ) { if ( syntheticField . type == targetEnclosingType || ( ! onlyExactMatch && ( ( ReferenceBinding ) syntheticField . type ) . findSuperTypeOriginatingFrom ( targetEnclosingType ) != null ) ) return new Object [ ] { syntheticField } ; } } } } FieldBinding syntheticField = sourceType . getSyntheticField ( targetEnclosingType , onlyExactMatch ) ; if ( syntheticField != null ) { if ( currentMethodScope . isConstructorCall ) { return BlockScope . NoEnclosingInstanceInConstructorCall ; } return new Object [ ] { syntheticField } ; } Object [ ] path = new Object [ <NUM_LIT:2> ] ; ReferenceBinding currentType = sourceType . enclosingType ( ) ; if ( insideConstructor ) { path [ <NUM_LIT:0> ] = ( ( NestedTypeBinding ) sourceType ) . getSyntheticArgument ( currentType , onlyExactMatch ) ; } else { if ( currentMethodScope . isConstructorCall ) { return BlockScope . NoEnclosingInstanceInConstructorCall ; } path [ <NUM_LIT:0> ] = sourceType . getSyntheticField ( currentType , onlyExactMatch ) ; } if ( path [ <NUM_LIT:0> ] != null ) { int count = <NUM_LIT:1> ; ReferenceBinding currentEnclosingType ; while ( ( currentEnclosingType = currentType . enclosingType ( ) ) != null ) { if ( currentType == targetEnclosingType || ( ! onlyExactMatch && currentType . findSuperTypeOriginatingFrom ( targetEnclosingType ) != null ) ) break ; if ( currentMethodScope != null ) { currentMethodScope = currentMethodScope . enclosingMethodScope ( ) ; if ( currentMethodScope != null && currentMethodScope . isConstructorCall ) { return BlockScope . NoEnclosingInstanceInConstructorCall ; } if ( currentMethodScope != null && currentMethodScope . isStatic ) { return BlockScope . NoEnclosingInstanceInStaticContext ; } } syntheticField = ( ( NestedTypeBinding ) currentType ) . getSyntheticField ( currentEnclosingType , onlyExactMatch ) ; if ( syntheticField == null ) break ; if ( count == path . length ) { System . arraycopy ( path , <NUM_LIT:0> , ( path = new Object [ count + <NUM_LIT:1> ] ) , <NUM_LIT:0> , count ) ; } path [ count ++ ] = ( ( SourceTypeBinding ) syntheticField . declaringClass ) . addSyntheticMethod ( syntheticField , true , false ) ; currentType = currentEnclosingType ; } if ( currentType == targetEnclosingType || ( ! onlyExactMatch && currentType . findSuperTypeOriginatingFrom ( targetEnclosingType ) != null ) ) { return path ; } } return null ; } public final boolean isDuplicateLocalVariable ( char [ ] name ) { BlockScope current = this ; while ( true ) { for ( int i = <NUM_LIT:0> ; i < this . localIndex ; i ++ ) { if ( CharOperation . equals ( name , current . locals [ i ] . name ) ) return true ; } if ( current . kind != Scope . BLOCK_SCOPE ) return false ; current = ( BlockScope ) current . parent ; } } public int maxShiftedOffset ( ) { int max = - <NUM_LIT:1> ; if ( this . shiftScopes != null ) { for ( int i = <NUM_LIT:0> , length = this . shiftScopes . length ; i < length ; i ++ ) { int subMaxOffset = this . shiftScopes [ i ] . maxOffset ; if ( subMaxOffset > max ) max = subMaxOffset ; } } return max ; } public final boolean needBlankFinalFieldInitializationCheck ( FieldBinding binding ) { boolean isStatic = binding . isStatic ( ) ; ReferenceBinding fieldDeclaringClass = binding . declaringClass ; MethodScope methodScope = methodScope ( ) ; while ( methodScope != null ) { if ( methodScope . isStatic != isStatic ) return false ; if ( ! methodScope . isInsideInitializer ( ) && ! ( ( AbstractMethodDeclaration ) methodScope . referenceContext ) . isInitializationMethod ( ) ) { return false ; } ReferenceBinding enclosingType = methodScope . enclosingReceiverType ( ) ; if ( enclosingType == fieldDeclaringClass ) { return true ; } if ( ! enclosingType . erasure ( ) . isAnonymousType ( ) ) { return false ; } methodScope = methodScope . enclosingMethodScope ( ) ; } return false ; } public ProblemReporter problemReporter ( ) { return outerMostMethodScope ( ) . problemReporter ( ) ; } public void propagateInnerEmulation ( ReferenceBinding targetType , boolean isEnclosingInstanceSupplied ) { SyntheticArgumentBinding [ ] syntheticArguments ; if ( ( syntheticArguments = targetType . syntheticOuterLocalVariables ( ) ) != null ) { for ( int i = <NUM_LIT:0> , max = syntheticArguments . length ; i < max ; i ++ ) { SyntheticArgumentBinding syntheticArg = syntheticArguments [ i ] ; if ( ! ( isEnclosingInstanceSupplied && ( syntheticArg . type == targetType . enclosingType ( ) ) ) ) { emulateOuterAccess ( syntheticArg . actualOuterLocalVariable ) ; } } } } public TypeDeclaration referenceType ( ) { return methodScope ( ) . referenceType ( ) ; } public int scopeIndex ( ) { if ( this instanceof MethodScope ) return - <NUM_LIT:1> ; BlockScope parentScope = ( BlockScope ) this . parent ; Scope [ ] parentSubscopes = parentScope . subscopes ; for ( int i = <NUM_LIT:0> , max = parentScope . subscopeCount ; i < max ; i ++ ) { if ( parentSubscopes [ i ] == this ) return i ; } return - <NUM_LIT:1> ; } int startIndex ( ) { return this . startIndex ; } public String toString ( ) { return toString ( <NUM_LIT:0> ) ; } public String toString ( int tab ) { String s = basicToString ( tab ) ; for ( int i = <NUM_LIT:0> ; i < this . subscopeCount ; i ++ ) if ( this . subscopes [ i ] instanceof BlockScope ) s += ( ( BlockScope ) this . subscopes [ i ] ) . toString ( tab + <NUM_LIT:1> ) + "<STR_LIT:n>" ; return s ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; public class SignatureWrapper { public char [ ] signature ; public int start ; public int end ; public int bracket ; public SignatureWrapper ( char [ ] signature ) { this . signature = signature ; this . start = <NUM_LIT:0> ; this . end = this . bracket = - <NUM_LIT:1> ; } public boolean atEnd ( ) { return this . start < <NUM_LIT:0> || this . start >= this . signature . length ; } public int computeEnd ( ) { int index = this . start ; while ( this . signature [ index ] == '<CHAR_LIT:[>' ) index ++ ; switch ( this . signature [ index ] ) { case '<CHAR_LIT>' : case '<CHAR_LIT>' : this . end = CharOperation . indexOf ( '<CHAR_LIT:;>' , this . signature , this . start ) ; if ( this . bracket <= this . start ) this . bracket = CharOperation . indexOf ( '<CHAR_LIT>' , this . signature , this . start ) ; if ( this . bracket > this . start && this . bracket < this . end ) this . end = this . bracket ; else if ( this . end == - <NUM_LIT:1> ) this . end = this . signature . length + <NUM_LIT:1> ; break ; default : this . end = this . start ; } this . start = this . end + <NUM_LIT:1> ; return this . end ; } public char [ ] nextWord ( ) { this . end = CharOperation . indexOf ( '<CHAR_LIT:;>' , this . signature , this . start ) ; if ( this . bracket <= this . start ) this . bracket = CharOperation . indexOf ( '<CHAR_LIT>' , this . signature , this . start ) ; int dot = CharOperation . indexOf ( '<CHAR_LIT:.>' , this . signature , this . start ) ; if ( this . bracket > this . start && this . bracket < this . end ) this . end = this . bracket ; if ( dot > this . start && dot < this . end ) this . end = dot ; return CharOperation . subarray ( this . signature , this . start , this . start = this . end ) ; } public String toString ( ) { return new String ( this . signature ) + "<STR_LIT>" + this . start ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; public interface Substitution { TypeBinding substitute ( TypeVariableBinding typeVariable ) ; LookupEnvironment environment ( ) ; boolean isRawSubstitution ( ) ; } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; public class SyntheticArgumentBinding extends LocalVariableBinding { { this . tagBits |= TagBits . IsArgument ; this . useFlag = USED ; } public LocalVariableBinding actualOuterLocalVariable ; public FieldBinding matchingField ; public SyntheticArgumentBinding ( LocalVariableBinding actualOuterLocalVariable ) { super ( CharOperation . concat ( TypeConstants . SYNTHETIC_OUTER_LOCAL_PREFIX , actualOuterLocalVariable . name ) , actualOuterLocalVariable . type , ClassFileConstants . AccFinal , true ) ; this . actualOuterLocalVariable = actualOuterLocalVariable ; } public SyntheticArgumentBinding ( ReferenceBinding enclosingType ) { super ( CharOperation . concat ( TypeConstants . SYNTHETIC_ENCLOSING_INSTANCE_PREFIX , String . valueOf ( enclosingType . depth ( ) ) . toCharArray ( ) ) , enclosingType , ClassFileConstants . AccFinal , true ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; public class ProblemFieldBinding extends FieldBinding { private int problemId ; public FieldBinding closestMatch ; public ProblemFieldBinding ( ReferenceBinding declaringClass , char [ ] name , int problemId ) { this ( null , declaringClass , name , problemId ) ; } public ProblemFieldBinding ( FieldBinding closestMatch , ReferenceBinding declaringClass , char [ ] name , int problemId ) { this . closestMatch = closestMatch ; this . declaringClass = declaringClass ; this . name = name ; this . problemId = problemId ; } public final int problemId ( ) { return this . problemId ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; public interface TagBits { long IsArrayType = ASTNode . Bit1 ; long IsBaseType = ASTNode . Bit2 ; long IsNestedType = ASTNode . Bit3 ; long IsMemberType = ASTNode . Bit4 ; long ContainsNestedTypeReferences = ASTNode . Bit12 ; long MemberTypeMask = IsNestedType | IsMemberType | ContainsNestedTypeReferences ; long IsLocalType = ASTNode . Bit5 ; long LocalTypeMask = IsNestedType | IsLocalType | ContainsNestedTypeReferences ; long IsAnonymousType = ASTNode . Bit6 ; long AnonymousTypeMask = LocalTypeMask | IsAnonymousType | ContainsNestedTypeReferences ; long IsBinaryBinding = ASTNode . Bit7 ; long HasMissingType = ASTNode . Bit8 ; long HasUncheckedTypeArgumentForBoundCheck = ASTNode . Bit9 ; long HasUnresolvedArguments = ASTNode . Bit10 ; long BeginHierarchyCheck = ASTNode . Bit9 ; long EndHierarchyCheck = ASTNode . Bit10 ; long PauseHierarchyCheck = ASTNode . Bit20 ; long HasParameterAnnotations = ASTNode . Bit11 ; long KnowsDefaultAbstractMethods = ASTNode . Bit11 ; long IsArgument = ASTNode . Bit11 ; long ClearPrivateModifier = ASTNode . Bit10 ; long AreFieldsSorted = ASTNode . Bit13 ; long AreFieldsComplete = ASTNode . Bit14 ; long AreMethodsSorted = ASTNode . Bit15 ; long AreMethodsComplete = ASTNode . Bit16 ; long HasNoMemberTypes = ASTNode . Bit17 ; long HierarchyHasProblems = ASTNode . Bit18 ; long TypeVariablesAreConnected = ASTNode . Bit19 ; long PassedBoundCheck = ASTNode . Bit23 ; long IsBoundParameterizedType = ASTNode . Bit24 ; long HasUnresolvedTypeVariables = ASTNode . Bit25 ; long HasUnresolvedSuperclass = ASTNode . Bit26 ; long HasUnresolvedSuperinterfaces = ASTNode . Bit27 ; long HasUnresolvedEnclosingType = ASTNode . Bit28 ; long HasUnresolvedMemberTypes = ASTNode . Bit29 ; long HasTypeVariable = ASTNode . Bit30 ; long HasDirectWildcard = ASTNode . Bit31 ; long BeginAnnotationCheck = ASTNode . Bit32L ; long EndAnnotationCheck = ASTNode . Bit33L ; long AnnotationResolved = ASTNode . Bit34L ; long DeprecatedAnnotationResolved = ASTNode . Bit35L ; long AnnotationTarget = ASTNode . Bit36L ; long AnnotationForType = ASTNode . Bit37L ; long AnnotationForField = ASTNode . Bit38L ; long AnnotationForMethod = ASTNode . Bit39L ; long AnnotationForParameter = ASTNode . Bit40L ; long AnnotationForConstructor = ASTNode . Bit41L ; long AnnotationForLocalVariable = ASTNode . Bit42L ; long AnnotationForAnnotationType = ASTNode . Bit43L ; long AnnotationForPackage = ASTNode . Bit44L ; long AnnotationTargetMASK = AnnotationTarget | AnnotationForType | AnnotationForField | AnnotationForMethod | AnnotationForParameter | AnnotationForConstructor | AnnotationForLocalVariable | AnnotationForAnnotationType | AnnotationForPackage ; long AnnotationSourceRetention = ASTNode . Bit45L ; long AnnotationClassRetention = ASTNode . Bit46L ; long AnnotationRuntimeRetention = AnnotationSourceRetention | AnnotationClassRetention ; long AnnotationRetentionMASK = AnnotationSourceRetention | AnnotationClassRetention | AnnotationRuntimeRetention ; long AnnotationDeprecated = ASTNode . Bit47L ; long AnnotationDocumented = ASTNode . Bit48L ; long AnnotationInherited = ASTNode . Bit49L ; long AnnotationOverride = ASTNode . Bit50L ; long AnnotationSuppressWarnings = ASTNode . Bit51L ; long AllStandardAnnotationsMask = AnnotationTargetMASK | AnnotationRetentionMASK | AnnotationDeprecated | AnnotationDocumented | AnnotationInherited | AnnotationOverride | AnnotationSuppressWarnings ; long DefaultValueResolved = ASTNode . Bit52L ; long HasNonPrivateConstructor = ASTNode . Bit53L ; } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; public class ProblemMethodBinding extends MethodBinding { private int problemReason ; public MethodBinding closestMatch ; public ProblemMethodBinding ( char [ ] selector , TypeBinding [ ] args , int problemReason ) { this . selector = selector ; this . parameters = ( args == null || args . length == <NUM_LIT:0> ) ? Binding . NO_PARAMETERS : args ; this . problemReason = problemReason ; this . thrownExceptions = Binding . NO_EXCEPTIONS ; } public ProblemMethodBinding ( char [ ] selector , TypeBinding [ ] args , ReferenceBinding declaringClass , int problemReason ) { this . selector = selector ; this . parameters = ( args == null || args . length == <NUM_LIT:0> ) ? Binding . NO_PARAMETERS : args ; this . declaringClass = declaringClass ; this . problemReason = problemReason ; this . thrownExceptions = Binding . NO_EXCEPTIONS ; } public ProblemMethodBinding ( MethodBinding closestMatch , char [ ] selector , TypeBinding [ ] args , int problemReason ) { this ( selector , args , problemReason ) ; this . closestMatch = closestMatch ; if ( closestMatch != null && problemReason != ProblemReasons . Ambiguous ) this . declaringClass = closestMatch . declaringClass ; } public final int problemId ( ) { return this . problemReason ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import java . util . List ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . impl . Constant ; public final class ArrayBinding extends TypeBinding { public static final FieldBinding ArrayLength = new FieldBinding ( TypeConstants . LENGTH , TypeBinding . INT , ClassFileConstants . AccPublic | ClassFileConstants . AccFinal , null , Constant . NotAConstant ) ; public TypeBinding leafComponentType ; public int dimensions ; LookupEnvironment environment ; char [ ] constantPoolName ; char [ ] genericTypeSignature ; public ArrayBinding ( TypeBinding type , int dimensions , LookupEnvironment environment ) { this . tagBits |= TagBits . IsArrayType ; this . leafComponentType = type ; this . dimensions = dimensions ; this . environment = environment ; if ( type instanceof UnresolvedReferenceBinding ) ( ( UnresolvedReferenceBinding ) type ) . addWrapper ( this , environment ) ; else this . tagBits |= type . tagBits & ( TagBits . HasTypeVariable | TagBits . HasDirectWildcard | TagBits . HasMissingType | TagBits . ContainsNestedTypeReferences ) ; } public TypeBinding closestMatch ( ) { if ( isValidBinding ( ) ) { return this ; } TypeBinding leafClosestMatch = this . leafComponentType . closestMatch ( ) ; if ( leafClosestMatch == null ) { return null ; } return this . environment . createArrayType ( this . leafComponentType . closestMatch ( ) , this . dimensions ) ; } public List collectMissingTypes ( List missingTypes ) { if ( ( this . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { missingTypes = this . leafComponentType . collectMissingTypes ( missingTypes ) ; } return missingTypes ; } public void collectSubstitutes ( Scope scope , TypeBinding actualType , InferenceContext inferenceContext , int constraint ) { if ( ( this . tagBits & TagBits . HasTypeVariable ) == <NUM_LIT:0> ) return ; if ( actualType == TypeBinding . NULL ) return ; switch ( actualType . kind ( ) ) { case Binding . ARRAY_TYPE : int actualDim = actualType . dimensions ( ) ; if ( actualDim == this . dimensions ) { this . leafComponentType . collectSubstitutes ( scope , actualType . leafComponentType ( ) , inferenceContext , constraint ) ; } else if ( actualDim > this . dimensions ) { ArrayBinding actualReducedType = this . environment . createArrayType ( actualType . leafComponentType ( ) , actualDim - this . dimensions ) ; this . leafComponentType . collectSubstitutes ( scope , actualReducedType , inferenceContext , constraint ) ; } break ; case Binding . TYPE_PARAMETER : break ; } } public char [ ] computeUniqueKey ( boolean isLeaf ) { char [ ] brackets = new char [ this . dimensions ] ; for ( int i = this . dimensions - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) brackets [ i ] = '<CHAR_LIT:[>' ; return CharOperation . concat ( brackets , this . leafComponentType . computeUniqueKey ( isLeaf ) ) ; } public char [ ] constantPoolName ( ) { if ( this . constantPoolName != null ) return this . constantPoolName ; char [ ] brackets = new char [ this . dimensions ] ; for ( int i = this . dimensions - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) brackets [ i ] = '<CHAR_LIT:[>' ; return this . constantPoolName = CharOperation . concat ( brackets , this . leafComponentType . signature ( ) ) ; } public String debugName ( ) { StringBuffer brackets = new StringBuffer ( this . dimensions * <NUM_LIT:2> ) ; for ( int i = this . dimensions ; -- i >= <NUM_LIT:0> ; ) brackets . append ( "<STR_LIT:[]>" ) ; return this . leafComponentType . debugName ( ) + brackets . toString ( ) ; } public int dimensions ( ) { return this . dimensions ; } public TypeBinding elementsType ( ) { if ( this . dimensions == <NUM_LIT:1> ) return this . leafComponentType ; return this . environment . createArrayType ( this . leafComponentType , this . dimensions - <NUM_LIT:1> ) ; } public TypeBinding erasure ( ) { TypeBinding erasedType = this . leafComponentType . erasure ( ) ; if ( this . leafComponentType != erasedType ) return this . environment . createArrayType ( erasedType , this . dimensions ) ; return this ; } public LookupEnvironment environment ( ) { return this . environment ; } public char [ ] genericTypeSignature ( ) { if ( this . genericTypeSignature == null ) { char [ ] brackets = new char [ this . dimensions ] ; for ( int i = this . dimensions - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) brackets [ i ] = '<CHAR_LIT:[>' ; this . genericTypeSignature = CharOperation . concat ( brackets , this . leafComponentType . genericTypeSignature ( ) ) ; } return this . genericTypeSignature ; } public PackageBinding getPackage ( ) { return this . leafComponentType . getPackage ( ) ; } public int hashCode ( ) { return this . leafComponentType == null ? super . hashCode ( ) : this . leafComponentType . hashCode ( ) ; } public boolean isCompatibleWith ( TypeBinding otherType ) { if ( this == otherType ) return true ; switch ( otherType . kind ( ) ) { case Binding . ARRAY_TYPE : ArrayBinding otherArray = ( ArrayBinding ) otherType ; if ( otherArray . leafComponentType . isBaseType ( ) ) return false ; if ( this . dimensions == otherArray . dimensions ) return this . leafComponentType . isCompatibleWith ( otherArray . leafComponentType ) ; if ( this . dimensions < otherArray . dimensions ) return false ; break ; case Binding . BASE_TYPE : return false ; case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : return ( ( WildcardBinding ) otherType ) . boundCheck ( this ) ; case Binding . TYPE_PARAMETER : if ( otherType . isCapture ( ) ) { CaptureBinding otherCapture = ( CaptureBinding ) otherType ; TypeBinding otherLowerBound ; if ( ( otherLowerBound = otherCapture . lowerBound ) != null ) { if ( ! otherLowerBound . isArrayType ( ) ) return false ; return isCompatibleWith ( otherLowerBound ) ; } } return false ; } switch ( otherType . leafComponentType ( ) . id ) { case TypeIds . T_JavaLangObject : case TypeIds . T_JavaLangCloneable : case TypeIds . T_JavaIoSerializable : return true ; } return false ; } public int kind ( ) { return ARRAY_TYPE ; } public TypeBinding leafComponentType ( ) { return this . leafComponentType ; } public int problemId ( ) { return this . leafComponentType . problemId ( ) ; } public char [ ] qualifiedSourceName ( ) { char [ ] brackets = new char [ this . dimensions * <NUM_LIT:2> ] ; for ( int i = this . dimensions * <NUM_LIT:2> - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -= <NUM_LIT:2> ) { brackets [ i ] = '<CHAR_LIT:]>' ; brackets [ i - <NUM_LIT:1> ] = '<CHAR_LIT:[>' ; } return CharOperation . concat ( this . leafComponentType . qualifiedSourceName ( ) , brackets ) ; } public char [ ] readableName ( ) { char [ ] brackets = new char [ this . dimensions * <NUM_LIT:2> ] ; for ( int i = this . dimensions * <NUM_LIT:2> - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -= <NUM_LIT:2> ) { brackets [ i ] = '<CHAR_LIT:]>' ; brackets [ i - <NUM_LIT:1> ] = '<CHAR_LIT:[>' ; } return CharOperation . concat ( this . leafComponentType . readableName ( ) , brackets ) ; } public char [ ] shortReadableName ( ) { char [ ] brackets = new char [ this . dimensions * <NUM_LIT:2> ] ; for ( int i = this . dimensions * <NUM_LIT:2> - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -= <NUM_LIT:2> ) { brackets [ i ] = '<CHAR_LIT:]>' ; brackets [ i - <NUM_LIT:1> ] = '<CHAR_LIT:[>' ; } return CharOperation . concat ( this . leafComponentType . shortReadableName ( ) , brackets ) ; } public char [ ] sourceName ( ) { char [ ] brackets = new char [ this . dimensions * <NUM_LIT:2> ] ; for ( int i = this . dimensions * <NUM_LIT:2> - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -= <NUM_LIT:2> ) { brackets [ i ] = '<CHAR_LIT:]>' ; brackets [ i - <NUM_LIT:1> ] = '<CHAR_LIT:[>' ; } return CharOperation . concat ( this . leafComponentType . sourceName ( ) , brackets ) ; } public void swapUnresolved ( UnresolvedReferenceBinding unresolvedType , ReferenceBinding resolvedType , LookupEnvironment env ) { if ( this . leafComponentType == unresolvedType ) { this . leafComponentType = env . convertUnresolvedBinaryToRawType ( resolvedType ) ; this . tagBits |= this . leafComponentType . tagBits & ( TagBits . HasTypeVariable | TagBits . HasDirectWildcard | TagBits . HasMissingType ) ; } } public String toString ( ) { return this . leafComponentType != null ? debugName ( ) : "<STR_LIT>" ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; public interface ProblemReasons { final int NoError = <NUM_LIT:0> ; final int NotFound = <NUM_LIT:1> ; final int NotVisible = <NUM_LIT:2> ; final int Ambiguous = <NUM_LIT:3> ; final int InternalNameProvided = <NUM_LIT:4> ; final int InheritedNameHidesEnclosingName = <NUM_LIT:5> ; final int NonStaticReferenceInConstructorInvocation = <NUM_LIT:6> ; final int NonStaticReferenceInStaticContext = <NUM_LIT:7> ; final int ReceiverTypeNotVisible = <NUM_LIT:8> ; final int IllegalSuperTypeVariable = <NUM_LIT:9> ; final int ParameterBoundMismatch = <NUM_LIT:10> ; final int TypeParameterArityMismatch = <NUM_LIT:11> ; final int ParameterizedMethodTypeMismatch = <NUM_LIT:12> ; final int TypeArgumentsForRawGenericMethod = <NUM_LIT> ; final int InvalidTypeForStaticImport = <NUM_LIT> ; } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . impl . Constant ; public class ParameterizedFieldBinding extends FieldBinding { public FieldBinding originalField ; public ParameterizedFieldBinding ( ParameterizedTypeBinding parameterizedDeclaringClass , FieldBinding originalField ) { super ( originalField . name , ( originalField . modifiers & ClassFileConstants . AccEnum ) != <NUM_LIT:0> ? parameterizedDeclaringClass : ( originalField . modifiers & ClassFileConstants . AccStatic ) != <NUM_LIT:0> ? originalField . type : Scope . substitute ( parameterizedDeclaringClass , originalField . type ) , originalField . modifiers , parameterizedDeclaringClass , null ) ; this . originalField = originalField ; this . tagBits = originalField . tagBits ; this . id = originalField . id ; } public Constant constant ( ) { return this . originalField . constant ( ) ; } public FieldBinding original ( ) { return this . originalField . original ( ) ; } public void setConstant ( Constant constant ) { this . originalField . setConstant ( constant ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import java . util . ArrayList ; import java . util . List ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; public class MissingTypeBinding extends BinaryTypeBinding { public MissingTypeBinding ( PackageBinding packageBinding , char [ ] [ ] compoundName , LookupEnvironment environment ) { this . compoundName = compoundName ; computeId ( ) ; this . tagBits |= TagBits . IsBinaryBinding | TagBits . HierarchyHasProblems | TagBits . HasMissingType ; this . environment = environment ; this . fPackage = packageBinding ; this . fileName = CharOperation . concatWith ( compoundName , '<CHAR_LIT:/>' ) ; this . sourceName = compoundName [ compoundName . length - <NUM_LIT:1> ] ; this . modifiers = ClassFileConstants . AccPublic ; this . superclass = null ; this . superInterfaces = Binding . NO_SUPERINTERFACES ; this . typeVariables = Binding . NO_TYPE_VARIABLES ; this . memberTypes = Binding . NO_MEMBER_TYPES ; this . fields = Binding . NO_FIELDS ; this . methods = Binding . NO_METHODS ; } public List collectMissingTypes ( List missingTypes ) { if ( missingTypes == null ) { missingTypes = new ArrayList ( <NUM_LIT:5> ) ; } else if ( missingTypes . contains ( this ) ) { return missingTypes ; } missingTypes . add ( this ) ; return missingTypes ; } public int problemId ( ) { return ProblemReasons . NotFound ; } void setMissingSuperclass ( ReferenceBinding missingSuperclass ) { this . superclass = missingSuperclass ; } public String toString ( ) { return "<STR_LIT>" + new String ( CharOperation . concatWith ( this . compoundName , '<CHAR_LIT:.>' ) ) + "<STR_LIT:]>" ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . ast . Annotation ; public class AnnotationBinding { ReferenceBinding type ; ElementValuePair [ ] pairs ; public static AnnotationBinding [ ] addStandardAnnotations ( AnnotationBinding [ ] recordedAnnotations , long annotationTagBits , LookupEnvironment env ) { int count = <NUM_LIT:0> ; if ( ( annotationTagBits & TagBits . AnnotationTargetMASK ) != <NUM_LIT:0> ) count ++ ; if ( ( annotationTagBits & TagBits . AnnotationRetentionMASK ) != <NUM_LIT:0> ) count ++ ; if ( ( annotationTagBits & TagBits . AnnotationDeprecated ) != <NUM_LIT:0> ) count ++ ; if ( ( annotationTagBits & TagBits . AnnotationDocumented ) != <NUM_LIT:0> ) count ++ ; if ( ( annotationTagBits & TagBits . AnnotationInherited ) != <NUM_LIT:0> ) count ++ ; if ( ( annotationTagBits & TagBits . AnnotationOverride ) != <NUM_LIT:0> ) count ++ ; if ( ( annotationTagBits & TagBits . AnnotationSuppressWarnings ) != <NUM_LIT:0> ) count ++ ; if ( count == <NUM_LIT:0> ) return recordedAnnotations ; int index = recordedAnnotations . length ; AnnotationBinding [ ] result = new AnnotationBinding [ index + count ] ; System . arraycopy ( recordedAnnotations , <NUM_LIT:0> , result , <NUM_LIT:0> , index ) ; if ( ( annotationTagBits & TagBits . AnnotationTargetMASK ) != <NUM_LIT:0> ) result [ index ++ ] = buildTargetAnnotation ( annotationTagBits , env ) ; if ( ( annotationTagBits & TagBits . AnnotationRetentionMASK ) != <NUM_LIT:0> ) result [ index ++ ] = buildRetentionAnnotation ( annotationTagBits , env ) ; if ( ( annotationTagBits & TagBits . AnnotationDeprecated ) != <NUM_LIT:0> ) result [ index ++ ] = buildMarkerAnnotation ( TypeConstants . JAVA_LANG_DEPRECATED , env ) ; if ( ( annotationTagBits & TagBits . AnnotationDocumented ) != <NUM_LIT:0> ) result [ index ++ ] = buildMarkerAnnotation ( TypeConstants . JAVA_LANG_ANNOTATION_DOCUMENTED , env ) ; if ( ( annotationTagBits & TagBits . AnnotationInherited ) != <NUM_LIT:0> ) result [ index ++ ] = buildMarkerAnnotation ( TypeConstants . JAVA_LANG_ANNOTATION_INHERITED , env ) ; if ( ( annotationTagBits & TagBits . AnnotationOverride ) != <NUM_LIT:0> ) result [ index ++ ] = buildMarkerAnnotation ( TypeConstants . JAVA_LANG_OVERRIDE , env ) ; if ( ( annotationTagBits & TagBits . AnnotationSuppressWarnings ) != <NUM_LIT:0> ) result [ index ++ ] = buildMarkerAnnotation ( TypeConstants . JAVA_LANG_SUPPRESSWARNINGS , env ) ; return result ; } private static AnnotationBinding buildMarkerAnnotation ( char [ ] [ ] compoundName , LookupEnvironment env ) { ReferenceBinding type = env . getResolvedType ( compoundName , null ) ; return env . createAnnotation ( type , Binding . NO_ELEMENT_VALUE_PAIRS ) ; } private static AnnotationBinding buildRetentionAnnotation ( long bits , LookupEnvironment env ) { ReferenceBinding retentionPolicy = env . getResolvedType ( TypeConstants . JAVA_LANG_ANNOTATION_RETENTIONPOLICY , null ) ; Object value = null ; if ( ( bits & TagBits . AnnotationRuntimeRetention ) == TagBits . AnnotationRuntimeRetention ) { value = retentionPolicy . getField ( TypeConstants . UPPER_RUNTIME , true ) ; } else if ( ( bits & TagBits . AnnotationClassRetention ) != <NUM_LIT:0> ) { value = retentionPolicy . getField ( TypeConstants . UPPER_CLASS , true ) ; } else if ( ( bits & TagBits . AnnotationSourceRetention ) != <NUM_LIT:0> ) { value = retentionPolicy . getField ( TypeConstants . UPPER_SOURCE , true ) ; } return env . createAnnotation ( env . getResolvedType ( TypeConstants . JAVA_LANG_ANNOTATION_RETENTION , null ) , new ElementValuePair [ ] { new ElementValuePair ( TypeConstants . VALUE , value , null ) } ) ; } private static AnnotationBinding buildTargetAnnotation ( long bits , LookupEnvironment env ) { ReferenceBinding target = env . getResolvedType ( TypeConstants . JAVA_LANG_ANNOTATION_TARGET , null ) ; if ( ( bits & TagBits . AnnotationTarget ) != <NUM_LIT:0> ) return new AnnotationBinding ( target , Binding . NO_ELEMENT_VALUE_PAIRS ) ; int arraysize = <NUM_LIT:0> ; if ( ( bits & TagBits . AnnotationForAnnotationType ) != <NUM_LIT:0> ) arraysize ++ ; if ( ( bits & TagBits . AnnotationForConstructor ) != <NUM_LIT:0> ) arraysize ++ ; if ( ( bits & TagBits . AnnotationForField ) != <NUM_LIT:0> ) arraysize ++ ; if ( ( bits & TagBits . AnnotationForLocalVariable ) != <NUM_LIT:0> ) arraysize ++ ; if ( ( bits & TagBits . AnnotationForMethod ) != <NUM_LIT:0> ) arraysize ++ ; if ( ( bits & TagBits . AnnotationForPackage ) != <NUM_LIT:0> ) arraysize ++ ; if ( ( bits & TagBits . AnnotationForParameter ) != <NUM_LIT:0> ) arraysize ++ ; if ( ( bits & TagBits . AnnotationForType ) != <NUM_LIT:0> ) arraysize ++ ; Object [ ] value = new Object [ arraysize ] ; if ( arraysize > <NUM_LIT:0> ) { ReferenceBinding elementType = env . getResolvedType ( TypeConstants . JAVA_LANG_ANNOTATION_ELEMENTTYPE , null ) ; int index = <NUM_LIT:0> ; if ( ( bits & TagBits . AnnotationForAnnotationType ) != <NUM_LIT:0> ) value [ index ++ ] = elementType . getField ( TypeConstants . UPPER_ANNOTATION_TYPE , true ) ; if ( ( bits & TagBits . AnnotationForConstructor ) != <NUM_LIT:0> ) value [ index ++ ] = elementType . getField ( TypeConstants . UPPER_CONSTRUCTOR , true ) ; if ( ( bits & TagBits . AnnotationForField ) != <NUM_LIT:0> ) value [ index ++ ] = elementType . getField ( TypeConstants . UPPER_FIELD , true ) ; if ( ( bits & TagBits . AnnotationForLocalVariable ) != <NUM_LIT:0> ) value [ index ++ ] = elementType . getField ( TypeConstants . UPPER_LOCAL_VARIABLE , true ) ; if ( ( bits & TagBits . AnnotationForMethod ) != <NUM_LIT:0> ) value [ index ++ ] = elementType . getField ( TypeConstants . UPPER_METHOD , true ) ; if ( ( bits & TagBits . AnnotationForPackage ) != <NUM_LIT:0> ) value [ index ++ ] = elementType . getField ( TypeConstants . UPPER_PACKAGE , true ) ; if ( ( bits & TagBits . AnnotationForParameter ) != <NUM_LIT:0> ) value [ index ++ ] = elementType . getField ( TypeConstants . UPPER_PARAMETER , true ) ; if ( ( bits & TagBits . AnnotationForType ) != <NUM_LIT:0> ) value [ index ++ ] = elementType . getField ( TypeConstants . TYPE , true ) ; } return env . createAnnotation ( target , new ElementValuePair [ ] { new ElementValuePair ( TypeConstants . VALUE , value , null ) } ) ; } AnnotationBinding ( ReferenceBinding type , ElementValuePair [ ] pairs ) { this . type = type ; this . pairs = pairs ; } AnnotationBinding ( Annotation astAnnotation ) { this ( ( ReferenceBinding ) astAnnotation . resolvedType , astAnnotation . computeElementValuePairs ( ) ) ; } public char [ ] computeUniqueKey ( char [ ] recipientKey ) { char [ ] typeKey = this . type . computeUniqueKey ( false ) ; int recipientKeyLength = recipientKey . length ; char [ ] uniqueKey = new char [ recipientKeyLength + <NUM_LIT:1> + typeKey . length ] ; System . arraycopy ( recipientKey , <NUM_LIT:0> , uniqueKey , <NUM_LIT:0> , recipientKeyLength ) ; uniqueKey [ recipientKeyLength ] = '<CHAR_LIT>' ; System . arraycopy ( typeKey , <NUM_LIT:0> , uniqueKey , recipientKeyLength + <NUM_LIT:1> , typeKey . length ) ; return uniqueKey ; } public ReferenceBinding getAnnotationType ( ) { return this . type ; } public ElementValuePair [ ] getElementValuePairs ( ) { return this . pairs ; } public static void setMethodBindings ( ReferenceBinding type , ElementValuePair [ ] pairs ) { for ( int i = pairs . length ; -- i >= <NUM_LIT:0> ; ) { ElementValuePair pair = pairs [ i ] ; MethodBinding [ ] methods = type . getMethods ( pair . getName ( ) ) ; if ( methods != null && methods . length == <NUM_LIT:1> ) pair . setMethodBinding ( methods [ <NUM_LIT:0> ] ) ; } } public String toString ( ) { StringBuffer buffer = new StringBuffer ( <NUM_LIT:5> ) ; buffer . append ( '<CHAR_LIT>' ) . append ( this . type . sourceName ) ; if ( this . pairs != null && this . pairs . length > <NUM_LIT:0> ) { buffer . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> , max = this . pairs . length ; i < max ; i ++ ) { if ( i > <NUM_LIT:0> ) buffer . append ( "<STR_LIT:U+002CU+0020>" ) ; buffer . append ( this . pairs [ i ] ) ; } buffer . append ( '<CHAR_LIT:}>' ) ; } return buffer . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; public class InnerEmulationDependency { public BlockScope scope ; public boolean wasEnclosingInstanceSupplied ; public InnerEmulationDependency ( BlockScope scope , boolean wasEnclosingInstanceSupplied ) { this . scope = scope ; this . wasEnclosingInstanceSupplied = wasEnclosingInstanceSupplied ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; public class ProblemBinding extends Binding { public char [ ] name ; public ReferenceBinding searchType ; private int problemId ; public ProblemBinding ( char [ ] [ ] compoundName , int problemId ) { this ( CharOperation . concatWith ( compoundName , '<CHAR_LIT:.>' ) , problemId ) ; } public ProblemBinding ( char [ ] [ ] compoundName , ReferenceBinding searchType , int problemId ) { this ( CharOperation . concatWith ( compoundName , '<CHAR_LIT:.>' ) , searchType , problemId ) ; } ProblemBinding ( char [ ] name , int problemId ) { this . name = name ; this . problemId = problemId ; } ProblemBinding ( char [ ] name , ReferenceBinding searchType , int problemId ) { this ( name , problemId ) ; this . searchType = searchType ; } public final int kind ( ) { return VARIABLE | TYPE ; } public final int problemId ( ) { return this . problemId ; } public char [ ] readableName ( ) { return this . name ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; public interface ExtraCompilerModifiers { final int AccJustFlag = <NUM_LIT> ; final int AccRestrictedAccess = ASTNode . Bit19 ; final int AccFromClassFile = ASTNode . Bit20 ; final int AccDefaultAbstract = ASTNode . Bit20 ; final int AccDeprecatedImplicitly = ASTNode . Bit22 ; final int AccAlternateModifierProblem = ASTNode . Bit23 ; final int AccModifierProblem = ASTNode . Bit24 ; final int AccSemicolonBody = ASTNode . Bit25 ; final int AccUnresolved = ASTNode . Bit26 ; final int AccBlankFinal = ASTNode . Bit27 ; final int AccIsDefaultConstructor = ASTNode . Bit27 ; final int AccLocallyUsed = ASTNode . Bit28 ; final int AccVisibilityMASK = ClassFileConstants . AccPublic | ClassFileConstants . AccProtected | ClassFileConstants . AccPrivate ; final int AccOverriding = ASTNode . Bit29 ; final int AccImplementing = ASTNode . Bit30 ; final int AccGenericSignature = ASTNode . Bit31 ; } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import java . lang . reflect . Field ; import org . eclipse . jdt . core . compiler . CharOperation ; public class ProblemReferenceBinding extends ReferenceBinding { ReferenceBinding closestMatch ; private int problemReason ; public ProblemReferenceBinding ( char [ ] [ ] compoundName , ReferenceBinding closestMatch , int problemReason ) { this . compoundName = compoundName ; this . closestMatch = closestMatch ; this . problemReason = problemReason ; } public TypeBinding closestMatch ( ) { return this . closestMatch ; } public ReferenceBinding closestReferenceMatch ( ) { return this . closestMatch ; } public int problemId ( ) { return this . problemReason ; } public static String problemReasonString ( int problemReason ) { try { Class reasons = ProblemReasons . class ; String simpleName = reasons . getName ( ) ; int lastDot = simpleName . lastIndexOf ( '<CHAR_LIT:.>' ) ; if ( lastDot >= <NUM_LIT:0> ) { simpleName = simpleName . substring ( lastDot + <NUM_LIT:1> ) ; } Field [ ] fields = reasons . getFields ( ) ; for ( int i = <NUM_LIT:0> , length = fields . length ; i < length ; i ++ ) { Field field = fields [ i ] ; if ( ! field . getType ( ) . equals ( int . class ) ) continue ; if ( field . getInt ( reasons ) == problemReason ) { return simpleName + '<CHAR_LIT:.>' + field . getName ( ) ; } } } catch ( IllegalAccessException e ) { } return "<STR_LIT:unknown>" ; } public char [ ] shortReadableName ( ) { return readableName ( ) ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( <NUM_LIT:10> ) ; buffer . append ( "<STR_LIT>" ) ; buffer . append ( this . compoundName == null ? "<STR_LIT>" : new String ( CharOperation . concatWith ( this . compoundName , '<CHAR_LIT:.>' ) ) ) ; buffer . append ( "<STR_LIT>" ) . append ( problemReasonString ( this . problemReason ) ) ; buffer . append ( "<STR_LIT>" ) ; buffer . append ( this . closestMatch == null ? "<STR_LIT>" : this . closestMatch . toString ( ) ) ; buffer . append ( "<STR_LIT:]>" ) ; return buffer . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; public class RawTypeBinding extends ParameterizedTypeBinding { public RawTypeBinding ( ReferenceBinding type , ReferenceBinding enclosingType , LookupEnvironment environment ) { super ( type , null , enclosingType , environment ) ; this . tagBits &= ~ TagBits . HasMissingType ; if ( ( type . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { if ( type instanceof MissingTypeBinding ) { this . tagBits |= TagBits . HasMissingType ; } else if ( type instanceof ParameterizedTypeBinding ) { ParameterizedTypeBinding parameterizedTypeBinding = ( ParameterizedTypeBinding ) type ; if ( parameterizedTypeBinding . genericType ( ) instanceof MissingTypeBinding ) { this . tagBits |= TagBits . HasMissingType ; } } } if ( enclosingType != null && ( enclosingType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { if ( enclosingType instanceof MissingTypeBinding ) { this . tagBits |= TagBits . HasMissingType ; } else if ( enclosingType instanceof ParameterizedTypeBinding ) { ParameterizedTypeBinding parameterizedTypeBinding = ( ParameterizedTypeBinding ) enclosingType ; if ( parameterizedTypeBinding . genericType ( ) instanceof MissingTypeBinding ) { this . tagBits |= TagBits . HasMissingType ; } } } if ( enclosingType == null || ( enclosingType . modifiers & ExtraCompilerModifiers . AccGenericSignature ) == <NUM_LIT:0> ) { this . modifiers &= ~ ExtraCompilerModifiers . AccGenericSignature ; } } public char [ ] computeUniqueKey ( boolean isLeaf ) { StringBuffer sig = new StringBuffer ( <NUM_LIT:10> ) ; if ( isMemberType ( ) && enclosingType ( ) . isParameterizedType ( ) ) { char [ ] typeSig = enclosingType ( ) . computeUniqueKey ( false ) ; sig . append ( typeSig , <NUM_LIT:0> , typeSig . length - <NUM_LIT:1> ) ; sig . append ( '<CHAR_LIT:.>' ) . append ( sourceName ( ) ) . append ( '<CHAR_LIT>' ) . append ( '<CHAR_LIT:>>' ) . append ( '<CHAR_LIT:;>' ) ; } else { sig . append ( genericType ( ) . computeUniqueKey ( false ) ) ; sig . insert ( sig . length ( ) - <NUM_LIT:1> , "<STR_LIT>" ) ; } int sigLength = sig . length ( ) ; char [ ] uniqueKey = new char [ sigLength ] ; sig . getChars ( <NUM_LIT:0> , sigLength , uniqueKey , <NUM_LIT:0> ) ; return uniqueKey ; } public ParameterizedMethodBinding createParameterizedMethod ( MethodBinding originalMethod ) { if ( originalMethod . typeVariables == Binding . NO_TYPE_VARIABLES || originalMethod . isStatic ( ) ) { return super . createParameterizedMethod ( originalMethod ) ; } return this . environment . createParameterizedGenericMethod ( originalMethod , this ) ; } public int kind ( ) { return RAW_TYPE ; } public String debugName ( ) { StringBuffer nameBuffer = new StringBuffer ( <NUM_LIT:10> ) ; nameBuffer . append ( actualType ( ) . sourceName ( ) ) . append ( "<STR_LIT>" ) ; return nameBuffer . toString ( ) ; } public char [ ] genericTypeSignature ( ) { if ( this . genericTypeSignature == null ) { if ( ( this . modifiers & ExtraCompilerModifiers . AccGenericSignature ) == <NUM_LIT:0> ) { this . genericTypeSignature = genericType ( ) . signature ( ) ; } else { StringBuffer sig = new StringBuffer ( <NUM_LIT:10> ) ; if ( isMemberType ( ) ) { ReferenceBinding enclosing = enclosingType ( ) ; char [ ] typeSig = enclosing . genericTypeSignature ( ) ; sig . append ( typeSig , <NUM_LIT:0> , typeSig . length - <NUM_LIT:1> ) ; if ( ( enclosing . modifiers & ExtraCompilerModifiers . AccGenericSignature ) != <NUM_LIT:0> ) { sig . append ( '<CHAR_LIT:.>' ) ; } else { sig . append ( '<CHAR_LIT>' ) ; } sig . append ( sourceName ( ) ) ; } else { char [ ] typeSig = genericType ( ) . signature ( ) ; sig . append ( typeSig , <NUM_LIT:0> , typeSig . length - <NUM_LIT:1> ) ; } sig . append ( '<CHAR_LIT:;>' ) ; int sigLength = sig . length ( ) ; this . genericTypeSignature = new char [ sigLength ] ; sig . getChars ( <NUM_LIT:0> , sigLength , this . genericTypeSignature , <NUM_LIT:0> ) ; } } return this . genericTypeSignature ; } public boolean isEquivalentTo ( TypeBinding otherType ) { if ( this == otherType ) return true ; if ( otherType == null ) return false ; switch ( otherType . kind ( ) ) { case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : return ( ( WildcardBinding ) otherType ) . boundCheck ( this ) ; case Binding . GENERIC_TYPE : case Binding . PARAMETERIZED_TYPE : case Binding . RAW_TYPE : return erasure ( ) == otherType . erasure ( ) ; } return false ; } public boolean isProvablyDistinct ( TypeBinding otherType ) { if ( this == otherType ) return false ; if ( otherType == null ) return true ; switch ( otherType . kind ( ) ) { case Binding . GENERIC_TYPE : case Binding . PARAMETERIZED_TYPE : case Binding . RAW_TYPE : return erasure ( ) != otherType . erasure ( ) ; } return true ; } protected void initializeArguments ( ) { TypeVariableBinding [ ] typeVariables = genericType ( ) . typeVariables ( ) ; int length = typeVariables . length ; TypeBinding [ ] typeArguments = new TypeBinding [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { typeArguments [ i ] = this . environment . convertToRawType ( typeVariables [ i ] . erasure ( ) , false ) ; } this . arguments = typeArguments ; } public char [ ] readableName ( ) { char [ ] readableName ; if ( isMemberType ( ) ) { readableName = CharOperation . concat ( enclosingType ( ) . readableName ( ) , this . sourceName , '<CHAR_LIT:.>' ) ; } else { readableName = CharOperation . concatWith ( actualType ( ) . compoundName , '<CHAR_LIT:.>' ) ; } return readableName ; } public char [ ] shortReadableName ( ) { char [ ] shortReadableName ; if ( isMemberType ( ) ) { shortReadableName = CharOperation . concat ( enclosingType ( ) . shortReadableName ( ) , this . sourceName , '<CHAR_LIT:.>' ) ; } else { shortReadableName = actualType ( ) . sourceName ; } return shortReadableName ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . ast . * ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . problem . ProblemReporter ; import org . eclipse . jdt . internal . compiler . util . HashtableOfObject ; import org . eclipse . jdt . internal . compiler . util . SimpleSet ; public class MethodVerifier { SourceTypeBinding type ; HashtableOfObject inheritedMethods ; HashtableOfObject currentMethods ; LookupEnvironment environment ; private boolean allowCompatibleReturnTypes ; MethodVerifier ( LookupEnvironment environment ) { this . type = null ; this . inheritedMethods = null ; this . currentMethods = null ; this . environment = environment ; this . allowCompatibleReturnTypes = environment . globalOptions . complianceLevel >= ClassFileConstants . JDK1_5 && environment . globalOptions . sourceLevel < ClassFileConstants . JDK1_5 ; } boolean areMethodsCompatible ( MethodBinding one , MethodBinding two ) { return isParameterSubsignature ( one , two ) && areReturnTypesCompatible ( one , two ) ; } boolean areParametersEqual ( MethodBinding one , MethodBinding two ) { TypeBinding [ ] oneArgs = one . parameters ; TypeBinding [ ] twoArgs = two . parameters ; if ( oneArgs == twoArgs ) return true ; int length = oneArgs . length ; if ( length != twoArgs . length ) return false ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) if ( ! areTypesEqual ( oneArgs [ i ] , twoArgs [ i ] ) ) return false ; return true ; } boolean areReturnTypesCompatible ( MethodBinding one , MethodBinding two ) { if ( one . returnType == two . returnType ) return true ; if ( areTypesEqual ( one . returnType , two . returnType ) ) return true ; if ( this . allowCompatibleReturnTypes && one . declaringClass instanceof BinaryTypeBinding && two . declaringClass instanceof BinaryTypeBinding ) { return areReturnTypesCompatible0 ( one , two ) ; } return false ; } boolean areReturnTypesCompatible0 ( MethodBinding one , MethodBinding two ) { if ( one . returnType . isBaseType ( ) ) return false ; if ( ! one . declaringClass . isInterface ( ) && one . declaringClass . id == TypeIds . T_JavaLangObject ) return two . returnType . isCompatibleWith ( one . returnType ) ; return one . returnType . isCompatibleWith ( two . returnType ) ; } boolean areTypesEqual ( TypeBinding one , TypeBinding two ) { if ( one == two ) return true ; if ( one instanceof UnresolvedReferenceBinding ) return ( ( UnresolvedReferenceBinding ) one ) . resolvedType == two ; if ( two instanceof UnresolvedReferenceBinding ) return ( ( UnresolvedReferenceBinding ) two ) . resolvedType == one ; return false ; } boolean canSkipInheritedMethods ( ) { if ( this . type . superclass ( ) != null && this . type . superclass ( ) . isAbstract ( ) ) return false ; return this . type . superInterfaces ( ) == Binding . NO_SUPERINTERFACES ; } boolean canSkipInheritedMethods ( MethodBinding one , MethodBinding two ) { return two == null || one . declaringClass == two . declaringClass ; } void checkAbstractMethod ( MethodBinding abstractMethod ) { if ( mustImplementAbstractMethod ( abstractMethod . declaringClass ) ) { TypeDeclaration typeDeclaration = this . type . scope . referenceContext ; if ( typeDeclaration != null ) { MethodDeclaration missingAbstractMethod = typeDeclaration . addMissingAbstractMethodFor ( abstractMethod ) ; missingAbstractMethod . scope . problemReporter ( ) . abstractMethodMustBeImplemented ( this . type , abstractMethod ) ; } else { problemReporter ( ) . abstractMethodMustBeImplemented ( this . type , abstractMethod ) ; } } } void checkAgainstInheritedMethods ( MethodBinding currentMethod , MethodBinding [ ] methods , int length , MethodBinding [ ] allInheritedMethods ) { if ( this . type . isAnnotationType ( ) ) { problemReporter ( ) . annotationCannotOverrideMethod ( currentMethod , methods [ length - <NUM_LIT:1> ] ) ; return ; } CompilerOptions options = this . type . scope . compilerOptions ( ) ; int [ ] overriddenInheritedMethods = length > <NUM_LIT:1> ? findOverriddenInheritedMethods ( methods , length ) : null ; nextMethod : for ( int i = length ; -- i >= <NUM_LIT:0> ; ) { MethodBinding inheritedMethod = methods [ i ] ; if ( overriddenInheritedMethods == null || overriddenInheritedMethods [ i ] == <NUM_LIT:0> ) { if ( currentMethod . isStatic ( ) != inheritedMethod . isStatic ( ) ) { problemReporter ( currentMethod ) . staticAndInstanceConflict ( currentMethod , inheritedMethod ) ; continue nextMethod ; } if ( inheritedMethod . isAbstract ( ) ) { if ( inheritedMethod . declaringClass . isInterface ( ) ) { currentMethod . modifiers |= ExtraCompilerModifiers . AccImplementing ; } else { currentMethod . modifiers |= ExtraCompilerModifiers . AccImplementing | ExtraCompilerModifiers . AccOverriding ; } } else if ( inheritedMethod . isPublic ( ) || ! this . type . isInterface ( ) ) { currentMethod . modifiers |= ExtraCompilerModifiers . AccOverriding ; } if ( ! areReturnTypesCompatible ( currentMethod , inheritedMethod ) && ( currentMethod . returnType . tagBits & TagBits . HasMissingType ) == <NUM_LIT:0> ) { if ( reportIncompatibleReturnTypeError ( currentMethod , inheritedMethod ) ) continue nextMethod ; } if ( currentMethod . thrownExceptions != Binding . NO_EXCEPTIONS ) checkExceptions ( currentMethod , inheritedMethod ) ; if ( inheritedMethod . isFinal ( ) ) problemReporter ( currentMethod ) . finalMethodCannotBeOverridden ( currentMethod , inheritedMethod ) ; if ( ! isAsVisible ( currentMethod , inheritedMethod ) ) problemReporter ( currentMethod ) . visibilityConflict ( currentMethod , inheritedMethod ) ; if ( inheritedMethod . isSynchronized ( ) && ! currentMethod . isSynchronized ( ) ) { problemReporter ( currentMethod ) . missingSynchronizedOnInheritedMethod ( currentMethod , inheritedMethod ) ; } if ( options . reportDeprecationWhenOverridingDeprecatedMethod && inheritedMethod . isViewedAsDeprecated ( ) ) { if ( ! currentMethod . isViewedAsDeprecated ( ) || options . reportDeprecationInsideDeprecatedCode ) { ReferenceBinding declaringClass = inheritedMethod . declaringClass ; if ( declaringClass . isInterface ( ) ) for ( int j = length ; -- j >= <NUM_LIT:0> ; ) if ( i != j && methods [ j ] . declaringClass . implementsInterface ( declaringClass , false ) ) continue nextMethod ; problemReporter ( currentMethod ) . overridesDeprecatedMethod ( currentMethod , inheritedMethod ) ; } } } checkForBridgeMethod ( currentMethod , inheritedMethod , allInheritedMethods ) ; } } void checkConcreteInheritedMethod ( MethodBinding concreteMethod , MethodBinding [ ] abstractMethods ) { if ( concreteMethod . isStatic ( ) ) problemReporter ( ) . staticInheritedMethodConflicts ( this . type , concreteMethod , abstractMethods ) ; if ( ! concreteMethod . isPublic ( ) ) { int index = <NUM_LIT:0> , length = abstractMethods . length ; if ( concreteMethod . isProtected ( ) ) { for ( ; index < length ; index ++ ) if ( abstractMethods [ index ] . isPublic ( ) ) break ; } else if ( concreteMethod . isDefault ( ) ) { for ( ; index < length ; index ++ ) if ( ! abstractMethods [ index ] . isDefault ( ) ) break ; } if ( index < length ) problemReporter ( ) . inheritedMethodReducesVisibility ( this . type , concreteMethod , abstractMethods ) ; } if ( concreteMethod . thrownExceptions != Binding . NO_EXCEPTIONS ) for ( int i = abstractMethods . length ; -- i >= <NUM_LIT:0> ; ) checkExceptions ( concreteMethod , abstractMethods [ i ] ) ; if ( concreteMethod . isOrEnclosedByPrivateType ( ) ) concreteMethod . original ( ) . modifiers |= ExtraCompilerModifiers . AccLocallyUsed ; } void checkExceptions ( MethodBinding newMethod , MethodBinding inheritedMethod ) { ReferenceBinding [ ] newExceptions = resolvedExceptionTypesFor ( newMethod ) ; ReferenceBinding [ ] inheritedExceptions = resolvedExceptionTypesFor ( inheritedMethod ) ; for ( int i = newExceptions . length ; -- i >= <NUM_LIT:0> ; ) { ReferenceBinding newException = newExceptions [ i ] ; int j = inheritedExceptions . length ; while ( -- j > - <NUM_LIT:1> && ! isSameClassOrSubclassOf ( newException , inheritedExceptions [ j ] ) ) { } if ( j == - <NUM_LIT:1> ) if ( ! newException . isUncheckedException ( false ) && ( newException . tagBits & TagBits . HasMissingType ) == <NUM_LIT:0> ) { problemReporter ( newMethod ) . incompatibleExceptionInThrowsClause ( this . type , newMethod , inheritedMethod , newException ) ; } } } void checkForBridgeMethod ( MethodBinding currentMethod , MethodBinding inheritedMethod , MethodBinding [ ] allInheritedMethods ) { } void checkForMissingHashCodeMethod ( ) { MethodBinding [ ] choices = this . type . getMethods ( TypeConstants . EQUALS ) ; boolean overridesEquals = false ; for ( int i = choices . length ; ! overridesEquals && -- i >= <NUM_LIT:0> ; ) overridesEquals = choices [ i ] . parameters . length == <NUM_LIT:1> && choices [ i ] . parameters [ <NUM_LIT:0> ] . id == TypeIds . T_JavaLangObject ; if ( overridesEquals ) { MethodBinding hashCodeMethod = this . type . getExactMethod ( TypeConstants . HASHCODE , Binding . NO_PARAMETERS , null ) ; if ( hashCodeMethod != null && hashCodeMethod . declaringClass . id == TypeIds . T_JavaLangObject ) this . problemReporter ( ) . shouldImplementHashcode ( this . type ) ; } } void checkForRedundantSuperinterfaces ( ReferenceBinding superclass , ReferenceBinding [ ] superInterfaces ) { if ( superInterfaces == Binding . NO_SUPERINTERFACES ) return ; SimpleSet interfacesToCheck = new SimpleSet ( superInterfaces . length ) ; next : for ( int i = <NUM_LIT:0> , l = superInterfaces . length ; i < l ; i ++ ) { ReferenceBinding toCheck = superInterfaces [ i ] ; for ( int j = <NUM_LIT:0> ; j < l ; j ++ ) { if ( i != j && toCheck . implementsInterface ( superInterfaces [ j ] , true ) ) { TypeReference [ ] refs = this . type . scope . referenceContext . superInterfaces ; for ( int r = <NUM_LIT:0> , rl = refs . length ; r < rl ; r ++ ) { if ( refs [ r ] . resolvedType == toCheck ) { problemReporter ( ) . redundantSuperInterface ( this . type , refs [ j ] , superInterfaces [ j ] , toCheck ) ; continue next ; } } } } interfacesToCheck . add ( toCheck ) ; } ReferenceBinding [ ] itsInterfaces = null ; SimpleSet inheritedInterfaces = new SimpleSet ( <NUM_LIT:5> ) ; ReferenceBinding superType = superclass ; while ( superType != null && superType . isValidBinding ( ) ) { if ( ( itsInterfaces = superType . superInterfaces ( ) ) != Binding . NO_SUPERINTERFACES ) { for ( int i = <NUM_LIT:0> , l = itsInterfaces . length ; i < l ; i ++ ) { ReferenceBinding inheritedInterface = itsInterfaces [ i ] ; if ( ! inheritedInterfaces . includes ( inheritedInterface ) && inheritedInterface . isValidBinding ( ) ) { if ( interfacesToCheck . includes ( inheritedInterface ) ) { TypeReference [ ] refs = this . type . scope . referenceContext . superInterfaces ; for ( int r = <NUM_LIT:0> , rl = refs . length ; r < rl ; r ++ ) { if ( refs [ r ] . resolvedType == inheritedInterface ) { problemReporter ( ) . redundantSuperInterface ( this . type , refs [ r ] , inheritedInterface , superType ) ; break ; } } } else { inheritedInterfaces . add ( inheritedInterface ) ; } } } } superType = superType . superclass ( ) ; } int nextPosition = inheritedInterfaces . elementSize ; if ( nextPosition == <NUM_LIT:0> ) return ; ReferenceBinding [ ] interfacesToVisit = new ReferenceBinding [ nextPosition ] ; inheritedInterfaces . asArray ( interfacesToVisit ) ; for ( int i = <NUM_LIT:0> ; i < nextPosition ; i ++ ) { superType = interfacesToVisit [ i ] ; if ( ( itsInterfaces = superType . superInterfaces ( ) ) != Binding . NO_SUPERINTERFACES ) { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding inheritedInterface = itsInterfaces [ a ] ; if ( ! inheritedInterfaces . includes ( inheritedInterface ) && inheritedInterface . isValidBinding ( ) ) { if ( interfacesToCheck . includes ( inheritedInterface ) ) { TypeReference [ ] refs = this . type . scope . referenceContext . superInterfaces ; for ( int r = <NUM_LIT:0> , rl = refs . length ; r < rl ; r ++ ) { if ( refs [ r ] . resolvedType == inheritedInterface ) { problemReporter ( ) . redundantSuperInterface ( this . type , refs [ r ] , inheritedInterface , superType ) ; break ; } } } else { inheritedInterfaces . add ( inheritedInterface ) ; interfacesToVisit [ nextPosition ++ ] = inheritedInterface ; } } } } } } void checkInheritedMethods ( MethodBinding [ ] methods , int length ) { MethodBinding concreteMethod = this . type . isInterface ( ) || methods [ <NUM_LIT:0> ] . isAbstract ( ) ? null : methods [ <NUM_LIT:0> ] ; if ( concreteMethod == null ) { MethodBinding bestAbstractMethod = length == <NUM_LIT:1> ? methods [ <NUM_LIT:0> ] : findBestInheritedAbstractMethod ( methods , length ) ; boolean noMatch = bestAbstractMethod == null ; if ( noMatch ) bestAbstractMethod = methods [ <NUM_LIT:0> ] ; if ( mustImplementAbstractMethod ( bestAbstractMethod . declaringClass ) ) { TypeDeclaration typeDeclaration = this . type . scope . referenceContext ; MethodBinding superclassAbstractMethod = methods [ <NUM_LIT:0> ] ; if ( superclassAbstractMethod == bestAbstractMethod || superclassAbstractMethod . declaringClass . isInterface ( ) ) { if ( typeDeclaration != null ) { MethodDeclaration missingAbstractMethod = typeDeclaration . addMissingAbstractMethodFor ( bestAbstractMethod ) ; missingAbstractMethod . scope . problemReporter ( ) . abstractMethodMustBeImplemented ( this . type , bestAbstractMethod ) ; } else { problemReporter ( ) . abstractMethodMustBeImplemented ( this . type , bestAbstractMethod ) ; } } else { if ( typeDeclaration != null ) { MethodDeclaration missingAbstractMethod = typeDeclaration . addMissingAbstractMethodFor ( bestAbstractMethod ) ; missingAbstractMethod . scope . problemReporter ( ) . abstractMethodMustBeImplemented ( this . type , bestAbstractMethod , superclassAbstractMethod ) ; } else { problemReporter ( ) . abstractMethodMustBeImplemented ( this . type , bestAbstractMethod , superclassAbstractMethod ) ; } } } else if ( noMatch ) { problemReporter ( ) . inheritedMethodsHaveIncompatibleReturnTypes ( this . type , methods , length ) ; } return ; } if ( length < <NUM_LIT:2> ) return ; int index = length ; while ( -- index > <NUM_LIT:0> && checkInheritedReturnTypes ( concreteMethod , methods [ index ] ) ) { } if ( index > <NUM_LIT:0> ) { MethodBinding bestAbstractMethod = findBestInheritedAbstractMethod ( methods , length ) ; if ( bestAbstractMethod == null ) problemReporter ( ) . inheritedMethodsHaveIncompatibleReturnTypes ( this . type , methods , length ) ; else problemReporter ( ) . abstractMethodMustBeImplemented ( this . type , bestAbstractMethod , concreteMethod ) ; return ; } MethodBinding [ ] abstractMethods = new MethodBinding [ length - <NUM_LIT:1> ] ; index = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) if ( methods [ i ] . isAbstract ( ) ) abstractMethods [ index ++ ] = methods [ i ] ; if ( index == <NUM_LIT:0> ) return ; if ( index < abstractMethods . length ) System . arraycopy ( abstractMethods , <NUM_LIT:0> , abstractMethods = new MethodBinding [ index ] , <NUM_LIT:0> , index ) ; checkConcreteInheritedMethod ( concreteMethod , abstractMethods ) ; } boolean checkInheritedReturnTypes ( MethodBinding method , MethodBinding otherMethod ) { if ( areReturnTypesCompatible ( method , otherMethod ) ) return true ; if ( ! this . type . isInterface ( ) ) if ( method . declaringClass . isClass ( ) || ! this . type . implementsInterface ( method . declaringClass , false ) ) if ( otherMethod . declaringClass . isClass ( ) || ! this . type . implementsInterface ( otherMethod . declaringClass , false ) ) return true ; return false ; } void checkMethods ( ) { boolean mustImplementAbstractMethods = mustImplementAbstractMethods ( ) ; boolean skipInheritedMethods = mustImplementAbstractMethods && canSkipInheritedMethods ( ) ; boolean isOrEnclosedByPrivateType = this . type . isOrEnclosedByPrivateType ( ) ; char [ ] [ ] methodSelectors = this . inheritedMethods . keyTable ; nextSelector : for ( int s = methodSelectors . length ; -- s >= <NUM_LIT:0> ; ) { if ( methodSelectors [ s ] == null ) continue nextSelector ; MethodBinding [ ] current = ( MethodBinding [ ] ) this . currentMethods . get ( methodSelectors [ s ] ) ; MethodBinding [ ] inherited = ( MethodBinding [ ] ) this . inheritedMethods . valueTable [ s ] ; if ( current == null && ! isOrEnclosedByPrivateType ) { int length = inherited . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { inherited [ i ] . original ( ) . modifiers |= ExtraCompilerModifiers . AccLocallyUsed ; } } if ( current == null && skipInheritedMethods ) continue nextSelector ; if ( inherited . length == <NUM_LIT:1> && current == null ) { if ( mustImplementAbstractMethods && inherited [ <NUM_LIT:0> ] . isAbstract ( ) ) checkAbstractMethod ( inherited [ <NUM_LIT:0> ] ) ; continue nextSelector ; } int index = - <NUM_LIT:1> ; MethodBinding [ ] matchingInherited = new MethodBinding [ inherited . length ] ; if ( current != null ) { for ( int i = <NUM_LIT:0> , length1 = current . length ; i < length1 ; i ++ ) { MethodBinding currentMethod = current [ i ] ; for ( int j = <NUM_LIT:0> , length2 = inherited . length ; j < length2 ; j ++ ) { MethodBinding inheritedMethod = computeSubstituteMethod ( inherited [ j ] , currentMethod ) ; if ( inheritedMethod != null ) { if ( isParameterSubsignature ( currentMethod , inheritedMethod ) ) { matchingInherited [ ++ index ] = inheritedMethod ; inherited [ j ] = null ; } } } if ( index >= <NUM_LIT:0> ) { checkAgainstInheritedMethods ( currentMethod , matchingInherited , index + <NUM_LIT:1> , inherited ) ; while ( index >= <NUM_LIT:0> ) matchingInherited [ index -- ] = null ; } } } for ( int i = <NUM_LIT:0> , length = inherited . length ; i < length ; i ++ ) { MethodBinding inheritedMethod = inherited [ i ] ; if ( inheritedMethod == null ) continue ; if ( ! isOrEnclosedByPrivateType && current != null ) { inheritedMethod . original ( ) . modifiers |= ExtraCompilerModifiers . AccLocallyUsed ; } matchingInherited [ ++ index ] = inheritedMethod ; for ( int j = i + <NUM_LIT:1> ; j < length ; j ++ ) { MethodBinding otherInheritedMethod = inherited [ j ] ; if ( canSkipInheritedMethods ( inheritedMethod , otherInheritedMethod ) ) continue ; otherInheritedMethod = computeSubstituteMethod ( otherInheritedMethod , inheritedMethod ) ; if ( otherInheritedMethod != null ) { if ( isParameterSubsignature ( inheritedMethod , otherInheritedMethod ) ) { matchingInherited [ ++ index ] = otherInheritedMethod ; inherited [ j ] = null ; } } } if ( index == - <NUM_LIT:1> ) continue ; if ( index > <NUM_LIT:0> ) checkInheritedMethods ( matchingInherited , index + <NUM_LIT:1> ) ; else if ( mustImplementAbstractMethods && matchingInherited [ <NUM_LIT:0> ] . isAbstract ( ) ) checkAbstractMethod ( matchingInherited [ <NUM_LIT:0> ] ) ; while ( index >= <NUM_LIT:0> ) matchingInherited [ index -- ] = null ; } } } void checkPackagePrivateAbstractMethod ( MethodBinding abstractMethod ) { PackageBinding necessaryPackage = abstractMethod . declaringClass . fPackage ; if ( necessaryPackage == this . type . fPackage ) return ; ReferenceBinding superType = this . type . superclass ( ) ; char [ ] selector = abstractMethod . selector ; do { if ( ! superType . isValidBinding ( ) ) return ; if ( ! superType . isAbstract ( ) ) return ; if ( necessaryPackage == superType . fPackage ) { MethodBinding [ ] methods = superType . getMethods ( selector ) ; nextMethod : for ( int m = methods . length ; -- m >= <NUM_LIT:0> ; ) { MethodBinding method = methods [ m ] ; if ( method . isPrivate ( ) || method . isConstructor ( ) || method . isDefaultAbstract ( ) ) continue nextMethod ; if ( areMethodsCompatible ( method , abstractMethod ) ) return ; } } } while ( ( superType = superType . superclass ( ) ) != abstractMethod . declaringClass ) ; problemReporter ( ) . abstractMethodCannotBeOverridden ( this . type , abstractMethod ) ; } void computeInheritedMethods ( ) { ReferenceBinding superclass = this . type . isInterface ( ) ? this . type . scope . getJavaLangObject ( ) : this . type . superclass ( ) ; computeInheritedMethods ( superclass , this . type . superInterfaces ( ) ) ; checkForRedundantSuperinterfaces ( superclass , this . type . superInterfaces ( ) ) ; } void computeInheritedMethods ( ReferenceBinding superclass , ReferenceBinding [ ] superInterfaces ) { this . inheritedMethods = new HashtableOfObject ( <NUM_LIT> ) ; ReferenceBinding [ ] interfacesToVisit = null ; int nextPosition = <NUM_LIT:0> ; ReferenceBinding [ ] itsInterfaces = superInterfaces ; if ( itsInterfaces != Binding . NO_SUPERINTERFACES ) { nextPosition = itsInterfaces . length ; interfacesToVisit = itsInterfaces ; } ReferenceBinding superType = superclass ; HashtableOfObject nonVisibleDefaultMethods = new HashtableOfObject ( <NUM_LIT:3> ) ; while ( superType != null && superType . isValidBinding ( ) ) { if ( ( itsInterfaces = superType . superInterfaces ( ) ) != Binding . NO_SUPERINTERFACES ) { if ( interfacesToVisit == null ) { interfacesToVisit = itsInterfaces ; nextPosition = interfacesToVisit . length ; } else { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } MethodBinding [ ] methods = superType . unResolvedMethods ( ) ; nextMethod : for ( int m = methods . length ; -- m >= <NUM_LIT:0> ; ) { MethodBinding inheritedMethod = methods [ m ] ; if ( inheritedMethod . isPrivate ( ) || inheritedMethod . isConstructor ( ) || inheritedMethod . isDefaultAbstract ( ) ) continue nextMethod ; MethodBinding [ ] existingMethods = ( MethodBinding [ ] ) this . inheritedMethods . get ( inheritedMethod . selector ) ; if ( existingMethods != null ) { existing : for ( int i = <NUM_LIT:0> , length = existingMethods . length ; i < length ; i ++ ) { MethodBinding existingMethod = existingMethods [ i ] ; if ( existingMethod . declaringClass != inheritedMethod . declaringClass && areMethodsCompatible ( existingMethod , inheritedMethod ) && ! canOverridingMethodDifferInErasure ( existingMethod , inheritedMethod ) ) { if ( inheritedMethod . isDefault ( ) ) { if ( inheritedMethod . isAbstract ( ) ) { checkPackagePrivateAbstractMethod ( inheritedMethod ) ; } else if ( existingMethod . declaringClass . fPackage != inheritedMethod . declaringClass . fPackage ) { if ( this . type . fPackage == inheritedMethod . declaringClass . fPackage && ! areReturnTypesCompatible ( inheritedMethod , existingMethod ) ) continue existing ; } } continue nextMethod ; } } } if ( ! inheritedMethod . isDefault ( ) || inheritedMethod . declaringClass . fPackage == this . type . fPackage ) { if ( existingMethods == null ) { existingMethods = new MethodBinding [ ] { inheritedMethod } ; } else { int length = existingMethods . length ; System . arraycopy ( existingMethods , <NUM_LIT:0> , existingMethods = new MethodBinding [ length + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; existingMethods [ length ] = inheritedMethod ; } this . inheritedMethods . put ( inheritedMethod . selector , existingMethods ) ; } else { MethodBinding [ ] nonVisible = ( MethodBinding [ ] ) nonVisibleDefaultMethods . get ( inheritedMethod . selector ) ; if ( nonVisible != null ) for ( int i = <NUM_LIT:0> , l = nonVisible . length ; i < l ; i ++ ) if ( areMethodsCompatible ( nonVisible [ i ] , inheritedMethod ) ) continue nextMethod ; if ( nonVisible == null ) { nonVisible = new MethodBinding [ ] { inheritedMethod } ; } else { int length = nonVisible . length ; System . arraycopy ( nonVisible , <NUM_LIT:0> , nonVisible = new MethodBinding [ length + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; nonVisible [ length ] = inheritedMethod ; } nonVisibleDefaultMethods . put ( inheritedMethod . selector , nonVisible ) ; if ( inheritedMethod . isAbstract ( ) && ! this . type . isAbstract ( ) ) problemReporter ( ) . abstractMethodCannotBeOverridden ( this . type , inheritedMethod ) ; MethodBinding [ ] current = ( MethodBinding [ ] ) this . currentMethods . get ( inheritedMethod . selector ) ; if ( current != null && ! inheritedMethod . isStatic ( ) ) { foundMatch : for ( int i = <NUM_LIT:0> , length = current . length ; i < length ; i ++ ) { if ( ! current [ i ] . isStatic ( ) && areMethodsCompatible ( current [ i ] , inheritedMethod ) ) { problemReporter ( ) . overridesPackageDefaultMethod ( current [ i ] , inheritedMethod ) ; break foundMatch ; } } } } } superType = superType . superclass ( ) ; } if ( nextPosition == <NUM_LIT:0> ) return ; SimpleSet skip = findSuperinterfaceCollisions ( superclass , superInterfaces ) ; for ( int i = <NUM_LIT:0> ; i < nextPosition ; i ++ ) { superType = interfacesToVisit [ i ] ; if ( superType . isValidBinding ( ) ) { if ( skip != null && skip . includes ( superType ) ) continue ; if ( ( itsInterfaces = superType . superInterfaces ( ) ) != Binding . NO_SUPERINTERFACES ) { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } MethodBinding [ ] methods = superType . unResolvedMethods ( ) ; nextMethod : for ( int m = methods . length ; -- m >= <NUM_LIT:0> ; ) { MethodBinding inheritedMethod = methods [ m ] ; MethodBinding [ ] existingMethods = ( MethodBinding [ ] ) this . inheritedMethods . get ( inheritedMethod . selector ) ; if ( existingMethods == null ) { existingMethods = new MethodBinding [ ] { inheritedMethod } ; } else { int length = existingMethods . length ; for ( int e = <NUM_LIT:0> ; e < length ; e ++ ) if ( isInterfaceMethodImplemented ( inheritedMethod , existingMethods [ e ] , superType ) && ! canOverridingMethodDifferInErasure ( existingMethods [ e ] , inheritedMethod ) ) continue nextMethod ; System . arraycopy ( existingMethods , <NUM_LIT:0> , existingMethods = new MethodBinding [ length + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; existingMethods [ length ] = inheritedMethod ; } this . inheritedMethods . put ( inheritedMethod . selector , existingMethods ) ; } } } } protected boolean canOverridingMethodDifferInErasure ( MethodBinding overridingMethod , MethodBinding inheritedMethod ) { return false ; } void computeMethods ( ) { MethodBinding [ ] methods = this . type . methods ( ) ; int size = methods . length ; this . currentMethods = new HashtableOfObject ( size == <NUM_LIT:0> ? <NUM_LIT:1> : size ) ; for ( int m = size ; -- m >= <NUM_LIT:0> ; ) { MethodBinding method = methods [ m ] ; if ( ! ( method . isConstructor ( ) || method . isDefaultAbstract ( ) ) ) { MethodBinding [ ] existingMethods = ( MethodBinding [ ] ) this . currentMethods . get ( method . selector ) ; if ( existingMethods == null ) existingMethods = new MethodBinding [ <NUM_LIT:1> ] ; else System . arraycopy ( existingMethods , <NUM_LIT:0> , ( existingMethods = new MethodBinding [ existingMethods . length + <NUM_LIT:1> ] ) , <NUM_LIT:0> , existingMethods . length - <NUM_LIT:1> ) ; existingMethods [ existingMethods . length - <NUM_LIT:1> ] = method ; this . currentMethods . put ( method . selector , existingMethods ) ; } } } MethodBinding computeSubstituteMethod ( MethodBinding inheritedMethod , MethodBinding currentMethod ) { if ( inheritedMethod == null ) return null ; if ( currentMethod . parameters . length != inheritedMethod . parameters . length ) return null ; return inheritedMethod ; } boolean couldMethodOverride ( MethodBinding method , MethodBinding inheritedMethod ) { if ( ! org . eclipse . jdt . core . compiler . CharOperation . equals ( method . selector , inheritedMethod . selector ) ) return false ; if ( method == inheritedMethod || method . isStatic ( ) || inheritedMethod . isStatic ( ) ) return false ; if ( inheritedMethod . isPrivate ( ) ) return false ; if ( inheritedMethod . isDefault ( ) && method . declaringClass . getPackage ( ) != inheritedMethod . declaringClass . getPackage ( ) ) return false ; if ( ! method . isPublic ( ) ) { if ( inheritedMethod . isPublic ( ) ) return false ; if ( inheritedMethod . isProtected ( ) && ! method . isProtected ( ) ) return false ; } return true ; } public boolean doesMethodOverride ( MethodBinding method , MethodBinding inheritedMethod ) { if ( ! couldMethodOverride ( method , inheritedMethod ) ) return false ; inheritedMethod = inheritedMethod . original ( ) ; TypeBinding match = method . declaringClass . findSuperTypeOriginatingFrom ( inheritedMethod . declaringClass ) ; if ( ! ( match instanceof ReferenceBinding ) ) return false ; return isParameterSubsignature ( method , inheritedMethod ) ; } SimpleSet findSuperinterfaceCollisions ( ReferenceBinding superclass , ReferenceBinding [ ] superInterfaces ) { return null ; } MethodBinding findBestInheritedAbstractMethod ( MethodBinding [ ] methods , int length ) { findMethod : for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { MethodBinding method = methods [ i ] ; if ( ! method . isAbstract ( ) ) continue findMethod ; for ( int j = <NUM_LIT:0> ; j < length ; j ++ ) { if ( i == j ) continue ; if ( ! checkInheritedReturnTypes ( method , methods [ j ] ) ) { if ( this . type . isInterface ( ) && methods [ j ] . declaringClass . id == TypeIds . T_JavaLangObject ) return method ; continue findMethod ; } } return method ; } return null ; } int [ ] findOverriddenInheritedMethods ( MethodBinding [ ] methods , int length ) { int [ ] toSkip = null ; int i = <NUM_LIT:0> ; ReferenceBinding declaringClass = methods [ i ] . declaringClass ; if ( ! declaringClass . isInterface ( ) ) { ReferenceBinding declaringClass2 = methods [ ++ i ] . declaringClass ; while ( declaringClass == declaringClass2 ) { if ( ++ i == length ) return null ; declaringClass2 = methods [ i ] . declaringClass ; } if ( ! declaringClass2 . isInterface ( ) ) { if ( declaringClass . fPackage != declaringClass2 . fPackage && methods [ i ] . isDefault ( ) ) return null ; toSkip = new int [ length ] ; do { toSkip [ i ] = - <NUM_LIT:1> ; if ( ++ i == length ) return toSkip ; declaringClass2 = methods [ i ] . declaringClass ; } while ( ! declaringClass2 . isInterface ( ) ) ; } } nextMethod : for ( ; i < length ; i ++ ) { if ( toSkip != null && toSkip [ i ] == - <NUM_LIT:1> ) continue nextMethod ; declaringClass = methods [ i ] . declaringClass ; for ( int j = i + <NUM_LIT:1> ; j < length ; j ++ ) { if ( toSkip != null && toSkip [ j ] == - <NUM_LIT:1> ) continue ; ReferenceBinding declaringClass2 = methods [ j ] . declaringClass ; if ( declaringClass == declaringClass2 ) continue ; if ( declaringClass . implementsInterface ( declaringClass2 , true ) ) { if ( toSkip == null ) toSkip = new int [ length ] ; toSkip [ j ] = - <NUM_LIT:1> ; } else if ( declaringClass2 . implementsInterface ( declaringClass , true ) ) { if ( toSkip == null ) toSkip = new int [ length ] ; toSkip [ i ] = - <NUM_LIT:1> ; continue nextMethod ; } } } return toSkip ; } boolean isAsVisible ( MethodBinding newMethod , MethodBinding inheritedMethod ) { if ( inheritedMethod . modifiers == newMethod . modifiers ) return true ; if ( newMethod . isPublic ( ) ) return true ; if ( inheritedMethod . isPublic ( ) ) return false ; if ( newMethod . isProtected ( ) ) return true ; if ( inheritedMethod . isProtected ( ) ) return false ; return ! newMethod . isPrivate ( ) ; } boolean isInterfaceMethodImplemented ( MethodBinding inheritedMethod , MethodBinding existingMethod , ReferenceBinding superType ) { return areParametersEqual ( existingMethod , inheritedMethod ) && existingMethod . declaringClass . implementsInterface ( superType , true ) ; } public boolean isMethodSubsignature ( MethodBinding method , MethodBinding inheritedMethod ) { return org . eclipse . jdt . core . compiler . CharOperation . equals ( method . selector , inheritedMethod . selector ) && isParameterSubsignature ( method , inheritedMethod ) ; } boolean isParameterSubsignature ( MethodBinding method , MethodBinding inheritedMethod ) { return areParametersEqual ( method , inheritedMethod ) ; } boolean isSameClassOrSubclassOf ( ReferenceBinding testClass , ReferenceBinding superclass ) { do { if ( testClass == superclass ) return true ; } while ( ( testClass = testClass . superclass ( ) ) != null ) ; return false ; } boolean mustImplementAbstractMethod ( ReferenceBinding declaringClass ) { if ( ! mustImplementAbstractMethods ( ) ) return false ; ReferenceBinding superclass = this . type . superclass ( ) ; if ( declaringClass . isClass ( ) ) { while ( superclass . isAbstract ( ) && superclass != declaringClass ) superclass = superclass . superclass ( ) ; } else { if ( this . type . implementsInterface ( declaringClass , false ) ) if ( ! superclass . implementsInterface ( declaringClass , true ) ) return true ; while ( superclass . isAbstract ( ) && ! superclass . implementsInterface ( declaringClass , false ) ) superclass = superclass . superclass ( ) ; } return superclass . isAbstract ( ) ; } boolean mustImplementAbstractMethods ( ) { return ! this . type . isInterface ( ) && ! this . type . isAbstract ( ) ; } ProblemReporter problemReporter ( ) { return this . type . scope . problemReporter ( ) ; } ProblemReporter problemReporter ( MethodBinding currentMethod ) { ProblemReporter reporter = problemReporter ( ) ; if ( currentMethod . declaringClass == this . type && currentMethod . sourceMethod ( ) != null ) reporter . referenceContext = currentMethod . sourceMethod ( ) ; return reporter ; } boolean reportIncompatibleReturnTypeError ( MethodBinding currentMethod , MethodBinding inheritedMethod ) { problemReporter ( currentMethod ) . incompatibleReturnType ( currentMethod , inheritedMethod ) ; return true ; } ReferenceBinding [ ] resolvedExceptionTypesFor ( MethodBinding method ) { ReferenceBinding [ ] exceptions = method . thrownExceptions ; if ( ( method . modifiers & ExtraCompilerModifiers . AccUnresolved ) == <NUM_LIT:0> ) return exceptions ; if ( ! ( method . declaringClass instanceof BinaryTypeBinding ) ) return Binding . NO_EXCEPTIONS ; for ( int i = exceptions . length ; -- i >= <NUM_LIT:0> ; ) exceptions [ i ] = ( ReferenceBinding ) BinaryTypeBinding . resolveType ( exceptions [ i ] , this . environment , true ) ; return exceptions ; } void verify ( ) { computeMethods ( ) ; computeInheritedMethods ( ) ; checkMethods ( ) ; if ( this . type . isClass ( ) ) checkForMissingHashCodeMethod ( ) ; } void verify ( SourceTypeBinding someType ) { if ( this . type == null ) { try { this . type = someType ; verify ( ) ; } finally { this . type = null ; } } else { this . environment . newMethodVerifier ( ) . verify ( someType ) ; } } public String toString ( ) { StringBuffer buffer = new StringBuffer ( <NUM_LIT:10> ) ; buffer . append ( "<STR_LIT>" ) ; buffer . append ( this . type . readableName ( ) ) ; buffer . append ( '<STR_LIT:\n>' ) ; buffer . append ( "<STR_LIT>" ) ; buffer . append ( this . inheritedMethods ) ; return buffer . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; public class InferenceContext { private TypeBinding [ ] [ ] [ ] collectedSubstitutes ; MethodBinding genericMethod ; int depth ; int status ; TypeBinding expectedType ; boolean hasExplicitExpectedType ; public boolean isUnchecked ; TypeBinding [ ] substitutes ; final static int FAILED = <NUM_LIT:1> ; public InferenceContext ( MethodBinding genericMethod ) { this . genericMethod = genericMethod ; TypeVariableBinding [ ] typeVariables = genericMethod . typeVariables ; int varLength = typeVariables . length ; this . collectedSubstitutes = new TypeBinding [ varLength ] [ <NUM_LIT:3> ] [ ] ; this . substitutes = new TypeBinding [ varLength ] ; } public TypeBinding [ ] getSubstitutes ( TypeVariableBinding typeVariable , int constraint ) { return this . collectedSubstitutes [ typeVariable . rank ] [ constraint ] ; } public boolean hasUnresolvedTypeArgument ( ) { for ( int i = <NUM_LIT:0> , varLength = this . substitutes . length ; i < varLength ; i ++ ) { if ( this . substitutes [ i ] == null ) { return true ; } } return false ; } public void recordSubstitute ( TypeVariableBinding typeVariable , TypeBinding actualType , int constraint ) { TypeBinding [ ] [ ] variableSubstitutes = this . collectedSubstitutes [ typeVariable . rank ] ; insertLoop : { TypeBinding [ ] constraintSubstitutes = variableSubstitutes [ constraint ] ; int length ; if ( constraintSubstitutes == null ) { length = <NUM_LIT:0> ; constraintSubstitutes = new TypeBinding [ <NUM_LIT:1> ] ; } else { length = constraintSubstitutes . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeBinding substitute = constraintSubstitutes [ i ] ; if ( substitute == actualType ) return ; if ( substitute == null ) { constraintSubstitutes [ i ] = actualType ; break insertLoop ; } } System . arraycopy ( constraintSubstitutes , <NUM_LIT:0> , constraintSubstitutes = new TypeBinding [ length + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; } constraintSubstitutes [ length ] = actualType ; variableSubstitutes [ constraint ] = constraintSubstitutes ; } } public String toString ( ) { StringBuffer buffer = new StringBuffer ( <NUM_LIT:20> ) ; buffer . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> , length = this . genericMethod . typeVariables . length ; i < length ; i ++ ) { buffer . append ( this . genericMethod . typeVariables [ i ] ) ; } buffer . append ( this . genericMethod ) ; buffer . append ( "<STR_LIT>" ) ; switch ( this . status ) { case <NUM_LIT:0> : buffer . append ( "<STR_LIT>" ) ; break ; case FAILED : buffer . append ( "<STR_LIT>" ) ; break ; } if ( this . expectedType == null ) { buffer . append ( "<STR_LIT>" ) ; } else { buffer . append ( "<STR_LIT>" ) . append ( this . expectedType . shortReadableName ( ) ) . append ( '<CHAR_LIT:]>' ) ; } buffer . append ( "<STR_LIT>" ) . append ( this . depth ) . append ( '<CHAR_LIT:]>' ) ; buffer . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> , length = this . collectedSubstitutes == null ? <NUM_LIT:0> : this . collectedSubstitutes . length ; i < length ; i ++ ) { TypeBinding [ ] [ ] collected = this . collectedSubstitutes [ i ] ; for ( int j = TypeConstants . CONSTRAINT_EQUAL ; j <= TypeConstants . CONSTRAINT_SUPER ; j ++ ) { TypeBinding [ ] constraintCollected = collected [ j ] ; if ( constraintCollected != null ) { for ( int k = <NUM_LIT:0> , clength = constraintCollected . length ; k < clength ; k ++ ) { buffer . append ( "<STR_LIT>" ) . append ( this . genericMethod . typeVariables [ i ] . sourceName ) ; switch ( j ) { case TypeConstants . CONSTRAINT_EQUAL : buffer . append ( "<STR_LIT:=>" ) ; break ; case TypeConstants . CONSTRAINT_EXTENDS : buffer . append ( "<STR_LIT>" ) ; break ; case TypeConstants . CONSTRAINT_SUPER : buffer . append ( "<STR_LIT>" ) ; break ; } if ( constraintCollected [ k ] != null ) { buffer . append ( constraintCollected [ k ] . shortReadableName ( ) ) ; } } } } } buffer . append ( "<STR_LIT>" ) ; buffer . append ( "<STR_LIT>" ) ; int count = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> , length = this . substitutes == null ? <NUM_LIT:0> : this . substitutes . length ; i < length ; i ++ ) { if ( this . substitutes [ i ] == null ) continue ; count ++ ; buffer . append ( '<CHAR_LIT>' ) . append ( this . genericMethod . typeVariables [ i ] . sourceName ) ; buffer . append ( "<STR_LIT:=>" ) . append ( this . substitutes [ i ] . shortReadableName ( ) ) . append ( '<CHAR_LIT:}>' ) ; } if ( count == <NUM_LIT:0> ) buffer . append ( "<STR_LIT:{}>" ) ; buffer . append ( '<CHAR_LIT:]>' ) ; return buffer . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . FieldDeclaration ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . impl . Constant ; public class FieldBinding extends VariableBinding { public ReferenceBinding declaringClass ; protected FieldBinding ( ) { super ( null , null , <NUM_LIT:0> , null ) ; } public FieldBinding ( char [ ] name , TypeBinding type , int modifiers , ReferenceBinding declaringClass , Constant constant ) { super ( name , type , modifiers , constant ) ; this . declaringClass = declaringClass ; } public FieldBinding ( FieldBinding initialFieldBinding , ReferenceBinding declaringClass ) { super ( initialFieldBinding . name , initialFieldBinding . type , initialFieldBinding . modifiers , initialFieldBinding . constant ( ) ) ; this . declaringClass = declaringClass ; this . id = initialFieldBinding . id ; setAnnotations ( initialFieldBinding . getAnnotations ( ) ) ; } public FieldBinding ( FieldDeclaration field , TypeBinding type , int modifiers , ReferenceBinding declaringClass ) { this ( field . name , type , modifiers , declaringClass , null ) ; field . binding = this ; } public final boolean canBeSeenBy ( PackageBinding invocationPackage ) { if ( isPublic ( ) ) return true ; if ( isPrivate ( ) ) return false ; return invocationPackage == this . declaringClass . getPackage ( ) ; } public final boolean canBeSeenBy ( TypeBinding receiverType , InvocationSite invocationSite , Scope scope ) { if ( isPublic ( ) ) return true ; SourceTypeBinding invocationType = scope . enclosingSourceType ( ) ; if ( invocationType == this . declaringClass && invocationType == receiverType ) return true ; if ( invocationType == null ) return ! isPrivate ( ) && scope . getCurrentPackage ( ) == this . declaringClass . fPackage ; if ( isProtected ( ) ) { if ( invocationType == this . declaringClass ) return true ; if ( invocationType . fPackage == this . declaringClass . fPackage ) return true ; ReferenceBinding currentType = invocationType ; int depth = <NUM_LIT:0> ; ReferenceBinding receiverErasure = ( ReferenceBinding ) receiverType . erasure ( ) ; ReferenceBinding declaringErasure = ( ReferenceBinding ) this . declaringClass . erasure ( ) ; do { if ( currentType . findSuperTypeOriginatingFrom ( declaringErasure ) != null ) { if ( invocationSite . isSuperAccess ( ) ) return true ; if ( receiverType instanceof ArrayBinding ) return false ; if ( isStatic ( ) ) { if ( depth > <NUM_LIT:0> ) invocationSite . setDepth ( depth ) ; return true ; } if ( currentType == receiverErasure || receiverErasure . findSuperTypeOriginatingFrom ( currentType ) != null ) { if ( depth > <NUM_LIT:0> ) invocationSite . setDepth ( depth ) ; return true ; } } depth ++ ; currentType = currentType . enclosingType ( ) ; } while ( currentType != null ) ; return false ; } if ( isPrivate ( ) ) { receiverCheck : { if ( receiverType != this . declaringClass ) { if ( receiverType . isTypeVariable ( ) && ( ( TypeVariableBinding ) receiverType ) . isErasureBoundTo ( this . declaringClass . erasure ( ) ) ) break receiverCheck ; return false ; } } if ( invocationType != this . declaringClass ) { ReferenceBinding outerInvocationType = invocationType ; ReferenceBinding temp = outerInvocationType . enclosingType ( ) ; while ( temp != null ) { outerInvocationType = temp ; temp = temp . enclosingType ( ) ; } ReferenceBinding outerDeclaringClass = ( ReferenceBinding ) this . declaringClass . erasure ( ) ; temp = outerDeclaringClass . enclosingType ( ) ; while ( temp != null ) { outerDeclaringClass = temp ; temp = temp . enclosingType ( ) ; } if ( outerInvocationType != outerDeclaringClass ) return false ; } return true ; } PackageBinding declaringPackage = this . declaringClass . fPackage ; if ( invocationType . fPackage != declaringPackage ) return false ; if ( receiverType instanceof ArrayBinding ) return false ; TypeBinding originalDeclaringClass = this . declaringClass . original ( ) ; ReferenceBinding currentType = ( ReferenceBinding ) receiverType ; do { if ( currentType . isCapture ( ) ) { if ( originalDeclaringClass == currentType . erasure ( ) . original ( ) ) return true ; } else { if ( originalDeclaringClass == currentType . original ( ) ) return true ; } PackageBinding currentPackage = currentType . fPackage ; if ( currentPackage != null && currentPackage != declaringPackage ) return false ; } while ( ( currentType = currentType . superclass ( ) ) != null ) ; return false ; } public char [ ] computeUniqueKey ( boolean isLeaf ) { char [ ] declaringKey = this . declaringClass == null ? CharOperation . NO_CHAR : this . declaringClass . computeUniqueKey ( false ) ; int declaringLength = declaringKey . length ; int nameLength = this . name . length ; char [ ] returnTypeKey = this . type == null ? new char [ ] { '<CHAR_LIT>' } : this . type . computeUniqueKey ( false ) ; int returnTypeLength = returnTypeKey . length ; char [ ] uniqueKey = new char [ declaringLength + <NUM_LIT:1> + nameLength + <NUM_LIT:1> + returnTypeLength ] ; int index = <NUM_LIT:0> ; System . arraycopy ( declaringKey , <NUM_LIT:0> , uniqueKey , index , declaringLength ) ; index += declaringLength ; uniqueKey [ index ++ ] = '<CHAR_LIT:.>' ; System . arraycopy ( this . name , <NUM_LIT:0> , uniqueKey , index , nameLength ) ; index += nameLength ; uniqueKey [ index ++ ] = '<CHAR_LIT:)>' ; System . arraycopy ( returnTypeKey , <NUM_LIT:0> , uniqueKey , index , returnTypeLength ) ; return uniqueKey ; } public Constant constant ( ) { Constant fieldConstant = this . constant ; if ( fieldConstant == null ) { if ( isFinal ( ) ) { FieldBinding originalField = original ( ) ; if ( originalField . declaringClass instanceof SourceTypeBinding ) { SourceTypeBinding sourceType = ( SourceTypeBinding ) originalField . declaringClass ; if ( sourceType . scope != null ) { TypeDeclaration typeDecl = sourceType . scope . referenceContext ; FieldDeclaration fieldDecl = typeDecl . declarationOf ( originalField ) ; MethodScope initScope = originalField . isStatic ( ) ? typeDecl . staticInitializerScope : typeDecl . initializerScope ; boolean old = initScope . insideTypeAnnotation ; try { initScope . insideTypeAnnotation = false ; fieldDecl . resolve ( initScope ) ; } finally { initScope . insideTypeAnnotation = old ; } fieldConstant = originalField . constant == null ? Constant . NotAConstant : originalField . constant ; } else { fieldConstant = Constant . NotAConstant ; } } else { fieldConstant = Constant . NotAConstant ; } } else { fieldConstant = Constant . NotAConstant ; } this . constant = fieldConstant ; } return fieldConstant ; } public char [ ] genericSignature ( ) { if ( ( this . modifiers & ExtraCompilerModifiers . AccGenericSignature ) == <NUM_LIT:0> ) return null ; return this . type . genericTypeSignature ( ) ; } public final int getAccessFlags ( ) { return this . modifiers & ExtraCompilerModifiers . AccJustFlag ; } public AnnotationBinding [ ] getAnnotations ( ) { FieldBinding originalField = original ( ) ; ReferenceBinding declaringClassBinding = originalField . declaringClass ; if ( declaringClassBinding == null ) { return Binding . NO_ANNOTATIONS ; } return declaringClassBinding . retrieveAnnotations ( originalField ) ; } public long getAnnotationTagBits ( ) { FieldBinding originalField = original ( ) ; if ( ( originalField . tagBits & TagBits . AnnotationResolved ) == <NUM_LIT:0> && originalField . declaringClass instanceof SourceTypeBinding ) { ClassScope scope = ( ( SourceTypeBinding ) originalField . declaringClass ) . scope ; if ( scope == null ) { this . tagBits |= ( TagBits . AnnotationResolved | TagBits . DeprecatedAnnotationResolved ) ; return <NUM_LIT:0> ; } TypeDeclaration typeDecl = scope . referenceContext ; FieldDeclaration fieldDecl = typeDecl . declarationOf ( originalField ) ; if ( fieldDecl != null ) { MethodScope initializationScope = isStatic ( ) ? typeDecl . staticInitializerScope : typeDecl . initializerScope ; FieldBinding previousField = initializationScope . initializedField ; int previousFieldID = initializationScope . lastVisibleFieldID ; try { initializationScope . initializedField = originalField ; initializationScope . lastVisibleFieldID = originalField . id ; ASTNode . resolveAnnotations ( initializationScope , fieldDecl . annotations , originalField ) ; } finally { initializationScope . initializedField = previousField ; initializationScope . lastVisibleFieldID = previousFieldID ; } } } return originalField . tagBits ; } public final boolean isDefault ( ) { return ! isPublic ( ) && ! isProtected ( ) && ! isPrivate ( ) ; } public final boolean isDeprecated ( ) { return ( this . modifiers & ClassFileConstants . AccDeprecated ) != <NUM_LIT:0> ; } public final boolean isPrivate ( ) { return ( this . modifiers & ClassFileConstants . AccPrivate ) != <NUM_LIT:0> ; } public final boolean isOrEnclosedByPrivateType ( ) { if ( ( this . modifiers & ClassFileConstants . AccPrivate ) != <NUM_LIT:0> ) return true ; return this . declaringClass != null && this . declaringClass . isOrEnclosedByPrivateType ( ) ; } public final boolean isProtected ( ) { return ( this . modifiers & ClassFileConstants . AccProtected ) != <NUM_LIT:0> ; } public final boolean isPublic ( ) { return ( this . modifiers & ClassFileConstants . AccPublic ) != <NUM_LIT:0> ; } public final boolean isStatic ( ) { return ( this . modifiers & ClassFileConstants . AccStatic ) != <NUM_LIT:0> ; } public final boolean isSynthetic ( ) { return ( this . modifiers & ClassFileConstants . AccSynthetic ) != <NUM_LIT:0> ; } public final boolean isTransient ( ) { return ( this . modifiers & ClassFileConstants . AccTransient ) != <NUM_LIT:0> ; } public final boolean isUsed ( ) { return ( this . modifiers & ExtraCompilerModifiers . AccLocallyUsed ) != <NUM_LIT:0> ; } public final boolean isViewedAsDeprecated ( ) { return ( this . modifiers & ( ClassFileConstants . AccDeprecated | ExtraCompilerModifiers . AccDeprecatedImplicitly ) ) != <NUM_LIT:0> ; } public final boolean isVolatile ( ) { return ( this . modifiers & ClassFileConstants . AccVolatile ) != <NUM_LIT:0> ; } public final int kind ( ) { return FIELD ; } public FieldBinding original ( ) { return this ; } public void setAnnotations ( AnnotationBinding [ ] annotations ) { this . declaringClass . storeAnnotations ( this , annotations ) ; } public FieldDeclaration sourceField ( ) { SourceTypeBinding sourceType ; try { sourceType = ( SourceTypeBinding ) this . declaringClass ; } catch ( ClassCastException e ) { return null ; } FieldDeclaration [ ] fields = sourceType . scope . referenceContext . fields ; if ( fields != null ) { for ( int i = fields . length ; -- i >= <NUM_LIT:0> ; ) if ( this == fields [ i ] . binding ) return fields [ i ] ; } return null ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; public class UnresolvedAnnotationBinding extends AnnotationBinding { private LookupEnvironment env ; private boolean typeUnresolved = true ; UnresolvedAnnotationBinding ( ReferenceBinding type , ElementValuePair [ ] pairs , LookupEnvironment env ) { super ( type , pairs ) ; this . env = env ; } public ReferenceBinding getAnnotationType ( ) { if ( this . typeUnresolved ) { this . type = ( ReferenceBinding ) BinaryTypeBinding . resolveType ( this . type , this . env , false ) ; this . typeUnresolved = false ; } return this . type ; } public ElementValuePair [ ] getElementValuePairs ( ) { if ( this . env != null ) { if ( this . typeUnresolved ) { getAnnotationType ( ) ; } for ( int i = this . pairs . length ; -- i >= <NUM_LIT:0> ; ) { ElementValuePair pair = this . pairs [ i ] ; MethodBinding [ ] methods = this . type . getMethods ( pair . getName ( ) ) ; if ( methods != null && methods . length == <NUM_LIT:1> ) { pair . setMethodBinding ( methods [ <NUM_LIT:0> ] ) ; } Object value = pair . getValue ( ) ; if ( value instanceof UnresolvedReferenceBinding ) { pair . setValue ( ( ( UnresolvedReferenceBinding ) value ) . resolve ( this . env , false ) ) ; } } this . env = null ; } return this . pairs ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import java . util . * ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . * ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . impl . ReferenceContext ; import org . eclipse . jdt . internal . compiler . problem . AbortCompilation ; import org . eclipse . jdt . internal . compiler . problem . ProblemReporter ; import org . eclipse . jdt . internal . compiler . util . HashtableOfObject ; import org . eclipse . jdt . internal . compiler . util . ObjectVector ; import org . eclipse . jdt . internal . compiler . util . SimpleSet ; public abstract class Scope { public final static int BLOCK_SCOPE = <NUM_LIT:1> ; public final static int CLASS_SCOPE = <NUM_LIT:3> ; public final static int COMPILATION_UNIT_SCOPE = <NUM_LIT:4> ; public final static int METHOD_SCOPE = <NUM_LIT:2> ; public final static int NOT_COMPATIBLE = - <NUM_LIT:1> ; public final static int COMPATIBLE = <NUM_LIT:0> ; public final static int AUTOBOX_COMPATIBLE = <NUM_LIT:1> ; public final static int VARARGS_COMPATIBLE = <NUM_LIT:2> ; public static final int EQUAL_OR_MORE_SPECIFIC = - <NUM_LIT:1> ; public static final int NOT_RELATED = <NUM_LIT:0> ; public static final int MORE_GENERIC = <NUM_LIT:1> ; public int kind ; public Scope parent ; protected Scope ( int kind , Scope parent ) { this . kind = kind ; this . parent = parent ; } public static int compareTypes ( TypeBinding left , TypeBinding right ) { if ( left . isCompatibleWith ( right ) ) return Scope . EQUAL_OR_MORE_SPECIFIC ; if ( right . isCompatibleWith ( left ) ) return Scope . MORE_GENERIC ; return Scope . NOT_RELATED ; } public static TypeBinding convertEliminatingTypeVariables ( TypeBinding originalType , ReferenceBinding genericType , int rank , Set eliminatedVariables ) { if ( ( originalType . tagBits & TagBits . HasTypeVariable ) != <NUM_LIT:0> ) { switch ( originalType . kind ( ) ) { case Binding . ARRAY_TYPE : ArrayBinding originalArrayType = ( ArrayBinding ) originalType ; TypeBinding originalLeafComponentType = originalArrayType . leafComponentType ; TypeBinding substitute = convertEliminatingTypeVariables ( originalLeafComponentType , genericType , rank , eliminatedVariables ) ; if ( substitute != originalLeafComponentType ) { return originalArrayType . environment . createArrayType ( substitute . leafComponentType ( ) , substitute . dimensions ( ) + originalArrayType . dimensions ( ) ) ; } break ; case Binding . PARAMETERIZED_TYPE : ParameterizedTypeBinding paramType = ( ParameterizedTypeBinding ) originalType ; ReferenceBinding originalEnclosing = paramType . enclosingType ( ) ; ReferenceBinding substitutedEnclosing = originalEnclosing ; if ( originalEnclosing != null ) { substitutedEnclosing = ( ReferenceBinding ) convertEliminatingTypeVariables ( originalEnclosing , genericType , rank , eliminatedVariables ) ; } TypeBinding [ ] originalArguments = paramType . arguments ; TypeBinding [ ] substitutedArguments = originalArguments ; for ( int i = <NUM_LIT:0> , length = originalArguments == null ? <NUM_LIT:0> : originalArguments . length ; i < length ; i ++ ) { TypeBinding originalArgument = originalArguments [ i ] ; TypeBinding substitutedArgument = convertEliminatingTypeVariables ( originalArgument , paramType . genericType ( ) , i , eliminatedVariables ) ; if ( substitutedArgument != originalArgument ) { if ( substitutedArguments == originalArguments ) { System . arraycopy ( originalArguments , <NUM_LIT:0> , substitutedArguments = new TypeBinding [ length ] , <NUM_LIT:0> , i ) ; } substitutedArguments [ i ] = substitutedArgument ; } else if ( substitutedArguments != originalArguments ) { substitutedArguments [ i ] = originalArgument ; } } if ( originalEnclosing != substitutedEnclosing || originalArguments != substitutedArguments ) { return paramType . environment . createParameterizedType ( paramType . genericType ( ) , substitutedArguments , substitutedEnclosing ) ; } break ; case Binding . TYPE_PARAMETER : if ( genericType == null ) { break ; } TypeVariableBinding originalVariable = ( TypeVariableBinding ) originalType ; if ( eliminatedVariables != null && eliminatedVariables . contains ( originalType ) ) { return originalVariable . environment . createWildcard ( genericType , rank , null , null , Wildcard . UNBOUND ) ; } TypeBinding originalUpperBound = originalVariable . upperBound ( ) ; if ( eliminatedVariables == null ) { eliminatedVariables = new HashSet ( <NUM_LIT:2> ) ; } eliminatedVariables . add ( originalVariable ) ; TypeBinding substitutedUpperBound = convertEliminatingTypeVariables ( originalUpperBound , genericType , rank , eliminatedVariables ) ; eliminatedVariables . remove ( originalVariable ) ; return originalVariable . environment . createWildcard ( genericType , rank , substitutedUpperBound , null , Wildcard . EXTENDS ) ; case Binding . RAW_TYPE : break ; case Binding . GENERIC_TYPE : ReferenceBinding currentType = ( ReferenceBinding ) originalType ; originalEnclosing = currentType . enclosingType ( ) ; substitutedEnclosing = originalEnclosing ; if ( originalEnclosing != null ) { substitutedEnclosing = ( ReferenceBinding ) convertEliminatingTypeVariables ( originalEnclosing , genericType , rank , eliminatedVariables ) ; } originalArguments = currentType . typeVariables ( ) ; substitutedArguments = originalArguments ; for ( int i = <NUM_LIT:0> , length = originalArguments == null ? <NUM_LIT:0> : originalArguments . length ; i < length ; i ++ ) { TypeBinding originalArgument = originalArguments [ i ] ; TypeBinding substitutedArgument = convertEliminatingTypeVariables ( originalArgument , currentType , i , eliminatedVariables ) ; if ( substitutedArgument != originalArgument ) { if ( substitutedArguments == originalArguments ) { System . arraycopy ( originalArguments , <NUM_LIT:0> , substitutedArguments = new TypeBinding [ length ] , <NUM_LIT:0> , i ) ; } substitutedArguments [ i ] = substitutedArgument ; } else if ( substitutedArguments != originalArguments ) { substitutedArguments [ i ] = originalArgument ; } } if ( originalEnclosing != substitutedEnclosing || originalArguments != substitutedArguments ) { return ( ( TypeVariableBinding ) originalArguments [ <NUM_LIT:0> ] ) . environment . createParameterizedType ( genericType , substitutedArguments , substitutedEnclosing ) ; } break ; case Binding . WILDCARD_TYPE : WildcardBinding wildcard = ( WildcardBinding ) originalType ; TypeBinding originalBound = wildcard . bound ; TypeBinding substitutedBound = originalBound ; if ( originalBound != null ) { substitutedBound = convertEliminatingTypeVariables ( originalBound , genericType , rank , eliminatedVariables ) ; if ( substitutedBound != originalBound ) { return wildcard . environment . createWildcard ( wildcard . genericType , wildcard . rank , substitutedBound , null , wildcard . boundKind ) ; } } break ; case Binding . INTERSECTION_TYPE : WildcardBinding intersection = ( WildcardBinding ) originalType ; originalBound = intersection . bound ; substitutedBound = originalBound ; if ( originalBound != null ) { substitutedBound = convertEliminatingTypeVariables ( originalBound , genericType , rank , eliminatedVariables ) ; } TypeBinding [ ] originalOtherBounds = intersection . otherBounds ; TypeBinding [ ] substitutedOtherBounds = originalOtherBounds ; for ( int i = <NUM_LIT:0> , length = originalOtherBounds == null ? <NUM_LIT:0> : originalOtherBounds . length ; i < length ; i ++ ) { TypeBinding originalOtherBound = originalOtherBounds [ i ] ; TypeBinding substitutedOtherBound = convertEliminatingTypeVariables ( originalOtherBound , genericType , rank , eliminatedVariables ) ; if ( substitutedOtherBound != originalOtherBound ) { if ( substitutedOtherBounds == originalOtherBounds ) { System . arraycopy ( originalOtherBounds , <NUM_LIT:0> , substitutedOtherBounds = new TypeBinding [ length ] , <NUM_LIT:0> , i ) ; } substitutedOtherBounds [ i ] = substitutedOtherBound ; } else if ( substitutedOtherBounds != originalOtherBounds ) { substitutedOtherBounds [ i ] = originalOtherBound ; } } if ( substitutedBound != originalBound || substitutedOtherBounds != originalOtherBounds ) { return intersection . environment . createWildcard ( intersection . genericType , intersection . rank , substitutedBound , substitutedOtherBounds , intersection . boundKind ) ; } break ; } } return originalType ; } public static TypeBinding getBaseType ( char [ ] name ) { int length = name . length ; if ( length > <NUM_LIT:2> && length < <NUM_LIT:8> ) { switch ( name [ <NUM_LIT:0> ] ) { case '<CHAR_LIT>' : if ( length == <NUM_LIT:3> && name [ <NUM_LIT:1> ] == '<CHAR_LIT>' && name [ <NUM_LIT:2> ] == '<CHAR_LIT>' ) return TypeBinding . INT ; break ; case '<CHAR_LIT>' : if ( length == <NUM_LIT:4> && name [ <NUM_LIT:1> ] == '<CHAR_LIT>' && name [ <NUM_LIT:2> ] == '<CHAR_LIT>' && name [ <NUM_LIT:3> ] == '<CHAR_LIT>' ) return TypeBinding . VOID ; break ; case '<CHAR_LIT:b>' : if ( length == <NUM_LIT:7> && name [ <NUM_LIT:1> ] == '<CHAR_LIT>' && name [ <NUM_LIT:2> ] == '<CHAR_LIT>' && name [ <NUM_LIT:3> ] == '<CHAR_LIT>' && name [ <NUM_LIT:4> ] == '<CHAR_LIT:e>' && name [ <NUM_LIT:5> ] == '<CHAR_LIT:a>' && name [ <NUM_LIT:6> ] == '<CHAR_LIT>' ) return TypeBinding . BOOLEAN ; if ( length == <NUM_LIT:4> && name [ <NUM_LIT:1> ] == '<CHAR_LIT>' && name [ <NUM_LIT:2> ] == '<CHAR_LIT>' && name [ <NUM_LIT:3> ] == '<CHAR_LIT:e>' ) return TypeBinding . BYTE ; break ; case '<CHAR_LIT:c>' : if ( length == <NUM_LIT:4> && name [ <NUM_LIT:1> ] == '<CHAR_LIT>' && name [ <NUM_LIT:2> ] == '<CHAR_LIT:a>' && name [ <NUM_LIT:3> ] == '<CHAR_LIT>' ) return TypeBinding . CHAR ; break ; case '<CHAR_LIT>' : if ( length == <NUM_LIT:6> && name [ <NUM_LIT:1> ] == '<CHAR_LIT>' && name [ <NUM_LIT:2> ] == '<CHAR_LIT>' && name [ <NUM_LIT:3> ] == '<CHAR_LIT:b>' && name [ <NUM_LIT:4> ] == '<CHAR_LIT>' && name [ <NUM_LIT:5> ] == '<CHAR_LIT:e>' ) return TypeBinding . DOUBLE ; break ; case '<CHAR_LIT>' : if ( length == <NUM_LIT:5> && name [ <NUM_LIT:1> ] == '<CHAR_LIT>' && name [ <NUM_LIT:2> ] == '<CHAR_LIT>' && name [ <NUM_LIT:3> ] == '<CHAR_LIT:a>' && name [ <NUM_LIT:4> ] == '<CHAR_LIT>' ) return TypeBinding . FLOAT ; break ; case '<CHAR_LIT>' : if ( length == <NUM_LIT:4> && name [ <NUM_LIT:1> ] == '<CHAR_LIT>' && name [ <NUM_LIT:2> ] == '<CHAR_LIT>' && name [ <NUM_LIT:3> ] == '<CHAR_LIT>' ) return TypeBinding . LONG ; break ; case '<CHAR_LIT>' : if ( length == <NUM_LIT:5> && name [ <NUM_LIT:1> ] == '<CHAR_LIT>' && name [ <NUM_LIT:2> ] == '<CHAR_LIT>' && name [ <NUM_LIT:3> ] == '<CHAR_LIT>' && name [ <NUM_LIT:4> ] == '<CHAR_LIT>' ) return TypeBinding . SHORT ; } } return null ; } public static ReferenceBinding [ ] greaterLowerBound ( ReferenceBinding [ ] types ) { if ( types == null ) return null ; int length = types . length ; if ( length == <NUM_LIT:0> ) return null ; ReferenceBinding [ ] result = types ; int removed = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { ReferenceBinding iType = result [ i ] ; if ( iType == null ) continue ; for ( int j = <NUM_LIT:0> ; j < length ; j ++ ) { if ( i == j ) continue ; ReferenceBinding jType = result [ j ] ; if ( jType == null ) continue ; if ( iType . isCompatibleWith ( jType ) ) { if ( result == types ) { System . arraycopy ( result , <NUM_LIT:0> , result = new ReferenceBinding [ length ] , <NUM_LIT:0> , length ) ; } result [ j ] = null ; removed ++ ; } } } if ( removed == <NUM_LIT:0> ) return result ; if ( length == removed ) return null ; ReferenceBinding [ ] trimmedResult = new ReferenceBinding [ length - removed ] ; for ( int i = <NUM_LIT:0> , index = <NUM_LIT:0> ; i < length ; i ++ ) { ReferenceBinding iType = result [ i ] ; if ( iType != null ) { trimmedResult [ index ++ ] = iType ; } } return trimmedResult ; } public static TypeBinding [ ] greaterLowerBound ( TypeBinding [ ] types ) { if ( types == null ) return null ; int length = types . length ; if ( length == <NUM_LIT:0> ) return null ; TypeBinding [ ] result = types ; int removed = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeBinding iType = result [ i ] ; if ( iType == null ) continue ; for ( int j = <NUM_LIT:0> ; j < length ; j ++ ) { if ( i == j ) continue ; TypeBinding jType = result [ j ] ; if ( jType == null ) continue ; if ( iType . isCompatibleWith ( jType ) ) { if ( result == types ) { System . arraycopy ( result , <NUM_LIT:0> , result = new TypeBinding [ length ] , <NUM_LIT:0> , length ) ; } result [ j ] = null ; removed ++ ; } } } if ( removed == <NUM_LIT:0> ) return result ; if ( length == removed ) return null ; TypeBinding [ ] trimmedResult = new TypeBinding [ length - removed ] ; for ( int i = <NUM_LIT:0> , index = <NUM_LIT:0> ; i < length ; i ++ ) { TypeBinding iType = result [ i ] ; if ( iType != null ) { trimmedResult [ index ++ ] = iType ; } } return trimmedResult ; } public static ReferenceBinding [ ] substitute ( Substitution substitution , ReferenceBinding [ ] originalTypes ) { if ( originalTypes == null ) return null ; ReferenceBinding [ ] substitutedTypes = originalTypes ; for ( int i = <NUM_LIT:0> , length = originalTypes . length ; i < length ; i ++ ) { ReferenceBinding originalType = originalTypes [ i ] ; TypeBinding substitutedType = substitute ( substitution , originalType ) ; if ( ! ( substitutedType instanceof ReferenceBinding ) ) { return null ; } if ( substitutedType != originalType ) { if ( substitutedTypes == originalTypes ) { System . arraycopy ( originalTypes , <NUM_LIT:0> , substitutedTypes = new ReferenceBinding [ length ] , <NUM_LIT:0> , i ) ; } substitutedTypes [ i ] = ( ReferenceBinding ) substitutedType ; } else if ( substitutedTypes != originalTypes ) { substitutedTypes [ i ] = originalType ; } } return substitutedTypes ; } public static TypeBinding substitute ( Substitution substitution , TypeBinding originalType ) { if ( originalType == null ) return null ; switch ( originalType . kind ( ) ) { case Binding . TYPE_PARAMETER : return substitution . substitute ( ( TypeVariableBinding ) originalType ) ; case Binding . PARAMETERIZED_TYPE : ParameterizedTypeBinding originalParameterizedType = ( ParameterizedTypeBinding ) originalType ; ReferenceBinding originalEnclosing = originalType . enclosingType ( ) ; ReferenceBinding substitutedEnclosing = originalEnclosing ; if ( originalEnclosing != null ) { substitutedEnclosing = ( ReferenceBinding ) substitute ( substitution , originalEnclosing ) ; } TypeBinding [ ] originalArguments = originalParameterizedType . arguments ; TypeBinding [ ] substitutedArguments = originalArguments ; if ( originalArguments != null ) { if ( substitution . isRawSubstitution ( ) ) { return originalParameterizedType . environment . createRawType ( originalParameterizedType . genericType ( ) , substitutedEnclosing ) ; } substitutedArguments = substitute ( substitution , originalArguments ) ; } if ( substitutedArguments != originalArguments || substitutedEnclosing != originalEnclosing ) { return originalParameterizedType . environment . createParameterizedType ( originalParameterizedType . genericType ( ) , substitutedArguments , substitutedEnclosing ) ; } break ; case Binding . ARRAY_TYPE : ArrayBinding originalArrayType = ( ArrayBinding ) originalType ; TypeBinding originalLeafComponentType = originalArrayType . leafComponentType ; TypeBinding substitute = substitute ( substitution , originalLeafComponentType ) ; if ( substitute != originalLeafComponentType ) { return originalArrayType . environment . createArrayType ( substitute . leafComponentType ( ) , substitute . dimensions ( ) + originalType . dimensions ( ) ) ; } break ; case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : WildcardBinding wildcard = ( WildcardBinding ) originalType ; if ( wildcard . boundKind != Wildcard . UNBOUND ) { TypeBinding originalBound = wildcard . bound ; TypeBinding substitutedBound = substitute ( substitution , originalBound ) ; TypeBinding [ ] originalOtherBounds = wildcard . otherBounds ; TypeBinding [ ] substitutedOtherBounds = substitute ( substitution , originalOtherBounds ) ; if ( substitutedBound != originalBound || originalOtherBounds != substitutedOtherBounds ) { return wildcard . environment . createWildcard ( wildcard . genericType , wildcard . rank , substitutedBound , substitutedOtherBounds , wildcard . boundKind ) ; } } break ; case Binding . TYPE : if ( ! originalType . isMemberType ( ) ) break ; ReferenceBinding originalReferenceType = ( ReferenceBinding ) originalType ; originalEnclosing = originalType . enclosingType ( ) ; substitutedEnclosing = originalEnclosing ; if ( originalEnclosing != null ) { substitutedEnclosing = ( ReferenceBinding ) substitute ( substitution , originalEnclosing ) ; } if ( substitutedEnclosing != originalEnclosing ) { return substitution . isRawSubstitution ( ) ? substitution . environment ( ) . createRawType ( originalReferenceType , substitutedEnclosing ) : substitution . environment ( ) . createParameterizedType ( originalReferenceType , null , substitutedEnclosing ) ; } break ; case Binding . GENERIC_TYPE : originalReferenceType = ( ReferenceBinding ) originalType ; originalEnclosing = originalType . enclosingType ( ) ; substitutedEnclosing = originalEnclosing ; if ( originalEnclosing != null ) { substitutedEnclosing = ( ReferenceBinding ) substitute ( substitution , originalEnclosing ) ; } if ( substitution . isRawSubstitution ( ) ) { return substitution . environment ( ) . createRawType ( originalReferenceType , substitutedEnclosing ) ; } originalArguments = originalReferenceType . typeVariables ( ) ; substitutedArguments = substitute ( substitution , originalArguments ) ; return substitution . environment ( ) . createParameterizedType ( originalReferenceType , substitutedArguments , substitutedEnclosing ) ; } return originalType ; } public static TypeBinding [ ] substitute ( Substitution substitution , TypeBinding [ ] originalTypes ) { if ( originalTypes == null ) return null ; TypeBinding [ ] substitutedTypes = originalTypes ; for ( int i = <NUM_LIT:0> , length = originalTypes . length ; i < length ; i ++ ) { TypeBinding originalType = originalTypes [ i ] ; TypeBinding substitutedParameter = substitute ( substitution , originalType ) ; if ( substitutedParameter != originalType ) { if ( substitutedTypes == originalTypes ) { System . arraycopy ( originalTypes , <NUM_LIT:0> , substitutedTypes = new TypeBinding [ length ] , <NUM_LIT:0> , i ) ; } substitutedTypes [ i ] = substitutedParameter ; } else if ( substitutedTypes != originalTypes ) { substitutedTypes [ i ] = originalType ; } } return substitutedTypes ; } public TypeBinding boxing ( TypeBinding type ) { if ( type . isBaseType ( ) ) return environment ( ) . computeBoxingType ( type ) ; return type ; } public final ClassScope classScope ( ) { Scope scope = this ; do { if ( scope instanceof ClassScope ) return ( ClassScope ) scope ; scope = scope . parent ; } while ( scope != null ) ; return null ; } public final CompilationUnitScope compilationUnitScope ( ) { Scope lastScope = null ; Scope scope = this ; do { lastScope = scope ; scope = scope . parent ; } while ( scope != null ) ; return ( CompilationUnitScope ) lastScope ; } public final CompilerOptions compilerOptions ( ) { return compilationUnitScope ( ) . environment . globalOptions ; } protected final MethodBinding computeCompatibleMethod ( MethodBinding method , TypeBinding [ ] arguments , InvocationSite invocationSite ) { TypeBinding [ ] genericTypeArguments = invocationSite . genericTypeArguments ( ) ; TypeBinding [ ] parameters = method . parameters ; TypeVariableBinding [ ] typeVariables = method . typeVariables ; if ( parameters == arguments && ( method . returnType . tagBits & TagBits . HasTypeVariable ) == <NUM_LIT:0> && genericTypeArguments == null && typeVariables == Binding . NO_TYPE_VARIABLES ) return method ; int argLength = arguments . length ; int paramLength = parameters . length ; boolean isVarArgs = method . isVarargs ( ) ; if ( argLength != paramLength ) if ( ! isVarArgs || argLength < paramLength - <NUM_LIT:1> ) return null ; if ( typeVariables != Binding . NO_TYPE_VARIABLES ) { TypeBinding [ ] newArgs = null ; for ( int i = <NUM_LIT:0> ; i < argLength ; i ++ ) { TypeBinding param = i < paramLength ? parameters [ i ] : parameters [ paramLength - <NUM_LIT:1> ] ; if ( arguments [ i ] . isBaseType ( ) != param . isBaseType ( ) ) { if ( newArgs == null ) { newArgs = new TypeBinding [ argLength ] ; System . arraycopy ( arguments , <NUM_LIT:0> , newArgs , <NUM_LIT:0> , argLength ) ; } newArgs [ i ] = environment ( ) . computeBoxingType ( arguments [ i ] ) ; } } if ( newArgs != null ) arguments = newArgs ; method = ParameterizedGenericMethodBinding . computeCompatibleMethod ( method , arguments , this , invocationSite ) ; if ( method == null ) return null ; if ( ! method . isValidBinding ( ) ) return method ; } else if ( genericTypeArguments != null && compilerOptions ( ) . complianceLevel < ClassFileConstants . JDK1_7 ) { if ( method instanceof ParameterizedGenericMethodBinding ) { if ( ! ( ( ParameterizedGenericMethodBinding ) method ) . wasInferred ) return new ProblemMethodBinding ( method , method . selector , genericTypeArguments , ProblemReasons . TypeArgumentsForRawGenericMethod ) ; } else if ( ! method . isOverriding ( ) || ! isOverriddenMethodGeneric ( method ) ) { return new ProblemMethodBinding ( method , method . selector , genericTypeArguments , ProblemReasons . TypeParameterArityMismatch ) ; } } if ( parameterCompatibilityLevel ( method , arguments ) > NOT_COMPATIBLE ) return method ; if ( genericTypeArguments != null ) return new ProblemMethodBinding ( method , method . selector , arguments , ProblemReasons . ParameterizedMethodTypeMismatch ) ; return null ; } protected boolean connectTypeVariables ( TypeParameter [ ] typeParameters , boolean checkForErasedCandidateCollisions ) { if ( typeParameters == null || compilerOptions ( ) . sourceLevel < ClassFileConstants . JDK1_5 ) return true ; Map invocations = new HashMap ( <NUM_LIT:2> ) ; boolean noProblems = true ; for ( int i = <NUM_LIT:0> , paramLength = typeParameters . length ; i < paramLength ; i ++ ) { TypeParameter typeParameter = typeParameters [ i ] ; TypeVariableBinding typeVariable = typeParameter . binding ; if ( typeVariable == null ) return false ; typeVariable . superclass = getJavaLangObject ( ) ; typeVariable . superInterfaces = Binding . NO_SUPERINTERFACES ; typeVariable . firstBound = null ; } nextVariable : for ( int i = <NUM_LIT:0> , paramLength = typeParameters . length ; i < paramLength ; i ++ ) { TypeParameter typeParameter = typeParameters [ i ] ; TypeVariableBinding typeVariable = typeParameter . binding ; TypeReference typeRef = typeParameter . type ; if ( typeRef == null ) continue nextVariable ; boolean isFirstBoundTypeVariable = false ; TypeBinding superType = this . kind == METHOD_SCOPE ? typeRef . resolveType ( ( BlockScope ) this , false ) : typeRef . resolveType ( ( ClassScope ) this ) ; if ( superType == null ) { typeVariable . tagBits |= TagBits . HierarchyHasProblems ; } else { typeRef . resolvedType = superType ; firstBound : { switch ( superType . kind ( ) ) { case Binding . ARRAY_TYPE : problemReporter ( ) . boundCannotBeArray ( typeRef , superType ) ; typeVariable . tagBits |= TagBits . HierarchyHasProblems ; break firstBound ; case Binding . TYPE_PARAMETER : isFirstBoundTypeVariable = true ; TypeVariableBinding varSuperType = ( TypeVariableBinding ) superType ; if ( varSuperType . rank >= typeVariable . rank && varSuperType . declaringElement == typeVariable . declaringElement ) { if ( compilerOptions ( ) . complianceLevel <= ClassFileConstants . JDK1_6 ) { problemReporter ( ) . forwardTypeVariableReference ( typeParameter , varSuperType ) ; typeVariable . tagBits |= TagBits . HierarchyHasProblems ; break firstBound ; } } break ; default : if ( ( ( ReferenceBinding ) superType ) . isFinal ( ) ) { problemReporter ( ) . finalVariableBound ( typeVariable , typeRef ) ; } break ; } ReferenceBinding superRefType = ( ReferenceBinding ) superType ; if ( ! superType . isInterface ( ) ) { typeVariable . superclass = superRefType ; } else { typeVariable . superInterfaces = new ReferenceBinding [ ] { superRefType } ; } typeVariable . tagBits |= superType . tagBits & TagBits . ContainsNestedTypeReferences ; typeVariable . firstBound = superRefType ; } } TypeReference [ ] boundRefs = typeParameter . bounds ; if ( boundRefs != null ) { nextBound : for ( int j = <NUM_LIT:0> , boundLength = boundRefs . length ; j < boundLength ; j ++ ) { typeRef = boundRefs [ j ] ; superType = this . kind == METHOD_SCOPE ? typeRef . resolveType ( ( BlockScope ) this , false ) : typeRef . resolveType ( ( ClassScope ) this ) ; if ( superType == null ) { typeVariable . tagBits |= TagBits . HierarchyHasProblems ; continue nextBound ; } else { typeVariable . tagBits |= superType . tagBits & TagBits . ContainsNestedTypeReferences ; boolean didAlreadyComplain = ! typeRef . resolvedType . isValidBinding ( ) ; if ( isFirstBoundTypeVariable && j == <NUM_LIT:0> ) { problemReporter ( ) . noAdditionalBoundAfterTypeVariable ( typeRef ) ; typeVariable . tagBits |= TagBits . HierarchyHasProblems ; didAlreadyComplain = true ; } else if ( superType . isArrayType ( ) ) { if ( ! didAlreadyComplain ) { problemReporter ( ) . boundCannotBeArray ( typeRef , superType ) ; typeVariable . tagBits |= TagBits . HierarchyHasProblems ; } continue nextBound ; } else { if ( ! superType . isInterface ( ) ) { if ( ! didAlreadyComplain ) { problemReporter ( ) . boundMustBeAnInterface ( typeRef , superType ) ; typeVariable . tagBits |= TagBits . HierarchyHasProblems ; } continue nextBound ; } } if ( checkForErasedCandidateCollisions && typeVariable . firstBound == typeVariable . superclass ) { if ( hasErasedCandidatesCollisions ( superType , typeVariable . superclass , invocations , typeVariable , typeRef ) ) { continue nextBound ; } } ReferenceBinding superRefType = ( ReferenceBinding ) superType ; for ( int index = typeVariable . superInterfaces . length ; -- index >= <NUM_LIT:0> ; ) { ReferenceBinding previousInterface = typeVariable . superInterfaces [ index ] ; if ( previousInterface == superRefType ) { problemReporter ( ) . duplicateBounds ( typeRef , superType ) ; typeVariable . tagBits |= TagBits . HierarchyHasProblems ; continue nextBound ; } if ( checkForErasedCandidateCollisions ) { if ( hasErasedCandidatesCollisions ( superType , previousInterface , invocations , typeVariable , typeRef ) ) { continue nextBound ; } } } int size = typeVariable . superInterfaces . length ; System . arraycopy ( typeVariable . superInterfaces , <NUM_LIT:0> , typeVariable . superInterfaces = new ReferenceBinding [ size + <NUM_LIT:1> ] , <NUM_LIT:0> , size ) ; typeVariable . superInterfaces [ size ] = superRefType ; } } } noProblems &= ( typeVariable . tagBits & TagBits . HierarchyHasProblems ) == <NUM_LIT:0> ; } return noProblems ; } public ArrayBinding createArrayType ( TypeBinding type , int dimension ) { if ( type . isValidBinding ( ) ) return environment ( ) . createArrayType ( type , dimension ) ; return new ArrayBinding ( type , dimension , environment ( ) ) ; } public TypeVariableBinding [ ] createTypeVariables ( TypeParameter [ ] typeParameters , Binding declaringElement ) { if ( typeParameters == null || compilerOptions ( ) . sourceLevel < ClassFileConstants . JDK1_5 ) return Binding . NO_TYPE_VARIABLES ; PackageBinding unitPackage = compilationUnitScope ( ) . fPackage ; int length = typeParameters . length ; TypeVariableBinding [ ] typeVariableBindings = new TypeVariableBinding [ length ] ; int count = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeParameter typeParameter = typeParameters [ i ] ; TypeVariableBinding parameterBinding = new TypeVariableBinding ( typeParameter . name , declaringElement , i , environment ( ) ) ; parameterBinding . fPackage = unitPackage ; typeParameter . binding = parameterBinding ; for ( int j = <NUM_LIT:0> ; j < count ; j ++ ) { TypeVariableBinding knownVar = typeVariableBindings [ j ] ; if ( CharOperation . equals ( knownVar . sourceName , typeParameter . name ) ) problemReporter ( ) . duplicateTypeParameterInType ( typeParameter ) ; } typeVariableBindings [ count ++ ] = parameterBinding ; } if ( count != length ) System . arraycopy ( typeVariableBindings , <NUM_LIT:0> , typeVariableBindings = new TypeVariableBinding [ count ] , <NUM_LIT:0> , count ) ; return typeVariableBindings ; } public final ClassScope enclosingClassScope ( ) { Scope scope = this ; while ( ( scope = scope . parent ) != null ) { if ( scope instanceof ClassScope ) return ( ClassScope ) scope ; } return null ; } public final MethodScope enclosingMethodScope ( ) { Scope scope = this ; while ( ( scope = scope . parent ) != null ) { if ( scope instanceof MethodScope ) return ( MethodScope ) scope ; } return null ; } public final ReferenceBinding enclosingReceiverType ( ) { Scope scope = this ; do { if ( scope instanceof ClassScope ) { return environment ( ) . convertToParameterizedType ( ( ( ClassScope ) scope ) . referenceContext . binding ) ; } scope = scope . parent ; } while ( scope != null ) ; return null ; } public ReferenceContext enclosingReferenceContext ( ) { Scope current = this ; while ( ( current = current . parent ) != null ) { switch ( current . kind ) { case METHOD_SCOPE : return ( ( MethodScope ) current ) . referenceContext ; case CLASS_SCOPE : return ( ( ClassScope ) current ) . referenceContext ; case COMPILATION_UNIT_SCOPE : return ( ( CompilationUnitScope ) current ) . referenceContext ; } } return null ; } public final SourceTypeBinding enclosingSourceType ( ) { Scope scope = this ; do { if ( scope instanceof ClassScope ) return ( ( ClassScope ) scope ) . referenceContext . binding ; scope = scope . parent ; } while ( scope != null ) ; return null ; } public final LookupEnvironment environment ( ) { Scope scope , unitScope = this ; while ( ( scope = unitScope . parent ) != null ) unitScope = scope ; return ( ( CompilationUnitScope ) unitScope ) . environment ; } protected MethodBinding findDefaultAbstractMethod ( ReferenceBinding receiverType , char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite , ReferenceBinding classHierarchyStart , ObjectVector found , MethodBinding concreteMatch ) { int startFoundSize = found . size ; ReferenceBinding currentType = classHierarchyStart ; while ( currentType != null ) { findMethodInSuperInterfaces ( currentType , selector , found , invocationSite ) ; currentType = currentType . superclass ( ) ; } MethodBinding [ ] candidates = null ; int candidatesCount = <NUM_LIT:0> ; MethodBinding problemMethod = null ; int foundSize = found . size ; if ( foundSize > startFoundSize ) { for ( int i = startFoundSize ; i < foundSize ; i ++ ) { MethodBinding methodBinding = ( MethodBinding ) found . elementAt ( i ) ; MethodBinding compatibleMethod = computeCompatibleMethod ( methodBinding , argumentTypes , invocationSite ) ; if ( compatibleMethod != null ) { if ( compatibleMethod . isValidBinding ( ) ) { if ( concreteMatch != null && environment ( ) . methodVerifier ( ) . areMethodsCompatible ( concreteMatch , compatibleMethod ) ) continue ; if ( candidatesCount == <NUM_LIT:0> ) { candidates = new MethodBinding [ foundSize - startFoundSize + <NUM_LIT:1> ] ; if ( concreteMatch != null ) candidates [ candidatesCount ++ ] = concreteMatch ; } candidates [ candidatesCount ++ ] = compatibleMethod ; } else if ( problemMethod == null ) { problemMethod = compatibleMethod ; } } } } if ( candidatesCount < <NUM_LIT:2> ) { if ( concreteMatch == null ) { if ( candidatesCount == <NUM_LIT:0> ) return problemMethod ; concreteMatch = candidates [ <NUM_LIT:0> ] ; } compilationUnitScope ( ) . recordTypeReferences ( concreteMatch . thrownExceptions ) ; return concreteMatch ; } if ( compilerOptions ( ) . complianceLevel >= ClassFileConstants . JDK1_4 ) return mostSpecificMethodBinding ( candidates , candidatesCount , argumentTypes , invocationSite , receiverType ) ; return mostSpecificInterfaceMethodBinding ( candidates , candidatesCount , invocationSite ) ; } public ReferenceBinding findDirectMemberType ( char [ ] typeName , ReferenceBinding enclosingType ) { if ( ( enclosingType . tagBits & TagBits . HasNoMemberTypes ) != <NUM_LIT:0> ) return null ; ReferenceBinding enclosingReceiverType = enclosingReceiverType ( ) ; CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordReference ( enclosingType , typeName ) ; ReferenceBinding memberType = enclosingType . getMemberType ( typeName ) ; if ( memberType != null ) { unitScope . recordTypeReference ( memberType ) ; if ( enclosingReceiverType == null ) { if ( memberType . canBeSeenBy ( getCurrentPackage ( ) ) ) { return memberType ; } if ( this instanceof CompilationUnitScope ) { TypeDeclaration [ ] types = ( ( CompilationUnitScope ) this ) . referenceContext . types ; if ( types != null ) { for ( int i = <NUM_LIT:0> , max = types . length ; i < max ; i ++ ) { if ( memberType . canBeSeenBy ( enclosingType , types [ i ] . binding ) ) { return memberType ; } } } } } else if ( memberType . canBeSeenBy ( enclosingType , enclosingReceiverType ) ) { return memberType ; } return new ProblemReferenceBinding ( new char [ ] [ ] { typeName } , memberType , ProblemReasons . NotVisible ) ; } return null ; } public MethodBinding findExactMethod ( ReferenceBinding receiverType , char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordTypeReferences ( argumentTypes ) ; MethodBinding exactMethod = receiverType . getExactMethod ( selector , argumentTypes , unitScope ) ; if ( exactMethod != null && exactMethod . typeVariables == Binding . NO_TYPE_VARIABLES && ! exactMethod . isBridge ( ) ) { if ( compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ) for ( int i = argumentTypes . length ; -- i >= <NUM_LIT:0> ; ) if ( isPossibleSubtypeOfRawType ( argumentTypes [ i ] ) ) return null ; unitScope . recordTypeReferences ( exactMethod . thrownExceptions ) ; if ( exactMethod . isAbstract ( ) && exactMethod . thrownExceptions != Binding . NO_EXCEPTIONS ) return null ; if ( receiverType . isInterface ( ) || exactMethod . canBeSeenBy ( receiverType , invocationSite , this ) ) { if ( argumentTypes == Binding . NO_PARAMETERS && CharOperation . equals ( selector , TypeConstants . GETCLASS ) && exactMethod . returnType . isParameterizedType ( ) ) { return environment ( ) . createGetClassMethod ( receiverType , exactMethod , this ) ; } if ( invocationSite . genericTypeArguments ( ) != null ) { exactMethod = computeCompatibleMethod ( exactMethod , argumentTypes , invocationSite ) ; } return exactMethod ; } } return null ; } public FieldBinding findField ( TypeBinding receiverType , char [ ] fieldName , InvocationSite invocationSite , boolean needResolve ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordTypeReference ( receiverType ) ; checkArrayField : { TypeBinding leafType ; switch ( receiverType . kind ( ) ) { case Binding . BASE_TYPE : return null ; case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : case Binding . TYPE_PARAMETER : TypeBinding receiverErasure = receiverType . erasure ( ) ; if ( ! receiverErasure . isArrayType ( ) ) break checkArrayField ; leafType = receiverErasure . leafComponentType ( ) ; break ; case Binding . ARRAY_TYPE : leafType = receiverType . leafComponentType ( ) ; break ; default : break checkArrayField ; } if ( leafType instanceof ReferenceBinding ) if ( ! ( ( ReferenceBinding ) leafType ) . canBeSeenBy ( this ) ) return new ProblemFieldBinding ( ( ReferenceBinding ) leafType , fieldName , ProblemReasons . ReceiverTypeNotVisible ) ; if ( CharOperation . equals ( fieldName , TypeConstants . LENGTH ) ) { if ( ( leafType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { return new ProblemFieldBinding ( ArrayBinding . ArrayLength , null , fieldName , ProblemReasons . NotFound ) ; } return ArrayBinding . ArrayLength ; } return null ; } ReferenceBinding currentType = ( ReferenceBinding ) receiverType ; if ( ! currentType . canBeSeenBy ( this ) ) return new ProblemFieldBinding ( currentType , fieldName , ProblemReasons . ReceiverTypeNotVisible ) ; currentType . initializeForStaticImports ( ) ; FieldBinding field = currentType . getField ( fieldName , needResolve ) ; boolean insideTypeAnnotations = this instanceof MethodScope && ( ( MethodScope ) this ) . insideTypeAnnotation ; if ( field != null ) { if ( invocationSite == null || insideTypeAnnotations ? field . canBeSeenBy ( getCurrentPackage ( ) ) : field . canBeSeenBy ( currentType , invocationSite , this ) ) return field ; return new ProblemFieldBinding ( field , field . declaringClass , fieldName , ProblemReasons . NotVisible ) ; } ReferenceBinding [ ] interfacesToVisit = null ; int nextPosition = <NUM_LIT:0> ; FieldBinding visibleField = null ; boolean keepLooking = true ; FieldBinding notVisibleField = null ; while ( keepLooking ) { ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { if ( interfacesToVisit == null ) { interfacesToVisit = itsInterfaces ; nextPosition = interfacesToVisit . length ; } else { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } if ( ( currentType = currentType . superclass ( ) ) == null ) break ; unitScope . recordTypeReference ( currentType ) ; currentType . initializeForStaticImports ( ) ; currentType = ( ReferenceBinding ) currentType . capture ( this , invocationSite == null ? <NUM_LIT:0> : invocationSite . sourceEnd ( ) ) ; if ( ( field = currentType . getField ( fieldName , needResolve ) ) != null ) { keepLooking = false ; if ( field . canBeSeenBy ( receiverType , invocationSite , this ) ) { if ( visibleField == null ) visibleField = field ; else return new ProblemFieldBinding ( visibleField , visibleField . declaringClass , fieldName , ProblemReasons . Ambiguous ) ; } else { if ( notVisibleField == null ) notVisibleField = field ; } } } if ( interfacesToVisit != null ) { ProblemFieldBinding ambiguous = null ; done : for ( int i = <NUM_LIT:0> ; i < nextPosition ; i ++ ) { ReferenceBinding anInterface = interfacesToVisit [ i ] ; unitScope . recordTypeReference ( anInterface ) ; if ( ( field = anInterface . getField ( fieldName , true ) ) != null ) { if ( visibleField == null ) { visibleField = field ; } else { ambiguous = new ProblemFieldBinding ( visibleField , visibleField . declaringClass , fieldName , ProblemReasons . Ambiguous ) ; break done ; } } else { ReferenceBinding [ ] itsInterfaces = anInterface . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } } if ( ambiguous != null ) return ambiguous ; } if ( visibleField != null ) return visibleField ; if ( notVisibleField != null ) { return new ProblemFieldBinding ( notVisibleField , currentType , fieldName , ProblemReasons . NotVisible ) ; } return null ; } public ReferenceBinding findMemberType ( char [ ] typeName , ReferenceBinding enclosingType ) { if ( ( enclosingType . tagBits & TagBits . HasNoMemberTypes ) != <NUM_LIT:0> ) return null ; ReferenceBinding enclosingSourceType = enclosingSourceType ( ) ; PackageBinding currentPackage = getCurrentPackage ( ) ; CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordReference ( enclosingType , typeName ) ; ReferenceBinding memberType = enclosingType . getMemberType ( typeName ) ; if ( memberType != null ) { unitScope . recordTypeReference ( memberType ) ; if ( enclosingSourceType == null || ( this . parent == unitScope && ( enclosingSourceType . tagBits & TagBits . TypeVariablesAreConnected ) == <NUM_LIT:0> ) ? memberType . canBeSeenBy ( currentPackage ) : memberType . canBeSeenBy ( enclosingType , enclosingSourceType ) ) return memberType ; return new ProblemReferenceBinding ( new char [ ] [ ] { typeName } , memberType , ProblemReasons . NotVisible ) ; } ReferenceBinding currentType = enclosingType ; ReferenceBinding [ ] interfacesToVisit = null ; int nextPosition = <NUM_LIT:0> ; ReferenceBinding visibleMemberType = null ; boolean keepLooking = true ; ReferenceBinding notVisible = null ; while ( keepLooking ) { ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces == null ) { ReferenceBinding sourceType = currentType . isParameterizedType ( ) ? ( ( ParameterizedTypeBinding ) currentType ) . genericType ( ) : currentType ; if ( sourceType . isHierarchyBeingConnected ( ) ) return null ; ( ( SourceTypeBinding ) sourceType ) . scope . connectTypeHierarchy ( ) ; itsInterfaces = currentType . superInterfaces ( ) ; } if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { if ( interfacesToVisit == null ) { interfacesToVisit = itsInterfaces ; nextPosition = interfacesToVisit . length ; } else { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } if ( ( currentType = currentType . superclass ( ) ) == null ) break ; unitScope . recordReference ( currentType , typeName ) ; if ( ( memberType = currentType . getMemberType ( typeName ) ) != null ) { unitScope . recordTypeReference ( memberType ) ; keepLooking = false ; if ( enclosingSourceType == null ? memberType . canBeSeenBy ( currentPackage ) : memberType . canBeSeenBy ( enclosingType , enclosingSourceType ) ) { if ( visibleMemberType == null ) visibleMemberType = memberType ; else return new ProblemReferenceBinding ( new char [ ] [ ] { typeName } , visibleMemberType , ProblemReasons . Ambiguous ) ; } else { notVisible = memberType ; } } } if ( interfacesToVisit != null ) { ProblemReferenceBinding ambiguous = null ; done : for ( int i = <NUM_LIT:0> ; i < nextPosition ; i ++ ) { ReferenceBinding anInterface = interfacesToVisit [ i ] ; unitScope . recordReference ( anInterface , typeName ) ; if ( ( memberType = anInterface . getMemberType ( typeName ) ) != null ) { unitScope . recordTypeReference ( memberType ) ; if ( visibleMemberType == null ) { visibleMemberType = memberType ; } else { ambiguous = new ProblemReferenceBinding ( new char [ ] [ ] { typeName } , visibleMemberType , ProblemReasons . Ambiguous ) ; break done ; } } else { ReferenceBinding [ ] itsInterfaces = anInterface . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } } if ( ambiguous != null ) return ambiguous ; } if ( visibleMemberType != null ) return visibleMemberType ; if ( notVisible != null ) return new ProblemReferenceBinding ( new char [ ] [ ] { typeName } , notVisible , ProblemReasons . NotVisible ) ; return null ; } public MethodBinding findMethod ( ReferenceBinding receiverType , char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite ) { return findMethod ( receiverType , selector , argumentTypes , invocationSite , false ) ; } public MethodBinding oneLastLook ( ReferenceBinding receiverType , char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite ) { MethodBinding [ ] extraMethods = receiverType . getAnyExtraMethods ( selector ) ; if ( extraMethods != null ) { return extraMethods [ <NUM_LIT:0> ] ; } else { return null ; } } public MethodBinding findMethod ( ReferenceBinding receiverType , char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite , boolean inStaticContext ) { ReferenceBinding currentType = receiverType ; boolean receiverTypeIsInterface = receiverType . isInterface ( ) ; ObjectVector found = new ObjectVector ( <NUM_LIT:3> ) ; CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordTypeReferences ( argumentTypes ) ; if ( receiverTypeIsInterface ) { unitScope . recordTypeReference ( receiverType ) ; MethodBinding [ ] receiverMethods = receiverType . getMethods ( selector , argumentTypes . length ) ; if ( receiverMethods . length > <NUM_LIT:0> ) found . addAll ( receiverMethods ) ; findMethodInSuperInterfaces ( receiverType , selector , found , invocationSite ) ; currentType = getJavaLangObject ( ) ; } long complianceLevel = compilerOptions ( ) . complianceLevel ; boolean isCompliant14 = complianceLevel >= ClassFileConstants . JDK1_4 ; boolean isCompliant15 = complianceLevel >= ClassFileConstants . JDK1_5 ; ReferenceBinding classHierarchyStart = currentType ; MethodVerifier verifier = environment ( ) . methodVerifier ( ) ; while ( currentType != null ) { unitScope . recordTypeReference ( currentType ) ; currentType = ( ReferenceBinding ) currentType . capture ( this , invocationSite == null ? <NUM_LIT:0> : invocationSite . sourceEnd ( ) ) ; MethodBinding [ ] currentMethods = currentType . getMethods ( selector , argumentTypes . length ) ; int currentLength = currentMethods . length ; if ( currentLength > <NUM_LIT:0> ) { if ( isCompliant14 && ( receiverTypeIsInterface || found . size > <NUM_LIT:0> ) ) { nextMethod : for ( int i = <NUM_LIT:0> , l = currentLength ; i < l ; i ++ ) { MethodBinding currentMethod = currentMethods [ i ] ; if ( currentMethod == null ) continue nextMethod ; if ( receiverTypeIsInterface && ! currentMethod . isPublic ( ) ) { currentLength -- ; currentMethods [ i ] = null ; continue nextMethod ; } for ( int j = <NUM_LIT:0> , max = found . size ; j < max ; j ++ ) { MethodBinding matchingMethod = ( MethodBinding ) found . elementAt ( j ) ; MethodBinding matchingOriginal = matchingMethod . original ( ) ; MethodBinding currentOriginal = matchingOriginal . findOriginalInheritedMethod ( currentMethod ) ; if ( currentOriginal != null && verifier . isParameterSubsignature ( matchingOriginal , currentOriginal ) ) { if ( isCompliant15 ) { if ( matchingMethod . isBridge ( ) && ! currentMethod . isBridge ( ) ) continue nextMethod ; } currentLength -- ; currentMethods [ i ] = null ; continue nextMethod ; } } } } if ( currentLength > <NUM_LIT:0> ) { if ( currentMethods . length == currentLength ) { found . addAll ( currentMethods ) ; } else { for ( int i = <NUM_LIT:0> , max = currentMethods . length ; i < max ; i ++ ) { MethodBinding currentMethod = currentMethods [ i ] ; if ( currentMethod != null ) found . add ( currentMethod ) ; } } } } currentType = currentType . superclass ( ) ; } int foundSize = found . size ; MethodBinding [ ] candidates = null ; int candidatesCount = <NUM_LIT:0> ; MethodBinding problemMethod = null ; boolean searchForDefaultAbstractMethod = isCompliant14 && ! receiverTypeIsInterface && ( receiverType . isAbstract ( ) || receiverType . isTypeVariable ( ) ) ; if ( foundSize > <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> ; i < foundSize ; i ++ ) { MethodBinding methodBinding = ( MethodBinding ) found . elementAt ( i ) ; MethodBinding compatibleMethod = computeCompatibleMethod ( methodBinding , argumentTypes , invocationSite ) ; if ( compatibleMethod != null ) { if ( compatibleMethod . isValidBinding ( ) ) { if ( foundSize == <NUM_LIT:1> && compatibleMethod . canBeSeenBy ( receiverType , invocationSite , this ) ) { if ( searchForDefaultAbstractMethod ) return findDefaultAbstractMethod ( receiverType , selector , argumentTypes , invocationSite , classHierarchyStart , found , compatibleMethod ) ; unitScope . recordTypeReferences ( compatibleMethod . thrownExceptions ) ; return compatibleMethod ; } if ( candidatesCount == <NUM_LIT:0> ) candidates = new MethodBinding [ foundSize ] ; candidates [ candidatesCount ++ ] = compatibleMethod ; } else if ( problemMethod == null ) { problemMethod = compatibleMethod ; } } } } if ( candidatesCount == <NUM_LIT:0> ) { if ( problemMethod != null ) { switch ( problemMethod . problemId ( ) ) { case ProblemReasons . TypeArgumentsForRawGenericMethod : case ProblemReasons . TypeParameterArityMismatch : return problemMethod ; } } MethodBinding interfaceMethod = findDefaultAbstractMethod ( receiverType , selector , argumentTypes , invocationSite , classHierarchyStart , found , null ) ; if ( interfaceMethod != null ) return interfaceMethod ; if ( found . size == <NUM_LIT:0> ) return null ; if ( problemMethod != null ) return problemMethod ; int bestArgMatches = - <NUM_LIT:1> ; MethodBinding bestGuess = ( MethodBinding ) found . elementAt ( <NUM_LIT:0> ) ; int argLength = argumentTypes . length ; foundSize = found . size ; nextMethod : for ( int i = <NUM_LIT:0> ; i < foundSize ; i ++ ) { MethodBinding methodBinding = ( MethodBinding ) found . elementAt ( i ) ; TypeBinding [ ] params = methodBinding . parameters ; int paramLength = params . length ; int argMatches = <NUM_LIT:0> ; next : for ( int a = <NUM_LIT:0> ; a < argLength ; a ++ ) { TypeBinding arg = argumentTypes [ a ] ; for ( int p = a == <NUM_LIT:0> ? <NUM_LIT:0> : a - <NUM_LIT:1> ; p < paramLength && p < a + <NUM_LIT:1> ; p ++ ) { if ( params [ p ] == arg ) { argMatches ++ ; continue next ; } } } if ( argMatches < bestArgMatches ) continue nextMethod ; if ( argMatches == bestArgMatches ) { int diff1 = paramLength < argLength ? <NUM_LIT:2> * ( argLength - paramLength ) : paramLength - argLength ; int bestLength = bestGuess . parameters . length ; int diff2 = bestLength < argLength ? <NUM_LIT:2> * ( argLength - bestLength ) : bestLength - argLength ; if ( diff1 >= diff2 ) continue nextMethod ; } bestArgMatches = argMatches ; bestGuess = methodBinding ; } return new ProblemMethodBinding ( bestGuess , bestGuess . selector , argumentTypes , ProblemReasons . NotFound ) ; } int visiblesCount = <NUM_LIT:0> ; if ( receiverTypeIsInterface ) { if ( candidatesCount == <NUM_LIT:1> ) { unitScope . recordTypeReferences ( candidates [ <NUM_LIT:0> ] . thrownExceptions ) ; return candidates [ <NUM_LIT:0> ] ; } visiblesCount = candidatesCount ; } else { for ( int i = <NUM_LIT:0> ; i < candidatesCount ; i ++ ) { MethodBinding methodBinding = candidates [ i ] ; if ( methodBinding . canBeSeenBy ( receiverType , invocationSite , this ) ) { if ( visiblesCount != i ) { candidates [ i ] = null ; candidates [ visiblesCount ] = methodBinding ; } visiblesCount ++ ; } } switch ( visiblesCount ) { case <NUM_LIT:0> : MethodBinding interfaceMethod = findDefaultAbstractMethod ( receiverType , selector , argumentTypes , invocationSite , classHierarchyStart , found , null ) ; if ( interfaceMethod != null ) return interfaceMethod ; return new ProblemMethodBinding ( candidates [ <NUM_LIT:0> ] , candidates [ <NUM_LIT:0> ] . selector , candidates [ <NUM_LIT:0> ] . parameters , ProblemReasons . NotVisible ) ; case <NUM_LIT:1> : if ( searchForDefaultAbstractMethod ) return findDefaultAbstractMethod ( receiverType , selector , argumentTypes , invocationSite , classHierarchyStart , found , candidates [ <NUM_LIT:0> ] ) ; unitScope . recordTypeReferences ( candidates [ <NUM_LIT:0> ] . thrownExceptions ) ; return candidates [ <NUM_LIT:0> ] ; default : break ; } } if ( complianceLevel <= ClassFileConstants . JDK1_3 ) { ReferenceBinding declaringClass = candidates [ <NUM_LIT:0> ] . declaringClass ; return ! declaringClass . isInterface ( ) ? mostSpecificClassMethodBinding ( candidates , visiblesCount , invocationSite ) : mostSpecificInterfaceMethodBinding ( candidates , visiblesCount , invocationSite ) ; } if ( compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ) { for ( int i = <NUM_LIT:0> ; i < visiblesCount ; i ++ ) { MethodBinding candidate = candidates [ i ] ; if ( candidate instanceof ParameterizedGenericMethodBinding ) candidate = ( ( ParameterizedGenericMethodBinding ) candidate ) . originalMethod ; if ( candidate . hasSubstitutedParameters ( ) ) { for ( int j = i + <NUM_LIT:1> ; j < visiblesCount ; j ++ ) { MethodBinding otherCandidate = candidates [ j ] ; if ( otherCandidate . hasSubstitutedParameters ( ) ) { if ( otherCandidate == candidate || ( candidate . declaringClass == otherCandidate . declaringClass && candidate . areParametersEqual ( otherCandidate ) ) ) { return new ProblemMethodBinding ( candidates [ i ] , candidates [ i ] . selector , candidates [ i ] . parameters , ProblemReasons . Ambiguous ) ; } } } } } } if ( inStaticContext ) { MethodBinding [ ] staticCandidates = new MethodBinding [ visiblesCount ] ; int staticCount = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < visiblesCount ; i ++ ) if ( candidates [ i ] . isStatic ( ) ) staticCandidates [ staticCount ++ ] = candidates [ i ] ; if ( staticCount == <NUM_LIT:1> ) return staticCandidates [ <NUM_LIT:0> ] ; if ( staticCount > <NUM_LIT:1> ) return mostSpecificMethodBinding ( staticCandidates , staticCount , argumentTypes , invocationSite , receiverType ) ; } MethodBinding mostSpecificMethod = mostSpecificMethodBinding ( candidates , visiblesCount , argumentTypes , invocationSite , receiverType ) ; if ( searchForDefaultAbstractMethod ) { if ( mostSpecificMethod . isValidBinding ( ) ) return findDefaultAbstractMethod ( receiverType , selector , argumentTypes , invocationSite , classHierarchyStart , found , mostSpecificMethod ) ; MethodBinding interfaceMethod = findDefaultAbstractMethod ( receiverType , selector , argumentTypes , invocationSite , classHierarchyStart , found , null ) ; if ( interfaceMethod != null && interfaceMethod . isValidBinding ( ) ) return interfaceMethod ; } return mostSpecificMethod ; } public MethodBinding findMethodForArray ( ArrayBinding receiverType , char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite ) { TypeBinding leafType = receiverType . leafComponentType ( ) ; if ( leafType instanceof ReferenceBinding ) { if ( ! ( ( ReferenceBinding ) leafType ) . canBeSeenBy ( this ) ) return new ProblemMethodBinding ( selector , Binding . NO_PARAMETERS , ( ReferenceBinding ) leafType , ProblemReasons . ReceiverTypeNotVisible ) ; } ReferenceBinding object = getJavaLangObject ( ) ; MethodBinding methodBinding = object . getExactMethod ( selector , argumentTypes , null ) ; if ( methodBinding != null ) { if ( argumentTypes == Binding . NO_PARAMETERS ) { switch ( selector [ <NUM_LIT:0> ] ) { case '<CHAR_LIT:c>' : if ( CharOperation . equals ( selector , TypeConstants . CLONE ) ) { return environment ( ) . computeArrayClone ( methodBinding ) ; } break ; case '<CHAR_LIT>' : if ( CharOperation . equals ( selector , TypeConstants . GETCLASS ) && methodBinding . returnType . isParameterizedType ( ) ) { return environment ( ) . createGetClassMethod ( receiverType , methodBinding , this ) ; } break ; } } if ( methodBinding . canBeSeenBy ( receiverType , invocationSite , this ) ) return methodBinding ; } methodBinding = findMethod ( object , selector , argumentTypes , invocationSite ) ; if ( methodBinding == null ) return new ProblemMethodBinding ( selector , argumentTypes , ProblemReasons . NotFound ) ; return methodBinding ; } protected void findMethodInSuperInterfaces ( ReferenceBinding currentType , char [ ] selector , ObjectVector found , InvocationSite invocationSite ) { ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { ReferenceBinding [ ] interfacesToVisit = itsInterfaces ; int nextPosition = interfacesToVisit . length ; for ( int i = <NUM_LIT:0> ; i < nextPosition ; i ++ ) { currentType = interfacesToVisit [ i ] ; compilationUnitScope ( ) . recordTypeReference ( currentType ) ; currentType = ( ReferenceBinding ) currentType . capture ( this , invocationSite == null ? <NUM_LIT:0> : invocationSite . sourceEnd ( ) ) ; MethodBinding [ ] currentMethods = currentType . getMethods ( selector ) ; if ( currentMethods . length > <NUM_LIT:0> ) { int foundSize = found . size ; if ( foundSize > <NUM_LIT:0> ) { next : for ( int c = <NUM_LIT:0> , l = currentMethods . length ; c < l ; c ++ ) { MethodBinding current = currentMethods [ c ] ; for ( int f = <NUM_LIT:0> ; f < foundSize ; f ++ ) if ( current == found . elementAt ( f ) ) continue next ; found . add ( current ) ; } } else { found . addAll ( currentMethods ) ; } } if ( ( itsInterfaces = currentType . superInterfaces ( ) ) != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } } } public ReferenceBinding findType ( char [ ] typeName , PackageBinding declarationPackage , PackageBinding invocationPackage ) { compilationUnitScope ( ) . recordReference ( declarationPackage . compoundName , typeName ) ; ReferenceBinding typeBinding = declarationPackage . getType ( typeName ) ; if ( typeBinding == null ) return null ; if ( typeBinding . isValidBinding ( ) ) { if ( declarationPackage != invocationPackage && ! typeBinding . canBeSeenBy ( invocationPackage ) ) return new ProblemReferenceBinding ( new char [ ] [ ] { typeName } , typeBinding , ProblemReasons . NotVisible ) ; } return typeBinding ; } public LocalVariableBinding findVariable ( char [ ] variable ) { return null ; } public Binding getBinding ( char [ ] name , int mask , InvocationSite invocationSite , boolean needResolve ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; LookupEnvironment env = unitScope . environment ; try { env . missingClassFileLocation = invocationSite ; Binding binding = null ; FieldBinding problemField = null ; if ( ( mask & Binding . VARIABLE ) != <NUM_LIT:0> ) { boolean insideStaticContext = false ; boolean insideConstructorCall = false ; boolean insideTypeAnnotation = false ; FieldBinding foundField = null ; ProblemFieldBinding foundInsideProblem = null ; Scope scope = this ; int depth = <NUM_LIT:0> ; int foundDepth = <NUM_LIT:0> ; ReferenceBinding foundActualReceiverType = null ; done : while ( true ) { switch ( scope . kind ) { case METHOD_SCOPE : MethodScope methodScope = ( MethodScope ) scope ; insideStaticContext |= methodScope . isStatic ; insideConstructorCall |= methodScope . isConstructorCall ; insideTypeAnnotation = methodScope . insideTypeAnnotation ; case BLOCK_SCOPE : LocalVariableBinding variableBinding = scope . findVariable ( name ) ; if ( variableBinding != null ) { if ( foundField != null && foundField . isValidBinding ( ) ) return new ProblemFieldBinding ( foundField , foundField . declaringClass , name , ProblemReasons . InheritedNameHidesEnclosingName ) ; if ( depth > <NUM_LIT:0> ) invocationSite . setDepth ( depth ) ; return variableBinding ; } break ; case CLASS_SCOPE : ClassScope classScope = ( ClassScope ) scope ; ReferenceBinding receiverType = classScope . enclosingReceiverType ( ) ; if ( ! insideTypeAnnotation ) { FieldBinding fieldBinding = classScope . findField ( receiverType , name , invocationSite , needResolve ) ; if ( fieldBinding != null ) { if ( fieldBinding . problemId ( ) == ProblemReasons . Ambiguous ) { if ( foundField == null || foundField . problemId ( ) == ProblemReasons . NotVisible ) return fieldBinding ; return new ProblemFieldBinding ( foundField , foundField . declaringClass , name , ProblemReasons . InheritedNameHidesEnclosingName ) ; } ProblemFieldBinding insideProblem = null ; if ( fieldBinding . isValidBinding ( ) ) { if ( ! fieldBinding . isStatic ( ) ) { if ( insideConstructorCall ) { insideProblem = new ProblemFieldBinding ( fieldBinding , fieldBinding . declaringClass , name , ProblemReasons . NonStaticReferenceInConstructorInvocation ) ; } else if ( insideStaticContext ) { insideProblem = new ProblemFieldBinding ( fieldBinding , fieldBinding . declaringClass , name , ProblemReasons . NonStaticReferenceInStaticContext ) ; } } if ( receiverType == fieldBinding . declaringClass || compilerOptions ( ) . complianceLevel >= ClassFileConstants . JDK1_4 ) { if ( foundField == null ) { if ( depth > <NUM_LIT:0> ) { invocationSite . setDepth ( depth ) ; invocationSite . setActualReceiverType ( receiverType ) ; } return insideProblem == null ? fieldBinding : insideProblem ; } if ( foundField . isValidBinding ( ) ) if ( foundField . declaringClass != fieldBinding . declaringClass ) return new ProblemFieldBinding ( foundField , foundField . declaringClass , name , ProblemReasons . InheritedNameHidesEnclosingName ) ; } } if ( foundField == null || ( foundField . problemId ( ) == ProblemReasons . NotVisible && fieldBinding . problemId ( ) != ProblemReasons . NotVisible ) ) { foundDepth = depth ; foundActualReceiverType = receiverType ; foundInsideProblem = insideProblem ; foundField = fieldBinding ; } } } insideTypeAnnotation = false ; depth ++ ; insideStaticContext |= receiverType . isStatic ( ) ; MethodScope enclosingMethodScope = scope . methodScope ( ) ; insideConstructorCall = enclosingMethodScope == null ? false : enclosingMethodScope . isConstructorCall ; break ; case COMPILATION_UNIT_SCOPE : break done ; } scope = scope . parent ; } if ( foundInsideProblem != null ) return foundInsideProblem ; if ( foundField != null ) { if ( foundField . isValidBinding ( ) ) { if ( foundDepth > <NUM_LIT:0> ) { invocationSite . setDepth ( foundDepth ) ; invocationSite . setActualReceiverType ( foundActualReceiverType ) ; } return foundField ; } problemField = foundField ; foundField = null ; } if ( compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ) { unitScope . faultInImports ( ) ; ImportBinding [ ] imports = unitScope . imports ; if ( imports != null ) { for ( int i = <NUM_LIT:0> , length = imports . length ; i < length ; i ++ ) { ImportBinding importBinding = imports [ i ] ; if ( importBinding . isStatic ( ) && ! importBinding . onDemand ) { if ( CharOperation . equals ( importBinding . compoundName [ importBinding . compoundName . length - <NUM_LIT:1> ] , name ) ) { if ( unitScope . resolveSingleImport ( importBinding , Binding . TYPE | Binding . FIELD | Binding . METHOD ) != null && importBinding . resolvedImport instanceof FieldBinding ) { foundField = ( FieldBinding ) importBinding . resolvedImport ; ImportReference importReference = importBinding . reference ; if ( importReference != null && needResolve ) { importReference . bits |= ASTNode . Used ; } invocationSite . setActualReceiverType ( foundField . declaringClass ) ; if ( foundField . isValidBinding ( ) ) { return foundField ; } if ( problemField == null ) problemField = foundField ; } } } } boolean foundInImport = false ; for ( int i = <NUM_LIT:0> , length = imports . length ; i < length ; i ++ ) { ImportBinding importBinding = imports [ i ] ; if ( importBinding . isStatic ( ) && importBinding . onDemand ) { Binding resolvedImport = importBinding . resolvedImport ; if ( resolvedImport instanceof ReferenceBinding ) { FieldBinding temp = findField ( ( ReferenceBinding ) resolvedImport , name , invocationSite , needResolve ) ; if ( temp != null ) { if ( ! temp . isValidBinding ( ) ) { if ( problemField == null ) problemField = temp ; } else if ( temp . isStatic ( ) ) { if ( foundField == temp ) continue ; ImportReference importReference = importBinding . reference ; if ( importReference != null && needResolve ) { importReference . bits |= ASTNode . Used ; } if ( foundInImport ) return new ProblemFieldBinding ( foundField , foundField . declaringClass , name , ProblemReasons . Ambiguous ) ; foundField = temp ; foundInImport = true ; } } } } } if ( foundField != null ) { invocationSite . setActualReceiverType ( foundField . declaringClass ) ; return foundField ; } } } } if ( ( mask & Binding . TYPE ) != <NUM_LIT:0> ) { if ( ( binding = getBaseType ( name ) ) != null ) return binding ; binding = getTypeOrPackage ( name , ( mask & Binding . PACKAGE ) == <NUM_LIT:0> ? Binding . TYPE : Binding . TYPE | Binding . PACKAGE , needResolve ) ; if ( binding . isValidBinding ( ) || mask == Binding . TYPE ) return binding ; } else if ( ( mask & Binding . PACKAGE ) != <NUM_LIT:0> ) { unitScope . recordSimpleReference ( name ) ; if ( ( binding = env . getTopLevelPackage ( name ) ) != null ) return binding ; } if ( problemField != null ) return problemField ; if ( binding != null && binding . problemId ( ) != ProblemReasons . NotFound ) return binding ; return new ProblemBinding ( name , enclosingSourceType ( ) , ProblemReasons . NotFound ) ; } catch ( AbortCompilation e ) { e . updateContext ( invocationSite , referenceCompilationUnit ( ) . compilationResult ) ; throw e ; } finally { env . missingClassFileLocation = null ; } } public MethodBinding getConstructor ( ReferenceBinding receiverType , TypeBinding [ ] argumentTypes , InvocationSite invocationSite ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; LookupEnvironment env = unitScope . environment ; try { env . missingClassFileLocation = invocationSite ; unitScope . recordTypeReference ( receiverType ) ; unitScope . recordTypeReferences ( argumentTypes ) ; MethodBinding methodBinding = receiverType . getExactConstructor ( argumentTypes ) ; if ( methodBinding != null && methodBinding . canBeSeenBy ( invocationSite , this ) ) { if ( invocationSite . genericTypeArguments ( ) != null ) methodBinding = computeCompatibleMethod ( methodBinding , argumentTypes , invocationSite ) ; return methodBinding ; } MethodBinding [ ] methods = receiverType . getMethods ( TypeConstants . INIT , argumentTypes . length ) ; if ( methods == Binding . NO_METHODS ) return new ProblemMethodBinding ( TypeConstants . INIT , argumentTypes , ProblemReasons . NotFound ) ; MethodBinding [ ] compatible = new MethodBinding [ methods . length ] ; int compatibleIndex = <NUM_LIT:0> ; MethodBinding problemMethod = null ; for ( int i = <NUM_LIT:0> , length = methods . length ; i < length ; i ++ ) { MethodBinding compatibleMethod = computeCompatibleMethod ( methods [ i ] , argumentTypes , invocationSite ) ; if ( compatibleMethod != null ) { if ( compatibleMethod . isValidBinding ( ) ) compatible [ compatibleIndex ++ ] = compatibleMethod ; else if ( problemMethod == null ) problemMethod = compatibleMethod ; } } if ( compatibleIndex == <NUM_LIT:0> ) { if ( problemMethod == null ) return new ProblemMethodBinding ( methods [ <NUM_LIT:0> ] , TypeConstants . INIT , argumentTypes , ProblemReasons . NotFound ) ; return problemMethod ; } MethodBinding [ ] visible = new MethodBinding [ compatibleIndex ] ; int visibleIndex = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < compatibleIndex ; i ++ ) { MethodBinding method = compatible [ i ] ; if ( method . canBeSeenBy ( invocationSite , this ) ) visible [ visibleIndex ++ ] = method ; } if ( visibleIndex == <NUM_LIT:1> ) return visible [ <NUM_LIT:0> ] ; if ( visibleIndex == <NUM_LIT:0> ) return new ProblemMethodBinding ( compatible [ <NUM_LIT:0> ] , TypeConstants . INIT , compatible [ <NUM_LIT:0> ] . parameters , ProblemReasons . NotVisible ) ; return mostSpecificMethodBinding ( visible , visibleIndex , argumentTypes , invocationSite , receiverType ) ; } catch ( AbortCompilation e ) { e . updateContext ( invocationSite , referenceCompilationUnit ( ) . compilationResult ) ; throw e ; } finally { env . missingClassFileLocation = null ; } } public final PackageBinding getCurrentPackage ( ) { Scope scope , unitScope = this ; while ( ( scope = unitScope . parent ) != null ) unitScope = scope ; return ( ( CompilationUnitScope ) unitScope ) . fPackage ; } public int getDeclarationModifiers ( ) { switch ( this . kind ) { case Scope . BLOCK_SCOPE : case Scope . METHOD_SCOPE : MethodScope methodScope = methodScope ( ) ; if ( ! methodScope . isInsideInitializer ( ) ) { MethodBinding context = ( ( AbstractMethodDeclaration ) methodScope . referenceContext ) . binding ; if ( context != null ) return context . modifiers ; } else { SourceTypeBinding type = ( ( BlockScope ) this ) . referenceType ( ) . binding ; if ( methodScope . initializedField != null ) return methodScope . initializedField . modifiers ; if ( type != null ) return type . modifiers ; } break ; case Scope . CLASS_SCOPE : ReferenceBinding context = ( ( ClassScope ) this ) . referenceType ( ) . binding ; if ( context != null ) return context . modifiers ; break ; } return - <NUM_LIT:1> ; } public FieldBinding getField ( TypeBinding receiverType , char [ ] fieldName , InvocationSite invocationSite ) { LookupEnvironment env = environment ( ) ; try { env . missingClassFileLocation = invocationSite ; FieldBinding field = findField ( receiverType , fieldName , invocationSite , true ) ; if ( field != null ) return field ; return new ProblemFieldBinding ( receiverType instanceof ReferenceBinding ? ( ReferenceBinding ) receiverType : null , fieldName , ProblemReasons . NotFound ) ; } catch ( AbortCompilation e ) { e . updateContext ( invocationSite , referenceCompilationUnit ( ) . compilationResult ) ; throw e ; } finally { env . missingClassFileLocation = null ; } } public MethodBinding getImplicitMethod ( char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite ) { boolean insideStaticContext = false ; boolean insideConstructorCall = false ; boolean insideTypeAnnotation = false ; MethodBinding foundMethod = null ; MethodBinding foundProblem = null ; boolean foundProblemVisible = false ; Scope scope = this ; int depth = <NUM_LIT:0> ; CompilerOptions options ; boolean inheritedHasPrecedence = ( options = compilerOptions ( ) ) . complianceLevel >= ClassFileConstants . JDK1_4 ; done : while ( true ) { switch ( scope . kind ) { case METHOD_SCOPE : MethodScope methodScope = ( MethodScope ) scope ; insideStaticContext |= methodScope . isStatic ; insideConstructorCall |= methodScope . isConstructorCall ; insideTypeAnnotation = methodScope . insideTypeAnnotation ; break ; case CLASS_SCOPE : ClassScope classScope = ( ClassScope ) scope ; ReferenceBinding receiverType = classScope . enclosingReceiverType ( ) ; if ( ! insideTypeAnnotation ) { MethodBinding methodBinding = classScope . findExactMethod ( receiverType , selector , argumentTypes , invocationSite ) ; if ( methodBinding == null ) methodBinding = classScope . findMethod ( receiverType , selector , argumentTypes , invocationSite ) ; if ( methodBinding != null ) { if ( foundMethod == null ) { if ( methodBinding . isValidBinding ( ) ) { if ( ! methodBinding . isStatic ( ) && ( insideConstructorCall || insideStaticContext ) ) { if ( foundProblem != null && foundProblem . problemId ( ) != ProblemReasons . NotVisible ) return foundProblem ; return new ProblemMethodBinding ( methodBinding , methodBinding . selector , methodBinding . parameters , insideConstructorCall ? ProblemReasons . NonStaticReferenceInConstructorInvocation : ProblemReasons . NonStaticReferenceInStaticContext ) ; } if ( inheritedHasPrecedence || receiverType == methodBinding . declaringClass || ( receiverType . getMethods ( selector ) ) != Binding . NO_METHODS ) { if ( foundProblemVisible ) { return foundProblem ; } if ( depth > <NUM_LIT:0> ) { invocationSite . setDepth ( depth ) ; invocationSite . setActualReceiverType ( receiverType ) ; } if ( argumentTypes == Binding . NO_PARAMETERS && CharOperation . equals ( selector , TypeConstants . GETCLASS ) && methodBinding . returnType . isParameterizedType ( ) ) { return environment ( ) . createGetClassMethod ( receiverType , methodBinding , this ) ; } return methodBinding ; } if ( foundProblem == null || foundProblem . problemId ( ) == ProblemReasons . NotVisible ) { if ( foundProblem != null ) foundProblem = null ; if ( depth > <NUM_LIT:0> ) { invocationSite . setDepth ( depth ) ; invocationSite . setActualReceiverType ( receiverType ) ; } foundMethod = methodBinding ; } } else { if ( methodBinding . problemId ( ) != ProblemReasons . NotVisible && methodBinding . problemId ( ) != ProblemReasons . NotFound ) return methodBinding ; if ( foundProblem == null ) { foundProblem = methodBinding ; } if ( ! foundProblemVisible && methodBinding . problemId ( ) == ProblemReasons . NotFound ) { MethodBinding closestMatch = ( ( ProblemMethodBinding ) methodBinding ) . closestMatch ; if ( closestMatch != null && closestMatch . canBeSeenBy ( receiverType , invocationSite , this ) ) { foundProblem = methodBinding ; foundProblemVisible = true ; } } } } else { if ( methodBinding . problemId ( ) == ProblemReasons . Ambiguous || ( foundMethod . declaringClass != methodBinding . declaringClass && ( receiverType == methodBinding . declaringClass || receiverType . getMethods ( selector ) != Binding . NO_METHODS ) ) ) return new ProblemMethodBinding ( methodBinding , selector , argumentTypes , ProblemReasons . InheritedNameHidesEnclosingName ) ; } } } insideTypeAnnotation = false ; depth ++ ; insideStaticContext |= receiverType . isStatic ( ) ; MethodScope enclosingMethodScope = scope . methodScope ( ) ; insideConstructorCall = enclosingMethodScope == null ? false : enclosingMethodScope . isConstructorCall ; break ; case COMPILATION_UNIT_SCOPE : break done ; } scope = scope . parent ; } if ( insideStaticContext && options . sourceLevel >= ClassFileConstants . JDK1_5 ) { if ( foundProblem != null ) { if ( foundProblem . declaringClass != null && foundProblem . declaringClass . id == TypeIds . T_JavaLangObject ) return foundProblem ; if ( foundProblem . problemId ( ) == ProblemReasons . NotFound && foundProblemVisible ) { return foundProblem ; } } CompilationUnitScope unitScope = ( CompilationUnitScope ) scope ; unitScope . faultInImports ( ) ; ImportBinding [ ] imports = unitScope . imports ; if ( imports != null ) { ObjectVector visible = null ; boolean skipOnDemand = false ; for ( int i = <NUM_LIT:0> , length = imports . length ; i < length ; i ++ ) { ImportBinding importBinding = imports [ i ] ; if ( importBinding . isStatic ( ) ) { Binding resolvedImport = importBinding . resolvedImport ; MethodBinding possible = null ; if ( importBinding . onDemand ) { if ( ! skipOnDemand && resolvedImport instanceof ReferenceBinding ) possible = findMethod ( ( ReferenceBinding ) resolvedImport , selector , argumentTypes , invocationSite , true ) ; } else { if ( resolvedImport instanceof MethodBinding ) { MethodBinding staticMethod = ( MethodBinding ) resolvedImport ; if ( CharOperation . equals ( staticMethod . selector , selector ) ) possible = findMethod ( staticMethod . declaringClass , selector , argumentTypes , invocationSite , true ) ; } else if ( resolvedImport instanceof FieldBinding ) { FieldBinding staticField = ( FieldBinding ) resolvedImport ; if ( CharOperation . equals ( staticField . name , selector ) ) { char [ ] [ ] importName = importBinding . reference . tokens ; TypeBinding referencedType = getType ( importName , importName . length - <NUM_LIT:1> ) ; if ( referencedType != null ) possible = findMethod ( ( ReferenceBinding ) referencedType , selector , argumentTypes , invocationSite , true ) ; } } } if ( possible != null && possible != foundProblem ) { if ( ! possible . isValidBinding ( ) ) { if ( foundProblem == null ) foundProblem = possible ; } else if ( possible . isStatic ( ) ) { MethodBinding compatibleMethod = computeCompatibleMethod ( possible , argumentTypes , invocationSite ) ; if ( compatibleMethod != null ) { if ( compatibleMethod . isValidBinding ( ) ) { if ( compatibleMethod . canBeSeenBy ( unitScope . fPackage ) ) { if ( visible == null || ! visible . contains ( compatibleMethod ) ) { ImportReference importReference = importBinding . reference ; if ( importReference != null ) { importReference . bits |= ASTNode . Used ; } if ( ! skipOnDemand && ! importBinding . onDemand ) { visible = null ; skipOnDemand = true ; } if ( visible == null ) visible = new ObjectVector ( <NUM_LIT:3> ) ; visible . add ( compatibleMethod ) ; } } else if ( foundProblem == null ) { foundProblem = new ProblemMethodBinding ( compatibleMethod , selector , compatibleMethod . parameters , ProblemReasons . NotVisible ) ; } } else if ( foundProblem == null ) { foundProblem = compatibleMethod ; } } else if ( foundProblem == null ) { foundProblem = new ProblemMethodBinding ( possible , selector , argumentTypes , ProblemReasons . NotFound ) ; } } } } } if ( visible != null ) { MethodBinding [ ] temp = new MethodBinding [ visible . size ] ; visible . copyInto ( temp ) ; foundMethod = mostSpecificMethodBinding ( temp , temp . length , argumentTypes , invocationSite , null ) ; } } } if ( foundMethod != null ) { invocationSite . setActualReceiverType ( foundMethod . declaringClass ) ; return foundMethod ; } if ( foundProblem != null ) return foundProblem ; return new ProblemMethodBinding ( selector , argumentTypes , ProblemReasons . NotFound ) ; } public final ReferenceBinding getJavaIoSerializable ( ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( TypeConstants . JAVA_IO_SERIALIZABLE ) ; return unitScope . environment . getResolvedType ( TypeConstants . JAVA_IO_SERIALIZABLE , this ) ; } public final ReferenceBinding getJavaLangAnnotationAnnotation ( ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( TypeConstants . JAVA_LANG_ANNOTATION_ANNOTATION ) ; return unitScope . environment . getResolvedType ( TypeConstants . JAVA_LANG_ANNOTATION_ANNOTATION , this ) ; } public final ReferenceBinding getJavaLangAssertionError ( ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( TypeConstants . JAVA_LANG_ASSERTIONERROR ) ; return unitScope . environment . getResolvedType ( TypeConstants . JAVA_LANG_ASSERTIONERROR , this ) ; } public final ReferenceBinding getJavaLangClass ( ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( TypeConstants . JAVA_LANG_CLASS ) ; return unitScope . environment . getResolvedType ( TypeConstants . JAVA_LANG_CLASS , this ) ; } public final ReferenceBinding getJavaLangCloneable ( ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( TypeConstants . JAVA_LANG_CLONEABLE ) ; return unitScope . environment . getResolvedType ( TypeConstants . JAVA_LANG_CLONEABLE , this ) ; } public final ReferenceBinding getJavaLangEnum ( ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( TypeConstants . JAVA_LANG_ENUM ) ; return unitScope . environment . getResolvedType ( TypeConstants . JAVA_LANG_ENUM , this ) ; } public final ReferenceBinding getJavaLangIterable ( ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( TypeConstants . JAVA_LANG_ITERABLE ) ; return unitScope . environment . getResolvedType ( TypeConstants . JAVA_LANG_ITERABLE , this ) ; } public final ReferenceBinding getJavaLangObject ( ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( TypeConstants . JAVA_LANG_OBJECT ) ; return unitScope . environment . getResolvedType ( TypeConstants . JAVA_LANG_OBJECT , this ) ; } public final ReferenceBinding getJavaLangString ( ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( TypeConstants . JAVA_LANG_STRING ) ; return unitScope . environment . getResolvedType ( TypeConstants . JAVA_LANG_STRING , this ) ; } public final ReferenceBinding getJavaLangThrowable ( ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( TypeConstants . JAVA_LANG_THROWABLE ) ; return unitScope . environment . getResolvedType ( TypeConstants . JAVA_LANG_THROWABLE , this ) ; } public final ReferenceBinding getJavaUtilIterator ( ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( TypeConstants . JAVA_UTIL_ITERATOR ) ; return unitScope . environment . getResolvedType ( TypeConstants . JAVA_UTIL_ITERATOR , this ) ; } public final ReferenceBinding getMemberType ( char [ ] typeName , ReferenceBinding enclosingType ) { ReferenceBinding memberType = findMemberType ( typeName , enclosingType ) ; if ( memberType != null ) return memberType ; char [ ] [ ] compoundName = new char [ ] [ ] { typeName } ; return new ProblemReferenceBinding ( compoundName , null , ProblemReasons . NotFound ) ; } public MethodBinding getMethod ( TypeBinding receiverType , char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; LookupEnvironment env = unitScope . environment ; try { env . missingClassFileLocation = invocationSite ; switch ( receiverType . kind ( ) ) { case Binding . BASE_TYPE : return new ProblemMethodBinding ( selector , argumentTypes , ProblemReasons . NotFound ) ; case Binding . ARRAY_TYPE : unitScope . recordTypeReference ( receiverType ) ; return findMethodForArray ( ( ArrayBinding ) receiverType , selector , argumentTypes , invocationSite ) ; } unitScope . recordTypeReference ( receiverType ) ; ReferenceBinding currentType = ( ReferenceBinding ) receiverType ; if ( ! currentType . canBeSeenBy ( this ) ) return new ProblemMethodBinding ( selector , argumentTypes , ProblemReasons . ReceiverTypeNotVisible ) ; MethodBinding methodBinding = findExactMethod ( currentType , selector , argumentTypes , invocationSite ) ; if ( methodBinding != null ) return methodBinding ; methodBinding = findMethod ( currentType , selector , argumentTypes , invocationSite ) ; if ( methodBinding == null ) { methodBinding = oneLastLook ( currentType , selector , argumentTypes , invocationSite ) ; } if ( methodBinding == null ) return new ProblemMethodBinding ( selector , argumentTypes , ProblemReasons . NotFound ) ; if ( ! methodBinding . isValidBinding ( ) ) return methodBinding ; if ( argumentTypes == Binding . NO_PARAMETERS && CharOperation . equals ( selector , TypeConstants . GETCLASS ) && methodBinding . returnType . isParameterizedType ( ) ) { return environment ( ) . createGetClassMethod ( receiverType , methodBinding , this ) ; } return methodBinding ; } catch ( AbortCompilation e ) { e . updateContext ( invocationSite , referenceCompilationUnit ( ) . compilationResult ) ; throw e ; } finally { env . missingClassFileLocation = null ; } } public final Binding getPackage ( char [ ] [ ] compoundName ) { compilationUnitScope ( ) . recordQualifiedReference ( compoundName ) ; Binding binding = getTypeOrPackage ( compoundName [ <NUM_LIT:0> ] , Binding . TYPE | Binding . PACKAGE , true ) ; if ( binding == null ) { char [ ] [ ] qName = new char [ ] [ ] { compoundName [ <NUM_LIT:0> ] } ; return new ProblemReferenceBinding ( qName , environment ( ) . createMissingType ( null , compoundName ) , ProblemReasons . NotFound ) ; } if ( ! binding . isValidBinding ( ) ) { if ( binding instanceof PackageBinding ) { char [ ] [ ] qName = new char [ ] [ ] { compoundName [ <NUM_LIT:0> ] } ; return new ProblemReferenceBinding ( qName , null , ProblemReasons . NotFound ) ; } return binding ; } if ( ! ( binding instanceof PackageBinding ) ) return null ; int currentIndex = <NUM_LIT:1> , length = compoundName . length ; PackageBinding packageBinding = ( PackageBinding ) binding ; while ( currentIndex < length ) { binding = packageBinding . getTypeOrPackage ( compoundName [ currentIndex ++ ] ) ; if ( binding == null ) { return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , null , ProblemReasons . NotFound ) ; } if ( ! binding . isValidBinding ( ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , binding instanceof ReferenceBinding ? ( ReferenceBinding ) ( ( ReferenceBinding ) binding ) . closestMatch ( ) : null , binding . problemId ( ) ) ; if ( ! ( binding instanceof PackageBinding ) ) return packageBinding ; packageBinding = ( PackageBinding ) binding ; } return new ProblemReferenceBinding ( compoundName , null , ProblemReasons . NotFound ) ; } public final TypeBinding getType ( char [ ] name ) { TypeBinding binding = getBaseType ( name ) ; if ( binding != null ) return binding ; return ( ReferenceBinding ) getTypeOrPackage ( name , Binding . TYPE , true ) ; } public final TypeBinding getType ( char [ ] name , PackageBinding packageBinding ) { if ( packageBinding == null ) return getType ( name ) ; Binding binding = packageBinding . getTypeOrPackage ( name ) ; if ( binding == null ) { return new ProblemReferenceBinding ( CharOperation . arrayConcat ( packageBinding . compoundName , name ) , null , ProblemReasons . NotFound ) ; } if ( ! binding . isValidBinding ( ) ) { return new ProblemReferenceBinding ( binding instanceof ReferenceBinding ? ( ( ReferenceBinding ) binding ) . compoundName : CharOperation . arrayConcat ( packageBinding . compoundName , name ) , binding instanceof ReferenceBinding ? ( ReferenceBinding ) ( ( ReferenceBinding ) binding ) . closestMatch ( ) : null , binding . problemId ( ) ) ; } ReferenceBinding typeBinding = ( ReferenceBinding ) binding ; if ( ! typeBinding . canBeSeenBy ( this ) ) return new ProblemReferenceBinding ( typeBinding . compoundName , typeBinding , ProblemReasons . NotVisible ) ; return typeBinding ; } public final TypeBinding getType ( char [ ] [ ] compoundName , int typeNameLength ) { if ( typeNameLength == <NUM_LIT:1> ) { TypeBinding binding = getBaseType ( compoundName [ <NUM_LIT:0> ] ) ; if ( binding != null ) return binding ; } CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( compoundName ) ; Binding binding = getTypeOrPackage ( compoundName [ <NUM_LIT:0> ] , typeNameLength == <NUM_LIT:1> ? Binding . TYPE : Binding . TYPE | Binding . PACKAGE , true ) ; if ( binding == null ) { char [ ] [ ] qName = new char [ ] [ ] { compoundName [ <NUM_LIT:0> ] } ; return new ProblemReferenceBinding ( qName , environment ( ) . createMissingType ( compilationUnitScope ( ) . getCurrentPackage ( ) , qName ) , ProblemReasons . NotFound ) ; } if ( ! binding . isValidBinding ( ) ) { if ( binding instanceof PackageBinding ) { char [ ] [ ] qName = new char [ ] [ ] { compoundName [ <NUM_LIT:0> ] } ; return new ProblemReferenceBinding ( qName , environment ( ) . createMissingType ( null , qName ) , ProblemReasons . NotFound ) ; } return ( ReferenceBinding ) binding ; } int currentIndex = <NUM_LIT:1> ; boolean checkVisibility = false ; if ( binding instanceof PackageBinding ) { PackageBinding packageBinding = ( PackageBinding ) binding ; while ( currentIndex < typeNameLength ) { binding = packageBinding . getTypeOrPackage ( compoundName [ currentIndex ++ ] ) ; if ( binding == null ) { char [ ] [ ] qName = CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) ; return new ProblemReferenceBinding ( qName , environment ( ) . createMissingType ( packageBinding , qName ) , ProblemReasons . NotFound ) ; } if ( ! binding . isValidBinding ( ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , binding instanceof ReferenceBinding ? ( ReferenceBinding ) ( ( ReferenceBinding ) binding ) . closestMatch ( ) : null , binding . problemId ( ) ) ; if ( ! ( binding instanceof PackageBinding ) ) break ; packageBinding = ( PackageBinding ) binding ; } if ( binding instanceof PackageBinding ) { char [ ] [ ] qName = CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) ; return new ProblemReferenceBinding ( qName , environment ( ) . createMissingType ( null , qName ) , ProblemReasons . NotFound ) ; } checkVisibility = true ; } ReferenceBinding typeBinding = ( ReferenceBinding ) binding ; unitScope . recordTypeReference ( typeBinding ) ; if ( checkVisibility ) if ( ! typeBinding . canBeSeenBy ( this ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , typeBinding , ProblemReasons . NotVisible ) ; while ( currentIndex < typeNameLength ) { typeBinding = getMemberType ( compoundName [ currentIndex ++ ] , typeBinding ) ; if ( ! typeBinding . isValidBinding ( ) ) { if ( typeBinding instanceof ProblemReferenceBinding ) { ProblemReferenceBinding problemBinding = ( ProblemReferenceBinding ) typeBinding ; return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , problemBinding . closestReferenceMatch ( ) , typeBinding . problemId ( ) ) ; } return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , ( ReferenceBinding ) ( ( ReferenceBinding ) binding ) . closestMatch ( ) , typeBinding . problemId ( ) ) ; } } return typeBinding ; } final Binding getTypeOrPackage ( char [ ] name , int mask , boolean needResolve ) { Scope scope = this ; ReferenceBinding foundType = null ; boolean insideStaticContext = false ; boolean insideTypeAnnotation = false ; if ( ( mask & Binding . TYPE ) == <NUM_LIT:0> ) { Scope next = scope ; while ( ( next = scope . parent ) != null ) scope = next ; } else { boolean inheritedHasPrecedence = compilerOptions ( ) . complianceLevel >= ClassFileConstants . JDK1_4 ; done : while ( true ) { switch ( scope . kind ) { case METHOD_SCOPE : MethodScope methodScope = ( MethodScope ) scope ; AbstractMethodDeclaration methodDecl = methodScope . referenceMethod ( ) ; if ( methodDecl != null ) { if ( methodDecl . binding != null ) { TypeVariableBinding typeVariable = methodDecl . binding . getTypeVariable ( name ) ; if ( typeVariable != null ) return typeVariable ; } else { TypeParameter [ ] params = methodDecl . typeParameters ( ) ; for ( int i = params == null ? <NUM_LIT:0> : params . length ; -- i >= <NUM_LIT:0> ; ) if ( CharOperation . equals ( params [ i ] . name , name ) ) if ( params [ i ] . binding != null && params [ i ] . binding . isValidBinding ( ) ) return params [ i ] . binding ; } } insideStaticContext |= methodScope . isStatic ; insideTypeAnnotation = methodScope . insideTypeAnnotation ; case BLOCK_SCOPE : ReferenceBinding localType = ( ( BlockScope ) scope ) . findLocalType ( name ) ; if ( localType != null ) { if ( foundType != null && foundType != localType ) return new ProblemReferenceBinding ( new char [ ] [ ] { name } , foundType , ProblemReasons . InheritedNameHidesEnclosingName ) ; return localType ; } break ; case CLASS_SCOPE : SourceTypeBinding sourceType = ( ( ClassScope ) scope ) . referenceContext . binding ; if ( scope == this && ( sourceType . tagBits & TagBits . TypeVariablesAreConnected ) == <NUM_LIT:0> ) { TypeVariableBinding typeVariable = sourceType . getTypeVariable ( name ) ; if ( typeVariable != null ) return typeVariable ; if ( CharOperation . equals ( name , sourceType . sourceName ) ) return sourceType ; insideStaticContext |= sourceType . isStatic ( ) ; break ; } if ( ! insideTypeAnnotation ) { ReferenceBinding memberType = findMemberType ( name , sourceType ) ; if ( memberType != null ) { if ( memberType . problemId ( ) == ProblemReasons . Ambiguous ) { if ( foundType == null || foundType . problemId ( ) == ProblemReasons . NotVisible ) return memberType ; return new ProblemReferenceBinding ( new char [ ] [ ] { name } , foundType , ProblemReasons . InheritedNameHidesEnclosingName ) ; } if ( memberType . isValidBinding ( ) ) { if ( sourceType == memberType . enclosingType ( ) || inheritedHasPrecedence ) { if ( insideStaticContext && ! memberType . isStatic ( ) && sourceType . isGenericType ( ) ) return new ProblemReferenceBinding ( new char [ ] [ ] { name } , memberType , ProblemReasons . NonStaticReferenceInStaticContext ) ; if ( foundType == null || ( inheritedHasPrecedence && foundType . problemId ( ) == ProblemReasons . NotVisible ) ) return memberType ; if ( foundType . isValidBinding ( ) && foundType != memberType ) return new ProblemReferenceBinding ( new char [ ] [ ] { name } , foundType , ProblemReasons . InheritedNameHidesEnclosingName ) ; } } if ( foundType == null || ( foundType . problemId ( ) == ProblemReasons . NotVisible && memberType . problemId ( ) != ProblemReasons . NotVisible ) ) foundType = memberType ; } } TypeVariableBinding typeVariable = sourceType . getTypeVariable ( name ) ; if ( typeVariable != null ) { if ( insideStaticContext ) return new ProblemReferenceBinding ( new char [ ] [ ] { name } , typeVariable , ProblemReasons . NonStaticReferenceInStaticContext ) ; return typeVariable ; } insideStaticContext |= sourceType . isStatic ( ) ; insideTypeAnnotation = false ; if ( CharOperation . equals ( sourceType . sourceName , name ) ) { if ( foundType != null && foundType != sourceType && foundType . problemId ( ) != ProblemReasons . NotVisible ) return new ProblemReferenceBinding ( new char [ ] [ ] { name } , foundType , ProblemReasons . InheritedNameHidesEnclosingName ) ; return sourceType ; } break ; case COMPILATION_UNIT_SCOPE : break done ; } scope = scope . parent ; } if ( foundType != null && foundType . problemId ( ) != ProblemReasons . NotVisible ) return foundType ; } CompilationUnitScope unitScope = ( CompilationUnitScope ) scope ; HashtableOfObject typeOrPackageCache = unitScope . typeOrPackageCache ; if ( typeOrPackageCache != null ) { Binding cachedBinding = ( Binding ) typeOrPackageCache . get ( name ) ; if ( cachedBinding != null ) { if ( cachedBinding instanceof ImportBinding ) { ImportReference importReference = ( ( ImportBinding ) cachedBinding ) . reference ; if ( importReference != null ) { importReference . bits |= ASTNode . Used ; } if ( cachedBinding instanceof ImportConflictBinding ) typeOrPackageCache . put ( name , cachedBinding = ( ( ImportConflictBinding ) cachedBinding ) . conflictingTypeBinding ) ; else typeOrPackageCache . put ( name , cachedBinding = ( ( ImportBinding ) cachedBinding ) . resolvedImport ) ; } if ( ( mask & Binding . TYPE ) != <NUM_LIT:0> ) { if ( foundType != null && foundType . problemId ( ) != ProblemReasons . NotVisible && cachedBinding . problemId ( ) != ProblemReasons . Ambiguous ) return foundType ; if ( cachedBinding instanceof ReferenceBinding ) return cachedBinding ; } if ( ( mask & Binding . PACKAGE ) != <NUM_LIT:0> && cachedBinding instanceof PackageBinding ) return cachedBinding ; } } if ( ( mask & Binding . TYPE ) != <NUM_LIT:0> ) { ImportBinding [ ] imports = unitScope . imports ; if ( imports != null && typeOrPackageCache == null ) { nextImport : for ( int i = <NUM_LIT:0> , length = imports . length ; i < length ; i ++ ) { ImportBinding importBinding = imports [ i ] ; if ( ! importBinding . onDemand ) { if ( CharOperation . equals ( getSimpleName ( importBinding ) , name ) ) { Binding resolvedImport = unitScope . resolveSingleImport ( importBinding , Binding . TYPE ) ; if ( resolvedImport == null ) continue nextImport ; if ( resolvedImport instanceof TypeBinding ) { ImportReference importReference = importBinding . reference ; if ( importReference != null ) importReference . bits |= ASTNode . Used ; return resolvedImport ; } } } } } PackageBinding currentPackage = unitScope . fPackage ; unitScope . recordReference ( currentPackage . compoundName , name ) ; Binding binding = currentPackage . getTypeOrPackage ( name ) ; if ( binding instanceof ReferenceBinding ) { ReferenceBinding referenceType = ( ReferenceBinding ) binding ; if ( ( referenceType . tagBits & TagBits . HasMissingType ) == <NUM_LIT:0> ) { if ( typeOrPackageCache != null ) typeOrPackageCache . put ( name , referenceType ) ; return referenceType ; } } if ( imports != null ) { boolean foundInImport = false ; ReferenceBinding type = null ; for ( int i = <NUM_LIT:0> , length = imports . length ; i < length ; i ++ ) { ImportBinding someImport = imports [ i ] ; if ( someImport . onDemand ) { Binding resolvedImport = someImport . resolvedImport ; ReferenceBinding temp = null ; if ( resolvedImport instanceof PackageBinding ) { temp = findType ( name , ( PackageBinding ) resolvedImport , currentPackage ) ; } else if ( someImport . isStatic ( ) ) { temp = findMemberType ( name , ( ReferenceBinding ) resolvedImport ) ; if ( temp != null && ! temp . isStatic ( ) ) temp = null ; } else { temp = findDirectMemberType ( name , ( ReferenceBinding ) resolvedImport ) ; } if ( temp != type && temp != null ) { if ( temp . isValidBinding ( ) ) { boolean conflict = true ; if ( this . parent != null && foundInImport ) { CompilationUnitScope cuScope = compilationUnitScope ( ) ; if ( cuScope != null ) { ReferenceBinding chosenBinding = cuScope . selectBinding ( temp , type , someImport . reference != null ) ; if ( chosenBinding != null ) { conflict = false ; foundInImport = true ; type = chosenBinding ; } } } if ( conflict ) { ImportReference importReference = someImport . reference ; if ( importReference != null ) { importReference . bits |= ASTNode . Used ; } if ( foundInImport ) { temp = new ProblemReferenceBinding ( new char [ ] [ ] { name } , type , ProblemReasons . Ambiguous ) ; if ( typeOrPackageCache != null ) typeOrPackageCache . put ( name , temp ) ; return temp ; } type = temp ; foundInImport = true ; } } else if ( foundType == null ) { foundType = temp ; } } } } if ( type != null ) { if ( typeOrPackageCache != null ) typeOrPackageCache . put ( name , type ) ; return type ; } } } unitScope . recordSimpleReference ( name ) ; if ( ( mask & Binding . PACKAGE ) != <NUM_LIT:0> ) { PackageBinding packageBinding = unitScope . environment . getTopLevelPackage ( name ) ; if ( packageBinding != null ) { if ( typeOrPackageCache != null ) typeOrPackageCache . put ( name , packageBinding ) ; return packageBinding ; } } if ( foundType == null ) { char [ ] [ ] qName = new char [ ] [ ] { name } ; ReferenceBinding closestMatch = null ; if ( ( mask & Binding . PACKAGE ) != <NUM_LIT:0> ) { if ( needResolve ) { closestMatch = environment ( ) . createMissingType ( unitScope . fPackage , qName ) ; } } else { PackageBinding packageBinding = unitScope . environment . getTopLevelPackage ( name ) ; if ( packageBinding == null || ! packageBinding . isValidBinding ( ) ) { if ( needResolve ) { closestMatch = environment ( ) . createMissingType ( unitScope . fPackage , qName ) ; } } } foundType = new ProblemReferenceBinding ( qName , closestMatch , ProblemReasons . NotFound ) ; if ( typeOrPackageCache != null && ( mask & Binding . PACKAGE ) != <NUM_LIT:0> ) { typeOrPackageCache . put ( name , foundType ) ; } } else if ( ( foundType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { char [ ] [ ] qName = new char [ ] [ ] { name } ; foundType = new ProblemReferenceBinding ( qName , foundType , ProblemReasons . NotFound ) ; if ( typeOrPackageCache != null && ( mask & Binding . PACKAGE ) != <NUM_LIT:0> ) typeOrPackageCache . put ( name , foundType ) ; } return foundType ; } public final Binding getTypeOrPackage ( char [ ] [ ] compoundName ) { int nameLength = compoundName . length ; if ( nameLength == <NUM_LIT:1> ) { TypeBinding binding = getBaseType ( compoundName [ <NUM_LIT:0> ] ) ; if ( binding != null ) return binding ; } Binding binding = getTypeOrPackage ( compoundName [ <NUM_LIT:0> ] , Binding . TYPE | Binding . PACKAGE , true ) ; if ( ! binding . isValidBinding ( ) ) return binding ; int currentIndex = <NUM_LIT:1> ; boolean checkVisibility = false ; if ( binding instanceof PackageBinding ) { PackageBinding packageBinding = ( PackageBinding ) binding ; while ( currentIndex < nameLength ) { binding = packageBinding . getTypeOrPackage ( compoundName [ currentIndex ++ ] ) ; if ( binding == null ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , null , ProblemReasons . NotFound ) ; if ( ! binding . isValidBinding ( ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , binding instanceof ReferenceBinding ? ( ReferenceBinding ) ( ( ReferenceBinding ) binding ) . closestMatch ( ) : null , binding . problemId ( ) ) ; if ( ! ( binding instanceof PackageBinding ) ) break ; packageBinding = ( PackageBinding ) binding ; } if ( binding instanceof PackageBinding ) return binding ; checkVisibility = true ; } ReferenceBinding typeBinding = ( ReferenceBinding ) binding ; ReferenceBinding qualifiedType = ( ReferenceBinding ) environment ( ) . convertToRawType ( typeBinding , false ) ; if ( checkVisibility ) if ( ! typeBinding . canBeSeenBy ( this ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , typeBinding , ProblemReasons . NotVisible ) ; while ( currentIndex < nameLength ) { typeBinding = getMemberType ( compoundName [ currentIndex ++ ] , typeBinding ) ; if ( ! typeBinding . isValidBinding ( ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , ( ReferenceBinding ) typeBinding . closestMatch ( ) , typeBinding . problemId ( ) ) ; if ( typeBinding . isGenericType ( ) ) { qualifiedType = environment ( ) . createRawType ( typeBinding , qualifiedType ) ; } else { qualifiedType = ( qualifiedType != null && ( qualifiedType . isRawType ( ) || qualifiedType . isParameterizedType ( ) ) ) ? environment ( ) . createParameterizedType ( typeBinding , null , qualifiedType ) : typeBinding ; } } return qualifiedType ; } protected boolean hasErasedCandidatesCollisions ( TypeBinding one , TypeBinding two , Map invocations , ReferenceBinding type , ASTNode typeRef ) { invocations . clear ( ) ; TypeBinding [ ] mecs = minimalErasedCandidates ( new TypeBinding [ ] { one , two } , invocations ) ; if ( mecs != null ) { nextCandidate : for ( int k = <NUM_LIT:0> , max = mecs . length ; k < max ; k ++ ) { TypeBinding mec = mecs [ k ] ; if ( mec == null ) continue nextCandidate ; Object value = invocations . get ( mec ) ; if ( value instanceof TypeBinding [ ] ) { TypeBinding [ ] invalidInvocations = ( TypeBinding [ ] ) value ; problemReporter ( ) . superinterfacesCollide ( invalidInvocations [ <NUM_LIT:0> ] . erasure ( ) , typeRef , invalidInvocations [ <NUM_LIT:0> ] , invalidInvocations [ <NUM_LIT:1> ] ) ; type . tagBits |= TagBits . HierarchyHasProblems ; return true ; } } } return false ; } protected char [ ] getSimpleName ( ImportBinding importBinding ) { if ( importBinding . reference == null ) { return importBinding . compoundName [ importBinding . compoundName . length - <NUM_LIT:1> ] ; } else { return importBinding . reference . getSimpleName ( ) ; } } public CaseStatement innermostSwitchCase ( ) { Scope scope = this ; do { if ( scope instanceof BlockScope ) return ( ( BlockScope ) scope ) . enclosingCase ; scope = scope . parent ; } while ( scope != null ) ; return null ; } protected boolean isAcceptableMethod ( MethodBinding one , MethodBinding two ) { TypeBinding [ ] oneParams = one . parameters ; TypeBinding [ ] twoParams = two . parameters ; int oneParamsLength = oneParams . length ; int twoParamsLength = twoParams . length ; if ( oneParamsLength == twoParamsLength ) { next : for ( int i = <NUM_LIT:0> ; i < oneParamsLength ; i ++ ) { TypeBinding oneParam = oneParams [ i ] ; TypeBinding twoParam = twoParams [ i ] ; if ( oneParam == twoParam || oneParam . isCompatibleWith ( twoParam ) ) { if ( two . declaringClass . isRawType ( ) ) continue next ; TypeBinding originalTwoParam = two . original ( ) . parameters [ i ] . leafComponentType ( ) ; switch ( originalTwoParam . kind ( ) ) { case Binding . TYPE_PARAMETER : if ( ( ( TypeVariableBinding ) originalTwoParam ) . hasOnlyRawBounds ( ) ) continue next ; case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : case Binding . PARAMETERIZED_TYPE : TypeBinding originalOneParam = one . original ( ) . parameters [ i ] . leafComponentType ( ) ; switch ( originalOneParam . kind ( ) ) { case Binding . TYPE : case Binding . GENERIC_TYPE : TypeBinding inheritedTwoParam = oneParam . findSuperTypeOriginatingFrom ( twoParam ) ; if ( inheritedTwoParam == null || ! inheritedTwoParam . leafComponentType ( ) . isRawType ( ) ) break ; return false ; case Binding . TYPE_PARAMETER : if ( ! ( ( TypeVariableBinding ) originalOneParam ) . upperBound ( ) . isRawType ( ) ) break ; return false ; case Binding . RAW_TYPE : return false ; } } } else { if ( i == oneParamsLength - <NUM_LIT:1> && one . isVarargs ( ) && two . isVarargs ( ) ) { TypeBinding eType = ( ( ArrayBinding ) twoParam ) . elementsType ( ) ; if ( oneParam == eType || oneParam . isCompatibleWith ( eType ) ) return true ; } return false ; } } return true ; } if ( one . isVarargs ( ) && two . isVarargs ( ) ) { if ( oneParamsLength > twoParamsLength ) { if ( ( ( ArrayBinding ) twoParams [ twoParamsLength - <NUM_LIT:1> ] ) . elementsType ( ) . id != TypeIds . T_JavaLangObject ) return false ; } for ( int i = ( oneParamsLength > twoParamsLength ? twoParamsLength : oneParamsLength ) - <NUM_LIT:2> ; i >= <NUM_LIT:0> ; i -- ) if ( oneParams [ i ] != twoParams [ i ] && ! oneParams [ i ] . isCompatibleWith ( twoParams [ i ] ) ) return false ; if ( parameterCompatibilityLevel ( one , twoParams ) == NOT_COMPATIBLE && parameterCompatibilityLevel ( two , oneParams ) == VARARGS_COMPATIBLE ) return true ; } return false ; } public boolean isBoxingCompatibleWith ( TypeBinding expressionType , TypeBinding targetType ) { LookupEnvironment environment = environment ( ) ; if ( environment . globalOptions . sourceLevel < ClassFileConstants . JDK1_5 || expressionType . isBaseType ( ) == targetType . isBaseType ( ) ) return false ; TypeBinding convertedType = environment . computeBoxingType ( expressionType ) ; return convertedType == targetType || convertedType . isCompatibleWith ( targetType ) ; } public final boolean isDefinedInField ( FieldBinding field ) { Scope scope = this ; do { if ( scope instanceof MethodScope ) { MethodScope methodScope = ( MethodScope ) scope ; if ( methodScope . initializedField == field ) return true ; } scope = scope . parent ; } while ( scope != null ) ; return false ; } public final boolean isDefinedInMethod ( MethodBinding method ) { Scope scope = this ; do { if ( scope instanceof MethodScope ) { ReferenceContext refContext = ( ( MethodScope ) scope ) . referenceContext ; if ( refContext instanceof AbstractMethodDeclaration ) if ( ( ( AbstractMethodDeclaration ) refContext ) . binding == method ) return true ; } scope = scope . parent ; } while ( scope != null ) ; return false ; } public final boolean isDefinedInSameUnit ( ReferenceBinding type ) { ReferenceBinding enclosingType = type ; while ( ( type = enclosingType . enclosingType ( ) ) != null ) enclosingType = type ; Scope scope , unitScope = this ; while ( ( scope = unitScope . parent ) != null ) unitScope = scope ; SourceTypeBinding [ ] topLevelTypes = ( ( CompilationUnitScope ) unitScope ) . topLevelTypes ; for ( int i = topLevelTypes . length ; -- i >= <NUM_LIT:0> ; ) if ( topLevelTypes [ i ] == enclosingType ) return true ; return false ; } public final boolean isDefinedInType ( ReferenceBinding type ) { Scope scope = this ; do { if ( scope instanceof ClassScope ) if ( ( ( ClassScope ) scope ) . referenceContext . binding == type ) return true ; scope = scope . parent ; } while ( scope != null ) ; return false ; } public boolean isInsideCase ( CaseStatement caseStatement ) { Scope scope = this ; do { switch ( scope . kind ) { case Scope . BLOCK_SCOPE : if ( ( ( BlockScope ) scope ) . enclosingCase == caseStatement ) { return true ; } } scope = scope . parent ; } while ( scope != null ) ; return false ; } public boolean isInsideDeprecatedCode ( ) { switch ( this . kind ) { case Scope . BLOCK_SCOPE : case Scope . METHOD_SCOPE : MethodScope methodScope = methodScope ( ) ; if ( ! methodScope . isInsideInitializer ( ) ) { MethodBinding context = ( ( AbstractMethodDeclaration ) methodScope . referenceContext ) . binding ; if ( context != null && context . isViewedAsDeprecated ( ) ) return true ; } else if ( methodScope . initializedField != null && methodScope . initializedField . isViewedAsDeprecated ( ) ) { return true ; } SourceTypeBinding declaringType = ( ( BlockScope ) this ) . referenceType ( ) . binding ; if ( declaringType != null ) { declaringType . initializeDeprecatedAnnotationTagBits ( ) ; if ( declaringType . isViewedAsDeprecated ( ) ) return true ; } break ; case Scope . CLASS_SCOPE : ReferenceBinding context = ( ( ClassScope ) this ) . referenceType ( ) . binding ; if ( context != null ) { context . initializeDeprecatedAnnotationTagBits ( ) ; if ( context . isViewedAsDeprecated ( ) ) return true ; } break ; case Scope . COMPILATION_UNIT_SCOPE : CompilationUnitDeclaration unit = referenceCompilationUnit ( ) ; if ( unit . types != null && unit . types . length > <NUM_LIT:0> ) { SourceTypeBinding type = unit . types [ <NUM_LIT:0> ] . binding ; if ( type != null ) { type . initializeDeprecatedAnnotationTagBits ( ) ; if ( type . isViewedAsDeprecated ( ) ) return true ; } } } return false ; } private boolean isOverriddenMethodGeneric ( MethodBinding method ) { MethodVerifier verifier = environment ( ) . methodVerifier ( ) ; ReferenceBinding currentType = method . declaringClass . superclass ( ) ; while ( currentType != null ) { MethodBinding [ ] currentMethods = currentType . getMethods ( method . selector ) ; for ( int i = <NUM_LIT:0> , l = currentMethods . length ; i < l ; i ++ ) { MethodBinding currentMethod = currentMethods [ i ] ; if ( currentMethod != null && currentMethod . original ( ) . typeVariables != Binding . NO_TYPE_VARIABLES ) if ( verifier . doesMethodOverride ( method , currentMethod ) ) return true ; } currentType = currentType . superclass ( ) ; } return false ; } public boolean isPossibleSubtypeOfRawType ( TypeBinding paramType ) { TypeBinding t = paramType . leafComponentType ( ) ; if ( t . isBaseType ( ) ) return false ; ReferenceBinding currentType = ( ReferenceBinding ) t ; ReferenceBinding [ ] interfacesToVisit = null ; int nextPosition = <NUM_LIT:0> ; do { if ( currentType . isRawType ( ) ) return true ; if ( ! currentType . isHierarchyConnected ( ) ) return true ; ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { if ( interfacesToVisit == null ) { interfacesToVisit = itsInterfaces ; nextPosition = interfacesToVisit . length ; } else { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } } while ( ( currentType = currentType . superclass ( ) ) != null ) ; for ( int i = <NUM_LIT:0> ; i < nextPosition ; i ++ ) { currentType = interfacesToVisit [ i ] ; if ( currentType . isRawType ( ) ) return true ; ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } return false ; } private TypeBinding leastContainingInvocation ( TypeBinding mec , Object invocationData , List lubStack ) { if ( invocationData == null ) return mec ; if ( invocationData instanceof TypeBinding ) { return ( TypeBinding ) invocationData ; } TypeBinding [ ] invocations = ( TypeBinding [ ] ) invocationData ; int dim = mec . dimensions ( ) ; mec = mec . leafComponentType ( ) ; int argLength = mec . typeVariables ( ) . length ; if ( argLength == <NUM_LIT:0> ) return mec ; TypeBinding [ ] bestArguments = new TypeBinding [ argLength ] ; for ( int i = <NUM_LIT:0> , length = invocations . length ; i < length ; i ++ ) { TypeBinding invocation = invocations [ i ] . leafComponentType ( ) ; switch ( invocation . kind ( ) ) { case Binding . GENERIC_TYPE : TypeVariableBinding [ ] invocationVariables = invocation . typeVariables ( ) ; for ( int j = <NUM_LIT:0> ; j < argLength ; j ++ ) { TypeBinding bestArgument = leastContainingTypeArgument ( bestArguments [ j ] , invocationVariables [ j ] , ( ReferenceBinding ) mec , j , lubStack ) ; if ( bestArgument == null ) return null ; bestArguments [ j ] = bestArgument ; } break ; case Binding . PARAMETERIZED_TYPE : ParameterizedTypeBinding parameterizedType = ( ParameterizedTypeBinding ) invocation ; for ( int j = <NUM_LIT:0> ; j < argLength ; j ++ ) { TypeBinding bestArgument = leastContainingTypeArgument ( bestArguments [ j ] , parameterizedType . arguments [ j ] , ( ReferenceBinding ) mec , j , lubStack ) ; if ( bestArgument == null ) return null ; bestArguments [ j ] = bestArgument ; } break ; case Binding . RAW_TYPE : return dim == <NUM_LIT:0> ? invocation : environment ( ) . createArrayType ( invocation , dim ) ; } } TypeBinding least = environment ( ) . createParameterizedType ( ( ReferenceBinding ) mec . erasure ( ) , bestArguments , mec . enclosingType ( ) ) ; return dim == <NUM_LIT:0> ? least : environment ( ) . createArrayType ( least , dim ) ; } private TypeBinding leastContainingTypeArgument ( TypeBinding u , TypeBinding v , ReferenceBinding genericType , int rank , List lubStack ) { if ( u == null ) return v ; if ( u == v ) return u ; if ( v . isWildcard ( ) ) { WildcardBinding wildV = ( WildcardBinding ) v ; if ( u . isWildcard ( ) ) { WildcardBinding wildU = ( WildcardBinding ) u ; switch ( wildU . boundKind ) { case Wildcard . EXTENDS : switch ( wildV . boundKind ) { case Wildcard . EXTENDS : TypeBinding lub = lowerUpperBound ( new TypeBinding [ ] { wildU . bound , wildV . bound } , lubStack ) ; if ( lub == null ) return null ; if ( lub == TypeBinding . INT ) return environment ( ) . createWildcard ( genericType , rank , null , null , Wildcard . UNBOUND ) ; return environment ( ) . createWildcard ( genericType , rank , lub , null , Wildcard . EXTENDS ) ; case Wildcard . SUPER : if ( wildU . bound == wildV . bound ) return wildU . bound ; return environment ( ) . createWildcard ( genericType , rank , null , null , Wildcard . UNBOUND ) ; } break ; case Wildcard . SUPER : if ( wildU . boundKind == Wildcard . SUPER ) { TypeBinding [ ] glb = greaterLowerBound ( new TypeBinding [ ] { wildU . bound , wildV . bound } ) ; if ( glb == null ) return null ; return environment ( ) . createWildcard ( genericType , rank , glb [ <NUM_LIT:0> ] , null , Wildcard . SUPER ) ; } } } else { switch ( wildV . boundKind ) { case Wildcard . EXTENDS : TypeBinding lub = lowerUpperBound ( new TypeBinding [ ] { u , wildV . bound } , lubStack ) ; if ( lub == null ) return null ; if ( lub == TypeBinding . INT ) return environment ( ) . createWildcard ( genericType , rank , null , null , Wildcard . UNBOUND ) ; return environment ( ) . createWildcard ( genericType , rank , lub , null , Wildcard . EXTENDS ) ; case Wildcard . SUPER : TypeBinding [ ] glb = greaterLowerBound ( new TypeBinding [ ] { u , wildV . bound } ) ; if ( glb == null ) return null ; return environment ( ) . createWildcard ( genericType , rank , glb [ <NUM_LIT:0> ] , null , Wildcard . SUPER ) ; case Wildcard . UNBOUND : } } } else if ( u . isWildcard ( ) ) { WildcardBinding wildU = ( WildcardBinding ) u ; switch ( wildU . boundKind ) { case Wildcard . EXTENDS : TypeBinding lub = lowerUpperBound ( new TypeBinding [ ] { wildU . bound , v } , lubStack ) ; if ( lub == null ) return null ; if ( lub == TypeBinding . INT ) return environment ( ) . createWildcard ( genericType , rank , null , null , Wildcard . UNBOUND ) ; return environment ( ) . createWildcard ( genericType , rank , lub , null , Wildcard . EXTENDS ) ; case Wildcard . SUPER : TypeBinding [ ] glb = greaterLowerBound ( new TypeBinding [ ] { wildU . bound , v } ) ; if ( glb == null ) return null ; return environment ( ) . createWildcard ( genericType , rank , glb [ <NUM_LIT:0> ] , null , Wildcard . SUPER ) ; case Wildcard . UNBOUND : } } TypeBinding lub = lowerUpperBound ( new TypeBinding [ ] { u , v } , lubStack ) ; if ( lub == null ) return null ; if ( lub == TypeBinding . INT ) return environment ( ) . createWildcard ( genericType , rank , null , null , Wildcard . UNBOUND ) ; return environment ( ) . createWildcard ( genericType , rank , lub , null , Wildcard . EXTENDS ) ; } public TypeBinding lowerUpperBound ( TypeBinding [ ] types ) { int typeLength = types . length ; if ( typeLength == <NUM_LIT:1> ) { TypeBinding type = types [ <NUM_LIT:0> ] ; return type == null ? TypeBinding . VOID : type ; } return lowerUpperBound ( types , new ArrayList ( <NUM_LIT:1> ) ) ; } private TypeBinding lowerUpperBound ( TypeBinding [ ] types , List lubStack ) { int typeLength = types . length ; if ( typeLength == <NUM_LIT:1> ) { TypeBinding type = types [ <NUM_LIT:0> ] ; return type == null ? TypeBinding . VOID : type ; } int stackLength = lubStack . size ( ) ; nextLubCheck : for ( int i = <NUM_LIT:0> ; i < stackLength ; i ++ ) { TypeBinding [ ] lubTypes = ( TypeBinding [ ] ) lubStack . get ( i ) ; int lubTypeLength = lubTypes . length ; if ( lubTypeLength < typeLength ) continue nextLubCheck ; nextTypeCheck : for ( int j = <NUM_LIT:0> ; j < typeLength ; j ++ ) { TypeBinding type = types [ j ] ; if ( type == null ) continue nextTypeCheck ; for ( int k = <NUM_LIT:0> ; k < lubTypeLength ; k ++ ) { TypeBinding lubType = lubTypes [ k ] ; if ( lubType == null ) continue ; if ( lubType == type || lubType . isEquivalentTo ( type ) ) continue nextTypeCheck ; } continue nextLubCheck ; } return TypeBinding . INT ; } lubStack . add ( types ) ; Map invocations = new HashMap ( <NUM_LIT:1> ) ; TypeBinding [ ] mecs = minimalErasedCandidates ( types , invocations ) ; if ( mecs == null ) return null ; int length = mecs . length ; if ( length == <NUM_LIT:0> ) return TypeBinding . VOID ; int count = <NUM_LIT:0> ; TypeBinding firstBound = null ; int commonDim = - <NUM_LIT:1> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeBinding mec = mecs [ i ] ; if ( mec == null ) continue ; mec = leastContainingInvocation ( mec , invocations . get ( mec ) , lubStack ) ; if ( mec == null ) return null ; int dim = mec . dimensions ( ) ; if ( commonDim == - <NUM_LIT:1> ) { commonDim = dim ; } else if ( dim != commonDim ) { return null ; } if ( firstBound == null && ! mec . leafComponentType ( ) . isInterface ( ) ) firstBound = mec . leafComponentType ( ) ; mecs [ count ++ ] = mec ; } switch ( count ) { case <NUM_LIT:0> : return TypeBinding . VOID ; case <NUM_LIT:1> : return mecs [ <NUM_LIT:0> ] ; case <NUM_LIT:2> : if ( ( commonDim == <NUM_LIT:0> ? mecs [ <NUM_LIT:1> ] . id : mecs [ <NUM_LIT:1> ] . leafComponentType ( ) . id ) == TypeIds . T_JavaLangObject ) return mecs [ <NUM_LIT:0> ] ; if ( ( commonDim == <NUM_LIT:0> ? mecs [ <NUM_LIT:0> ] . id : mecs [ <NUM_LIT:0> ] . leafComponentType ( ) . id ) == TypeIds . T_JavaLangObject ) return mecs [ <NUM_LIT:1> ] ; } TypeBinding [ ] otherBounds = new TypeBinding [ count - <NUM_LIT:1> ] ; int rank = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < count ; i ++ ) { TypeBinding mec = commonDim == <NUM_LIT:0> ? mecs [ i ] : mecs [ i ] . leafComponentType ( ) ; if ( mec . isInterface ( ) ) { otherBounds [ rank ++ ] = mec ; } } TypeBinding intersectionType = environment ( ) . createWildcard ( null , <NUM_LIT:0> , firstBound , otherBounds , Wildcard . EXTENDS ) ; return commonDim == <NUM_LIT:0> ? intersectionType : environment ( ) . createArrayType ( intersectionType , commonDim ) ; } public final MethodScope methodScope ( ) { Scope scope = this ; do { if ( scope instanceof MethodScope ) return ( MethodScope ) scope ; scope = scope . parent ; } while ( scope != null ) ; return null ; } protected TypeBinding [ ] minimalErasedCandidates ( TypeBinding [ ] types , Map allInvocations ) { int length = types . length ; int indexOfFirst = - <NUM_LIT:1> , actualLength = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeBinding type = types [ i ] ; if ( type == null ) continue ; if ( type . isBaseType ( ) ) return null ; if ( indexOfFirst < <NUM_LIT:0> ) indexOfFirst = i ; actualLength ++ ; } switch ( actualLength ) { case <NUM_LIT:0> : return Binding . NO_TYPES ; case <NUM_LIT:1> : return types ; } TypeBinding firstType = types [ indexOfFirst ] ; if ( firstType . isBaseType ( ) ) return null ; ArrayList typesToVisit = new ArrayList ( <NUM_LIT:5> ) ; int dim = firstType . dimensions ( ) ; TypeBinding leafType = firstType . leafComponentType ( ) ; TypeBinding firstErasure ; switch ( leafType . kind ( ) ) { case Binding . PARAMETERIZED_TYPE : case Binding . RAW_TYPE : case Binding . ARRAY_TYPE : firstErasure = firstType . erasure ( ) ; break ; default : firstErasure = firstType ; break ; } if ( firstErasure != firstType ) { allInvocations . put ( firstErasure , firstType ) ; } typesToVisit . add ( firstType ) ; int max = <NUM_LIT:1> ; ReferenceBinding currentType ; for ( int i = <NUM_LIT:0> ; i < max ; i ++ ) { TypeBinding typeToVisit = ( TypeBinding ) typesToVisit . get ( i ) ; dim = typeToVisit . dimensions ( ) ; if ( dim > <NUM_LIT:0> ) { leafType = typeToVisit . leafComponentType ( ) ; switch ( leafType . id ) { case TypeIds . T_JavaLangObject : if ( dim > <NUM_LIT:1> ) { TypeBinding elementType = ( ( ArrayBinding ) typeToVisit ) . elementsType ( ) ; if ( ! typesToVisit . contains ( elementType ) ) { typesToVisit . add ( elementType ) ; max ++ ; } continue ; } case TypeIds . T_byte : case TypeIds . T_short : case TypeIds . T_char : case TypeIds . T_boolean : case TypeIds . T_int : case TypeIds . T_long : case TypeIds . T_float : case TypeIds . T_double : TypeBinding superType = getJavaIoSerializable ( ) ; if ( ! typesToVisit . contains ( superType ) ) { typesToVisit . add ( superType ) ; max ++ ; } superType = getJavaLangCloneable ( ) ; if ( ! typesToVisit . contains ( superType ) ) { typesToVisit . add ( superType ) ; max ++ ; } superType = getJavaLangObject ( ) ; if ( ! typesToVisit . contains ( superType ) ) { typesToVisit . add ( superType ) ; max ++ ; } continue ; default : } typeToVisit = leafType ; } currentType = ( ReferenceBinding ) typeToVisit ; if ( currentType . isCapture ( ) ) { TypeBinding firstBound = ( ( CaptureBinding ) currentType ) . firstBound ; if ( firstBound != null && firstBound . isArrayType ( ) ) { TypeBinding superType = dim == <NUM_LIT:0> ? firstBound : ( TypeBinding ) environment ( ) . createArrayType ( firstBound , dim ) ; if ( ! typesToVisit . contains ( superType ) ) { typesToVisit . add ( superType ) ; max ++ ; TypeBinding superTypeErasure = ( firstBound . isTypeVariable ( ) || firstBound . isWildcard ( ) ) ? superType : superType . erasure ( ) ; if ( superTypeErasure != superType ) { allInvocations . put ( superTypeErasure , superType ) ; } } continue ; } } ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces != null ) { for ( int j = <NUM_LIT:0> , count = itsInterfaces . length ; j < count ; j ++ ) { TypeBinding itsInterface = itsInterfaces [ j ] ; TypeBinding superType = dim == <NUM_LIT:0> ? itsInterface : ( TypeBinding ) environment ( ) . createArrayType ( itsInterface , dim ) ; if ( ! typesToVisit . contains ( superType ) ) { typesToVisit . add ( superType ) ; max ++ ; TypeBinding superTypeErasure = ( itsInterface . isTypeVariable ( ) || itsInterface . isWildcard ( ) ) ? superType : superType . erasure ( ) ; if ( superTypeErasure != superType ) { allInvocations . put ( superTypeErasure , superType ) ; } } } } TypeBinding itsSuperclass = currentType . superclass ( ) ; if ( itsSuperclass != null ) { TypeBinding superType = dim == <NUM_LIT:0> ? itsSuperclass : ( TypeBinding ) environment ( ) . createArrayType ( itsSuperclass , dim ) ; if ( ! typesToVisit . contains ( superType ) ) { typesToVisit . add ( superType ) ; max ++ ; TypeBinding superTypeErasure = ( itsSuperclass . isTypeVariable ( ) || itsSuperclass . isWildcard ( ) ) ? superType : superType . erasure ( ) ; if ( superTypeErasure != superType ) { allInvocations . put ( superTypeErasure , superType ) ; } } } } int superLength = typesToVisit . size ( ) ; TypeBinding [ ] erasedSuperTypes = new TypeBinding [ superLength ] ; int rank = <NUM_LIT:0> ; for ( Iterator iter = typesToVisit . iterator ( ) ; iter . hasNext ( ) ; ) { TypeBinding type = ( TypeBinding ) iter . next ( ) ; leafType = type . leafComponentType ( ) ; erasedSuperTypes [ rank ++ ] = ( leafType . isTypeVariable ( ) || leafType . isWildcard ( ) ) ? type : type . erasure ( ) ; } int remaining = superLength ; nextOtherType : for ( int i = indexOfFirst + <NUM_LIT:1> ; i < length ; i ++ ) { TypeBinding otherType = types [ i ] ; if ( otherType == null ) continue nextOtherType ; if ( otherType . isArrayType ( ) ) { nextSuperType : for ( int j = <NUM_LIT:0> ; j < superLength ; j ++ ) { TypeBinding erasedSuperType = erasedSuperTypes [ j ] ; if ( erasedSuperType == null || erasedSuperType == otherType ) continue nextSuperType ; TypeBinding match ; if ( ( match = otherType . findSuperTypeOriginatingFrom ( erasedSuperType ) ) == null ) { erasedSuperTypes [ j ] = null ; if ( -- remaining == <NUM_LIT:0> ) return null ; continue nextSuperType ; } Object invocationData = allInvocations . get ( erasedSuperType ) ; if ( invocationData == null ) { allInvocations . put ( erasedSuperType , match ) ; } else if ( invocationData instanceof TypeBinding ) { if ( match != invocationData ) { TypeBinding [ ] someInvocations = { ( TypeBinding ) invocationData , match , } ; allInvocations . put ( erasedSuperType , someInvocations ) ; } } else { TypeBinding [ ] someInvocations = ( TypeBinding [ ] ) invocationData ; checkExisting : { int invocLength = someInvocations . length ; for ( int k = <NUM_LIT:0> ; k < invocLength ; k ++ ) { if ( someInvocations [ k ] == match ) break checkExisting ; } System . arraycopy ( someInvocations , <NUM_LIT:0> , someInvocations = new TypeBinding [ invocLength + <NUM_LIT:1> ] , <NUM_LIT:0> , invocLength ) ; allInvocations . put ( erasedSuperType , someInvocations ) ; someInvocations [ invocLength ] = match ; } } } continue nextOtherType ; } nextSuperType : for ( int j = <NUM_LIT:0> ; j < superLength ; j ++ ) { TypeBinding erasedSuperType = erasedSuperTypes [ j ] ; if ( erasedSuperType == null ) continue nextSuperType ; TypeBinding match ; if ( erasedSuperType == otherType || erasedSuperType . id == TypeIds . T_JavaLangObject && otherType . isInterface ( ) ) { match = erasedSuperType ; } else { if ( erasedSuperType . isArrayType ( ) ) { match = null ; } else { match = otherType . findSuperTypeOriginatingFrom ( erasedSuperType ) ; } if ( match == null ) { erasedSuperTypes [ j ] = null ; if ( -- remaining == <NUM_LIT:0> ) return null ; continue nextSuperType ; } } Object invocationData = allInvocations . get ( erasedSuperType ) ; if ( invocationData == null ) { allInvocations . put ( erasedSuperType , match ) ; } else if ( invocationData instanceof TypeBinding ) { if ( match != invocationData ) { TypeBinding [ ] someInvocations = { ( TypeBinding ) invocationData , match , } ; allInvocations . put ( erasedSuperType , someInvocations ) ; } } else { TypeBinding [ ] someInvocations = ( TypeBinding [ ] ) invocationData ; checkExisting : { int invocLength = someInvocations . length ; for ( int k = <NUM_LIT:0> ; k < invocLength ; k ++ ) { if ( someInvocations [ k ] == match ) break checkExisting ; } System . arraycopy ( someInvocations , <NUM_LIT:0> , someInvocations = new TypeBinding [ invocLength + <NUM_LIT:1> ] , <NUM_LIT:0> , invocLength ) ; allInvocations . put ( erasedSuperType , someInvocations ) ; someInvocations [ invocLength ] = match ; } } } } if ( remaining > <NUM_LIT:1> ) { nextType : for ( int i = <NUM_LIT:0> ; i < superLength ; i ++ ) { TypeBinding erasedSuperType = erasedSuperTypes [ i ] ; if ( erasedSuperType == null ) continue nextType ; nextOtherType : for ( int j = <NUM_LIT:0> ; j < superLength ; j ++ ) { if ( i == j ) continue nextOtherType ; TypeBinding otherType = erasedSuperTypes [ j ] ; if ( otherType == null ) continue nextOtherType ; if ( erasedSuperType instanceof ReferenceBinding ) { if ( otherType . id == TypeIds . T_JavaLangObject && erasedSuperType . isInterface ( ) ) continue nextOtherType ; if ( erasedSuperType . findSuperTypeOriginatingFrom ( otherType ) != null ) { erasedSuperTypes [ j ] = null ; remaining -- ; } } else if ( erasedSuperType . isArrayType ( ) ) { if ( otherType . isArrayType ( ) && otherType . leafComponentType ( ) . id == TypeIds . T_JavaLangObject && otherType . dimensions ( ) == erasedSuperType . dimensions ( ) && erasedSuperType . leafComponentType ( ) . isInterface ( ) ) continue nextOtherType ; if ( erasedSuperType . findSuperTypeOriginatingFrom ( otherType ) != null ) { erasedSuperTypes [ j ] = null ; remaining -- ; } } } } } return erasedSuperTypes ; } protected final MethodBinding mostSpecificClassMethodBinding ( MethodBinding [ ] visible , int visibleSize , InvocationSite invocationSite ) { MethodBinding previous = null ; nextVisible : for ( int i = <NUM_LIT:0> ; i < visibleSize ; i ++ ) { MethodBinding method = visible [ i ] ; if ( previous != null && method . declaringClass != previous . declaringClass ) break ; if ( ! method . isStatic ( ) ) previous = method ; for ( int j = <NUM_LIT:0> ; j < visibleSize ; j ++ ) { if ( i == j ) continue ; if ( ! visible [ j ] . areParametersCompatibleWith ( method . parameters ) ) continue nextVisible ; } compilationUnitScope ( ) . recordTypeReferences ( method . thrownExceptions ) ; return method ; } return new ProblemMethodBinding ( visible [ <NUM_LIT:0> ] , visible [ <NUM_LIT:0> ] . selector , visible [ <NUM_LIT:0> ] . parameters , ProblemReasons . Ambiguous ) ; } protected final MethodBinding mostSpecificInterfaceMethodBinding ( MethodBinding [ ] visible , int visibleSize , InvocationSite invocationSite ) { nextVisible : for ( int i = <NUM_LIT:0> ; i < visibleSize ; i ++ ) { MethodBinding method = visible [ i ] ; for ( int j = <NUM_LIT:0> ; j < visibleSize ; j ++ ) { if ( i == j ) continue ; if ( ! visible [ j ] . areParametersCompatibleWith ( method . parameters ) ) continue nextVisible ; } compilationUnitScope ( ) . recordTypeReferences ( method . thrownExceptions ) ; return method ; } return new ProblemMethodBinding ( visible [ <NUM_LIT:0> ] , visible [ <NUM_LIT:0> ] . selector , visible [ <NUM_LIT:0> ] . parameters , ProblemReasons . Ambiguous ) ; } protected final MethodBinding mostSpecificMethodBinding ( MethodBinding [ ] visible , int visibleSize , TypeBinding [ ] argumentTypes , final InvocationSite invocationSite , ReferenceBinding receiverType ) { int [ ] compatibilityLevels = new int [ visibleSize ] ; for ( int i = <NUM_LIT:0> ; i < visibleSize ; i ++ ) compatibilityLevels [ i ] = parameterCompatibilityLevel ( visible [ i ] , argumentTypes ) ; InvocationSite tieBreakInvocationSite = new InvocationSite ( ) { public TypeBinding [ ] genericTypeArguments ( ) { return null ; } public boolean isSuperAccess ( ) { return invocationSite . isSuperAccess ( ) ; } public boolean isTypeAccess ( ) { return invocationSite . isTypeAccess ( ) ; } public void setActualReceiverType ( ReferenceBinding actualReceiverType ) { } public void setDepth ( int depth ) { } public void setFieldIndex ( int depth ) { } public int sourceStart ( ) { return invocationSite . sourceStart ( ) ; } public int sourceEnd ( ) { return invocationSite . sourceStart ( ) ; } public TypeBinding expectedType ( ) { return invocationSite . expectedType ( ) ; } } ; MethodBinding [ ] moreSpecific = new MethodBinding [ visibleSize ] ; int count = <NUM_LIT:0> ; for ( int level = <NUM_LIT:0> , max = VARARGS_COMPATIBLE ; level <= max ; level ++ ) { nextVisible : for ( int i = <NUM_LIT:0> ; i < visibleSize ; i ++ ) { if ( compatibilityLevels [ i ] != level ) continue nextVisible ; max = level ; MethodBinding current = visible [ i ] ; MethodBinding original = current . original ( ) ; MethodBinding tiebreakMethod = current . tiebreakMethod ( ) ; for ( int j = <NUM_LIT:0> ; j < visibleSize ; j ++ ) { if ( i == j || compatibilityLevels [ j ] != level ) continue ; MethodBinding next = visible [ j ] ; if ( original == next . original ( ) ) { compatibilityLevels [ j ] = - <NUM_LIT:1> ; continue ; } MethodBinding methodToTest = next ; if ( next instanceof ParameterizedGenericMethodBinding ) { ParameterizedGenericMethodBinding pNext = ( ParameterizedGenericMethodBinding ) next ; if ( pNext . isRaw && ! pNext . isStatic ( ) ) { } else { methodToTest = pNext . originalMethod ; } } MethodBinding acceptable = computeCompatibleMethod ( methodToTest , tiebreakMethod . parameters , tieBreakInvocationSite ) ; if ( acceptable == null || ! acceptable . isValidBinding ( ) ) continue nextVisible ; if ( ! isAcceptableMethod ( tiebreakMethod , acceptable ) ) continue nextVisible ; if ( current . isBridge ( ) && ! next . isBridge ( ) ) if ( tiebreakMethod . areParametersEqual ( acceptable ) ) continue nextVisible ; } moreSpecific [ i ] = current ; count ++ ; } } if ( count == <NUM_LIT:1> ) { for ( int i = <NUM_LIT:0> ; i < visibleSize ; i ++ ) { if ( moreSpecific [ i ] != null ) { compilationUnitScope ( ) . recordTypeReferences ( visible [ i ] . thrownExceptions ) ; return visible [ i ] ; } } } else if ( count == <NUM_LIT:0> ) { return new ProblemMethodBinding ( visible [ <NUM_LIT:0> ] , visible [ <NUM_LIT:0> ] . selector , visible [ <NUM_LIT:0> ] . parameters , ProblemReasons . Ambiguous ) ; } if ( receiverType != null ) receiverType = receiverType instanceof CaptureBinding ? receiverType : ( ReferenceBinding ) receiverType . erasure ( ) ; nextSpecific : for ( int i = <NUM_LIT:0> ; i < visibleSize ; i ++ ) { MethodBinding current = moreSpecific [ i ] ; if ( current != null ) { ReferenceBinding [ ] mostSpecificExceptions = null ; MethodBinding original = current . original ( ) ; boolean shouldIntersectExceptions = original . declaringClass . isAbstract ( ) && original . thrownExceptions != Binding . NO_EXCEPTIONS ; for ( int j = <NUM_LIT:0> ; j < visibleSize ; j ++ ) { MethodBinding next = moreSpecific [ j ] ; if ( next == null || i == j ) continue ; MethodBinding original2 = next . original ( ) ; if ( original . declaringClass == original2 . declaringClass ) break nextSpecific ; if ( ! original . isAbstract ( ) ) { if ( original2 . isAbstract ( ) ) continue ; original2 = original . findOriginalInheritedMethod ( original2 ) ; if ( original2 == null ) continue nextSpecific ; if ( current . hasSubstitutedParameters ( ) || original . typeVariables != Binding . NO_TYPE_VARIABLES ) { if ( ! environment ( ) . methodVerifier ( ) . isParameterSubsignature ( original , original2 ) ) continue nextSpecific ; } } else if ( receiverType != null ) { TypeBinding superType = receiverType . findSuperTypeOriginatingFrom ( original . declaringClass . erasure ( ) ) ; if ( original . declaringClass == superType || ! ( superType instanceof ReferenceBinding ) ) { } else { MethodBinding [ ] superMethods = ( ( ReferenceBinding ) superType ) . getMethods ( original . selector , argumentTypes . length ) ; for ( int m = <NUM_LIT:0> , l = superMethods . length ; m < l ; m ++ ) { if ( superMethods [ m ] . original ( ) == original ) { original = superMethods [ m ] ; break ; } } } superType = receiverType . findSuperTypeOriginatingFrom ( original2 . declaringClass . erasure ( ) ) ; if ( original2 . declaringClass == superType || ! ( superType instanceof ReferenceBinding ) ) { } else { MethodBinding [ ] superMethods = ( ( ReferenceBinding ) superType ) . getMethods ( original2 . selector , argumentTypes . length ) ; for ( int m = <NUM_LIT:0> , l = superMethods . length ; m < l ; m ++ ) { if ( superMethods [ m ] . original ( ) == original2 ) { original2 = superMethods [ m ] ; break ; } } } if ( original . typeVariables != Binding . NO_TYPE_VARIABLES ) original2 = original . computeSubstitutedMethod ( original2 , environment ( ) ) ; if ( original2 == null || ! original . areParameterErasuresEqual ( original2 ) ) continue nextSpecific ; if ( original . returnType != original2 . returnType ) { if ( next . original ( ) . typeVariables != Binding . NO_TYPE_VARIABLES ) { if ( original . returnType . erasure ( ) . findSuperTypeOriginatingFrom ( original2 . returnType . erasure ( ) ) == null ) continue nextSpecific ; } else if ( ! current . returnType . isCompatibleWith ( next . returnType ) ) { continue nextSpecific ; } } if ( shouldIntersectExceptions && original2 . declaringClass . isInterface ( ) ) { if ( current . thrownExceptions != next . thrownExceptions ) { if ( next . thrownExceptions == Binding . NO_EXCEPTIONS ) { mostSpecificExceptions = Binding . NO_EXCEPTIONS ; } else { if ( mostSpecificExceptions == null ) { mostSpecificExceptions = current . thrownExceptions ; } int mostSpecificLength = mostSpecificExceptions . length ; int nextLength = next . thrownExceptions . length ; SimpleSet temp = new SimpleSet ( mostSpecificLength ) ; boolean changed = false ; nextException : for ( int t = <NUM_LIT:0> ; t < mostSpecificLength ; t ++ ) { ReferenceBinding exception = mostSpecificExceptions [ t ] ; for ( int s = <NUM_LIT:0> ; s < nextLength ; s ++ ) { ReferenceBinding nextException = next . thrownExceptions [ s ] ; if ( exception . isCompatibleWith ( nextException ) ) { temp . add ( exception ) ; continue nextException ; } else if ( nextException . isCompatibleWith ( exception ) ) { temp . add ( nextException ) ; changed = true ; continue nextException ; } else { changed = true ; } } } if ( changed ) { mostSpecificExceptions = temp . elementSize == <NUM_LIT:0> ? Binding . NO_EXCEPTIONS : new ReferenceBinding [ temp . elementSize ] ; temp . asArray ( mostSpecificExceptions ) ; } } } } } } if ( mostSpecificExceptions != null && mostSpecificExceptions != current . thrownExceptions ) { return new MostSpecificExceptionMethodBinding ( current , mostSpecificExceptions ) ; } return current ; } } return new ProblemMethodBinding ( visible [ <NUM_LIT:0> ] , visible [ <NUM_LIT:0> ] . selector , visible [ <NUM_LIT:0> ] . parameters , ProblemReasons . Ambiguous ) ; } public final ClassScope outerMostClassScope ( ) { ClassScope lastClassScope = null ; Scope scope = this ; do { if ( scope instanceof ClassScope ) lastClassScope = ( ClassScope ) scope ; scope = scope . parent ; } while ( scope != null ) ; return lastClassScope ; } public final MethodScope outerMostMethodScope ( ) { MethodScope lastMethodScope = null ; Scope scope = this ; do { if ( scope instanceof MethodScope ) lastMethodScope = ( MethodScope ) scope ; scope = scope . parent ; } while ( scope != null ) ; return lastMethodScope ; } public int parameterCompatibilityLevel ( MethodBinding method , TypeBinding [ ] arguments ) { TypeBinding [ ] parameters = method . parameters ; int paramLength = parameters . length ; int argLength = arguments . length ; if ( compilerOptions ( ) . sourceLevel < ClassFileConstants . JDK1_5 ) { if ( paramLength != argLength ) return NOT_COMPATIBLE ; for ( int i = <NUM_LIT:0> ; i < argLength ; i ++ ) { TypeBinding param = parameters [ i ] ; TypeBinding arg = arguments [ i ] ; if ( arg != param && ! arg . isCompatibleWith ( param ) ) return NOT_COMPATIBLE ; } return COMPATIBLE ; } int level = COMPATIBLE ; int lastIndex = argLength ; LookupEnvironment env = environment ( ) ; if ( method . isVarargs ( ) ) { lastIndex = paramLength - <NUM_LIT:1> ; if ( paramLength == argLength ) { TypeBinding param = parameters [ lastIndex ] ; TypeBinding arg = arguments [ lastIndex ] ; if ( param != arg ) { level = parameterCompatibilityLevel ( arg , param , env ) ; if ( level == NOT_COMPATIBLE ) { param = ( ( ArrayBinding ) param ) . elementsType ( ) ; if ( parameterCompatibilityLevel ( arg , param , env ) == NOT_COMPATIBLE ) return NOT_COMPATIBLE ; level = VARARGS_COMPATIBLE ; } } } else { if ( paramLength < argLength ) { TypeBinding param = ( ( ArrayBinding ) parameters [ lastIndex ] ) . elementsType ( ) ; for ( int i = lastIndex ; i < argLength ; i ++ ) { TypeBinding arg = arguments [ i ] ; if ( param != arg && parameterCompatibilityLevel ( arg , param , env ) == NOT_COMPATIBLE ) return NOT_COMPATIBLE ; } } else if ( lastIndex != argLength ) { return NOT_COMPATIBLE ; } level = VARARGS_COMPATIBLE ; } } else if ( paramLength != argLength ) { return NOT_COMPATIBLE ; } for ( int i = <NUM_LIT:0> ; i < lastIndex ; i ++ ) { TypeBinding param = parameters [ i ] ; TypeBinding arg = arguments [ i ] ; if ( arg != param ) { int newLevel = parameterCompatibilityLevel ( arg , param , env ) ; if ( newLevel == NOT_COMPATIBLE ) return NOT_COMPATIBLE ; if ( newLevel > level ) level = newLevel ; } } return level ; } private int parameterCompatibilityLevel ( TypeBinding arg , TypeBinding param , LookupEnvironment env ) { if ( arg . isCompatibleWith ( param ) ) return COMPATIBLE ; if ( arg . isBaseType ( ) != param . isBaseType ( ) ) { TypeBinding convertedType = env . computeBoxingType ( arg ) ; if ( convertedType == param || convertedType . isCompatibleWith ( param ) ) return AUTOBOX_COMPATIBLE ; } return NOT_COMPATIBLE ; } public abstract ProblemReporter problemReporter ( ) ; public final CompilationUnitDeclaration referenceCompilationUnit ( ) { Scope scope , unitScope = this ; while ( ( scope = unitScope . parent ) != null ) unitScope = scope ; return ( ( CompilationUnitScope ) unitScope ) . referenceContext ; } public ReferenceContext referenceContext ( ) { Scope current = this ; do { switch ( current . kind ) { case METHOD_SCOPE : return ( ( MethodScope ) current ) . referenceContext ; case CLASS_SCOPE : return ( ( ClassScope ) current ) . referenceContext ; case COMPILATION_UNIT_SCOPE : return ( ( CompilationUnitScope ) current ) . referenceContext ; } } while ( ( current = current . parent ) != null ) ; return null ; } public void deferBoundCheck ( TypeReference typeRef ) { if ( this . kind == CLASS_SCOPE ) { ClassScope classScope = ( ClassScope ) this ; if ( classScope . deferredBoundChecks == null ) { classScope . deferredBoundChecks = new ArrayList ( <NUM_LIT:3> ) ; classScope . deferredBoundChecks . add ( typeRef ) ; } else if ( ! classScope . deferredBoundChecks . contains ( typeRef ) ) { classScope . deferredBoundChecks . add ( typeRef ) ; } } } int startIndex ( ) { return <NUM_LIT:0> ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . ast . * ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . impl . Constant ; public class ElementValuePair { char [ ] name ; public Object value ; public MethodBinding binding ; public static Object getValue ( Expression expression ) { if ( expression == null ) return null ; Constant constant = expression . constant ; if ( constant != null && constant != Constant . NotAConstant ) return constant ; if ( expression instanceof Annotation ) return ( ( Annotation ) expression ) . getCompilerAnnotation ( ) ; if ( expression instanceof ArrayInitializer ) { Expression [ ] exprs = ( ( ArrayInitializer ) expression ) . expressions ; int length = exprs == null ? <NUM_LIT:0> : exprs . length ; Object [ ] values = new Object [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) values [ i ] = getValue ( exprs [ i ] ) ; return values ; } if ( expression instanceof ClassLiteralAccess ) return ( ( ClassLiteralAccess ) expression ) . targetType ; if ( expression instanceof Reference ) { FieldBinding fieldBinding = null ; if ( expression instanceof FieldReference ) { fieldBinding = ( ( FieldReference ) expression ) . fieldBinding ( ) ; } else if ( expression instanceof NameReference ) { Binding binding = ( ( NameReference ) expression ) . binding ; if ( binding != null && binding . kind ( ) == Binding . FIELD ) fieldBinding = ( FieldBinding ) binding ; } if ( fieldBinding != null && ( fieldBinding . modifiers & ClassFileConstants . AccEnum ) > <NUM_LIT:0> ) return fieldBinding ; } return null ; } public ElementValuePair ( char [ ] name , Expression expression , MethodBinding binding ) { this ( name , ElementValuePair . getValue ( expression ) , binding ) ; } public ElementValuePair ( char [ ] name , Object value , MethodBinding binding ) { this . name = name ; this . value = value ; this . binding = binding ; } public char [ ] getName ( ) { return this . name ; } public MethodBinding getMethodBinding ( ) { return this . binding ; } public Object getValue ( ) { return this . value ; } void setMethodBinding ( MethodBinding binding ) { this . binding = binding ; } void setValue ( Object value ) { this . value = value ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( <NUM_LIT:5> ) ; buffer . append ( this . name ) . append ( "<STR_LIT:U+0020=U+0020>" ) ; buffer . append ( this . value ) ; return buffer . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; public class NestedTypeBinding extends SourceTypeBinding { public SourceTypeBinding enclosingType ; public SyntheticArgumentBinding [ ] enclosingInstances ; private ReferenceBinding [ ] enclosingTypes = Binding . UNINITIALIZED_REFERENCE_TYPES ; public SyntheticArgumentBinding [ ] outerLocalVariables ; private int outerLocalVariablesSlotSize = - <NUM_LIT:1> ; public NestedTypeBinding ( char [ ] [ ] typeName , ClassScope scope , SourceTypeBinding enclosingType ) { super ( typeName , enclosingType . fPackage , scope ) ; this . tagBits |= ( TagBits . IsNestedType | TagBits . ContainsNestedTypeReferences ) ; this . enclosingType = enclosingType ; } public SyntheticArgumentBinding addSyntheticArgument ( LocalVariableBinding actualOuterLocalVariable ) { SyntheticArgumentBinding synthLocal = null ; if ( this . outerLocalVariables == null ) { synthLocal = new SyntheticArgumentBinding ( actualOuterLocalVariable ) ; this . outerLocalVariables = new SyntheticArgumentBinding [ ] { synthLocal } ; } else { int size = this . outerLocalVariables . length ; int newArgIndex = size ; for ( int i = size ; -- i >= <NUM_LIT:0> ; ) { if ( this . outerLocalVariables [ i ] . actualOuterLocalVariable == actualOuterLocalVariable ) return this . outerLocalVariables [ i ] ; if ( this . outerLocalVariables [ i ] . id > actualOuterLocalVariable . id ) newArgIndex = i ; } SyntheticArgumentBinding [ ] synthLocals = new SyntheticArgumentBinding [ size + <NUM_LIT:1> ] ; System . arraycopy ( this . outerLocalVariables , <NUM_LIT:0> , synthLocals , <NUM_LIT:0> , newArgIndex ) ; synthLocals [ newArgIndex ] = synthLocal = new SyntheticArgumentBinding ( actualOuterLocalVariable ) ; System . arraycopy ( this . outerLocalVariables , newArgIndex , synthLocals , newArgIndex + <NUM_LIT:1> , size - newArgIndex ) ; this . outerLocalVariables = synthLocals ; } if ( this . scope . referenceCompilationUnit ( ) . isPropagatingInnerClassEmulation ) updateInnerEmulationDependents ( ) ; return synthLocal ; } public SyntheticArgumentBinding addSyntheticArgument ( ReferenceBinding targetEnclosingType ) { SyntheticArgumentBinding synthLocal = null ; if ( this . enclosingInstances == null ) { synthLocal = new SyntheticArgumentBinding ( targetEnclosingType ) ; this . enclosingInstances = new SyntheticArgumentBinding [ ] { synthLocal } ; } else { int size = this . enclosingInstances . length ; int newArgIndex = size ; for ( int i = size ; -- i >= <NUM_LIT:0> ; ) { if ( this . enclosingInstances [ i ] . type == targetEnclosingType ) return this . enclosingInstances [ i ] ; if ( enclosingType ( ) == targetEnclosingType ) newArgIndex = <NUM_LIT:0> ; } SyntheticArgumentBinding [ ] newInstances = new SyntheticArgumentBinding [ size + <NUM_LIT:1> ] ; System . arraycopy ( this . enclosingInstances , <NUM_LIT:0> , newInstances , newArgIndex == <NUM_LIT:0> ? <NUM_LIT:1> : <NUM_LIT:0> , size ) ; newInstances [ newArgIndex ] = synthLocal = new SyntheticArgumentBinding ( targetEnclosingType ) ; this . enclosingInstances = newInstances ; } if ( this . scope . referenceCompilationUnit ( ) . isPropagatingInnerClassEmulation ) updateInnerEmulationDependents ( ) ; return synthLocal ; } public SyntheticArgumentBinding addSyntheticArgumentAndField ( LocalVariableBinding actualOuterLocalVariable ) { SyntheticArgumentBinding synthLocal = addSyntheticArgument ( actualOuterLocalVariable ) ; if ( synthLocal == null ) return null ; if ( synthLocal . matchingField == null ) synthLocal . matchingField = addSyntheticFieldForInnerclass ( actualOuterLocalVariable ) ; return synthLocal ; } public SyntheticArgumentBinding addSyntheticArgumentAndField ( ReferenceBinding targetEnclosingType ) { SyntheticArgumentBinding synthLocal = addSyntheticArgument ( targetEnclosingType ) ; if ( synthLocal == null ) return null ; if ( synthLocal . matchingField == null ) synthLocal . matchingField = addSyntheticFieldForInnerclass ( targetEnclosingType ) ; return synthLocal ; } public ReferenceBinding enclosingType ( ) { return this . enclosingType ; } public int getEnclosingInstancesSlotSize ( ) { return this . enclosingInstances == null ? <NUM_LIT:0> : this . enclosingInstances . length ; } public int getOuterLocalVariablesSlotSize ( ) { if ( this . outerLocalVariablesSlotSize < <NUM_LIT:0> ) { this . outerLocalVariablesSlotSize = <NUM_LIT:0> ; int outerLocalsCount = this . outerLocalVariables == null ? <NUM_LIT:0> : this . outerLocalVariables . length ; for ( int i = <NUM_LIT:0> ; i < outerLocalsCount ; i ++ ) { SyntheticArgumentBinding argument = this . outerLocalVariables [ i ] ; switch ( argument . type . id ) { case TypeIds . T_long : case TypeIds . T_double : this . outerLocalVariablesSlotSize += <NUM_LIT:2> ; break ; default : this . outerLocalVariablesSlotSize ++ ; break ; } } } return this . outerLocalVariablesSlotSize ; } public SyntheticArgumentBinding getSyntheticArgument ( LocalVariableBinding actualOuterLocalVariable ) { if ( this . outerLocalVariables == null ) return null ; for ( int i = this . outerLocalVariables . length ; -- i >= <NUM_LIT:0> ; ) if ( this . outerLocalVariables [ i ] . actualOuterLocalVariable == actualOuterLocalVariable ) return this . outerLocalVariables [ i ] ; return null ; } public SyntheticArgumentBinding getSyntheticArgument ( ReferenceBinding targetEnclosingType , boolean onlyExactMatch ) { if ( this . enclosingInstances == null ) return null ; for ( int i = this . enclosingInstances . length ; -- i >= <NUM_LIT:0> ; ) if ( this . enclosingInstances [ i ] . type == targetEnclosingType ) if ( this . enclosingInstances [ i ] . actualOuterLocalVariable == null ) return this . enclosingInstances [ i ] ; if ( ! onlyExactMatch ) { for ( int i = this . enclosingInstances . length ; -- i >= <NUM_LIT:0> ; ) if ( this . enclosingInstances [ i ] . actualOuterLocalVariable == null ) if ( this . enclosingInstances [ i ] . type . findSuperTypeOriginatingFrom ( targetEnclosingType ) != null ) return this . enclosingInstances [ i ] ; } return null ; } public SyntheticArgumentBinding [ ] syntheticEnclosingInstances ( ) { return this . enclosingInstances ; } public ReferenceBinding [ ] syntheticEnclosingInstanceTypes ( ) { if ( this . enclosingTypes == UNINITIALIZED_REFERENCE_TYPES ) { if ( this . enclosingInstances == null ) { this . enclosingTypes = null ; } else { int length = this . enclosingInstances . length ; this . enclosingTypes = new ReferenceBinding [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { this . enclosingTypes [ i ] = ( ReferenceBinding ) this . enclosingInstances [ i ] . type ; } } } return this . enclosingTypes ; } public SyntheticArgumentBinding [ ] syntheticOuterLocalVariables ( ) { return this . outerLocalVariables ; } public void updateInnerEmulationDependents ( ) { } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; public abstract class Binding { public static final int FIELD = ASTNode . Bit1 ; public static final int LOCAL = ASTNode . Bit2 ; public static final int VARIABLE = FIELD | LOCAL ; public static final int TYPE = ASTNode . Bit3 ; public static final int METHOD = ASTNode . Bit4 ; public static final int PACKAGE = ASTNode . Bit5 ; public static final int IMPORT = ASTNode . Bit6 ; public static final int ARRAY_TYPE = TYPE | ASTNode . Bit7 ; public static final int BASE_TYPE = TYPE | ASTNode . Bit8 ; public static final int PARAMETERIZED_TYPE = TYPE | ASTNode . Bit9 ; public static final int WILDCARD_TYPE = TYPE | ASTNode . Bit10 ; public static final int RAW_TYPE = TYPE | ASTNode . Bit11 ; public static final int GENERIC_TYPE = TYPE | ASTNode . Bit12 ; public static final int TYPE_PARAMETER = TYPE | ASTNode . Bit13 ; public static final int INTERSECTION_TYPE = TYPE | ASTNode . Bit14 ; public static final TypeBinding [ ] NO_TYPES = new TypeBinding [ <NUM_LIT:0> ] ; public static final TypeBinding [ ] NO_PARAMETERS = new TypeBinding [ <NUM_LIT:0> ] ; public static final ReferenceBinding [ ] NO_EXCEPTIONS = new ReferenceBinding [ <NUM_LIT:0> ] ; public static final ReferenceBinding [ ] ANY_EXCEPTION = new ReferenceBinding [ ] { null } ; public static final FieldBinding [ ] NO_FIELDS = new FieldBinding [ <NUM_LIT:0> ] ; public static final MethodBinding [ ] NO_METHODS = new MethodBinding [ <NUM_LIT:0> ] ; public static final ReferenceBinding [ ] NO_SUPERINTERFACES = new ReferenceBinding [ <NUM_LIT:0> ] ; public static final ReferenceBinding [ ] NO_MEMBER_TYPES = new ReferenceBinding [ <NUM_LIT:0> ] ; public static final TypeVariableBinding [ ] NO_TYPE_VARIABLES = new TypeVariableBinding [ <NUM_LIT:0> ] ; public static final AnnotationBinding [ ] NO_ANNOTATIONS = new AnnotationBinding [ <NUM_LIT:0> ] ; public static final ElementValuePair [ ] NO_ELEMENT_VALUE_PAIRS = new ElementValuePair [ <NUM_LIT:0> ] ; public static final FieldBinding [ ] UNINITIALIZED_FIELDS = new FieldBinding [ <NUM_LIT:0> ] ; public static final MethodBinding [ ] UNINITIALIZED_METHODS = new MethodBinding [ <NUM_LIT:0> ] ; public static final ReferenceBinding [ ] UNINITIALIZED_REFERENCE_TYPES = new ReferenceBinding [ <NUM_LIT:0> ] ; public abstract int kind ( ) ; public char [ ] computeUniqueKey ( ) { return computeUniqueKey ( true ) ; } public char [ ] computeUniqueKey ( boolean isLeaf ) { return null ; } public long getAnnotationTagBits ( ) { return <NUM_LIT:0> ; } public void initializeDeprecatedAnnotationTagBits ( ) { } public final boolean isValidBinding ( ) { return problemId ( ) == ProblemReasons . NoError ; } public int problemId ( ) { return ProblemReasons . NoError ; } public abstract char [ ] readableName ( ) ; public char [ ] shortReadableName ( ) { return readableName ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; public class MostSpecificExceptionMethodBinding extends MethodBinding { private MethodBinding originalMethod ; public MostSpecificExceptionMethodBinding ( MethodBinding originalMethod , ReferenceBinding [ ] mostSpecificExceptions ) { super ( originalMethod . modifiers , originalMethod . selector , originalMethod . returnType , originalMethod . parameters , mostSpecificExceptions , originalMethod . declaringClass ) ; this . originalMethod = originalMethod ; } public MethodBinding original ( ) { return this . originalMethod . original ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . ImportReference ; public class ImportBinding extends Binding { public char [ ] [ ] compoundName ; public boolean onDemand ; public ImportReference reference ; public Binding resolvedImport ; public ImportBinding ( char [ ] [ ] compoundName , boolean isOnDemand , Binding binding , ImportReference reference ) { this . compoundName = compoundName ; this . onDemand = isOnDemand ; this . resolvedImport = binding ; this . reference = reference ; } public final int kind ( ) { return IMPORT ; } public boolean isStatic ( ) { return this . reference != null && this . reference . isStatic ( ) ; } public char [ ] readableName ( ) { if ( this . onDemand ) return CharOperation . concat ( CharOperation . concatWith ( this . compoundName , '<CHAR_LIT:.>' ) , "<STR_LIT>" . toCharArray ( ) ) ; else return CharOperation . concatWith ( this . compoundName , '<CHAR_LIT:.>' ) ; } public String toString ( ) { return "<STR_LIT>" + new String ( readableName ( ) ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; public interface TypeConstants { char [ ] JAVA = "<STR_LIT>" . toCharArray ( ) ; char [ ] LANG = "<STR_LIT>" . toCharArray ( ) ; char [ ] IO = "<STR_LIT>" . toCharArray ( ) ; char [ ] UTIL = "<STR_LIT>" . toCharArray ( ) ; char [ ] ANNOTATION = "<STR_LIT>" . toCharArray ( ) ; char [ ] REFLECT = "<STR_LIT>" . toCharArray ( ) ; char [ ] LENGTH = "<STR_LIT>" . toCharArray ( ) ; char [ ] CLONE = "<STR_LIT>" . toCharArray ( ) ; char [ ] EQUALS = "<STR_LIT>" . toCharArray ( ) ; char [ ] GETCLASS = "<STR_LIT>" . toCharArray ( ) ; char [ ] HASHCODE = "<STR_LIT>" . toCharArray ( ) ; char [ ] OBJECT = "<STR_LIT>" . toCharArray ( ) ; char [ ] MAIN = "<STR_LIT>" . toCharArray ( ) ; char [ ] SERIALVERSIONUID = "<STR_LIT>" . toCharArray ( ) ; char [ ] SERIALPERSISTENTFIELDS = "<STR_LIT>" . toCharArray ( ) ; char [ ] READRESOLVE = "<STR_LIT>" . toCharArray ( ) ; char [ ] WRITEREPLACE = "<STR_LIT>" . toCharArray ( ) ; char [ ] READOBJECT = "<STR_LIT>" . toCharArray ( ) ; char [ ] WRITEOBJECT = "<STR_LIT>" . toCharArray ( ) ; char [ ] CharArray_JAVA_LANG_OBJECT = "<STR_LIT>" . toCharArray ( ) ; char [ ] CharArray_JAVA_LANG_ENUM = "<STR_LIT>" . toCharArray ( ) ; char [ ] CharArray_JAVA_LANG_ANNOTATION_ANNOTATION = "<STR_LIT>" . toCharArray ( ) ; char [ ] CharArray_JAVA_IO_OBJECTINPUTSTREAM = "<STR_LIT>" . toCharArray ( ) ; char [ ] CharArray_JAVA_IO_OBJECTOUTPUTSTREAM = "<STR_LIT>" . toCharArray ( ) ; char [ ] CharArray_JAVA_IO_OBJECTSTREAMFIELD = "<STR_LIT>" . toCharArray ( ) ; char [ ] ANONYM_PREFIX = "<STR_LIT>" . toCharArray ( ) ; char [ ] ANONYM_SUFFIX = "<STR_LIT>" . toCharArray ( ) ; char [ ] WILDCARD_NAME = { '<CHAR_LIT>' } ; char [ ] WILDCARD_SUPER = "<STR_LIT>" . toCharArray ( ) ; char [ ] WILDCARD_EXTENDS = "<STR_LIT>" . toCharArray ( ) ; char [ ] WILDCARD_MINUS = { '<CHAR_LIT:->' } ; char [ ] WILDCARD_STAR = { '<CHAR_LIT>' } ; char [ ] WILDCARD_PLUS = { '<CHAR_LIT>' } ; char [ ] WILDCARD_CAPTURE_NAME_PREFIX = "<STR_LIT>" . toCharArray ( ) ; char [ ] WILDCARD_CAPTURE_NAME_SUFFIX = "<STR_LIT>" . toCharArray ( ) ; char [ ] WILDCARD_CAPTURE = { '<CHAR_LIT>' } ; char [ ] BYTE = "<STR_LIT>" . toCharArray ( ) ; char [ ] SHORT = "<STR_LIT>" . toCharArray ( ) ; char [ ] INT = "<STR_LIT:int>" . toCharArray ( ) ; char [ ] LONG = "<STR_LIT:long>" . toCharArray ( ) ; char [ ] FLOAT = "<STR_LIT:float>" . toCharArray ( ) ; char [ ] DOUBLE = "<STR_LIT:double>" . toCharArray ( ) ; char [ ] CHAR = "<STR_LIT>" . toCharArray ( ) ; char [ ] BOOLEAN = "<STR_LIT:boolean>" . toCharArray ( ) ; char [ ] NULL = "<STR_LIT:null>" . toCharArray ( ) ; char [ ] VOID = "<STR_LIT>" . toCharArray ( ) ; char [ ] VALUE = "<STR_LIT:value>" . toCharArray ( ) ; char [ ] VALUES = "<STR_LIT>" . toCharArray ( ) ; char [ ] VALUEOF = "<STR_LIT>" . toCharArray ( ) ; char [ ] UPPER_SOURCE = "<STR_LIT>" . toCharArray ( ) ; char [ ] UPPER_CLASS = "<STR_LIT>" . toCharArray ( ) ; char [ ] UPPER_RUNTIME = "<STR_LIT>" . toCharArray ( ) ; char [ ] ANNOTATION_PREFIX = "<STR_LIT:@>" . toCharArray ( ) ; char [ ] ANNOTATION_SUFFIX = "<STR_LIT>" . toCharArray ( ) ; char [ ] TYPE = "<STR_LIT>" . toCharArray ( ) ; char [ ] UPPER_FIELD = "<STR_LIT>" . toCharArray ( ) ; char [ ] UPPER_METHOD = "<STR_LIT>" . toCharArray ( ) ; char [ ] UPPER_PARAMETER = "<STR_LIT>" . toCharArray ( ) ; char [ ] UPPER_CONSTRUCTOR = "<STR_LIT>" . toCharArray ( ) ; char [ ] UPPER_LOCAL_VARIABLE = "<STR_LIT>" . toCharArray ( ) ; char [ ] UPPER_ANNOTATION_TYPE = "<STR_LIT>" . toCharArray ( ) ; char [ ] UPPER_PACKAGE = "<STR_LIT>" . toCharArray ( ) ; char [ ] [ ] JAVA_LANG = { JAVA , LANG } ; char [ ] [ ] JAVA_IO = { JAVA , IO } ; char [ ] [ ] JAVA_LANG_ANNOTATION_ANNOTATION = { JAVA , LANG , ANNOTATION , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_ASSERTIONERROR = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_CLASS = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_CLASSNOTFOUNDEXCEPTION = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_CLONEABLE = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_ENUM = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_EXCEPTION = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_ERROR = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_ILLEGALARGUMENTEXCEPTION = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_ITERABLE = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_NOCLASSDEFERROR = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_OBJECT = { JAVA , LANG , OBJECT } ; char [ ] [ ] JAVA_LANG_STRING = { JAVA , LANG , "<STR_LIT:String>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_STRINGBUFFER = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_STRINGBUILDER = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_SYSTEM = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_RUNTIMEEXCEPTION = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_THROWABLE = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_REFLECT_CONSTRUCTOR = { JAVA , LANG , REFLECT , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_IO_PRINTSTREAM = { JAVA , IO , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_IO_SERIALIZABLE = { JAVA , IO , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_BYTE = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_SHORT = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_CHARACTER = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_INTEGER = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_LONG = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_FLOAT = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_DOUBLE = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_BOOLEAN = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_VOID = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_UTIL_COLLECTION = { JAVA , UTIL , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_UTIL_ITERATOR = { JAVA , UTIL , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_DEPRECATED = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_ANNOTATION_DOCUMENTED = { JAVA , LANG , ANNOTATION , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_ANNOTATION_INHERITED = { JAVA , LANG , ANNOTATION , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_OVERRIDE = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_ANNOTATION_RETENTION = { JAVA , LANG , ANNOTATION , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_SUPPRESSWARNINGS = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_ANNOTATION_TARGET = { JAVA , LANG , ANNOTATION , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_ANNOTATION_RETENTIONPOLICY = { JAVA , LANG , ANNOTATION , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_ANNOTATION_ELEMENTTYPE = { JAVA , LANG , ANNOTATION , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_REFLECT_FIELD = new char [ ] [ ] { JAVA , LANG , REFLECT , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_REFLECT_METHOD = new char [ ] [ ] { JAVA , LANG , REFLECT , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_IO_OBJECTSTREAMEXCEPTION = new char [ ] [ ] { JAVA , IO , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_IO_EXTERNALIZABLE = { JAVA , IO , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_IO_IOEXCEPTION = new char [ ] [ ] { JAVA , IO , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_IO_OBJECTOUTPUTSTREAM = new char [ ] [ ] { JAVA , IO , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_IO_OBJECTINPUTSTREAM = new char [ ] [ ] { JAVA , IO , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVAX_RMI_CORBA_STUB = new char [ ] [ ] { "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , } ; int CONSTRAINT_EQUAL = <NUM_LIT:0> ; int CONSTRAINT_EXTENDS = <NUM_LIT:1> ; int CONSTRAINT_SUPER = <NUM_LIT:2> ; int OK = <NUM_LIT:0> ; int UNCHECKED = <NUM_LIT:1> ; int MISMATCH = <NUM_LIT:2> ; char [ ] INIT = "<STR_LIT>" . toCharArray ( ) ; char [ ] CLINIT = "<STR_LIT>" . toCharArray ( ) ; char [ ] SYNTHETIC_SWITCH_ENUM_TABLE = "<STR_LIT>" . toCharArray ( ) ; char [ ] SYNTHETIC_ENUM_VALUES = "<STR_LIT>" . toCharArray ( ) ; char [ ] SYNTHETIC_ASSERT_DISABLED = "<STR_LIT>" . toCharArray ( ) ; char [ ] SYNTHETIC_CLASS = "<STR_LIT>" . toCharArray ( ) ; char [ ] SYNTHETIC_OUTER_LOCAL_PREFIX = "<STR_LIT>" . toCharArray ( ) ; char [ ] SYNTHETIC_ENCLOSING_INSTANCE_PREFIX = "<STR_LIT>" . toCharArray ( ) ; char [ ] SYNTHETIC_ACCESS_METHOD_PREFIX = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] PACKAGE_INFO_NAME = "<STR_LIT>" . toCharArray ( ) ; } </s>