text
stringlengths
30
1.67M
<s> package org . eclipse . jdt . internal . core ; import java . util . HashSet ; import java . util . Iterator ; import org . eclipse . core . runtime . CoreException ; import org . eclipse . core . runtime . IPath ; import org . eclipse . core . runtime . IProgressMonitor ; import org . eclipse . jdt . core . IClasspathEntry ; import org . eclipse . jdt . core . JavaModelException ; public class ExternalFolderChange { private JavaProject project ; private IClasspathEntry [ ] oldResolvedClasspath ; public ExternalFolderChange ( JavaProject project , IClasspathEntry [ ] oldResolvedClasspath ) { this . project = project ; this . oldResolvedClasspath = oldResolvedClasspath ; } public void updateExternalFoldersIfNecessary ( boolean refreshIfExistAlready , IProgressMonitor monitor ) throws JavaModelException { HashSet oldFolders = ExternalFoldersManager . getExternalFolders ( this . oldResolvedClasspath ) ; IClasspathEntry [ ] newResolvedClasspath = this . project . getResolvedClasspath ( ) ; HashSet newFolders = ExternalFoldersManager . getExternalFolders ( newResolvedClasspath ) ; if ( newFolders == null ) return ; ExternalFoldersManager foldersManager = JavaModelManager . getExternalManager ( ) ; Iterator iterator = newFolders . iterator ( ) ; while ( iterator . hasNext ( ) ) { Object folderPath = iterator . next ( ) ; if ( oldFolders == null || ! oldFolders . remove ( folderPath ) || foldersManager . removePendingFolder ( folderPath ) ) { try { foldersManager . createLinkFolder ( ( IPath ) folderPath , refreshIfExistAlready , monitor ) ; } catch ( CoreException e ) { throw new JavaModelException ( e ) ; } } } } public String toString ( ) { return "<STR_LIT>" + this . project . getElementName ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . core ; import java . io . InputStream ; import java . net . URL ; import java . util . ArrayList ; import java . util . HashMap ; import org . eclipse . core . runtime . Assert ; import org . eclipse . core . runtime . IProgressMonitor ; import org . eclipse . core . runtime . OperationCanceledException ; import org . eclipse . jdt . core . * ; import org . eclipse . jdt . core . compiler . CharOperation ; 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 . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . env . IBinaryAnnotation ; import org . eclipse . jdt . internal . compiler . env . IBinaryType ; import org . eclipse . jdt . internal . compiler . lookup . Binding ; import org . eclipse . jdt . internal . compiler . util . SuffixConstants ; import org . eclipse . jdt . internal . core . JavaModelManager . PerProjectInfo ; import org . eclipse . jdt . internal . core . hierarchy . TypeHierarchy ; import org . eclipse . jdt . internal . core . util . MementoTokenizer ; import org . eclipse . jdt . internal . core . util . Messages ; import org . eclipse . jdt . internal . core . util . Util ; public class BinaryType extends BinaryMember implements IType , SuffixConstants { private static final IField [ ] NO_FIELDS = new IField [ <NUM_LIT:0> ] ; private static final IMethod [ ] NO_METHODS = new IMethod [ <NUM_LIT:0> ] ; private static final IType [ ] NO_TYPES = new IType [ <NUM_LIT:0> ] ; private static final IInitializer [ ] NO_INITIALIZERS = new IInitializer [ <NUM_LIT:0> ] ; public static final JavadocContents EMPTY_JAVADOC = new JavadocContents ( null , org . eclipse . jdt . internal . compiler . util . Util . EMPTY_STRING ) ; protected BinaryType ( JavaElement parent , String name ) { super ( parent , name ) ; } protected void closing ( Object info ) throws JavaModelException { ClassFileInfo cfi = getClassFileInfo ( ) ; cfi . removeBinaryChildren ( ) ; } 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 = getClassFile ( ) . 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 ( ) , project ) ; 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 { throw new JavaModelException ( new JavaModelStatus ( IJavaModelStatusConstants . READ_ONLY , this ) ) ; } public IInitializer createInitializer ( String contents , IJavaElement sibling , IProgressMonitor monitor ) throws JavaModelException { throw new JavaModelException ( new JavaModelStatus ( IJavaModelStatusConstants . READ_ONLY , this ) ) ; } public IMethod createMethod ( String contents , IJavaElement sibling , boolean force , IProgressMonitor monitor ) throws JavaModelException { throw new JavaModelException ( new JavaModelStatus ( IJavaModelStatusConstants . READ_ONLY , this ) ) ; } public IType createType ( String contents , IJavaElement sibling , boolean force , IProgressMonitor monitor ) throws JavaModelException { throw new JavaModelException ( new JavaModelStatus ( IJavaModelStatusConstants . READ_ONLY , this ) ) ; } public boolean equals ( Object o ) { if ( ! ( o instanceof BinaryType ) ) 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 { IBinaryType info = ( IBinaryType ) getElementInfo ( ) ; IBinaryAnnotation [ ] binaryAnnotations = info . getAnnotations ( ) ; return getAnnotations ( binaryAnnotations , info . getTagBits ( ) ) ; } public IJavaElement [ ] getChildren ( ) throws JavaModelException { ClassFileInfo cfi = getClassFileInfo ( ) ; return cfi . binaryChildren ; } public IJavaElement [ ] getChildrenForCategory ( String category ) throws JavaModelException { IJavaElement [ ] children = getChildren ( ) ; int length = children . length ; if ( length == <NUM_LIT:0> ) return children ; SourceMapper mapper = getSourceMapper ( ) ; if ( mapper != null ) { ( ( ClassFile ) getClassFile ( ) ) . getBuffer ( ) ; HashMap categories = mapper . categories ; IJavaElement [ ] result = new IJavaElement [ length ] ; int index = <NUM_LIT:0> ; if ( categories != null ) { for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { IJavaElement child = children [ i ] ; String [ ] cats = ( String [ ] ) categories . get ( child ) ; if ( cats != null ) { for ( int j = <NUM_LIT:0> , length2 = cats . length ; j < length2 ; j ++ ) { if ( cats [ j ] . equals ( category ) ) { result [ index ++ ] = child ; break ; } } } } } if ( index < length ) System . arraycopy ( result , <NUM_LIT:0> , result = new IJavaElement [ index ] , <NUM_LIT:0> , index ) ; return result ; } return NO_ELEMENTS ; } protected ClassFileInfo getClassFileInfo ( ) throws JavaModelException { ClassFile cf = ( ClassFile ) this . parent ; return ( ClassFileInfo ) cf . getElementInfo ( ) ; } public IType getDeclaringType ( ) { IClassFile classFile = getClassFile ( ) ; if ( classFile . isOpen ( ) ) { try { char [ ] enclosingTypeName = ( ( IBinaryType ) getElementInfo ( ) ) . getEnclosingTypeName ( ) ; if ( enclosingTypeName == null ) { return null ; } enclosingTypeName = ClassFile . unqualifiedName ( enclosingTypeName ) ; if ( classFile . getElementName ( ) . length ( ) > enclosingTypeName . length + <NUM_LIT:1> && Character . isDigit ( classFile . getElementName ( ) . charAt ( enclosingTypeName . length + <NUM_LIT:1> ) ) ) { return null ; } return getPackageFragment ( ) . getClassFile ( new String ( enclosingTypeName ) + SUFFIX_STRING_class ) . getType ( ) ; } catch ( JavaModelException npe ) { return null ; } } else { String classFileName = classFile . getElementName ( ) ; int lastDollar = - <NUM_LIT:1> ; for ( int i = <NUM_LIT:0> , length = classFileName . length ( ) ; i < length ; i ++ ) { char c = classFileName . charAt ( i ) ; if ( Character . isDigit ( c ) && lastDollar == i - <NUM_LIT:1> ) { return null ; } else if ( c == '<CHAR_LIT>' ) { lastDollar = i ; } } if ( lastDollar == - <NUM_LIT:1> ) { return null ; } else { String enclosingName = classFileName . substring ( <NUM_LIT:0> , lastDollar ) ; String enclosingClassFileName = enclosingName + SUFFIX_STRING_class ; return new BinaryType ( ( JavaElement ) getPackageFragment ( ) . getClassFile ( enclosingClassFileName ) , Util . localTypeName ( enclosingName , enclosingName . lastIndexOf ( '<CHAR_LIT>' ) , enclosingName . length ( ) ) ) ; } } } public Object getElementInfo ( IProgressMonitor monitor ) throws JavaModelException { JavaModelManager manager = JavaModelManager . getJavaModelManager ( ) ; Object info = manager . getInfo ( this ) ; if ( info != null && info != JavaModelCache . NON_EXISTING_JAR_TYPE_INFO ) return info ; return openWhenClosed ( createElementInfo ( ) , monitor ) ; } public int getElementType ( ) { return TYPE ; } public IField getField ( String fieldName ) { return new BinaryField ( this , fieldName ) ; } public IField [ ] getFields ( ) throws JavaModelException { ArrayList list = getChildrenOfType ( FIELD ) ; int size ; if ( ( size = list . size ( ) ) == <NUM_LIT:0> ) { return NO_FIELDS ; } else { IField [ ] array = new IField [ size ] ; list . toArray ( array ) ; return array ; } } public int getFlags ( ) throws JavaModelException { IBinaryType info = ( IBinaryType ) getElementInfo ( ) ; return info . getModifiers ( ) & ~ ClassFileConstants . AccSuper ; } 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 ( ) { return NO_INITIALIZERS ; } public String getKey ( boolean forceOpen ) throws JavaModelException { return getKey ( this , forceOpen ) ; } public IMethod getMethod ( String selector , String [ ] parameterTypeSignatures ) { return new BinaryMethod ( this , selector , parameterTypeSignatures ) ; } public IMethod [ ] getMethods ( ) throws JavaModelException { ArrayList list = getChildrenOfType ( METHOD ) ; int size ; if ( ( size = list . size ( ) ) == <NUM_LIT:0> ) { return NO_METHODS ; } else { IMethod [ ] array = new IMethod [ 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 String getSuperclassTypeSignature ( ) throws JavaModelException { IBinaryType info = ( IBinaryType ) getElementInfo ( ) ; char [ ] genericSignature = info . getGenericSignature ( ) ; if ( genericSignature != null ) { int signatureLength = genericSignature . length ; int index = <NUM_LIT:0> ; if ( genericSignature [ <NUM_LIT:0> ] == '<CHAR_LIT>' ) { int count = <NUM_LIT:1> ; while ( count > <NUM_LIT:0> && ++ index < signatureLength ) { switch ( genericSignature [ index ] ) { case '<CHAR_LIT>' : count ++ ; break ; case '<CHAR_LIT:>>' : count -- ; break ; } } index ++ ; } int start = index ; index = org . eclipse . jdt . internal . compiler . util . Util . scanClassTypeSignature ( genericSignature , start ) + <NUM_LIT:1> ; char [ ] superclassSig = CharOperation . subarray ( genericSignature , start , index ) ; return new String ( ClassFile . translatedName ( superclassSig ) ) ; } else { char [ ] superclassName = info . getSuperclassName ( ) ; if ( superclassName == null ) { return null ; } return new String ( Signature . createTypeSignature ( ClassFile . translatedName ( superclassName ) , true ) ) ; } } public String getSourceFileName ( IBinaryType info ) { if ( info == null ) { try { info = ( IBinaryType ) getElementInfo ( ) ; } catch ( JavaModelException e ) { IType type = this ; IType enclosingType = getDeclaringType ( ) ; while ( enclosingType != null ) { type = enclosingType ; enclosingType = type . getDeclaringType ( ) ; } return type . getElementName ( ) + Util . defaultJavaExtension ( ) ; } } return sourceFileName ( info ) ; } public String getSuperclassName ( ) throws JavaModelException { IBinaryType info = ( IBinaryType ) getElementInfo ( ) ; char [ ] superclassName = info . getSuperclassName ( ) ; if ( superclassName == null ) { return null ; } return new String ( ClassFile . translatedName ( superclassName ) ) ; } public String [ ] getSuperInterfaceNames ( ) throws JavaModelException { IBinaryType info = ( IBinaryType ) getElementInfo ( ) ; char [ ] [ ] names = info . getInterfaceNames ( ) ; int length ; if ( names == null || ( length = names . length ) == <NUM_LIT:0> ) { return CharOperation . NO_STRINGS ; } names = ClassFile . translatedNames ( names ) ; String [ ] strings = new String [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { strings [ i ] = new String ( names [ i ] ) ; } return strings ; } public String [ ] getSuperInterfaceTypeSignatures ( ) throws JavaModelException { IBinaryType info = ( IBinaryType ) getElementInfo ( ) ; char [ ] genericSignature = info . getGenericSignature ( ) ; if ( genericSignature != null ) { ArrayList interfaces = new ArrayList ( ) ; int signatureLength = genericSignature . length ; int index = <NUM_LIT:0> ; if ( genericSignature [ <NUM_LIT:0> ] == '<CHAR_LIT>' ) { int count = <NUM_LIT:1> ; while ( count > <NUM_LIT:0> && ++ index < signatureLength ) { switch ( genericSignature [ index ] ) { case '<CHAR_LIT>' : count ++ ; break ; case '<CHAR_LIT:>>' : count -- ; break ; } } index ++ ; } index = org . eclipse . jdt . internal . compiler . util . Util . scanClassTypeSignature ( genericSignature , index ) + <NUM_LIT:1> ; while ( index < signatureLength ) { int start = index ; index = org . eclipse . jdt . internal . compiler . util . Util . scanClassTypeSignature ( genericSignature , start ) + <NUM_LIT:1> ; char [ ] interfaceSig = CharOperation . subarray ( genericSignature , start , index ) ; interfaces . add ( new String ( ClassFile . translatedName ( interfaceSig ) ) ) ; } int size = interfaces . size ( ) ; String [ ] result = new String [ size ] ; interfaces . toArray ( result ) ; return result ; } else { char [ ] [ ] names = info . getInterfaceNames ( ) ; int length ; if ( names == null || ( length = names . length ) == <NUM_LIT:0> ) { return CharOperation . NO_STRINGS ; } names = ClassFile . translatedNames ( names ) ; String [ ] strings = new String [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { strings [ i ] = new String ( Signature . createTypeSignature ( names [ i ] , true ) ) ; } return strings ; } } public ITypeParameter [ ] getTypeParameters ( ) throws JavaModelException { String [ ] typeParameterSignatures = getTypeParameterSignatures ( ) ; int length = typeParameterSignatures . length ; if ( length == <NUM_LIT:0> ) return TypeParameter . NO_TYPE_PARAMETERS ; ITypeParameter [ ] typeParameters = new ITypeParameter [ length ] ; for ( int i = <NUM_LIT:0> ; i < typeParameterSignatures . length ; i ++ ) { String typeParameterName = Signature . getTypeVariable ( typeParameterSignatures [ i ] ) ; typeParameters [ i ] = new TypeParameter ( this , typeParameterName ) ; } return typeParameters ; } public String [ ] getTypeParameterSignatures ( ) throws JavaModelException { IBinaryType info = ( IBinaryType ) getElementInfo ( ) ; char [ ] genericSignature = info . getGenericSignature ( ) ; if ( genericSignature == null ) return CharOperation . NO_STRINGS ; char [ ] dotBaseSignature = CharOperation . replaceOnCopy ( genericSignature , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ; char [ ] [ ] typeParams = Signature . getTypeParameters ( dotBaseSignature ) ; return CharOperation . toStrings ( typeParams ) ; } public IType getType ( String typeName ) { IClassFile classFile = getPackageFragment ( ) . getClassFile ( getTypeQualifiedName ( ) + "<STR_LIT:$>" + typeName + SUFFIX_STRING_class ) ; return new BinaryType ( ( JavaElement ) classFile , 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 ) ; int size ; if ( ( size = list . size ( ) ) == <NUM_LIT:0> ) { return NO_TYPES ; } else { IType [ ] array = new IType [ size ] ; list . toArray ( array ) ; return array ; } } public boolean isAnonymous ( ) throws JavaModelException { IBinaryType info = ( IBinaryType ) getElementInfo ( ) ; return info . isAnonymous ( ) ; } public boolean isClass ( ) throws JavaModelException { IBinaryType info = ( IBinaryType ) getElementInfo ( ) ; return TypeDeclaration . kind ( info . getModifiers ( ) ) == TypeDeclaration . CLASS_DECL ; } public boolean isEnum ( ) throws JavaModelException { IBinaryType info = ( IBinaryType ) getElementInfo ( ) ; return TypeDeclaration . kind ( info . getModifiers ( ) ) == TypeDeclaration . ENUM_DECL ; } public boolean isInterface ( ) throws JavaModelException { IBinaryType info = ( IBinaryType ) getElementInfo ( ) ; switch ( TypeDeclaration . kind ( info . getModifiers ( ) ) ) { case TypeDeclaration . INTERFACE_DECL : case TypeDeclaration . ANNOTATION_TYPE_DECL : return true ; } return false ; } public boolean isAnnotation ( ) throws JavaModelException { IBinaryType info = ( IBinaryType ) getElementInfo ( ) ; return TypeDeclaration . kind ( info . getModifiers ( ) ) == TypeDeclaration . ANNOTATION_TYPE_DECL ; } public boolean isLocal ( ) throws JavaModelException { IBinaryType info = ( IBinaryType ) getElementInfo ( ) ; return info . isLocal ( ) ; } public boolean isMember ( ) throws JavaModelException { IBinaryType info = ( IBinaryType ) getElementInfo ( ) ; return info . isMember ( ) ; } 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 ResolvedBinaryType ( this . parent , this . name , new String ( binding . computeUniqueKey ( ) ) ) ; resolvedHandle . occurrenceCount = this . occurrenceCount ; return resolvedHandle ; } public String sourceFileName ( IBinaryType info ) { char [ ] sourceFileName = info . sourceFileName ( ) ; if ( sourceFileName == null ) { if ( info . isMember ( ) ) { IType enclosingType = getDeclaringType ( ) ; if ( enclosingType == null ) return null ; while ( enclosingType . getDeclaringType ( ) != null ) { enclosingType = enclosingType . getDeclaringType ( ) ; } return enclosingType . getElementName ( ) + Util . defaultJavaExtension ( ) ; } else if ( info . isLocal ( ) || info . isAnonymous ( ) ) { String typeQualifiedName = getTypeQualifiedName ( ) ; int dollar = typeQualifiedName . indexOf ( '<CHAR_LIT>' ) ; if ( dollar == - <NUM_LIT:1> ) { return getElementName ( ) + Util . defaultJavaExtension ( ) ; } return typeQualifiedName . substring ( <NUM_LIT:0> , dollar ) + Util . defaultJavaExtension ( ) ; } else { return getElementName ( ) + Util . defaultJavaExtension ( ) ; } } else { int index = CharOperation . lastIndexOf ( '<CHAR_LIT:/>' , sourceFileName ) ; return new String ( sourceFileName , index + <NUM_LIT:1> , sourceFileName . length - index - <NUM_LIT:1> ) ; } } 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 { try { if ( isAnnotation ( ) ) { buffer . append ( "<STR_LIT>" ) ; } else if ( isEnum ( ) ) { buffer . append ( "<STR_LIT>" ) ; } else if ( isInterface ( ) ) { buffer . append ( "<STR_LIT>" ) ; } else { buffer . append ( "<STR_LIT>" ) ; } toStringName ( buffer ) ; } catch ( JavaModelException e ) { buffer . append ( "<STR_LIT>" + getElementName ( ) ) ; } } } protected void toStringName ( StringBuffer buffer ) { if ( getElementName ( ) . length ( ) > <NUM_LIT:0> ) super . toStringName ( buffer ) ; else buffer . append ( "<STR_LIT>" ) ; } public String getAttachedJavadoc ( IProgressMonitor monitor ) throws JavaModelException { JavadocContents javadocContents = getJavadocContents ( monitor ) ; if ( javadocContents == null ) return null ; return javadocContents . getTypeDoc ( ) ; } public JavadocContents getJavadocContents ( IProgressMonitor monitor ) throws JavaModelException { PerProjectInfo projectInfo = JavaModelManager . getJavaModelManager ( ) . getPerProjectInfoCheckExistence ( getJavaProject ( ) . getProject ( ) ) ; JavadocContents cachedJavadoc = null ; synchronized ( projectInfo . javadocCache ) { cachedJavadoc = ( JavadocContents ) projectInfo . javadocCache . get ( this ) ; } if ( cachedJavadoc != null && cachedJavadoc != EMPTY_JAVADOC ) { return cachedJavadoc ; } URL baseLocation = getJavadocBaseLocation ( ) ; if ( baseLocation == null ) { return null ; } StringBuffer pathBuffer = new StringBuffer ( baseLocation . toExternalForm ( ) ) ; if ( ! ( pathBuffer . charAt ( pathBuffer . length ( ) - <NUM_LIT:1> ) == '<CHAR_LIT:/>' ) ) { pathBuffer . append ( '<CHAR_LIT:/>' ) ; } IPackageFragment pack = getPackageFragment ( ) ; String typeQualifiedName = null ; if ( isMember ( ) ) { IType currentType = this ; StringBuffer typeName = new StringBuffer ( ) ; while ( currentType != null ) { typeName . insert ( <NUM_LIT:0> , currentType . getElementName ( ) ) ; currentType = currentType . getDeclaringType ( ) ; if ( currentType != null ) { typeName . insert ( <NUM_LIT:0> , '<CHAR_LIT:.>' ) ; } } typeQualifiedName = new String ( typeName . toString ( ) ) ; } else { typeQualifiedName = getElementName ( ) ; } pathBuffer . append ( pack . getElementName ( ) . replace ( '<CHAR_LIT:.>' , '<CHAR_LIT:/>' ) ) . append ( '<CHAR_LIT:/>' ) . append ( typeQualifiedName ) . append ( JavadocConstants . HTML_EXTENSION ) ; if ( monitor != null && monitor . isCanceled ( ) ) throw new OperationCanceledException ( ) ; final String contents = getURLContents ( String . valueOf ( pathBuffer ) ) ; JavadocContents javadocContents = new JavadocContents ( this , contents ) ; synchronized ( projectInfo . javadocCache ) { projectInfo . javadocCache . put ( this , javadocContents ) ; } return javadocContents ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . util . ClassFormatException ; import org . eclipse . jdt . core . util . IConstantPool ; import org . eclipse . jdt . core . util . IStackMapFrame ; import org . eclipse . jdt . core . util . IStackMapAttribute ; public class StackMapAttribute extends ClassFileAttribute implements IStackMapAttribute { private static final IStackMapFrame [ ] NO_FRAMES = new IStackMapFrame [ <NUM_LIT:0> ] ; private static final byte [ ] NO_ENTRIES = new byte [ <NUM_LIT:0> ] ; private int numberOfEntries ; private IStackMapFrame [ ] frames ; private byte [ ] bytes ; public StackMapAttribute ( byte [ ] classFileBytes , IConstantPool constantPool , int offset ) throws ClassFormatException { super ( classFileBytes , constantPool , offset ) ; final int length = u2At ( classFileBytes , <NUM_LIT:6> , offset ) ; this . numberOfEntries = length ; if ( length != <NUM_LIT:0> ) { int readOffset = <NUM_LIT:8> ; this . frames = new IStackMapFrame [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { DefaultStackMapFrame frame = new DefaultStackMapFrame ( classFileBytes , constantPool , offset + readOffset ) ; this . frames [ i ] = frame ; readOffset += frame . sizeInBytes ( ) ; } } else { this . frames = NO_FRAMES ; } final int byteLength = ( int ) u4At ( classFileBytes , <NUM_LIT:2> , offset ) ; if ( length != <NUM_LIT:0> ) { System . arraycopy ( classFileBytes , offset + <NUM_LIT:6> , this . bytes = new byte [ byteLength ] , <NUM_LIT:0> , byteLength ) ; } else { this . bytes = NO_ENTRIES ; } } public int getNumberOfEntries ( ) { return this . numberOfEntries ; } public IStackMapFrame [ ] getStackMapFrame ( ) { return this . frames ; } public byte [ ] getBytes ( ) { return this . bytes ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . util . ClassFormatException ; import org . eclipse . jdt . core . util . IAnnotationComponent ; import org . eclipse . jdt . core . util . IAnnotationComponentValue ; import org . eclipse . jdt . core . util . IConstantPool ; import org . eclipse . jdt . core . util . IConstantPoolConstant ; import org . eclipse . jdt . core . util . IConstantPoolEntry ; public class AnnotationComponent extends ClassFileStruct implements IAnnotationComponent { private int componentNameIndex ; private char [ ] componentName ; private IAnnotationComponentValue componentValue ; private int readOffset ; public AnnotationComponent ( byte [ ] classFileBytes , IConstantPool constantPool , int offset ) throws ClassFormatException { final int nameIndex = u2At ( classFileBytes , <NUM_LIT:0> , offset ) ; this . componentNameIndex = nameIndex ; if ( nameIndex != <NUM_LIT:0> ) { IConstantPoolEntry constantPoolEntry = constantPool . decodeEntry ( nameIndex ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Utf8 ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } this . componentName = constantPoolEntry . getUtf8Value ( ) ; } this . readOffset = <NUM_LIT:2> ; AnnotationComponentValue value = new AnnotationComponentValue ( classFileBytes , constantPool , offset + this . readOffset ) ; this . componentValue = value ; this . readOffset += value . sizeInBytes ( ) ; } public int getComponentNameIndex ( ) { return this . componentNameIndex ; } public char [ ] getComponentName ( ) { return this . componentName ; } public IAnnotationComponentValue getComponentValue ( ) { return this . componentValue ; } int sizeInBytes ( ) { return this . readOffset ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import java . text . MessageFormat ; import org . eclipse . osgi . util . NLS ; public final class Messages extends NLS { private static final String BUNDLE_NAME = "<STR_LIT>" ; private Messages ( ) { } public static String hierarchy_nullProject ; public static String hierarchy_nullRegion ; public static String hierarchy_nullFocusType ; public static String hierarchy_creating ; public static String hierarchy_creatingOnType ; public static String element_doesNotExist ; public static String element_notOnClasspath ; public static String element_invalidClassFileName ; public static String element_reconciling ; public static String element_attachingSource ; public static String element_invalidResourceForProject ; public static String element_nullName ; public static String element_nullType ; public static String element_illegalParent ; public static String javamodel_initialization ; public static String javamodel_initializing_delta_state ; public static String javamodel_building_after_upgrade ; public static String javamodel_configuring ; public static String javamodel_configuring_classpath_containers ; public static String javamodel_configuring_searchengine ; public static String javamodel_getting_build_state_number ; public static String javamodel_refreshing_external_jars ; public static String javamodel_resetting_source_attachment_properties ; public static String operation_needElements ; public static String operation_needName ; public static String operation_needPath ; public static String operation_needAbsolutePath ; public static String operation_needString ; public static String operation_notSupported ; public static String operation_cancelled ; public static String operation_nullContainer ; public static String operation_nullName ; public static String operation_copyElementProgress ; public static String operation_moveElementProgress ; public static String operation_renameElementProgress ; public static String operation_copyResourceProgress ; public static String operation_moveResourceProgress ; public static String operation_renameResourceProgress ; public static String operation_createUnitProgress ; public static String operation_createFieldProgress ; public static String operation_createImportsProgress ; public static String operation_createInitializerProgress ; public static String operation_createMethodProgress ; public static String operation_createPackageProgress ; public static String operation_createPackageFragmentProgress ; public static String operation_createTypeProgress ; public static String operation_deleteElementProgress ; public static String operation_deleteResourceProgress ; public static String operation_cannotRenameDefaultPackage ; public static String operation_pathOutsideProject ; public static String operation_sortelements ; public static String workingCopy_commit ; public static String buffer_closed ; public static String build_preparingBuild ; public static String build_readStateProgress ; public static String build_saveStateProgress ; public static String build_saveStateComplete ; public static String build_readingDelta ; public static String build_analyzingDeltas ; public static String build_analyzingSources ; public static String build_cleaningOutput ; public static String build_copyingResources ; public static String build_compiling ; public static String build_foundHeader ; public static String build_fixedHeader ; public static String build_oneError ; public static String build_oneWarning ; public static String build_multipleErrors ; public static String build_multipleWarnings ; public static String build_done ; public static String build_wrongFileFormat ; public static String build_cannotSaveState ; public static String build_cannotSaveStates ; public static String build_initializationError ; public static String build_serializationError ; public static String build_classFileCollision ; public static String build_duplicateClassFile ; public static String build_duplicateResource ; public static String build_inconsistentClassFile ; public static String build_inconsistentProject ; public static String build_incompleteClassPath ; public static String build_missingSourceFile ; public static String build_prereqProjectHasClasspathProblems ; public static String build_prereqProjectMustBeRebuilt ; public static String build_abortDueToClasspathProblems ; public static String status_cannot_retrieve_attached_javadoc ; public static String status_timeout_javadoc ; public static String status_cannotUseDeviceOnPath ; public static String status_coreException ; public static String status_defaultPackageReadOnly ; public static String status_evaluationError ; public static String status_JDOMError ; public static String status_IOException ; public static String status_indexOutOfBounds ; public static String status_invalidContents ; public static String status_invalidDestination ; public static String status_invalidName ; public static String status_invalidPackage ; public static String status_invalidPath ; public static String status_invalidProject ; public static String status_invalidResource ; public static String status_invalidResourceType ; public static String status_invalidSibling ; public static String status_nameCollision ; public static String status_noLocalContents ; public static String status_OK ; public static String status_readOnly ; public static String status_targetException ; public static String status_unknown_javadoc_format ; public static String status_updateConflict ; public static String classpath_buildPath ; public static String classpath_cannotNestEntryInEntry ; public static String classpath_cannotNestEntryInEntryNoExclusion ; public static String classpath_cannotNestEntryInLibrary ; public static String classpath_cannotNestEntryInOutput ; public static String classpath_cannotNestOutputInEntry ; public static String classpath_cannotNestOutputInOutput ; public static String classpath_cannotReadClasspathFile ; public static String classpath_cannotReferToItself ; public static String classpath_cannotUseDistinctSourceFolderAsOutput ; public static String classpath_cannotUseLibraryAsOutput ; public static String classpath_closedProject ; public static String classpath_couldNotWriteClasspathFile ; public static String classpath_cycle ; public static String classpath_duplicateEntryPath ; public static String classpath_illegalContainerPath ; public static String classpath_illegalEntryInClasspathFile ; public static String classpath_illegalLibraryPath ; public static String classpath_illegalLibraryPathInContainer ; public static String classpath_illegalLibraryArchive ; public static String classpath_archiveReadError ; public static String classpath_illegalExternalFolder ; public static String classpath_illegalExternalFolderInContainer ; public static String classpath_illegalProjectPath ; public static String classpath_illegalSourceFolderPath ; public static String classpath_illegalVariablePath ; public static String classpath_invalidClasspathInClasspathFile ; public static String classpath_invalidContainer ; public static String classpath_mustEndWithSlash ; public static String classpath_unboundContainerPath ; public static String classpath_unboundLibrary ; public static String classpath_userLibraryInfo ; public static String classpath_containerInfo ; public static String classpath_unboundLibraryInContainer ; public static String classpath_unboundProject ; public static String classpath_settingOutputLocationProgress ; public static String classpath_settingProgress ; public static String classpath_unboundSourceAttachment ; public static String classpath_unboundSourceAttachmentInContainedLibrary ; public static String classpath_unboundSourceFolder ; public static String classpath_unboundVariablePath ; public static String classpath_unknownKind ; public static String classpath_xmlFormatError ; public static String classpath_disabledInclusionExclusionPatterns ; public static String classpath_disabledMultipleOutputLocations ; public static String classpath_incompatibleLibraryJDKLevel ; public static String classpath_incompatibleLibraryJDKLevelInContainer ; public static String classpath_duplicateEntryExtraAttribute ; public static String classpath_deprecated_variable ; public static String file_notFound ; public static String file_badFormat ; public static String path_nullPath ; public static String path_mustBeAbsolute ; public static String cache_invalidLoadFactor ; public static String savedState_jobName ; public static String refreshing_external_folders ; public static String updating_external_archives_jobName ; public static String convention_unit_nullName ; public static String convention_unit_notJavaName ; public static String convention_classFile_nullName ; public static String convention_classFile_notClassFileName ; public static String convention_illegalIdentifier ; public static String convention_import_nullImport ; public static String convention_import_unqualifiedImport ; public static String convention_type_nullName ; public static String convention_type_nameWithBlanks ; public static String convention_type_dollarName ; public static String convention_type_lowercaseName ; public static String convention_type_invalidName ; public static String convention_package_nullName ; public static String convention_package_emptyName ; public static String convention_package_dotName ; public static String convention_package_nameWithBlanks ; public static String convention_package_consecutiveDotsName ; public static String convention_package_uppercaseName ; public static String dom_cannotDetail ; public static String dom_nullTypeParameter ; public static String dom_nullNameParameter ; public static String dom_nullReturnType ; public static String dom_nullExceptionType ; public static String dom_mismatchArgNamesAndTypes ; public static String dom_addNullChild ; public static String dom_addIncompatibleChild ; public static String dom_addChildWithParent ; public static String dom_unableAddChild ; public static String dom_addAncestorAsChild ; public static String dom_addNullSibling ; public static String dom_addSiblingBeforeRoot ; public static String dom_addIncompatibleSibling ; public static String dom_addSiblingWithParent ; public static String dom_addAncestorAsSibling ; public static String dom_addNullInterface ; public static String dom_nullInterfaces ; public static String importRewrite_processDescription ; public static String correction_nullRequestor ; public static String correction_nullUnit ; public static String engine_completing ; public static String engine_searching ; public static String engine_searching_indexing ; public static String engine_searching_matching ; public static String exception_wrongFormat ; public static String process_name ; public static String jobmanager_filesToIndex ; public static String jobmanager_indexing ; public static String disassembler_description ; public static String disassembler_opentypedeclaration ; public static String disassembler_closetypedeclaration ; public static String disassembler_parametername ; public static String disassembler_localvariablename ; public static String disassembler_endofmethodheader ; public static String disassembler_begincommentline ; public static String disassembler_fieldhasconstant ; public static String disassembler_endoffieldheader ; public static String disassembler_sourceattributeheader ; public static String disassembler_enclosingmethodheader ; public static String disassembler_exceptiontableheader ; public static String disassembler_linenumberattributeheader ; public static String disassembler_localvariabletableattributeheader ; public static String disassembler_localvariabletypetableattributeheader ; public static String disassembler_arraydimensions ; public static String disassembler_innerattributesheader ; public static String disassembler_inner_class_info_name ; public static String disassembler_outer_class_info_name ; public static String disassembler_inner_name ; public static String disassembler_inner_accessflags ; public static String disassembler_genericattributeheader ; public static String disassembler_signatureattributeheader ; public static String disassembler_indentation ; public static String disassembler_constantpoolindex ; public static String disassembler_space ; public static String disassembler_comma ; public static String disassembler_openinnerclassentry ; public static String disassembler_closeinnerclassentry ; public static String disassembler_deprecated ; public static String disassembler_constantpoolheader ; public static String disassembler_constantpool_class ; public static String disassembler_constantpool_double ; public static String disassembler_constantpool_float ; public static String disassembler_constantpool_integer ; public static String disassembler_constantpool_long ; public static String disassembler_constantpool_string ; public static String disassembler_constantpool_fieldref ; public static String disassembler_constantpool_interfacemethodref ; public static String disassembler_constantpool_methodref ; public static String disassembler_constantpool_name_and_type ; public static String disassembler_constantpool_utf8 ; public static String disassembler_annotationdefaultheader ; public static String disassembler_annotationdefaultvalue ; public static String disassembler_annotationenumvalue ; public static String disassembler_annotationclassvalue ; public static String disassembler_annotationannotationvalue ; public static String disassembler_annotationarrayvaluestart ; public static String disassembler_annotationarrayvalueend ; public static String disassembler_annotationentrystart ; public static String disassembler_annotationentryend ; public static String disassembler_annotationcomponent ; public static String disassembler_runtimevisibleannotationsattributeheader ; public static String disassembler_runtimeinvisibleannotationsattributeheader ; public static String disassembler_runtimevisibleparameterannotationsattributeheader ; public static String disassembler_runtimeinvisibleparameterannotationsattributeheader ; public static String disassembler_parameterannotationentrystart ; public static String disassembler_stackmaptableattributeheader ; public static String disassembler_stackmapattributeheader ; public static String classfileformat_versiondetails ; public static String classfileformat_methoddescriptor ; public static String classfileformat_fieldddescriptor ; public static String classfileformat_stacksAndLocals ; public static String classfileformat_superflagisnotset ; public static String classfileformat_superflagisset ; public static String classfileformat_clinitname ; public static String classformat_classformatexception ; public static String classformat_anewarray ; public static String classformat_checkcast ; public static String classformat_instanceof ; public static String classformat_ldc_w_class ; public static String classformat_ldc_w_float ; public static String classformat_ldc_w_integer ; public static String classformat_ldc_w_string ; public static String classformat_ldc2_w_long ; public static String classformat_ldc2_w_double ; public static String classformat_multianewarray ; public static String classformat_new ; public static String classformat_iinc ; public static String classformat_invokespecial ; public static String classformat_invokeinterface ; public static String classformat_invokestatic ; public static String classformat_invokevirtual ; public static String classformat_invokedynamic ; public static String classformat_getfield ; public static String classformat_getstatic ; public static String classformat_putstatic ; public static String classformat_putfield ; public static String classformat_newarray_boolean ; public static String classformat_newarray_char ; public static String classformat_newarray_float ; public static String classformat_newarray_double ; public static String classformat_newarray_byte ; public static String classformat_newarray_short ; public static String classformat_newarray_int ; public static String classformat_newarray_long ; public static String classformat_store ; public static String classformat_load ; public static String classfileformat_anyexceptionhandler ; public static String classfileformat_exceptiontableentry ; public static String classfileformat_linenumbertableentry ; public static String classfileformat_localvariabletableentry ; public static String classfileformat_versionUnknown ; public static String disassembler_frame_same_locals_1_stack_item_extended ; public static String disassembler_frame_chop ; public static String disassembler_frame_same_frame_extended ; public static String disassembler_frame_append ; public static String disassembler_frame_full_frame ; public static String disassembler_frame_same_frame ; public static String disassembler_frame_same_locals_1_stack_item ; public static String code_assist_internal_error ; static { NLS . initializeMessages ( BUNDLE_NAME , Messages . class ) ; } public static String bind ( String message ) { return bind ( message , null ) ; } public static String bind ( String message , Object binding ) { return bind ( message , new Object [ ] { binding } ) ; } public static String bind ( String message , Object binding1 , Object binding2 ) { return bind ( message , new Object [ ] { binding1 , binding2 } ) ; } public static String bind ( String message , Object [ ] bindings ) { return MessageFormat . format ( message , bindings ) ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . internal . compiler . util . Util ; public class CharArrayBuffer { protected char [ ] [ ] buffer ; public static final int DEFAULT_BUFFER_SIZE = <NUM_LIT:10> ; protected int end ; protected int size ; protected int [ ] [ ] ranges ; public CharArrayBuffer ( ) { this ( null , DEFAULT_BUFFER_SIZE ) ; } public CharArrayBuffer ( char [ ] first ) { this ( first , DEFAULT_BUFFER_SIZE ) ; } public CharArrayBuffer ( char [ ] first , int size ) { this . size = ( size > <NUM_LIT:0> ) ? size : DEFAULT_BUFFER_SIZE ; this . buffer = new char [ this . size ] [ ] ; this . ranges = new int [ this . size ] [ ] ; this . end = <NUM_LIT:0> ; if ( first != null ) append ( first , <NUM_LIT:0> , first . length ) ; } public CharArrayBuffer ( int size ) { this ( null , size ) ; } public CharArrayBuffer append ( char [ ] src ) { if ( src != null ) append ( src , <NUM_LIT:0> , src . length ) ; return this ; } public CharArrayBuffer append ( char [ ] src , int start , int length ) { if ( start < <NUM_LIT:0> ) throw new ArrayIndexOutOfBoundsException ( ) ; if ( length < <NUM_LIT:0> ) throw new ArrayIndexOutOfBoundsException ( ) ; if ( src != null ) { int srcLength = src . length ; if ( start > srcLength ) throw new ArrayIndexOutOfBoundsException ( ) ; if ( length + start > srcLength ) throw new ArrayIndexOutOfBoundsException ( ) ; if ( length > <NUM_LIT:0> ) { if ( this . end == this . size ) { int size2 = this . size * <NUM_LIT:2> ; System . arraycopy ( this . buffer , <NUM_LIT:0> , ( this . buffer = new char [ size2 ] [ ] ) , <NUM_LIT:0> , this . size ) ; System . arraycopy ( this . ranges , <NUM_LIT:0> , ( this . ranges = new int [ size2 ] [ ] ) , <NUM_LIT:0> , this . size ) ; this . size *= <NUM_LIT:2> ; } this . buffer [ this . end ] = src ; this . ranges [ this . end ] = new int [ ] { start , length } ; this . end ++ ; } } return this ; } public CharArrayBuffer append ( char c ) { append ( new char [ ] { c } , <NUM_LIT:0> , <NUM_LIT:1> ) ; return this ; } public CharArrayBuffer append ( String src ) { if ( src != null ) append ( src . toCharArray ( ) , <NUM_LIT:0> , src . length ( ) ) ; return this ; } public char [ ] getContents ( ) { if ( this . end == <NUM_LIT:0> ) return null ; int length = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < this . end ; i ++ ) length += this . ranges [ i ] [ <NUM_LIT:1> ] ; if ( length > <NUM_LIT:0> ) { char [ ] result = new char [ length ] ; int current = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < this . end ; i ++ ) { int [ ] range = this . ranges [ i ] ; int length2 = range [ <NUM_LIT:1> ] ; System . arraycopy ( this . buffer [ i ] , range [ <NUM_LIT:0> ] , result , current , length2 ) ; current += length2 ; } return result ; } return null ; } public String toString ( ) { char [ ] contents = getContents ( ) ; return ( contents != null ) ? new String ( contents ) : Util . EMPTY_STRING ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . compiler . CharOperation ; public final class HashSetOfCharArrayArray implements Cloneable { public char [ ] [ ] [ ] set ; public int elementSize ; int threshold ; public HashSetOfCharArrayArray ( ) { this ( <NUM_LIT> ) ; } public HashSetOfCharArrayArray ( int size ) { this . elementSize = <NUM_LIT:0> ; this . threshold = size ; int extraRoom = ( int ) ( size * <NUM_LIT> ) ; if ( this . threshold == extraRoom ) extraRoom ++ ; this . set = new char [ extraRoom ] [ ] [ ] ; } public Object clone ( ) throws CloneNotSupportedException { HashSetOfCharArrayArray result = ( HashSetOfCharArrayArray ) super . clone ( ) ; result . elementSize = this . elementSize ; result . threshold = this . threshold ; int length = this . set . length ; result . set = new char [ length ] [ ] [ ] ; System . arraycopy ( this . set , <NUM_LIT:0> , result . set , <NUM_LIT:0> , length ) ; return result ; } public boolean contains ( char [ ] [ ] array ) { int length = this . set . length ; int index = hashCode ( array ) % length ; int arrayLength = array . length ; char [ ] [ ] currentArray ; while ( ( currentArray = this . set [ index ] ) != null ) { if ( currentArray . length == arrayLength && CharOperation . equals ( currentArray , array ) ) return true ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return false ; } private int hashCode ( char [ ] [ ] element ) { return hashCode ( element , element . length ) ; } private int hashCode ( char [ ] [ ] element , int length ) { int hash = <NUM_LIT:0> ; for ( int i = length - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) hash = Util . combineHashCodes ( hash , CharOperation . hashCode ( element [ i ] ) ) ; return hash & <NUM_LIT> ; } public char [ ] [ ] add ( char [ ] [ ] array ) { int length = this . set . length ; int index = hashCode ( array ) % length ; int arrayLength = array . length ; char [ ] [ ] currentArray ; while ( ( currentArray = this . set [ index ] ) != null ) { if ( currentArray . length == arrayLength && CharOperation . equals ( currentArray , array ) ) return this . set [ index ] = array ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } this . set [ index ] = array ; if ( ++ this . elementSize > this . threshold ) rehash ( ) ; return array ; } public char [ ] [ ] remove ( char [ ] [ ] array ) { int length = this . set . length ; int index = hashCode ( array ) % length ; int arrayLength = array . length ; char [ ] [ ] currentArray ; while ( ( currentArray = this . set [ index ] ) != null ) { if ( currentArray . length == arrayLength && CharOperation . equals ( currentArray , array ) ) { char [ ] [ ] existing = this . set [ index ] ; this . elementSize -- ; this . set [ index ] = null ; rehash ( ) ; return existing ; } if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return null ; } private void rehash ( ) { HashSetOfCharArrayArray newHashSet = new HashSetOfCharArrayArray ( this . elementSize * <NUM_LIT:2> ) ; char [ ] [ ] currentArray ; for ( int i = this . set . length ; -- i >= <NUM_LIT:0> ; ) if ( ( currentArray = this . set [ i ] ) != null ) newHashSet . add ( currentArray ) ; this . set = newHashSet . set ; this . threshold = newHashSet . threshold ; } public int size ( ) { return this . elementSize ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; for ( int i = <NUM_LIT:0> , length = this . set . length ; i < length ; i ++ ) { char [ ] [ ] arrayArray = this . set [ i ] ; if ( arrayArray != null ) { buffer . append ( "<STR_LIT:{>" ) ; for ( int j = <NUM_LIT:0> , length2 = arrayArray . length ; j < length2 ; j ++ ) { char [ ] array = arrayArray [ j ] ; buffer . append ( '<CHAR_LIT>' ) ; for ( int k = <NUM_LIT:0> , length3 = array . length ; k < length3 ; k ++ ) { buffer . append ( '<STR_LIT>' ) ; buffer . append ( array [ k ] ) ; buffer . append ( '<STR_LIT>' ) ; if ( k != length3 - <NUM_LIT:1> ) buffer . append ( "<STR_LIT:U+002CU+0020>" ) ; } buffer . append ( '<CHAR_LIT:}>' ) ; if ( j != length2 - <NUM_LIT:1> ) buffer . append ( "<STR_LIT:U+002CU+0020>" ) ; } buffer . append ( "<STR_LIT:}>" ) ; if ( i != length - <NUM_LIT:1> ) buffer . append ( '<STR_LIT:\n>' ) ; } } return buffer . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . util . ClassFormatException ; import org . eclipse . jdt . core . util . IConstantPool ; import org . eclipse . jdt . core . util . ILocalVariableAttribute ; import org . eclipse . jdt . core . util . ILocalVariableTableEntry ; public class LocalVariableAttribute extends ClassFileAttribute implements ILocalVariableAttribute { private static final ILocalVariableTableEntry [ ] NO_ENTRIES = new ILocalVariableTableEntry [ <NUM_LIT:0> ] ; private int localVariableTableLength ; private ILocalVariableTableEntry [ ] localVariableTable ; public LocalVariableAttribute ( byte [ ] classFileBytes , IConstantPool constantPool , int offset ) throws ClassFormatException { super ( classFileBytes , constantPool , offset ) ; final int length = u2At ( classFileBytes , <NUM_LIT:6> , offset ) ; this . localVariableTableLength = length ; if ( length != <NUM_LIT:0> ) { int readOffset = <NUM_LIT:8> ; this . localVariableTable = new ILocalVariableTableEntry [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { this . localVariableTable [ i ] = new LocalVariableTableEntry ( classFileBytes , constantPool , offset + readOffset ) ; readOffset += <NUM_LIT:10> ; } } else { this . localVariableTable = NO_ENTRIES ; } } public ILocalVariableTableEntry [ ] getLocalVariableTable ( ) { return this . localVariableTable ; } public int getLocalVariableTableLength ( ) { return this . localVariableTableLength ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . compiler . CategorizedProblem ; import org . eclipse . jdt . internal . compiler . CompilationResult ; public class RecordedParsingInformation { public CategorizedProblem [ ] problems ; public int problemsCount ; public int [ ] lineEnds ; public int [ ] [ ] commentPositions ; public RecordedParsingInformation ( CategorizedProblem [ ] problems , int [ ] lineEnds , int [ ] [ ] commentPositions ) { this . problems = problems ; this . lineEnds = lineEnds ; this . commentPositions = commentPositions ; this . problemsCount = problems != null ? problems . length : <NUM_LIT:0> ; } void updateRecordedParsingInformation ( CompilationResult compilationResult ) { if ( compilationResult . problems != null ) { this . problems = compilationResult . problems ; this . problemsCount = this . problems . length ; } } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . util . ClassFormatException ; import org . eclipse . jdt . core . util . IConstantPool ; import org . eclipse . jdt . core . util . IParameterAnnotation ; import org . eclipse . jdt . core . util . IRuntimeVisibleParameterAnnotationsAttribute ; public class RuntimeVisibleParameterAnnotationsAttribute extends ClassFileAttribute implements IRuntimeVisibleParameterAnnotationsAttribute { private static final IParameterAnnotation [ ] NO_ENTRIES = new IParameterAnnotation [ <NUM_LIT:0> ] ; private int parametersNumber ; private IParameterAnnotation [ ] parameterAnnotations ; public RuntimeVisibleParameterAnnotationsAttribute ( byte [ ] classFileBytes , IConstantPool constantPool , int offset ) throws ClassFormatException { super ( classFileBytes , constantPool , offset ) ; final int length = u1At ( classFileBytes , <NUM_LIT:6> , offset ) ; this . parametersNumber = length ; if ( length != <NUM_LIT:0> ) { int readOffset = <NUM_LIT:7> ; this . parameterAnnotations = new IParameterAnnotation [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { ParameterAnnotation parameterAnnotation = new ParameterAnnotation ( classFileBytes , constantPool , offset + readOffset ) ; this . parameterAnnotations [ i ] = parameterAnnotation ; readOffset += parameterAnnotation . sizeInBytes ( ) ; } } else { this . parameterAnnotations = NO_ENTRIES ; } } public IParameterAnnotation [ ] getParameterAnnotations ( ) { return this . parameterAnnotations ; } public int getParametersNumber ( ) { return this . parametersNumber ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import java . lang . ref . ReferenceQueue ; import java . lang . ref . WeakReference ; public class WeakHashSet { public static class HashableWeakReference extends WeakReference { public int hashCode ; public HashableWeakReference ( Object referent , ReferenceQueue queue ) { super ( referent , queue ) ; this . hashCode = referent . hashCode ( ) ; } public boolean equals ( Object obj ) { if ( ! ( obj instanceof HashableWeakReference ) ) return false ; Object referent = get ( ) ; Object other = ( ( HashableWeakReference ) obj ) . get ( ) ; if ( referent == null ) return other == null ; return referent . equals ( other ) ; } public int hashCode ( ) { return this . hashCode ; } public String toString ( ) { Object referent = get ( ) ; if ( referent == null ) return "<STR_LIT>" + this . hashCode + "<STR_LIT>" ; return "<STR_LIT>" + this . hashCode + "<STR_LIT>" + referent . toString ( ) ; } } HashableWeakReference [ ] values ; public int elementSize ; int threshold ; ReferenceQueue referenceQueue = new ReferenceQueue ( ) ; public WeakHashSet ( ) { this ( <NUM_LIT:5> ) ; } public WeakHashSet ( int size ) { this . elementSize = <NUM_LIT:0> ; this . threshold = size ; int extraRoom = ( int ) ( size * <NUM_LIT> ) ; if ( this . threshold == extraRoom ) extraRoom ++ ; this . values = new HashableWeakReference [ extraRoom ] ; } public Object add ( Object obj ) { cleanupGarbageCollectedValues ( ) ; int valuesLength = this . values . length , index = ( obj . hashCode ( ) & <NUM_LIT> ) % valuesLength ; HashableWeakReference currentValue ; while ( ( currentValue = this . values [ index ] ) != null ) { Object referent ; if ( obj . equals ( referent = currentValue . get ( ) ) ) { return referent ; } if ( ++ index == valuesLength ) { index = <NUM_LIT:0> ; } } this . values [ index ] = new HashableWeakReference ( obj , this . referenceQueue ) ; if ( ++ this . elementSize > this . threshold ) rehash ( ) ; return obj ; } private void addValue ( HashableWeakReference value ) { Object obj = value . get ( ) ; if ( obj == null ) return ; int valuesLength = this . values . length ; int index = ( value . hashCode & <NUM_LIT> ) % valuesLength ; HashableWeakReference currentValue ; while ( ( currentValue = this . values [ index ] ) != null ) { if ( obj . equals ( currentValue . get ( ) ) ) { return ; } if ( ++ index == valuesLength ) { index = <NUM_LIT:0> ; } } this . values [ index ] = value ; if ( ++ this . elementSize > this . threshold ) rehash ( ) ; } private void cleanupGarbageCollectedValues ( ) { HashableWeakReference toBeRemoved ; while ( ( toBeRemoved = ( HashableWeakReference ) this . referenceQueue . poll ( ) ) != null ) { int hashCode = toBeRemoved . hashCode ; int valuesLength = this . values . length ; int index = ( hashCode & <NUM_LIT> ) % valuesLength ; HashableWeakReference currentValue ; while ( ( currentValue = this . values [ index ] ) != null ) { if ( currentValue == toBeRemoved ) { int sameHash = index ; int current ; while ( ( currentValue = this . values [ current = ( sameHash + <NUM_LIT:1> ) % valuesLength ] ) != null && currentValue . hashCode == hashCode ) sameHash = current ; this . values [ index ] = this . values [ sameHash ] ; this . values [ sameHash ] = null ; this . elementSize -- ; break ; } if ( ++ index == valuesLength ) { index = <NUM_LIT:0> ; } } } } public boolean contains ( Object obj ) { return get ( obj ) != null ; } public Object get ( Object obj ) { cleanupGarbageCollectedValues ( ) ; int valuesLength = this . values . length ; int index = ( obj . hashCode ( ) & <NUM_LIT> ) % valuesLength ; HashableWeakReference currentValue ; while ( ( currentValue = this . values [ index ] ) != null ) { Object referent ; if ( obj . equals ( referent = currentValue . get ( ) ) ) { return referent ; } if ( ++ index == valuesLength ) { index = <NUM_LIT:0> ; } } return null ; } private void rehash ( ) { WeakHashSet newHashSet = new WeakHashSet ( this . elementSize * <NUM_LIT:2> ) ; newHashSet . referenceQueue = this . referenceQueue ; HashableWeakReference currentValue ; for ( int i = <NUM_LIT:0> , length = this . values . length ; i < length ; i ++ ) if ( ( currentValue = this . values [ i ] ) != null ) newHashSet . addValue ( currentValue ) ; this . values = newHashSet . values ; this . threshold = newHashSet . threshold ; this . elementSize = newHashSet . elementSize ; } public Object remove ( Object obj ) { cleanupGarbageCollectedValues ( ) ; int valuesLength = this . values . length ; int index = ( obj . hashCode ( ) & <NUM_LIT> ) % valuesLength ; HashableWeakReference currentValue ; while ( ( currentValue = this . values [ index ] ) != null ) { Object referent ; if ( obj . equals ( referent = currentValue . get ( ) ) ) { this . elementSize -- ; this . values [ index ] = null ; rehash ( ) ; return referent ; } if ( ++ index == valuesLength ) { index = <NUM_LIT:0> ; } } return null ; } public int size ( ) { return this . elementSize ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( "<STR_LIT:{>" ) ; for ( int i = <NUM_LIT:0> , length = this . values . length ; i < length ; i ++ ) { HashableWeakReference value = this . values [ i ] ; if ( value != null ) { Object ref = value . get ( ) ; if ( ref != null ) { buffer . append ( ref . toString ( ) ) ; buffer . append ( "<STR_LIT:U+002CU+0020>" ) ; } } } buffer . append ( "<STR_LIT:}>" ) ; return buffer . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . util . ClassFormatException ; import org . eclipse . jdt . core . util . IConstantPool ; import org . eclipse . jdt . core . util . IStackMapFrame ; import org . eclipse . jdt . core . util . IVerificationTypeInfo ; public class DefaultStackMapFrame extends ClassFileStruct implements IStackMapFrame { private static final IVerificationTypeInfo [ ] EMPTY_LOCALS_OR_STACK_ITEMS = new IVerificationTypeInfo [ <NUM_LIT:0> ] ; private int readOffset ; private int numberOfLocals ; private int numberOfStackItems ; private IVerificationTypeInfo [ ] locals ; private IVerificationTypeInfo [ ] stackItems ; private int offsetDelta ; public DefaultStackMapFrame ( byte [ ] classFileBytes , IConstantPool constantPool , int offset ) throws ClassFormatException { this . offsetDelta = u2At ( classFileBytes , <NUM_LIT:0> , offset ) ; int tempLocals = u2At ( classFileBytes , <NUM_LIT:2> , offset ) ; this . numberOfLocals = tempLocals ; this . readOffset = <NUM_LIT:4> ; if ( tempLocals != <NUM_LIT:0> ) { this . locals = new IVerificationTypeInfo [ tempLocals ] ; for ( int i = <NUM_LIT:0> ; i < tempLocals ; i ++ ) { VerificationInfo verificationInfo = new VerificationInfo ( classFileBytes , constantPool , offset + this . readOffset ) ; this . locals [ i ] = verificationInfo ; this . readOffset += verificationInfo . sizeInBytes ( ) ; } } else { this . locals = EMPTY_LOCALS_OR_STACK_ITEMS ; } int tempStackItems = u2At ( classFileBytes , this . readOffset , offset ) ; this . readOffset += <NUM_LIT:2> ; this . numberOfStackItems = tempStackItems ; if ( tempStackItems != <NUM_LIT:0> ) { this . stackItems = new IVerificationTypeInfo [ tempStackItems ] ; for ( int i = <NUM_LIT:0> ; i < tempStackItems ; i ++ ) { VerificationInfo verificationInfo = new VerificationInfo ( classFileBytes , constantPool , offset + this . readOffset ) ; this . stackItems [ i ] = verificationInfo ; this . readOffset += verificationInfo . sizeInBytes ( ) ; } } else { this . stackItems = EMPTY_LOCALS_OR_STACK_ITEMS ; } } int sizeInBytes ( ) { return this . readOffset ; } public int getFrameType ( ) { return <NUM_LIT:255> ; } public IVerificationTypeInfo [ ] getLocals ( ) { return this . locals ; } public int getNumberOfLocals ( ) { return this . numberOfLocals ; } public int getNumberOfStackItems ( ) { return this . numberOfStackItems ; } public int getOffsetDelta ( ) { return this . offsetDelta ; } public IVerificationTypeInfo [ ] getStackItems ( ) { return this . stackItems ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . util . ClassFormatException ; import org . eclipse . jdt . core . util . IAttributeNamesConstants ; import org . eclipse . jdt . core . util . IClassFileAttribute ; import org . eclipse . jdt . core . util . IClassFileReader ; import org . eclipse . jdt . core . util . ICodeAttribute ; import org . eclipse . jdt . core . util . IConstantPool ; import org . eclipse . jdt . core . util . IConstantPoolConstant ; import org . eclipse . jdt . core . util . IConstantPoolEntry ; import org . eclipse . jdt . core . util . IExceptionAttribute ; import org . eclipse . jdt . core . util . IMethodInfo ; import org . eclipse . jdt . core . util . IModifierConstants ; public class MethodInfo extends ClassFileStruct implements IMethodInfo { private int accessFlags ; private int attributeBytes ; private IClassFileAttribute [ ] attributes ; private int attributesCount ; private ICodeAttribute codeAttribute ; private char [ ] descriptor ; private int descriptorIndex ; private IExceptionAttribute exceptionAttribute ; private boolean isDeprecated ; private boolean isSynthetic ; private char [ ] name ; private int nameIndex ; public MethodInfo ( byte classFileBytes [ ] , IConstantPool constantPool , int offset , int decodingFlags ) throws ClassFormatException { boolean no_code_attribute = ( decodingFlags & IClassFileReader . METHOD_BODIES ) == <NUM_LIT:0> ; final int flags = u2At ( classFileBytes , <NUM_LIT:0> , offset ) ; this . accessFlags = flags ; if ( ( flags & IModifierConstants . ACC_SYNTHETIC ) != <NUM_LIT:0> ) { this . isSynthetic = true ; } this . nameIndex = u2At ( classFileBytes , <NUM_LIT:2> , offset ) ; IConstantPoolEntry constantPoolEntry = constantPool . decodeEntry ( this . nameIndex ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Utf8 ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } this . name = constantPoolEntry . getUtf8Value ( ) ; this . descriptorIndex = u2At ( classFileBytes , <NUM_LIT:4> , offset ) ; constantPoolEntry = constantPool . decodeEntry ( this . descriptorIndex ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Utf8 ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } this . descriptor = constantPoolEntry . getUtf8Value ( ) ; this . attributesCount = u2At ( classFileBytes , <NUM_LIT:6> , offset ) ; this . attributes = ClassFileAttribute . NO_ATTRIBUTES ; if ( this . attributesCount != <NUM_LIT:0> ) { if ( no_code_attribute && ! isAbstract ( ) && ! isNative ( ) ) { if ( this . attributesCount != <NUM_LIT:1> ) { this . attributes = new IClassFileAttribute [ this . attributesCount - <NUM_LIT:1> ] ; } } else { this . attributes = new IClassFileAttribute [ this . attributesCount ] ; } } int attributesIndex = <NUM_LIT:0> ; int readOffset = <NUM_LIT:8> ; for ( int i = <NUM_LIT:0> ; i < this . attributesCount ; i ++ ) { constantPoolEntry = constantPool . decodeEntry ( u2At ( classFileBytes , readOffset , offset ) ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Utf8 ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } char [ ] attributeName = constantPoolEntry . getUtf8Value ( ) ; if ( equals ( attributeName , IAttributeNamesConstants . DEPRECATED ) ) { this . isDeprecated = true ; this . attributes [ attributesIndex ++ ] = new ClassFileAttribute ( classFileBytes , constantPool , offset + readOffset ) ; } else if ( equals ( attributeName , IAttributeNamesConstants . SYNTHETIC ) ) { this . isSynthetic = true ; this . attributes [ attributesIndex ++ ] = new ClassFileAttribute ( classFileBytes , constantPool , offset + readOffset ) ; } else if ( equals ( attributeName , IAttributeNamesConstants . CODE ) ) { if ( ! no_code_attribute ) { this . codeAttribute = new CodeAttribute ( classFileBytes , constantPool , offset + readOffset ) ; this . attributes [ attributesIndex ++ ] = this . codeAttribute ; } } else if ( equals ( attributeName , IAttributeNamesConstants . EXCEPTIONS ) ) { this . exceptionAttribute = new ExceptionAttribute ( classFileBytes , constantPool , offset + readOffset ) ; this . attributes [ attributesIndex ++ ] = this . exceptionAttribute ; } else if ( equals ( attributeName , IAttributeNamesConstants . SIGNATURE ) ) { this . attributes [ attributesIndex ++ ] = new SignatureAttribute ( classFileBytes , constantPool , offset + readOffset ) ; } else if ( equals ( attributeName , IAttributeNamesConstants . RUNTIME_VISIBLE_ANNOTATIONS ) ) { this . attributes [ attributesIndex ++ ] = new RuntimeVisibleAnnotationsAttribute ( classFileBytes , constantPool , offset + readOffset ) ; } else if ( equals ( attributeName , IAttributeNamesConstants . RUNTIME_INVISIBLE_ANNOTATIONS ) ) { this . attributes [ attributesIndex ++ ] = new RuntimeInvisibleAnnotationsAttribute ( classFileBytes , constantPool , offset + readOffset ) ; } else if ( equals ( attributeName , IAttributeNamesConstants . RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS ) ) { this . attributes [ attributesIndex ++ ] = new RuntimeVisibleParameterAnnotationsAttribute ( classFileBytes , constantPool , offset + readOffset ) ; } else if ( equals ( attributeName , IAttributeNamesConstants . RUNTIME_INVISIBLE_PARAMETER_ANNOTATIONS ) ) { this . attributes [ attributesIndex ++ ] = new RuntimeInvisibleParameterAnnotationsAttribute ( classFileBytes , constantPool , offset + readOffset ) ; } else if ( equals ( attributeName , IAttributeNamesConstants . ANNOTATION_DEFAULT ) ) { this . attributes [ attributesIndex ++ ] = new AnnotationDefaultAttribute ( classFileBytes , constantPool , offset + readOffset ) ; } else { this . attributes [ attributesIndex ++ ] = new ClassFileAttribute ( classFileBytes , constantPool , offset + readOffset ) ; } readOffset += ( <NUM_LIT:6> + u4At ( classFileBytes , readOffset + <NUM_LIT:2> , offset ) ) ; } this . attributeBytes = readOffset ; } public int getAccessFlags ( ) { return this . accessFlags ; } public int getAttributeCount ( ) { return this . attributesCount ; } public IClassFileAttribute [ ] getAttributes ( ) { return this . attributes ; } public ICodeAttribute getCodeAttribute ( ) { return this . codeAttribute ; } public char [ ] getDescriptor ( ) { return this . descriptor ; } public int getDescriptorIndex ( ) { return this . descriptorIndex ; } public IExceptionAttribute getExceptionAttribute ( ) { return this . exceptionAttribute ; } public char [ ] getName ( ) { return this . name ; } public int getNameIndex ( ) { return this . nameIndex ; } private boolean isAbstract ( ) { return ( this . accessFlags & IModifierConstants . ACC_ABSTRACT ) != <NUM_LIT:0> ; } public boolean isClinit ( ) { return this . name [ <NUM_LIT:0> ] == '<CHAR_LIT>' && this . name . length == <NUM_LIT:8> ; } public boolean isConstructor ( ) { return this . name [ <NUM_LIT:0> ] == '<CHAR_LIT>' && this . name . length == <NUM_LIT:6> ; } public boolean isDeprecated ( ) { return this . isDeprecated ; } private boolean isNative ( ) { return ( this . accessFlags & IModifierConstants . ACC_NATIVE ) != <NUM_LIT:0> ; } public boolean isSynthetic ( ) { return this . isSynthetic ; } int sizeInBytes ( ) { return this . attributeBytes ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . core . util . ClassFormatException ; import org . eclipse . jdt . core . util . IConstantPool ; import org . eclipse . jdt . core . util . IConstantPoolConstant ; import org . eclipse . jdt . core . util . IConstantPoolEntry ; import org . eclipse . jdt . core . util . IExceptionAttribute ; public class ExceptionAttribute extends ClassFileAttribute implements IExceptionAttribute { private int exceptionsNumber ; private char [ ] [ ] exceptionNames ; private int [ ] exceptionIndexes ; ExceptionAttribute ( byte [ ] classFileBytes , IConstantPool constantPool , int offset ) throws ClassFormatException { super ( classFileBytes , constantPool , offset ) ; this . exceptionsNumber = u2At ( classFileBytes , <NUM_LIT:6> , offset ) ; int exceptionLength = this . exceptionsNumber ; this . exceptionNames = CharOperation . NO_CHAR_CHAR ; this . exceptionIndexes = org . eclipse . jdt . internal . compiler . util . Util . EMPTY_INT_ARRAY ; if ( exceptionLength != <NUM_LIT:0> ) { this . exceptionNames = new char [ exceptionLength ] [ ] ; this . exceptionIndexes = new int [ exceptionLength ] ; } int readOffset = <NUM_LIT:8> ; IConstantPoolEntry constantPoolEntry ; for ( int i = <NUM_LIT:0> ; i < exceptionLength ; i ++ ) { this . exceptionIndexes [ i ] = u2At ( classFileBytes , readOffset , offset ) ; constantPoolEntry = constantPool . decodeEntry ( this . exceptionIndexes [ i ] ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Class ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } this . exceptionNames [ i ] = constantPoolEntry . getClassInfoName ( ) ; readOffset += <NUM_LIT:2> ; } } public int [ ] getExceptionIndexes ( ) { return this . exceptionIndexes ; } public char [ ] [ ] getExceptionNames ( ) { return this . exceptionNames ; } public int getExceptionsNumber ( ) { return this . exceptionsNumber ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import java . util . ArrayList ; import org . eclipse . jdt . core . Signature ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . Compiler ; import org . eclipse . jdt . internal . compiler . ast . ArrayReference ; import org . eclipse . jdt . internal . compiler . ast . Assignment ; import org . eclipse . jdt . internal . compiler . ast . CastExpression ; import org . eclipse . jdt . internal . compiler . ast . CompilationUnitDeclaration ; import org . eclipse . jdt . internal . compiler . ast . ConditionalExpression ; import org . eclipse . jdt . internal . compiler . ast . FieldReference ; import org . eclipse . jdt . internal . compiler . ast . MessageSend ; import org . eclipse . jdt . internal . compiler . ast . QualifiedNameReference ; import org . eclipse . jdt . internal . compiler . ast . SingleNameReference ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; import org . eclipse . jdt . internal . compiler . ast . Wildcard ; import org . eclipse . jdt . internal . compiler . lookup . AnnotationBinding ; import org . eclipse . jdt . internal . compiler . lookup . ArrayBinding ; import org . eclipse . jdt . internal . compiler . lookup . Binding ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . CaptureBinding ; import org . eclipse . jdt . internal . compiler . lookup . FieldBinding ; import org . eclipse . jdt . internal . compiler . lookup . LocalTypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . LocalVariableBinding ; import org . eclipse . jdt . internal . compiler . lookup . LookupEnvironment ; import org . eclipse . jdt . internal . compiler . lookup . MethodBinding ; import org . eclipse . jdt . internal . compiler . lookup . PackageBinding ; import org . eclipse . jdt . internal . compiler . lookup . ParameterizedTypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . PolymorphicMethodBinding ; import org . eclipse . jdt . internal . compiler . lookup . RawTypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . ReferenceBinding ; import org . eclipse . jdt . internal . compiler . lookup . SourceTypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . TagBits ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . TypeVariableBinding ; import org . eclipse . jdt . internal . compiler . lookup . VariableBinding ; import org . eclipse . jdt . internal . compiler . lookup . WildcardBinding ; import org . eclipse . jdt . internal . compiler . util . HashtableOfObject ; public class BindingKeyResolver extends BindingKeyParser { Compiler compiler ; Binding compilerBinding ; char [ ] [ ] compoundName ; int dimension ; LookupEnvironment environment ; ReferenceBinding genericType ; MethodBinding methodBinding ; AnnotationBinding annotationBinding ; char [ ] secondarySimpleName ; CompilationUnitDeclaration parsedUnit ; BlockScope scope ; TypeBinding typeBinding ; TypeDeclaration typeDeclaration ; ArrayList types = new ArrayList ( ) ; int wildcardRank ; CompilationUnitDeclaration outerMostParsedUnit ; HashtableOfObject resolvedUnits ; private BindingKeyResolver ( BindingKeyParser parser , Compiler compiler , LookupEnvironment environment , CompilationUnitDeclaration outerMostParsedUnit , HashtableOfObject parsedUnits ) { super ( parser ) ; this . compiler = compiler ; this . environment = environment ; this . outerMostParsedUnit = outerMostParsedUnit ; this . resolvedUnits = parsedUnits ; } public BindingKeyResolver ( String key , Compiler compiler , LookupEnvironment environment ) { super ( key ) ; this . compiler = compiler ; this . environment = environment ; this . resolvedUnits = new HashtableOfObject ( ) ; } public char [ ] [ ] compoundName ( ) { return this . compoundName ; } public void consumeAnnotation ( ) { int size = this . types . size ( ) ; if ( size == <NUM_LIT:0> ) return ; Binding annotationType = ( ( BindingKeyResolver ) this . types . get ( size - <NUM_LIT:1> ) ) . compilerBinding ; AnnotationBinding [ ] annotationBindings ; if ( this . compilerBinding == null && this . typeBinding instanceof ReferenceBinding ) { annotationBindings = ( ( ReferenceBinding ) this . typeBinding ) . getAnnotations ( ) ; } else if ( this . compilerBinding instanceof MethodBinding ) { annotationBindings = ( ( MethodBinding ) this . compilerBinding ) . getAnnotations ( ) ; } else if ( this . compilerBinding instanceof VariableBinding ) { annotationBindings = ( ( VariableBinding ) this . compilerBinding ) . getAnnotations ( ) ; } else { return ; } for ( int i = <NUM_LIT:0> , length = annotationBindings . length ; i < length ; i ++ ) { AnnotationBinding binding = annotationBindings [ i ] ; if ( binding . getAnnotationType ( ) == annotationType ) { this . annotationBinding = binding ; break ; } } } public void consumeArrayDimension ( char [ ] brakets ) { this . dimension = brakets . length ; } public void consumeBaseType ( char [ ] baseTypeSig ) { this . compoundName = new char [ ] [ ] { getKey ( ) . toCharArray ( ) } ; TypeBinding baseTypeBinding = getBaseTypeBinding ( baseTypeSig ) ; if ( baseTypeBinding != null ) { this . typeBinding = baseTypeBinding ; } } public void consumeCapture ( final int position ) { CompilationUnitDeclaration outerParsedUnit = this . outerMostParsedUnit == null ? this . parsedUnit : this . outerMostParsedUnit ; if ( outerParsedUnit == null ) return ; final Binding wildcardBinding = ( ( BindingKeyResolver ) this . types . get ( <NUM_LIT:0> ) ) . compilerBinding ; class CaptureFinder extends ASTVisitor { CaptureBinding capture ; boolean checkType ( TypeBinding binding ) { if ( binding == null ) return false ; switch ( binding . kind ( ) ) { case Binding . PARAMETERIZED_TYPE : TypeBinding [ ] arguments = ( ( ParameterizedTypeBinding ) binding ) . arguments ; if ( arguments == null ) return false ; for ( int i = <NUM_LIT:0> , length = arguments . length ; i < length ; i ++ ) { if ( checkType ( arguments [ i ] ) ) return true ; } break ; case Binding . WILDCARD_TYPE : return checkType ( ( ( WildcardBinding ) binding ) . bound ) ; case Binding . INTERSECTION_TYPE : if ( checkType ( ( ( WildcardBinding ) binding ) . bound ) ) return true ; TypeBinding [ ] otherBounds = ( ( WildcardBinding ) binding ) . otherBounds ; for ( int i = <NUM_LIT:0> , length = otherBounds . length ; i < length ; i ++ ) { if ( checkType ( otherBounds [ i ] ) ) return true ; } break ; case Binding . ARRAY_TYPE : return checkType ( ( ( ArrayBinding ) binding ) . leafComponentType ) ; case Binding . TYPE_PARAMETER : if ( binding . isCapture ( ) ) { CaptureBinding captureBinding = ( CaptureBinding ) binding ; if ( captureBinding . position == position && captureBinding . wildcard == wildcardBinding ) { this . capture = captureBinding ; return true ; } } break ; } return false ; } public boolean visit ( SingleNameReference singleNameReference , BlockScope blockScope ) { if ( checkType ( singleNameReference . resolvedType ) ) return false ; return super . visit ( singleNameReference , blockScope ) ; } public boolean visit ( QualifiedNameReference qualifiedNameReference , BlockScope blockScope ) { if ( checkType ( qualifiedNameReference . resolvedType ) ) return false ; return super . visit ( qualifiedNameReference , blockScope ) ; } public boolean visit ( MessageSend messageSend , BlockScope blockScope ) { if ( checkType ( messageSend . resolvedType ) ) return false ; return super . visit ( messageSend , blockScope ) ; } public boolean visit ( FieldReference fieldReference , BlockScope blockScope ) { if ( checkType ( fieldReference . resolvedType ) ) return false ; return super . visit ( fieldReference , blockScope ) ; } public boolean visit ( ConditionalExpression conditionalExpression , BlockScope blockScope ) { if ( checkType ( conditionalExpression . resolvedType ) ) return false ; return super . visit ( conditionalExpression , blockScope ) ; } public boolean visit ( CastExpression castExpression , BlockScope blockScope ) { if ( checkType ( castExpression . resolvedType ) ) return false ; return super . visit ( castExpression , blockScope ) ; } public boolean visit ( Assignment assignment , BlockScope blockScope ) { if ( checkType ( assignment . resolvedType ) ) return false ; return super . visit ( assignment , blockScope ) ; } public boolean visit ( ArrayReference arrayReference , BlockScope blockScope ) { if ( checkType ( arrayReference . resolvedType ) ) return false ; return super . visit ( arrayReference , blockScope ) ; } } CaptureFinder captureFinder = new CaptureFinder ( ) ; outerParsedUnit . traverse ( captureFinder , outerParsedUnit . scope ) ; this . typeBinding = captureFinder . capture ; } public void consumeException ( ) { this . types = new ArrayList ( ) ; } public void consumeField ( char [ ] fieldName ) { if ( this . typeBinding == null ) return ; FieldBinding [ ] fields = ( ( ReferenceBinding ) this . typeBinding ) . availableFields ( ) ; for ( int i = <NUM_LIT:0> , length = fields . length ; i < length ; i ++ ) { FieldBinding field = fields [ i ] ; if ( CharOperation . equals ( fieldName , field . name ) ) { this . typeBinding = null ; this . compilerBinding = field ; return ; } } } public void consumeParameterizedGenericMethod ( ) { if ( this . methodBinding == null ) return ; TypeBinding [ ] arguments = getTypeBindingArguments ( ) ; if ( arguments == null ) { this . methodBinding = null ; this . compilerBinding = null ; return ; } if ( arguments . length != this . methodBinding . typeVariables ( ) . length ) this . methodBinding = this . environment . createParameterizedGenericMethod ( this . methodBinding , ( RawTypeBinding ) null ) ; else this . methodBinding = this . environment . createParameterizedGenericMethod ( this . methodBinding , arguments ) ; this . compilerBinding = this . methodBinding ; } public void consumeLocalType ( char [ ] uniqueKey ) { LocalTypeBinding [ ] localTypeBindings = this . parsedUnit . localTypes ; for ( int i = <NUM_LIT:0> ; i < this . parsedUnit . localTypeCount ; i ++ ) if ( CharOperation . equals ( uniqueKey , localTypeBindings [ i ] . computeUniqueKey ( false ) ) ) { this . typeBinding = localTypeBindings [ i ] ; return ; } } public void consumeLocalVar ( char [ ] varName , int occurrenceCount ) { if ( this . scope == null ) { if ( this . methodBinding == null ) return ; this . scope = this . methodBinding . sourceMethod ( ) . scope ; } for ( int i = <NUM_LIT:0> ; i < this . scope . localIndex ; i ++ ) { LocalVariableBinding local = this . scope . locals [ i ] ; if ( CharOperation . equals ( local . name , varName ) && occurrenceCount -- == <NUM_LIT:0> ) { this . methodBinding = null ; this . compilerBinding = local ; return ; } } } public void consumeMethod ( char [ ] selector , char [ ] signature ) { if ( this . typeBinding == null ) return ; MethodBinding [ ] methods = ( ( ReferenceBinding ) this . typeBinding ) . availableMethods ( ) ; for ( int i = <NUM_LIT:0> , methodLength = methods . length ; i < methodLength ; i ++ ) { MethodBinding method = methods [ i ] ; if ( CharOperation . equals ( selector , method . selector ) || ( selector . length == <NUM_LIT:0> && method . isConstructor ( ) ) ) { char [ ] methodSignature = method . genericSignature ( ) ; if ( methodSignature == null ) methodSignature = method . signature ( ) ; if ( CharOperation . equals ( signature , methodSignature ) ) { this . typeBinding = null ; this . methodBinding = method ; this . compilerBinding = this . methodBinding ; return ; } else if ( ( method . tagBits & TagBits . AnnotationPolymorphicSignature ) != <NUM_LIT:0> ) { this . typeBinding = null ; char [ ] [ ] typeParameters = Signature . getParameterTypes ( signature ) ; int length = typeParameters . length ; TypeBinding [ ] parameterTypes = new TypeBinding [ length ] ; for ( int j = <NUM_LIT:0> ; j < length ; j ++ ) { parameterTypes [ j ] = getType ( typeParameters [ j ] ) ; } PolymorphicMethodBinding polymorphicMethod = this . environment . createPolymorphicMethod ( method , parameterTypes ) ; this . methodBinding = polymorphicMethod ; this . methodBinding = this . environment . updatePolymorphicMethodReturnType ( polymorphicMethod , getType ( Signature . getReturnType ( signature ) ) ) ; this . compilerBinding = this . methodBinding ; return ; } } } } private TypeBinding getType ( char [ ] type ) { TypeBinding binding = null ; int length = type . length ; switch ( length ) { case <NUM_LIT:1> : switch ( type [ <NUM_LIT:0> ] ) { case '<CHAR_LIT>' : binding = TypeBinding . INT ; break ; case '<CHAR_LIT:Z>' : binding = TypeBinding . BOOLEAN ; break ; case '<CHAR_LIT>' : binding = TypeBinding . VOID ; break ; case '<CHAR_LIT>' : binding = TypeBinding . CHAR ; break ; case '<CHAR_LIT>' : binding = TypeBinding . DOUBLE ; break ; case '<CHAR_LIT>' : binding = TypeBinding . BYTE ; break ; case '<CHAR_LIT>' : binding = TypeBinding . FLOAT ; break ; case '<CHAR_LIT>' : binding = TypeBinding . LONG ; break ; case '<CHAR_LIT>' : binding = TypeBinding . SHORT ; break ; } break ; default : int dimensions = <NUM_LIT:0> ; int start = <NUM_LIT:0> ; while ( type [ start ] == '<CHAR_LIT:[>' ) { start ++ ; dimensions ++ ; } binding = this . environment . getType ( CharOperation . splitOn ( '<CHAR_LIT:/>' , type , start + <NUM_LIT:1> , length - <NUM_LIT:1> ) ) ; if ( dimensions != <NUM_LIT:0> ) { binding = this . environment . createArrayType ( binding , dimensions ) ; } } return binding ; } public void consumeMemberType ( char [ ] simpleTypeName ) { this . typeBinding = getTypeBinding ( simpleTypeName ) ; } public void consumePackage ( char [ ] pkgName ) { this . compoundName = CharOperation . splitOn ( '<CHAR_LIT:/>' , pkgName ) ; this . compilerBinding = new PackageBinding ( this . compoundName , null , this . environment ) ; } public void consumeParameterizedType ( char [ ] simpleTypeName , boolean isRaw ) { if ( this . typeBinding == null ) return ; TypeBinding [ ] arguments = getTypeBindingArguments ( ) ; if ( arguments == null ) { this . typeBinding = null ; this . genericType = null ; return ; } if ( simpleTypeName != null ) { if ( this . genericType == null ) { this . genericType = ( ( ReferenceBinding ) this . typeBinding ) . getMemberType ( simpleTypeName ) ; } else { this . genericType = this . genericType . getMemberType ( simpleTypeName ) ; } if ( ! isRaw ) this . typeBinding = this . environment . createParameterizedType ( this . genericType , arguments , ( ReferenceBinding ) this . typeBinding ) ; else this . typeBinding = this . environment . createRawType ( this . genericType , ( ReferenceBinding ) this . typeBinding ) ; } else { this . genericType = ( ReferenceBinding ) this . typeBinding ; ReferenceBinding enclosing = this . genericType . enclosingType ( ) ; if ( enclosing != null ) enclosing = ( ReferenceBinding ) this . environment . convertToRawType ( enclosing , false ) ; this . typeBinding = this . environment . createParameterizedType ( this . genericType , arguments , enclosing ) ; } } public void consumeParser ( BindingKeyParser parser ) { this . types . add ( parser ) ; } public void consumeScope ( int scopeNumber ) { if ( this . scope == null ) { if ( this . methodBinding == null ) return ; this . scope = this . methodBinding . sourceMethod ( ) . scope ; } if ( scopeNumber >= this . scope . subscopeCount ) return ; this . scope = ( BlockScope ) this . scope . subscopes [ scopeNumber ] ; } public void consumeRawType ( ) { if ( this . typeBinding == null ) return ; this . typeBinding = this . environment . convertToRawType ( this . typeBinding , false ) ; } public void consumeSecondaryType ( char [ ] simpleTypeName ) { this . secondarySimpleName = simpleTypeName ; } public void consumeFullyQualifiedName ( char [ ] fullyQualifiedName ) { this . compoundName = CharOperation . splitOn ( '<CHAR_LIT:/>' , fullyQualifiedName ) ; } public void consumeTopLevelType ( ) { char [ ] fileName ; this . parsedUnit = getCompilationUnitDeclaration ( ) ; if ( this . parsedUnit != null && this . compiler != null && ! this . resolvedUnits . containsKey ( fileName = this . parsedUnit . getFileName ( ) ) ) { this . compiler . process ( this . parsedUnit , this . compiler . totalUnits + <NUM_LIT:1> ) ; this . resolvedUnits . put ( fileName , fileName ) ; } if ( this . parsedUnit == null ) { this . typeBinding = getBinaryBinding ( ) ; } else { char [ ] typeName = this . secondarySimpleName == null ? this . compoundName [ this . compoundName . length - <NUM_LIT:1> ] : this . secondarySimpleName ; this . typeBinding = getTypeBinding ( typeName ) ; } } public void consumeKey ( ) { if ( this . typeBinding != null ) { this . typeBinding = getArrayBinding ( this . dimension , this . typeBinding ) ; this . compilerBinding = this . typeBinding ; } } public void consumeTypeVariable ( char [ ] position , char [ ] typeVariableName ) { if ( position . length > <NUM_LIT:0> ) { if ( this . typeBinding == null ) return ; int pos = Integer . parseInt ( new String ( position ) ) ; MethodBinding [ ] methods = ( ( ReferenceBinding ) this . typeBinding ) . availableMethods ( ) ; if ( methods != null && pos < methods . length ) { this . methodBinding = methods [ pos ] ; } } TypeVariableBinding [ ] typeVariableBindings ; if ( this . methodBinding != null ) { typeVariableBindings = this . methodBinding . typeVariables ( ) ; } else if ( this . typeBinding != null ) { typeVariableBindings = this . typeBinding . typeVariables ( ) ; } else { return ; } for ( int i = <NUM_LIT:0> , length = typeVariableBindings . length ; i < length ; i ++ ) { TypeVariableBinding typeVariableBinding = typeVariableBindings [ i ] ; if ( CharOperation . equals ( typeVariableName , typeVariableBinding . sourceName ( ) ) ) { this . typeBinding = typeVariableBinding ; return ; } } } public void consumeTypeWithCapture ( ) { BindingKeyResolver resolver = ( BindingKeyResolver ) this . types . get ( <NUM_LIT:0> ) ; this . typeBinding = ( TypeBinding ) resolver . compilerBinding ; } public void consumeWildcardRank ( int aRank ) { this . wildcardRank = aRank ; } public void consumeWildCard ( int kind ) { switch ( kind ) { case Wildcard . EXTENDS : case Wildcard . SUPER : BindingKeyResolver boundResolver = ( BindingKeyResolver ) this . types . get ( <NUM_LIT:0> ) ; final Binding boundBinding = boundResolver . compilerBinding ; if ( boundBinding instanceof TypeBinding ) { this . typeBinding = this . environment . createWildcard ( ( ReferenceBinding ) this . typeBinding , this . wildcardRank , ( TypeBinding ) boundBinding , null , kind ) ; } else { this . typeBinding = null ; } break ; case Wildcard . UNBOUND : this . typeBinding = this . environment . createWildcard ( ( ReferenceBinding ) this . typeBinding , this . wildcardRank , null , null , kind ) ; break ; } } public AnnotationBinding getAnnotationBinding ( ) { return this . annotationBinding ; } private TypeBinding getArrayBinding ( int dim , TypeBinding binding ) { if ( binding == null ) return null ; if ( dim == <NUM_LIT:0> ) return binding ; return this . environment . createArrayType ( binding , dim ) ; } private TypeBinding getBaseTypeBinding ( char [ ] signature ) { switch ( signature [ <NUM_LIT:0> ] ) { case '<CHAR_LIT>' : return TypeBinding . INT ; case '<CHAR_LIT:Z>' : return TypeBinding . BOOLEAN ; case '<CHAR_LIT>' : return TypeBinding . VOID ; case '<CHAR_LIT>' : return TypeBinding . CHAR ; case '<CHAR_LIT>' : return TypeBinding . DOUBLE ; case '<CHAR_LIT>' : return TypeBinding . BYTE ; case '<CHAR_LIT>' : return TypeBinding . FLOAT ; case '<CHAR_LIT>' : return TypeBinding . LONG ; case '<CHAR_LIT>' : return TypeBinding . SHORT ; case '<CHAR_LIT>' : return TypeBinding . NULL ; default : return null ; } } private TypeBinding getBinaryBinding ( ) { if ( this . compoundName . length == <NUM_LIT:0> ) return null ; return this . environment . getType ( this . compoundName ) ; } public CompilationUnitDeclaration getCompilationUnitDeclaration ( ) { char [ ] [ ] name = this . compoundName ; if ( name . length == <NUM_LIT:0> ) return null ; if ( this . environment == null ) return null ; ReferenceBinding binding = this . environment . getType ( name ) ; if ( ! ( binding instanceof SourceTypeBinding ) ) { if ( this . secondarySimpleName == null ) return null ; int length = name . length ; System . arraycopy ( name , <NUM_LIT:0> , name = new char [ length ] [ ] , <NUM_LIT:0> , length - <NUM_LIT:1> ) ; name [ length - <NUM_LIT:1> ] = this . secondarySimpleName ; binding = this . environment . getType ( name ) ; if ( ! ( binding instanceof SourceTypeBinding ) ) return null ; } SourceTypeBinding sourceTypeBinding = ( SourceTypeBinding ) binding ; if ( sourceTypeBinding . scope == null ) return null ; return sourceTypeBinding . scope . compilationUnitScope ( ) . referenceContext ; } public Binding getCompilerBinding ( ) { try { parse ( ) ; return this . compilerBinding ; } catch ( RuntimeException e ) { Util . log ( e , "<STR_LIT>" + getKey ( ) ) ; return null ; } } private TypeBinding getTypeBinding ( char [ ] simpleTypeName ) { if ( this . typeBinding instanceof ReferenceBinding ) { return ( ( ReferenceBinding ) this . typeBinding ) . getMemberType ( simpleTypeName ) ; } TypeDeclaration [ ] typeDeclarations = this . typeDeclaration == null ? ( this . parsedUnit == null ? null : this . parsedUnit . types ) : this . typeDeclaration . memberTypes ; if ( typeDeclarations == null ) return null ; for ( int i = <NUM_LIT:0> , length = typeDeclarations . length ; i < length ; i ++ ) { TypeDeclaration declaration = typeDeclarations [ i ] ; if ( CharOperation . equals ( simpleTypeName , declaration . name ) ) { this . typeDeclaration = declaration ; return declaration . binding ; } } return null ; } private TypeBinding [ ] getTypeBindingArguments ( ) { int size = this . types . size ( ) ; TypeBinding [ ] arguments = new TypeBinding [ size ] ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) { BindingKeyResolver resolver = ( BindingKeyResolver ) this . types . get ( i ) ; TypeBinding compilerBinding2 = ( TypeBinding ) resolver . compilerBinding ; if ( compilerBinding2 == null ) { this . types = new ArrayList ( ) ; return null ; } arguments [ i ] = compilerBinding2 ; } this . types = new ArrayList ( ) ; return arguments ; } public void malformedKey ( ) { this . compoundName = CharOperation . NO_CHAR_CHAR ; } public BindingKeyParser newParser ( ) { return new BindingKeyResolver ( this , this . compiler , this . environment , this . outerMostParsedUnit == null ? this . parsedUnit : this . outerMostParsedUnit , this . resolvedUnits ) ; } public String toString ( ) { return getKey ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . core . util . ClassFormatException ; import org . eclipse . jdt . core . util . IAttributeNamesConstants ; import org . eclipse . jdt . core . util . IClassFileAttribute ; import org . eclipse . jdt . core . util . IClassFileReader ; import org . eclipse . jdt . core . util . IConstantPool ; import org . eclipse . jdt . core . util . IConstantPoolConstant ; import org . eclipse . jdt . core . util . IFieldInfo ; import org . eclipse . jdt . core . util . IInnerClassesAttribute ; import org . eclipse . jdt . core . util . IMethodInfo ; import org . eclipse . jdt . core . util . IModifierConstants ; import org . eclipse . jdt . core . util . ISourceAttribute ; import org . eclipse . jdt . internal . compiler . util . Util ; public class ClassFileReader extends ClassFileStruct implements IClassFileReader { private static final IFieldInfo [ ] NO_FIELD_INFOS = new IFieldInfo [ <NUM_LIT:0> ] ; private static final char [ ] [ ] NO_INTERFACES_NAMES = CharOperation . NO_CHAR_CHAR ; private static final IMethodInfo [ ] NO_METHOD_INFOS = new IMethodInfo [ <NUM_LIT:0> ] ; private int accessFlags ; private IClassFileAttribute [ ] attributes ; private int attributesCount ; private char [ ] className ; private int classNameIndex ; private IConstantPool constantPool ; private IFieldInfo [ ] fields ; private int fieldsCount ; private IInnerClassesAttribute innerClassesAttribute ; private int [ ] interfaceIndexes ; private char [ ] [ ] interfaceNames ; private int interfacesCount ; private int magicNumber ; private int majorVersion ; private IMethodInfo [ ] methods ; private int methodsCount ; private int minorVersion ; private ISourceAttribute sourceFileAttribute ; private char [ ] superclassName ; private int superclassNameIndex ; public ClassFileReader ( byte [ ] classFileBytes , int decodingFlags ) throws ClassFormatException { int constantPoolCount ; int [ ] constantPoolOffsets ; try { this . magicNumber = ( int ) u4At ( classFileBytes , <NUM_LIT:0> , <NUM_LIT:0> ) ; if ( this . magicNumber != <NUM_LIT> ) { throw new ClassFormatException ( ClassFormatException . INVALID_MAGIC_NUMBER ) ; } int readOffset = <NUM_LIT:10> ; this . minorVersion = u2At ( classFileBytes , <NUM_LIT:4> , <NUM_LIT:0> ) ; this . majorVersion = u2At ( classFileBytes , <NUM_LIT:6> , <NUM_LIT:0> ) ; if ( ( decodingFlags & IClassFileReader . CONSTANT_POOL ) == <NUM_LIT:0> ) { return ; } constantPoolCount = u2At ( classFileBytes , <NUM_LIT:8> , <NUM_LIT:0> ) ; constantPoolOffsets = new int [ constantPoolCount ] ; for ( int i = <NUM_LIT:1> ; i < constantPoolCount ; i ++ ) { int tag = u1At ( classFileBytes , readOffset , <NUM_LIT:0> ) ; switch ( tag ) { case IConstantPoolConstant . CONSTANT_Utf8 : constantPoolOffsets [ i ] = readOffset ; readOffset += u2At ( classFileBytes , readOffset + <NUM_LIT:1> , <NUM_LIT:0> ) ; readOffset += IConstantPoolConstant . CONSTANT_Utf8_SIZE ; break ; case IConstantPoolConstant . CONSTANT_Integer : constantPoolOffsets [ i ] = readOffset ; readOffset += IConstantPoolConstant . CONSTANT_Integer_SIZE ; break ; case IConstantPoolConstant . CONSTANT_Float : constantPoolOffsets [ i ] = readOffset ; readOffset += IConstantPoolConstant . CONSTANT_Float_SIZE ; break ; case IConstantPoolConstant . CONSTANT_Long : constantPoolOffsets [ i ] = readOffset ; readOffset += IConstantPoolConstant . CONSTANT_Long_SIZE ; i ++ ; break ; case IConstantPoolConstant . CONSTANT_Double : constantPoolOffsets [ i ] = readOffset ; readOffset += IConstantPoolConstant . CONSTANT_Double_SIZE ; i ++ ; break ; case IConstantPoolConstant . CONSTANT_Class : constantPoolOffsets [ i ] = readOffset ; readOffset += IConstantPoolConstant . CONSTANT_Class_SIZE ; break ; case IConstantPoolConstant . CONSTANT_String : constantPoolOffsets [ i ] = readOffset ; readOffset += IConstantPoolConstant . CONSTANT_String_SIZE ; break ; case IConstantPoolConstant . CONSTANT_Fieldref : constantPoolOffsets [ i ] = readOffset ; readOffset += IConstantPoolConstant . CONSTANT_Fieldref_SIZE ; break ; case IConstantPoolConstant . CONSTANT_Methodref : constantPoolOffsets [ i ] = readOffset ; readOffset += IConstantPoolConstant . CONSTANT_Methodref_SIZE ; break ; case IConstantPoolConstant . CONSTANT_InterfaceMethodref : constantPoolOffsets [ i ] = readOffset ; readOffset += IConstantPoolConstant . CONSTANT_InterfaceMethodref_SIZE ; break ; case IConstantPoolConstant . CONSTANT_NameAndType : constantPoolOffsets [ i ] = readOffset ; readOffset += IConstantPoolConstant . CONSTANT_NameAndType_SIZE ; break ; default : throw new ClassFormatException ( ClassFormatException . INVALID_TAG_CONSTANT ) ; } } this . constantPool = new ConstantPool ( classFileBytes , constantPoolOffsets ) ; this . accessFlags = u2At ( classFileBytes , readOffset , <NUM_LIT:0> ) ; readOffset += <NUM_LIT:2> ; this . classNameIndex = u2At ( classFileBytes , readOffset , <NUM_LIT:0> ) ; this . className = getConstantClassNameAt ( classFileBytes , constantPoolOffsets , this . classNameIndex ) ; readOffset += <NUM_LIT:2> ; this . superclassNameIndex = u2At ( classFileBytes , readOffset , <NUM_LIT:0> ) ; readOffset += <NUM_LIT:2> ; if ( this . superclassNameIndex != <NUM_LIT:0> ) { this . superclassName = getConstantClassNameAt ( classFileBytes , constantPoolOffsets , this . superclassNameIndex ) ; } this . interfacesCount = u2At ( classFileBytes , readOffset , <NUM_LIT:0> ) ; readOffset += <NUM_LIT:2> ; this . interfaceNames = NO_INTERFACES_NAMES ; this . interfaceIndexes = Util . EMPTY_INT_ARRAY ; if ( this . interfacesCount != <NUM_LIT:0> ) { if ( ( decodingFlags & IClassFileReader . SUPER_INTERFACES ) != IClassFileReader . CONSTANT_POOL ) { this . interfaceNames = new char [ this . interfacesCount ] [ ] ; this . interfaceIndexes = new int [ this . interfacesCount ] ; for ( int i = <NUM_LIT:0> ; i < this . interfacesCount ; i ++ ) { this . interfaceIndexes [ i ] = u2At ( classFileBytes , readOffset , <NUM_LIT:0> ) ; this . interfaceNames [ i ] = getConstantClassNameAt ( classFileBytes , constantPoolOffsets , this . interfaceIndexes [ i ] ) ; readOffset += <NUM_LIT:2> ; } } else { readOffset += ( <NUM_LIT:2> * this . interfacesCount ) ; } } this . fieldsCount = u2At ( classFileBytes , readOffset , <NUM_LIT:0> ) ; readOffset += <NUM_LIT:2> ; this . fields = NO_FIELD_INFOS ; if ( this . fieldsCount != <NUM_LIT:0> ) { if ( ( decodingFlags & IClassFileReader . FIELD_INFOS ) != IClassFileReader . CONSTANT_POOL ) { FieldInfo field ; this . fields = new FieldInfo [ this . fieldsCount ] ; for ( int i = <NUM_LIT:0> ; i < this . fieldsCount ; i ++ ) { field = new FieldInfo ( classFileBytes , this . constantPool , readOffset ) ; this . fields [ i ] = field ; readOffset += field . sizeInBytes ( ) ; } } else { for ( int i = <NUM_LIT:0> ; i < this . fieldsCount ; i ++ ) { int attributeCountForField = u2At ( classFileBytes , <NUM_LIT:6> , readOffset ) ; readOffset += <NUM_LIT:8> ; if ( attributeCountForField != <NUM_LIT:0> ) { for ( int j = <NUM_LIT:0> ; j < attributeCountForField ; j ++ ) { int attributeLength = ( int ) u4At ( classFileBytes , <NUM_LIT:2> , readOffset ) ; readOffset += ( <NUM_LIT:6> + attributeLength ) ; } } } } } this . methodsCount = u2At ( classFileBytes , readOffset , <NUM_LIT:0> ) ; readOffset += <NUM_LIT:2> ; this . methods = NO_METHOD_INFOS ; if ( this . methodsCount != <NUM_LIT:0> ) { if ( ( decodingFlags & IClassFileReader . METHOD_INFOS ) != IClassFileReader . CONSTANT_POOL ) { this . methods = new MethodInfo [ this . methodsCount ] ; MethodInfo method ; for ( int i = <NUM_LIT:0> ; i < this . methodsCount ; i ++ ) { method = new MethodInfo ( classFileBytes , this . constantPool , readOffset , decodingFlags ) ; this . methods [ i ] = method ; readOffset += method . sizeInBytes ( ) ; } } else { for ( int i = <NUM_LIT:0> ; i < this . methodsCount ; i ++ ) { int attributeCountForMethod = u2At ( classFileBytes , <NUM_LIT:6> , readOffset ) ; readOffset += <NUM_LIT:8> ; if ( attributeCountForMethod != <NUM_LIT:0> ) { for ( int j = <NUM_LIT:0> ; j < attributeCountForMethod ; j ++ ) { int attributeLength = ( int ) u4At ( classFileBytes , <NUM_LIT:2> , readOffset ) ; readOffset += ( <NUM_LIT:6> + attributeLength ) ; } } } } } this . attributesCount = u2At ( classFileBytes , readOffset , <NUM_LIT:0> ) ; readOffset += <NUM_LIT:2> ; int attributesIndex = <NUM_LIT:0> ; this . attributes = ClassFileAttribute . NO_ATTRIBUTES ; if ( this . attributesCount != <NUM_LIT:0> ) { if ( ( decodingFlags & IClassFileReader . CLASSFILE_ATTRIBUTES ) != IClassFileReader . CONSTANT_POOL ) { this . attributes = new IClassFileAttribute [ this . attributesCount ] ; for ( int i = <NUM_LIT:0> ; i < this . attributesCount ; i ++ ) { int utf8Offset = constantPoolOffsets [ u2At ( classFileBytes , readOffset , <NUM_LIT:0> ) ] ; char [ ] attributeName = utf8At ( classFileBytes , utf8Offset + <NUM_LIT:3> , <NUM_LIT:0> , u2At ( classFileBytes , utf8Offset + <NUM_LIT:1> , <NUM_LIT:0> ) ) ; if ( equals ( attributeName , IAttributeNamesConstants . INNER_CLASSES ) ) { this . innerClassesAttribute = new InnerClassesAttribute ( classFileBytes , this . constantPool , readOffset ) ; this . attributes [ attributesIndex ++ ] = this . innerClassesAttribute ; } else if ( equals ( attributeName , IAttributeNamesConstants . SOURCE ) ) { this . sourceFileAttribute = new SourceFileAttribute ( classFileBytes , this . constantPool , readOffset ) ; this . attributes [ attributesIndex ++ ] = this . sourceFileAttribute ; } else if ( equals ( attributeName , IAttributeNamesConstants . ENCLOSING_METHOD ) ) { this . attributes [ attributesIndex ++ ] = new EnclosingMethodAttribute ( classFileBytes , this . constantPool , readOffset ) ; } else if ( equals ( attributeName , IAttributeNamesConstants . SIGNATURE ) ) { this . attributes [ attributesIndex ++ ] = new SignatureAttribute ( classFileBytes , this . constantPool , readOffset ) ; } else if ( equals ( attributeName , IAttributeNamesConstants . RUNTIME_VISIBLE_ANNOTATIONS ) ) { this . attributes [ attributesIndex ++ ] = new RuntimeVisibleAnnotationsAttribute ( classFileBytes , this . constantPool , readOffset ) ; } else if ( equals ( attributeName , IAttributeNamesConstants . RUNTIME_INVISIBLE_ANNOTATIONS ) ) { this . attributes [ attributesIndex ++ ] = new RuntimeInvisibleAnnotationsAttribute ( classFileBytes , this . constantPool , readOffset ) ; } else { this . attributes [ attributesIndex ++ ] = new ClassFileAttribute ( classFileBytes , this . constantPool , readOffset ) ; } readOffset += ( <NUM_LIT:6> + u4At ( classFileBytes , readOffset + <NUM_LIT:2> , <NUM_LIT:0> ) ) ; } } else { for ( int i = <NUM_LIT:0> ; i < this . attributesCount ; i ++ ) { readOffset += ( <NUM_LIT:6> + u4At ( classFileBytes , readOffset + <NUM_LIT:2> , <NUM_LIT:0> ) ) ; } } } if ( readOffset != classFileBytes . length ) { throw new ClassFormatException ( ClassFormatException . TOO_MANY_BYTES ) ; } } catch ( ClassFormatException e ) { throw e ; } catch ( Exception e ) { e . printStackTrace ( ) ; throw new ClassFormatException ( ClassFormatException . ERROR_TRUNCATED_INPUT ) ; } } public int getAccessFlags ( ) { return this . accessFlags ; } public int getAttributeCount ( ) { return this . attributesCount ; } public IClassFileAttribute [ ] getAttributes ( ) { return this . attributes ; } public int getClassIndex ( ) { return this . classNameIndex ; } public char [ ] getClassName ( ) { return this . className ; } private char [ ] getConstantClassNameAt ( byte [ ] classFileBytes , int [ ] constantPoolOffsets , int constantPoolIndex ) { int utf8Offset = constantPoolOffsets [ u2At ( classFileBytes , constantPoolOffsets [ constantPoolIndex ] + <NUM_LIT:1> , <NUM_LIT:0> ) ] ; return utf8At ( classFileBytes , utf8Offset + <NUM_LIT:3> , <NUM_LIT:0> , u2At ( classFileBytes , utf8Offset + <NUM_LIT:1> , <NUM_LIT:0> ) ) ; } public IConstantPool getConstantPool ( ) { return this . constantPool ; } public IFieldInfo [ ] getFieldInfos ( ) { return this . fields ; } public int getFieldsCount ( ) { return this . fieldsCount ; } public IInnerClassesAttribute getInnerClassesAttribute ( ) { return this . innerClassesAttribute ; } public int [ ] getInterfaceIndexes ( ) { return this . interfaceIndexes ; } public char [ ] [ ] getInterfaceNames ( ) { return this . interfaceNames ; } public int getMagic ( ) { return this . magicNumber ; } public int getMajorVersion ( ) { return this . majorVersion ; } public IMethodInfo [ ] getMethodInfos ( ) { return this . methods ; } public int getMethodsCount ( ) { return this . methodsCount ; } public int getMinorVersion ( ) { return this . minorVersion ; } public ISourceAttribute getSourceFileAttribute ( ) { return this . sourceFileAttribute ; } public int getSuperclassIndex ( ) { return this . superclassNameIndex ; } public char [ ] getSuperclassName ( ) { return this . superclassName ; } public boolean isClass ( ) { return ! isInterface ( ) ; } public boolean isInterface ( ) { return ( getAccessFlags ( ) & IModifierConstants . ACC_INTERFACE ) != <NUM_LIT:0> ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . util . IConstantPool ; import org . eclipse . jdt . core . util . IConstantPoolConstant ; import org . eclipse . jdt . core . util . IConstantPoolEntry ; public class ConstantPool extends ClassFileStruct implements IConstantPool { private int constantPoolCount ; private int [ ] constantPoolOffset ; private byte [ ] classFileBytes ; ConstantPool ( byte [ ] reference , int [ ] constantPoolOffset ) { this . constantPoolCount = constantPoolOffset . length ; this . constantPoolOffset = constantPoolOffset ; this . classFileBytes = reference ; } public IConstantPoolEntry decodeEntry ( int index ) { ConstantPoolEntry constantPoolEntry = new ConstantPoolEntry ( ) ; constantPoolEntry . reset ( ) ; int kind = getEntryKind ( index ) ; constantPoolEntry . setKind ( kind ) ; switch ( kind ) { case IConstantPoolConstant . CONSTANT_Class : constantPoolEntry . setClassInfoNameIndex ( u2At ( this . classFileBytes , <NUM_LIT:1> , this . constantPoolOffset [ index ] ) ) ; constantPoolEntry . setClassInfoName ( getUtf8ValueAt ( constantPoolEntry . getClassInfoNameIndex ( ) ) ) ; break ; case IConstantPoolConstant . CONSTANT_Double : constantPoolEntry . setDoubleValue ( doubleAt ( this . classFileBytes , <NUM_LIT:1> , this . constantPoolOffset [ index ] ) ) ; break ; case IConstantPoolConstant . CONSTANT_Fieldref : constantPoolEntry . setClassIndex ( u2At ( this . classFileBytes , <NUM_LIT:1> , this . constantPoolOffset [ index ] ) ) ; int declaringClassIndex = u2At ( this . classFileBytes , <NUM_LIT:1> , this . constantPoolOffset [ constantPoolEntry . getClassIndex ( ) ] ) ; constantPoolEntry . setClassName ( getUtf8ValueAt ( declaringClassIndex ) ) ; constantPoolEntry . setNameAndTypeIndex ( u2At ( this . classFileBytes , <NUM_LIT:3> , this . constantPoolOffset [ index ] ) ) ; int fieldNameIndex = u2At ( this . classFileBytes , <NUM_LIT:1> , this . constantPoolOffset [ constantPoolEntry . getNameAndTypeIndex ( ) ] ) ; int fieldDescriptorIndex = u2At ( this . classFileBytes , <NUM_LIT:3> , this . constantPoolOffset [ constantPoolEntry . getNameAndTypeIndex ( ) ] ) ; constantPoolEntry . setFieldName ( getUtf8ValueAt ( fieldNameIndex ) ) ; constantPoolEntry . setFieldDescriptor ( getUtf8ValueAt ( fieldDescriptorIndex ) ) ; break ; case IConstantPoolConstant . CONSTANT_Methodref : case IConstantPoolConstant . CONSTANT_InterfaceMethodref : constantPoolEntry . setClassIndex ( u2At ( this . classFileBytes , <NUM_LIT:1> , this . constantPoolOffset [ index ] ) ) ; declaringClassIndex = u2At ( this . classFileBytes , <NUM_LIT:1> , this . constantPoolOffset [ constantPoolEntry . getClassIndex ( ) ] ) ; constantPoolEntry . setClassName ( getUtf8ValueAt ( declaringClassIndex ) ) ; constantPoolEntry . setNameAndTypeIndex ( u2At ( this . classFileBytes , <NUM_LIT:3> , this . constantPoolOffset [ index ] ) ) ; int methodNameIndex = u2At ( this . classFileBytes , <NUM_LIT:1> , this . constantPoolOffset [ constantPoolEntry . getNameAndTypeIndex ( ) ] ) ; int methodDescriptorIndex = u2At ( this . classFileBytes , <NUM_LIT:3> , this . constantPoolOffset [ constantPoolEntry . getNameAndTypeIndex ( ) ] ) ; constantPoolEntry . setMethodName ( getUtf8ValueAt ( methodNameIndex ) ) ; constantPoolEntry . setMethodDescriptor ( getUtf8ValueAt ( methodDescriptorIndex ) ) ; break ; case IConstantPoolConstant . CONSTANT_Float : constantPoolEntry . setFloatValue ( floatAt ( this . classFileBytes , <NUM_LIT:1> , this . constantPoolOffset [ index ] ) ) ; break ; case IConstantPoolConstant . CONSTANT_Integer : constantPoolEntry . setIntegerValue ( i4At ( this . classFileBytes , <NUM_LIT:1> , this . constantPoolOffset [ index ] ) ) ; break ; case IConstantPoolConstant . CONSTANT_Long : constantPoolEntry . setLongValue ( i8At ( this . classFileBytes , <NUM_LIT:1> , this . constantPoolOffset [ index ] ) ) ; break ; case IConstantPoolConstant . CONSTANT_NameAndType : constantPoolEntry . setNameAndTypeNameIndex ( u2At ( this . classFileBytes , <NUM_LIT:1> , this . constantPoolOffset [ index ] ) ) ; constantPoolEntry . setNameAndTypeDescriptorIndex ( u2At ( this . classFileBytes , <NUM_LIT:3> , this . constantPoolOffset [ index ] ) ) ; break ; case IConstantPoolConstant . CONSTANT_String : constantPoolEntry . setStringIndex ( u2At ( this . classFileBytes , <NUM_LIT:1> , this . constantPoolOffset [ index ] ) ) ; constantPoolEntry . setStringValue ( getUtf8ValueAt ( constantPoolEntry . getStringIndex ( ) ) ) ; break ; case IConstantPoolConstant . CONSTANT_Utf8 : constantPoolEntry . setUtf8Length ( u2At ( this . classFileBytes , <NUM_LIT:1> , this . constantPoolOffset [ index ] ) ) ; constantPoolEntry . setUtf8Value ( getUtf8ValueAt ( index ) ) ; } return constantPoolEntry ; } public int getConstantPoolCount ( ) { return this . constantPoolCount ; } public int getEntryKind ( int index ) { return u1At ( this . classFileBytes , <NUM_LIT:0> , this . constantPoolOffset [ index ] ) ; } private char [ ] getUtf8ValueAt ( int utf8Index ) { int utf8Offset = this . constantPoolOffset [ utf8Index ] ; return utf8At ( this . classFileBytes , <NUM_LIT:0> , utf8Offset + <NUM_LIT:3> , u2At ( this . classFileBytes , <NUM_LIT:0> , utf8Offset + <NUM_LIT:1> ) ) ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . * ; import org . eclipse . jdt . core . IJavaElement ; import org . eclipse . jdt . core . IMethod ; import org . eclipse . jdt . core . IType ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . ast . * ; import org . eclipse . jdt . internal . compiler . ast . CompilationUnitDeclaration ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . ClassScope ; import org . eclipse . jdt . internal . core . SourceRefElement ; import org . eclipse . jdt . internal . core . SourceType ; public class ASTNodeFinder { private CompilationUnitDeclaration unit ; public ASTNodeFinder ( CompilationUnitDeclaration unit ) { this . unit = unit ; } public FieldDeclaration findField ( IField fieldHandle ) { TypeDeclaration typeDecl = findType ( ( IType ) fieldHandle . getParent ( ) ) ; if ( typeDecl == null ) return null ; FieldDeclaration [ ] fields = typeDecl . fields ; if ( fields != null ) { char [ ] fieldName = fieldHandle . getElementName ( ) . toCharArray ( ) ; for ( int i = <NUM_LIT:0> , length = fields . length ; i < length ; i ++ ) { FieldDeclaration field = fields [ i ] ; if ( CharOperation . equals ( fieldName , field . name ) ) { return field ; } } } return null ; } public Initializer findInitializer ( IInitializer initializerHandle ) { TypeDeclaration typeDecl = findType ( ( IType ) initializerHandle . getParent ( ) ) ; if ( typeDecl == null ) return null ; FieldDeclaration [ ] fields = typeDecl . fields ; if ( fields != null ) { int occurenceCount = ( ( SourceRefElement ) initializerHandle ) . occurrenceCount ; for ( int i = <NUM_LIT:0> , length = fields . length ; i < length ; i ++ ) { FieldDeclaration field = fields [ i ] ; if ( field instanceof Initializer && -- occurenceCount == <NUM_LIT:0> ) { return ( Initializer ) field ; } } } return null ; } public AbstractMethodDeclaration findMethod ( IMethod methodHandle ) { TypeDeclaration typeDecl = findType ( ( IType ) methodHandle . getParent ( ) ) ; if ( typeDecl == null ) return null ; AbstractMethodDeclaration [ ] methods = typeDecl . methods ; if ( methods != null ) { char [ ] selector = methodHandle . getElementName ( ) . toCharArray ( ) ; String [ ] parameterTypeSignatures = methodHandle . getParameterTypes ( ) ; int parameterCount = parameterTypeSignatures . length ; nextMethod : for ( int i = <NUM_LIT:0> , length = methods . length ; i < length ; i ++ ) { AbstractMethodDeclaration method = methods [ i ] ; if ( CharOperation . equals ( selector , method . selector ) ) { Argument [ ] args = method . arguments ; int argsLength = args == null ? <NUM_LIT:0> : args . length ; if ( argsLength == parameterCount ) { for ( int j = <NUM_LIT:0> ; j < parameterCount ; j ++ ) { TypeReference type = args [ j ] . type ; String signature = Util . typeSignature ( type ) ; if ( ! signature . equals ( parameterTypeSignatures [ j ] ) ) { continue nextMethod ; } } return method ; } } } } return null ; } public TypeDeclaration findType ( IType typeHandle ) { IJavaElement parent = typeHandle . getParent ( ) ; final char [ ] typeName = typeHandle . getElementName ( ) . toCharArray ( ) ; final int occurenceCount = ( ( SourceType ) typeHandle ) . occurrenceCount ; final boolean findAnonymous = typeName . length == <NUM_LIT:0> ; class Visitor extends ASTVisitor { TypeDeclaration result ; int count = <NUM_LIT:0> ; public boolean visit ( TypeDeclaration typeDeclaration , BlockScope scope ) { if ( this . result != null ) return false ; if ( ( typeDeclaration . bits & ASTNode . IsAnonymousType ) != <NUM_LIT:0> ) { if ( findAnonymous && ++ this . count == occurenceCount ) { this . result = typeDeclaration ; } } else { if ( ! findAnonymous && CharOperation . equals ( typeName , typeDeclaration . name ) ) { this . result = typeDeclaration ; } } return false ; } } switch ( parent . getElementType ( ) ) { case IJavaElement . COMPILATION_UNIT : TypeDeclaration [ ] types = this . unit . types ; if ( types != null ) { for ( int i = <NUM_LIT:0> , length = types . length ; i < length ; i ++ ) { TypeDeclaration type = types [ i ] ; if ( CharOperation . equals ( typeName , type . name ) ) { return type ; } } } break ; case IJavaElement . TYPE : TypeDeclaration parentDecl = findType ( ( IType ) parent ) ; if ( parentDecl == null ) return null ; types = parentDecl . memberTypes ; if ( types != null ) { for ( int i = <NUM_LIT:0> , length = types . length ; i < length ; i ++ ) { TypeDeclaration type = types [ i ] ; if ( CharOperation . equals ( typeName , type . name ) ) { return type ; } } } break ; case IJavaElement . FIELD : FieldDeclaration fieldDecl = findField ( ( IField ) parent ) ; if ( fieldDecl == null ) return null ; Visitor visitor = new Visitor ( ) ; fieldDecl . traverse ( visitor , null ) ; return visitor . result ; case IJavaElement . INITIALIZER : Initializer initializer = findInitializer ( ( IInitializer ) parent ) ; if ( initializer == null ) return null ; visitor = new Visitor ( ) ; initializer . traverse ( visitor , null ) ; return visitor . result ; case IJavaElement . METHOD : AbstractMethodDeclaration methodDecl = findMethod ( ( IMethod ) parent ) ; if ( methodDecl == null ) return null ; visitor = new Visitor ( ) ; methodDecl . traverse ( visitor , ( ClassScope ) null ) ; return visitor . result ; } return null ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . util . ClassFormatException ; import org . eclipse . jdt . core . util . IAnnotation ; import org . eclipse . jdt . core . util . IConstantPool ; import org . eclipse . jdt . core . util . IRuntimeVisibleAnnotationsAttribute ; public class RuntimeVisibleAnnotationsAttribute extends ClassFileAttribute implements IRuntimeVisibleAnnotationsAttribute { private static final IAnnotation [ ] NO_ENTRIES = new IAnnotation [ <NUM_LIT:0> ] ; private int annotationsNumber ; private IAnnotation [ ] annotations ; public RuntimeVisibleAnnotationsAttribute ( byte [ ] classFileBytes , IConstantPool constantPool , int offset ) throws ClassFormatException { super ( classFileBytes , constantPool , offset ) ; final int length = u2At ( classFileBytes , <NUM_LIT:6> , offset ) ; this . annotationsNumber = length ; if ( length != <NUM_LIT:0> ) { int readOffset = <NUM_LIT:8> ; this . annotations = new IAnnotation [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { Annotation annotation = new Annotation ( classFileBytes , constantPool , offset + readOffset ) ; this . annotations [ i ] = annotation ; readOffset += annotation . sizeInBytes ( ) ; } } else { this . annotations = NO_ENTRIES ; } } public IAnnotation [ ] getAnnotations ( ) { return this . annotations ; } public int getAnnotationsNumber ( ) { return this . annotationsNumber ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . util . ClassFormatException ; import org . eclipse . jdt . core . util . IConstantPool ; import org . eclipse . jdt . core . util . IConstantPoolConstant ; import org . eclipse . jdt . core . util . IConstantPoolEntry ; import org . eclipse . jdt . core . util . IInnerClassesAttributeEntry ; public class InnerClassesAttributeEntry extends ClassFileStruct implements IInnerClassesAttributeEntry { private int innerClassNameIndex ; private int outerClassNameIndex ; private int innerNameIndex ; private char [ ] innerClassName ; private char [ ] outerClassName ; private char [ ] innerName ; private int accessFlags ; public InnerClassesAttributeEntry ( byte classFileBytes [ ] , IConstantPool constantPool , int offset ) throws ClassFormatException { this . innerClassNameIndex = u2At ( classFileBytes , <NUM_LIT:0> , offset ) ; this . outerClassNameIndex = u2At ( classFileBytes , <NUM_LIT:2> , offset ) ; this . innerNameIndex = u2At ( classFileBytes , <NUM_LIT:4> , offset ) ; this . accessFlags = u2At ( classFileBytes , <NUM_LIT:6> , offset ) ; IConstantPoolEntry constantPoolEntry ; if ( this . innerClassNameIndex != <NUM_LIT:0> ) { constantPoolEntry = constantPool . decodeEntry ( this . innerClassNameIndex ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Class ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } this . innerClassName = constantPoolEntry . getClassInfoName ( ) ; } if ( this . outerClassNameIndex != <NUM_LIT:0> ) { constantPoolEntry = constantPool . decodeEntry ( this . outerClassNameIndex ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Class ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } this . outerClassName = constantPoolEntry . getClassInfoName ( ) ; } if ( this . innerNameIndex != <NUM_LIT:0> ) { constantPoolEntry = constantPool . decodeEntry ( this . innerNameIndex ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Utf8 ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } this . innerName = constantPoolEntry . getUtf8Value ( ) ; } } public int getAccessFlags ( ) { return this . accessFlags ; } public char [ ] getInnerClassName ( ) { return this . innerClassName ; } public int getInnerClassNameIndex ( ) { return this . innerClassNameIndex ; } public char [ ] getInnerName ( ) { return this . innerName ; } public int getInnerNameIndex ( ) { return this . innerNameIndex ; } public char [ ] getOuterClassName ( ) { return this . outerClassName ; } public int getOuterClassNameIndex ( ) { return this . outerClassNameIndex ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . internal . core . JavaElement ; public class MementoTokenizer { public static final String COUNT = Character . toString ( JavaElement . JEM_COUNT ) ; public static final String JAVAPROJECT = Character . toString ( JavaElement . JEM_JAVAPROJECT ) ; public static final String PACKAGEFRAGMENTROOT = Character . toString ( JavaElement . JEM_PACKAGEFRAGMENTROOT ) ; public static final String PACKAGEFRAGMENT = Character . toString ( JavaElement . JEM_PACKAGEFRAGMENT ) ; public static final String FIELD = Character . toString ( JavaElement . JEM_FIELD ) ; public static final String METHOD = Character . toString ( JavaElement . JEM_METHOD ) ; public static final String INITIALIZER = Character . toString ( JavaElement . JEM_INITIALIZER ) ; public static final String COMPILATIONUNIT = Character . toString ( JavaElement . JEM_COMPILATIONUNIT ) ; public static final String CLASSFILE = Character . toString ( JavaElement . JEM_CLASSFILE ) ; public static final String TYPE = Character . toString ( JavaElement . JEM_TYPE ) ; public static final String PACKAGEDECLARATION = Character . toString ( JavaElement . JEM_PACKAGEDECLARATION ) ; public static final String IMPORTDECLARATION = Character . toString ( JavaElement . JEM_IMPORTDECLARATION ) ; public static final String LOCALVARIABLE = Character . toString ( JavaElement . JEM_LOCALVARIABLE ) ; public static final String TYPE_PARAMETER = Character . toString ( JavaElement . JEM_TYPE_PARAMETER ) ; public static final String ANNOTATION = Character . toString ( JavaElement . JEM_ANNOTATION ) ; private final char [ ] memento ; private final int length ; private int index = <NUM_LIT:0> ; public MementoTokenizer ( String memento ) { this . memento = memento . toCharArray ( ) ; this . length = this . memento . length ; } public boolean hasMoreTokens ( ) { return this . index < this . length ; } public String nextToken ( ) { int start = this . index ; StringBuffer buffer = null ; switch ( this . memento [ this . index ++ ] ) { case JavaElement . JEM_ESCAPE : buffer = new StringBuffer ( ) ; buffer . append ( this . memento [ this . index ] ) ; start = ++ this . index ; break ; case JavaElement . JEM_COUNT : return COUNT ; case JavaElement . JEM_JAVAPROJECT : return JAVAPROJECT ; case JavaElement . JEM_PACKAGEFRAGMENTROOT : return PACKAGEFRAGMENTROOT ; case JavaElement . JEM_PACKAGEFRAGMENT : return PACKAGEFRAGMENT ; case JavaElement . JEM_FIELD : return FIELD ; case JavaElement . JEM_METHOD : return METHOD ; case JavaElement . JEM_INITIALIZER : return INITIALIZER ; case JavaElement . JEM_COMPILATIONUNIT : return COMPILATIONUNIT ; case JavaElement . JEM_CLASSFILE : return CLASSFILE ; case JavaElement . JEM_TYPE : return TYPE ; case JavaElement . JEM_PACKAGEDECLARATION : return PACKAGEDECLARATION ; case JavaElement . JEM_IMPORTDECLARATION : return IMPORTDECLARATION ; case JavaElement . JEM_LOCALVARIABLE : return LOCALVARIABLE ; case JavaElement . JEM_TYPE_PARAMETER : return TYPE_PARAMETER ; case JavaElement . JEM_ANNOTATION : return ANNOTATION ; } loop : while ( this . index < this . length ) { switch ( this . memento [ this . index ] ) { case JavaElement . JEM_ESCAPE : if ( buffer == null ) buffer = new StringBuffer ( ) ; buffer . append ( this . memento , start , this . index - start ) ; start = ++ this . index ; break ; case JavaElement . JEM_COUNT : case JavaElement . JEM_JAVAPROJECT : case JavaElement . JEM_PACKAGEFRAGMENTROOT : case JavaElement . JEM_PACKAGEFRAGMENT : case JavaElement . JEM_FIELD : case JavaElement . JEM_METHOD : case JavaElement . JEM_INITIALIZER : case JavaElement . JEM_COMPILATIONUNIT : case JavaElement . JEM_CLASSFILE : case JavaElement . JEM_TYPE : case JavaElement . JEM_PACKAGEDECLARATION : case JavaElement . JEM_IMPORTDECLARATION : case JavaElement . JEM_LOCALVARIABLE : case JavaElement . JEM_TYPE_PARAMETER : case JavaElement . JEM_ANNOTATION : break loop ; } this . index ++ ; } if ( buffer != null ) { buffer . append ( this . memento , start , this . index - start ) ; return buffer . toString ( ) ; } else { return new String ( this . memento , start , this . index - start ) ; } } } </s>
<s> package org . eclipse . jdt . internal . core . util ; 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 . CompilationResult ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . parser . NLSTag ; import org . eclipse . jdt . internal . compiler . parser . ScannerHelper ; import org . eclipse . jdt . internal . compiler . parser . TerminalTokens ; import org . eclipse . jdt . internal . compiler . util . Util ; public class PublicScanner implements IScanner , ITerminalSymbols { public long sourceLevel ; public long complianceLevel ; public boolean useAssertAsAnIndentifier = false ; public boolean containsAssertKeyword = false ; public boolean useEnumAsAnIndentifier = false ; public boolean recordLineSeparator = false ; public char currentCharacter ; public int startPosition ; public int currentPosition ; public int initialPosition , eofPosition ; public boolean skipComments = false ; public boolean tokenizeComments = false ; public boolean tokenizeWhiteSpace = false ; public char source [ ] ; public char [ ] withoutUnicodeBuffer ; public int withoutUnicodePtr ; public boolean unicodeAsBackSlash = false ; public boolean scanningFloatLiteral = false ; public final static int COMMENT_ARRAYS_SIZE = <NUM_LIT:30> ; public int [ ] commentStops = new int [ COMMENT_ARRAYS_SIZE ] ; public int [ ] commentStarts = new int [ COMMENT_ARRAYS_SIZE ] ; public int [ ] commentTagStarts = new int [ COMMENT_ARRAYS_SIZE ] ; public int commentPtr = - <NUM_LIT:1> ; protected int lastCommentLinePosition = - <NUM_LIT:1> ; public char [ ] [ ] foundTaskTags = null ; public char [ ] [ ] foundTaskMessages ; public char [ ] [ ] foundTaskPriorities = null ; public int [ ] [ ] foundTaskPositions ; public int foundTaskCount = <NUM_LIT:0> ; public char [ ] [ ] taskTags = null ; public char [ ] [ ] taskPriorities = null ; public boolean isTaskCaseSensitive = true ; public boolean diet = false ; public int [ ] lineEnds = new int [ <NUM_LIT> ] ; public int linePtr = - <NUM_LIT:1> ; public boolean wasAcr = false ; public static final String END_OF_SOURCE = "<STR_LIT>" ; public static final String INVALID_HEXA = "<STR_LIT>" ; public static final String INVALID_OCTAL = "<STR_LIT>" ; public static final String INVALID_CHARACTER_CONSTANT = "<STR_LIT>" ; public static final String INVALID_ESCAPE = "<STR_LIT>" ; public static final String INVALID_INPUT = "<STR_LIT>" ; public static final String INVALID_UNICODE_ESCAPE = "<STR_LIT>" ; public static final String INVALID_FLOAT = "<STR_LIT>" ; public static final String INVALID_LOW_SURROGATE = "<STR_LIT>" ; public static final String INVALID_HIGH_SURROGATE = "<STR_LIT>" ; public static final String NULL_SOURCE_STRING = "<STR_LIT>" ; public static final String UNTERMINATED_STRING = "<STR_LIT>" ; public static final String UNTERMINATED_COMMENT = "<STR_LIT>" ; public static final String INVALID_CHAR_IN_STRING = "<STR_LIT>" ; public static final String INVALID_DIGIT = "<STR_LIT>" ; private static final int [ ] EMPTY_LINE_ENDS = Util . EMPTY_INT_ARRAY ; public static final String INVALID_BINARY = "<STR_LIT>" ; public static final String BINARY_LITERAL_NOT_BELOW_17 = "<STR_LIT>" ; public static final String ILLEGAL_HEXA_LITERAL = "<STR_LIT>" ; public static final String INVALID_UNDERSCORE = "<STR_LIT>" ; public static final String UNDERSCORES_IN_LITERALS_NOT_BELOW_17 = "<STR_LIT>" ; static final char [ ] charArray_a = new char [ ] { '<CHAR_LIT:a>' } , charArray_b = new char [ ] { '<CHAR_LIT:b>' } , charArray_c = new char [ ] { '<CHAR_LIT:c>' } , charArray_d = new char [ ] { '<CHAR_LIT>' } , charArray_e = new char [ ] { '<CHAR_LIT:e>' } , charArray_f = new char [ ] { '<CHAR_LIT>' } , charArray_g = new char [ ] { '<CHAR_LIT>' } , charArray_h = new char [ ] { '<CHAR_LIT>' } , charArray_i = new char [ ] { '<CHAR_LIT>' } , charArray_j = new char [ ] { '<CHAR_LIT>' } , charArray_k = new char [ ] { '<CHAR_LIT>' } , charArray_l = new char [ ] { '<CHAR_LIT>' } , charArray_m = new char [ ] { '<CHAR_LIT>' } , charArray_n = new char [ ] { '<CHAR_LIT>' } , charArray_o = new char [ ] { '<CHAR_LIT>' } , charArray_p = new char [ ] { '<CHAR_LIT>' } , charArray_q = new char [ ] { '<CHAR_LIT>' } , charArray_r = new char [ ] { '<CHAR_LIT>' } , charArray_s = new char [ ] { '<CHAR_LIT>' } , charArray_t = new char [ ] { '<CHAR_LIT>' } , charArray_u = new char [ ] { '<CHAR_LIT>' } , charArray_v = new char [ ] { '<CHAR_LIT>' } , charArray_w = new char [ ] { '<CHAR_LIT>' } , charArray_x = new char [ ] { '<CHAR_LIT>' } , charArray_y = new char [ ] { '<CHAR_LIT>' } , charArray_z = new char [ ] { '<CHAR_LIT>' } ; static final char [ ] initCharArray = new char [ ] { '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' } ; static final int TableSize = <NUM_LIT:30> , InternalTableSize = <NUM_LIT:6> ; public static final int OptimizedLength = <NUM_LIT:7> ; public final char [ ] [ ] [ ] [ ] charArray_length = new char [ OptimizedLength ] [ TableSize ] [ InternalTableSize ] [ ] ; public static final char [ ] TAG_PREFIX = "<STR_LIT>" . toCharArray ( ) ; public static final int TAG_PREFIX_LENGTH = TAG_PREFIX . length ; public static final char TAG_POSTFIX = '<CHAR_LIT>' ; public static final int TAG_POSTFIX_LENGTH = <NUM_LIT:1> ; private NLSTag [ ] nlsTags = null ; protected int nlsTagsPtr ; public boolean checkNonExternalizedStringLiterals ; protected int lastPosition ; public boolean returnOnlyGreater = false ; { for ( int i = <NUM_LIT:0> ; i < <NUM_LIT:6> ; i ++ ) { for ( int j = <NUM_LIT:0> ; j < TableSize ; j ++ ) { for ( int k = <NUM_LIT:0> ; k < InternalTableSize ; k ++ ) { this . charArray_length [ i ] [ j ] [ k ] = initCharArray ; } } } } int newEntry2 = <NUM_LIT:0> , newEntry3 = <NUM_LIT:0> , newEntry4 = <NUM_LIT:0> , newEntry5 = <NUM_LIT:0> , newEntry6 = <NUM_LIT:0> ; public boolean insideRecovery = false ; public static final int RoundBracket = <NUM_LIT:0> ; public static final int SquareBracket = <NUM_LIT:1> ; public static final int CurlyBracket = <NUM_LIT:2> ; public static final int BracketKinds = <NUM_LIT:3> ; public static final int LOW_SURROGATE_MIN_VALUE = <NUM_LIT> ; public static final int HIGH_SURROGATE_MIN_VALUE = <NUM_LIT> ; public static final int HIGH_SURROGATE_MAX_VALUE = <NUM_LIT> ; public static final int LOW_SURROGATE_MAX_VALUE = <NUM_LIT> ; public PublicScanner ( ) { this ( false , false , false , ClassFileConstants . JDK1_3 , null , null , true ) ; } public PublicScanner ( boolean tokenizeComments , boolean tokenizeWhiteSpace , boolean checkNonExternalizedStringLiterals , long sourceLevel , long complianceLevel , char [ ] [ ] taskTags , char [ ] [ ] taskPriorities , boolean isTaskCaseSensitive ) { this . eofPosition = Integer . MAX_VALUE ; this . tokenizeComments = tokenizeComments ; this . tokenizeWhiteSpace = tokenizeWhiteSpace ; this . sourceLevel = sourceLevel ; this . complianceLevel = complianceLevel ; this . checkNonExternalizedStringLiterals = checkNonExternalizedStringLiterals ; if ( taskTags != null ) { int taskTagsLength = taskTags . length ; int length = taskTagsLength ; if ( taskPriorities != null ) { int taskPrioritiesLength = taskPriorities . length ; if ( taskPrioritiesLength != taskTagsLength ) { if ( taskPrioritiesLength > taskTagsLength ) { System . arraycopy ( taskPriorities , <NUM_LIT:0> , ( taskPriorities = new char [ taskTagsLength ] [ ] ) , <NUM_LIT:0> , taskTagsLength ) ; } else { System . arraycopy ( taskTags , <NUM_LIT:0> , ( taskTags = new char [ taskPrioritiesLength ] [ ] ) , <NUM_LIT:0> , taskPrioritiesLength ) ; length = taskPrioritiesLength ; } } int [ ] initialIndexes = new int [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { initialIndexes [ i ] = i ; } Util . reverseQuickSort ( taskTags , <NUM_LIT:0> , length - <NUM_LIT:1> , initialIndexes ) ; char [ ] [ ] temp = new char [ length ] [ ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { temp [ i ] = taskPriorities [ initialIndexes [ i ] ] ; } this . taskPriorities = temp ; } else { Util . reverseQuickSort ( taskTags , <NUM_LIT:0> , length - <NUM_LIT:1> ) ; } this . taskTags = taskTags ; this . isTaskCaseSensitive = isTaskCaseSensitive ; } } public PublicScanner ( boolean tokenizeComments , boolean tokenizeWhiteSpace , boolean checkNonExternalizedStringLiterals , long sourceLevel , char [ ] [ ] taskTags , char [ ] [ ] taskPriorities , boolean isTaskCaseSensitive ) { this ( tokenizeComments , tokenizeWhiteSpace , checkNonExternalizedStringLiterals , sourceLevel , sourceLevel , taskTags , taskPriorities , isTaskCaseSensitive ) ; } public final boolean atEnd ( ) { return this . eofPosition <= this . currentPosition ; } public void checkTaskTag ( int commentStart , int commentEnd ) throws InvalidInputException { char [ ] src = this . source ; if ( this . foundTaskCount > <NUM_LIT:0> && this . foundTaskPositions [ this . foundTaskCount - <NUM_LIT:1> ] [ <NUM_LIT:0> ] >= commentStart ) { return ; } int foundTaskIndex = this . foundTaskCount ; char previous = src [ commentStart + <NUM_LIT:1> ] ; for ( int i = commentStart + <NUM_LIT:2> ; i < commentEnd && i < this . eofPosition ; i ++ ) { char [ ] tag = null ; char [ ] priority = null ; if ( previous != '<CHAR_LIT>' ) { nextTag : for ( int itag = <NUM_LIT:0> ; itag < this . taskTags . length ; itag ++ ) { tag = this . taskTags [ itag ] ; int tagLength = tag . length ; if ( tagLength == <NUM_LIT:0> ) continue nextTag ; if ( ScannerHelper . isJavaIdentifierStart ( this . complianceLevel , tag [ <NUM_LIT:0> ] ) ) { if ( ScannerHelper . isJavaIdentifierPart ( this . complianceLevel , previous ) ) { continue nextTag ; } } for ( int t = <NUM_LIT:0> ; t < tagLength ; t ++ ) { char sc , tc ; int x = i + t ; if ( x >= this . eofPosition || x >= commentEnd ) continue nextTag ; if ( ( sc = src [ i + t ] ) != ( tc = tag [ t ] ) ) { if ( this . isTaskCaseSensitive || ( ScannerHelper . toLowerCase ( sc ) != ScannerHelper . toLowerCase ( tc ) ) ) { continue nextTag ; } } } if ( i + tagLength < commentEnd && ScannerHelper . isJavaIdentifierPart ( this . complianceLevel , src [ i + tagLength - <NUM_LIT:1> ] ) ) { if ( ScannerHelper . isJavaIdentifierPart ( this . complianceLevel , src [ i + tagLength ] ) ) continue nextTag ; } if ( this . foundTaskTags == null ) { this . foundTaskTags = new char [ <NUM_LIT:5> ] [ ] ; this . foundTaskMessages = new char [ <NUM_LIT:5> ] [ ] ; this . foundTaskPriorities = new char [ <NUM_LIT:5> ] [ ] ; this . foundTaskPositions = new int [ <NUM_LIT:5> ] [ ] ; } else if ( this . foundTaskCount == this . foundTaskTags . length ) { System . arraycopy ( this . foundTaskTags , <NUM_LIT:0> , this . foundTaskTags = new char [ this . foundTaskCount * <NUM_LIT:2> ] [ ] , <NUM_LIT:0> , this . foundTaskCount ) ; System . arraycopy ( this . foundTaskMessages , <NUM_LIT:0> , this . foundTaskMessages = new char [ this . foundTaskCount * <NUM_LIT:2> ] [ ] , <NUM_LIT:0> , this . foundTaskCount ) ; System . arraycopy ( this . foundTaskPriorities , <NUM_LIT:0> , this . foundTaskPriorities = new char [ this . foundTaskCount * <NUM_LIT:2> ] [ ] , <NUM_LIT:0> , this . foundTaskCount ) ; System . arraycopy ( this . foundTaskPositions , <NUM_LIT:0> , this . foundTaskPositions = new int [ this . foundTaskCount * <NUM_LIT:2> ] [ ] , <NUM_LIT:0> , this . foundTaskCount ) ; } priority = this . taskPriorities != null && itag < this . taskPriorities . length ? this . taskPriorities [ itag ] : null ; this . foundTaskTags [ this . foundTaskCount ] = tag ; this . foundTaskPriorities [ this . foundTaskCount ] = priority ; this . foundTaskPositions [ this . foundTaskCount ] = new int [ ] { i , i + tagLength - <NUM_LIT:1> } ; this . foundTaskMessages [ this . foundTaskCount ] = CharOperation . NO_CHAR ; this . foundTaskCount ++ ; i += tagLength - <NUM_LIT:1> ; break nextTag ; } } previous = src [ i ] ; } boolean containsEmptyTask = false ; for ( int i = foundTaskIndex ; i < this . foundTaskCount ; i ++ ) { int msgStart = this . foundTaskPositions [ i ] [ <NUM_LIT:0> ] + this . foundTaskTags [ i ] . length ; int max_value = i + <NUM_LIT:1> < this . foundTaskCount ? this . foundTaskPositions [ i + <NUM_LIT:1> ] [ <NUM_LIT:0> ] - <NUM_LIT:1> : commentEnd - <NUM_LIT:1> ; if ( max_value < msgStart ) { max_value = msgStart ; } int end = - <NUM_LIT:1> ; char c ; for ( int j = msgStart ; j < max_value ; j ++ ) { if ( ( c = src [ j ] ) == '<STR_LIT:\n>' || c == '<STR_LIT>' ) { end = j - <NUM_LIT:1> ; break ; } } if ( end == - <NUM_LIT:1> ) { for ( int j = max_value ; j > msgStart ; j -- ) { if ( ( c = src [ j ] ) == '<CHAR_LIT>' ) { end = j - <NUM_LIT:1> ; break ; } } if ( end == - <NUM_LIT:1> ) end = max_value ; } if ( msgStart == end ) { containsEmptyTask = true ; continue ; } while ( CharOperation . isWhitespace ( src [ end ] ) && msgStart <= end ) end -- ; this . foundTaskPositions [ i ] [ <NUM_LIT:1> ] = end ; final int messageLength = end - msgStart + <NUM_LIT:1> ; char [ ] message = new char [ messageLength ] ; System . arraycopy ( src , msgStart , message , <NUM_LIT:0> , messageLength ) ; this . foundTaskMessages [ i ] = message ; } if ( containsEmptyTask ) { for ( int i = foundTaskIndex , max = this . foundTaskCount ; i < max ; i ++ ) { if ( this . foundTaskMessages [ i ] . length == <NUM_LIT:0> ) { loop : for ( int j = i + <NUM_LIT:1> ; j < max ; j ++ ) { if ( this . foundTaskMessages [ j ] . length != <NUM_LIT:0> ) { this . foundTaskMessages [ i ] = this . foundTaskMessages [ j ] ; this . foundTaskPositions [ i ] [ <NUM_LIT:1> ] = this . foundTaskPositions [ j ] [ <NUM_LIT:1> ] ; break loop ; } } } } } } public char [ ] getCurrentIdentifierSource ( ) { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { char [ ] result = new char [ this . withoutUnicodePtr ] ; System . arraycopy ( this . withoutUnicodeBuffer , <NUM_LIT:1> , result , <NUM_LIT:0> , this . withoutUnicodePtr ) ; return result ; } int length = this . currentPosition - this . startPosition ; if ( length == this . eofPosition ) return this . source ; switch ( length ) { case <NUM_LIT:1> : return optimizedCurrentTokenSource1 ( ) ; case <NUM_LIT:2> : return optimizedCurrentTokenSource2 ( ) ; case <NUM_LIT:3> : return optimizedCurrentTokenSource3 ( ) ; case <NUM_LIT:4> : return optimizedCurrentTokenSource4 ( ) ; case <NUM_LIT:5> : return optimizedCurrentTokenSource5 ( ) ; case <NUM_LIT:6> : return optimizedCurrentTokenSource6 ( ) ; } char [ ] result = new char [ length ] ; System . arraycopy ( this . source , this . startPosition , result , <NUM_LIT:0> , length ) ; return result ; } public int getCurrentTokenEndPosition ( ) { return this . currentPosition - <NUM_LIT:1> ; } public char [ ] getCurrentTokenSource ( ) { char [ ] result ; if ( this . withoutUnicodePtr != <NUM_LIT:0> ) System . arraycopy ( this . withoutUnicodeBuffer , <NUM_LIT:1> , result = new char [ this . withoutUnicodePtr ] , <NUM_LIT:0> , this . withoutUnicodePtr ) ; else { int length ; System . arraycopy ( this . source , this . startPosition , result = new char [ length = this . currentPosition - this . startPosition ] , <NUM_LIT:0> , length ) ; } return result ; } public final String getCurrentTokenString ( ) { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { return new String ( this . withoutUnicodeBuffer , <NUM_LIT:1> , this . withoutUnicodePtr ) ; } return new String ( this . source , this . startPosition , this . currentPosition - this . startPosition ) ; } public char [ ] getCurrentTokenSourceString ( ) { char [ ] result ; if ( this . withoutUnicodePtr != <NUM_LIT:0> ) System . arraycopy ( this . withoutUnicodeBuffer , <NUM_LIT:2> , result = new char [ this . withoutUnicodePtr - <NUM_LIT:2> ] , <NUM_LIT:0> , this . withoutUnicodePtr - <NUM_LIT:2> ) ; else { int length ; System . arraycopy ( this . source , this . startPosition + <NUM_LIT:1> , result = new char [ length = this . currentPosition - this . startPosition - <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; } return result ; } public final String getCurrentStringLiteral ( ) { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) return new String ( this . withoutUnicodeBuffer , <NUM_LIT:2> , this . withoutUnicodePtr - <NUM_LIT:2> ) ; else { return new String ( this . source , this . startPosition + <NUM_LIT:1> , this . currentPosition - this . startPosition - <NUM_LIT:2> ) ; } } public final char [ ] getRawTokenSource ( ) { int length = this . currentPosition - this . startPosition ; char [ ] tokenSource = new char [ length ] ; System . arraycopy ( this . source , this . startPosition , tokenSource , <NUM_LIT:0> , length ) ; return tokenSource ; } public final char [ ] getRawTokenSourceEnd ( ) { int length = this . eofPosition - this . currentPosition - <NUM_LIT:1> ; char [ ] sourceEnd = new char [ length ] ; System . arraycopy ( this . source , this . currentPosition , sourceEnd , <NUM_LIT:0> , length ) ; return sourceEnd ; } public int getCurrentTokenStartPosition ( ) { return this . startPosition ; } public final int getLineEnd ( int lineNumber ) { if ( this . lineEnds == null || this . linePtr == - <NUM_LIT:1> ) return - <NUM_LIT:1> ; if ( lineNumber > this . lineEnds . length + <NUM_LIT:1> ) return - <NUM_LIT:1> ; if ( lineNumber <= <NUM_LIT:0> ) return - <NUM_LIT:1> ; if ( lineNumber == this . lineEnds . length + <NUM_LIT:1> ) return this . eofPosition ; return this . lineEnds [ lineNumber - <NUM_LIT:1> ] ; } public final int [ ] getLineEnds ( ) { if ( this . linePtr == - <NUM_LIT:1> ) { return EMPTY_LINE_ENDS ; } int [ ] copy ; System . arraycopy ( this . lineEnds , <NUM_LIT:0> , copy = new int [ this . linePtr + <NUM_LIT:1> ] , <NUM_LIT:0> , this . linePtr + <NUM_LIT:1> ) ; return copy ; } public final int getLineStart ( int lineNumber ) { if ( this . lineEnds == null || this . linePtr == - <NUM_LIT:1> ) return - <NUM_LIT:1> ; if ( lineNumber > this . lineEnds . length + <NUM_LIT:1> ) return - <NUM_LIT:1> ; if ( lineNumber <= <NUM_LIT:0> ) return - <NUM_LIT:1> ; if ( lineNumber == <NUM_LIT:1> ) return this . initialPosition ; return this . lineEnds [ lineNumber - <NUM_LIT:2> ] + <NUM_LIT:1> ; } public final int getNextChar ( ) { try { if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; } else { this . unicodeAsBackSlash = false ; if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } return this . currentCharacter ; } catch ( IndexOutOfBoundsException e ) { return - <NUM_LIT:1> ; } catch ( InvalidInputException e ) { return - <NUM_LIT:1> ; } } public final int getNextCharWithBoundChecks ( ) { if ( this . currentPosition >= this . eofPosition ) { return - <NUM_LIT:1> ; } this . currentCharacter = this . source [ this . currentPosition ++ ] ; if ( this . currentPosition >= this . eofPosition ) { this . unicodeAsBackSlash = false ; if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } return this . currentCharacter ; } if ( this . currentCharacter == '<STR_LIT:\\>' && this . source [ this . currentPosition ] == '<CHAR_LIT>' ) { try { getNextUnicodeChar ( ) ; } catch ( InvalidInputException e ) { return - <NUM_LIT:1> ; } } else { this . unicodeAsBackSlash = false ; if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } return this . currentCharacter ; } public final boolean getNextChar ( char testedChar ) { if ( this . currentPosition >= this . eofPosition ) { this . unicodeAsBackSlash = false ; return false ; } int temp = this . currentPosition ; try { if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; if ( this . currentCharacter != testedChar ) { this . currentPosition = temp ; this . withoutUnicodePtr -- ; return false ; } return true ; } else { if ( this . currentCharacter != testedChar ) { this . currentPosition = temp ; return false ; } this . unicodeAsBackSlash = false ; if ( this . withoutUnicodePtr != <NUM_LIT:0> ) unicodeStore ( ) ; return true ; } } catch ( IndexOutOfBoundsException e ) { this . unicodeAsBackSlash = false ; this . currentPosition = temp ; return false ; } catch ( InvalidInputException e ) { this . unicodeAsBackSlash = false ; this . currentPosition = temp ; return false ; } } public final int getNextChar ( char testedChar1 , char testedChar2 ) { if ( this . currentPosition >= this . eofPosition ) return - <NUM_LIT:1> ; int temp = this . currentPosition ; try { int result ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; if ( this . currentCharacter == testedChar1 ) { result = <NUM_LIT:0> ; } else if ( this . currentCharacter == testedChar2 ) { result = <NUM_LIT:1> ; } else { this . currentPosition = temp ; this . withoutUnicodePtr -- ; result = - <NUM_LIT:1> ; } return result ; } else { if ( this . currentCharacter == testedChar1 ) { result = <NUM_LIT:0> ; } else if ( this . currentCharacter == testedChar2 ) { result = <NUM_LIT:1> ; } else { this . currentPosition = temp ; return - <NUM_LIT:1> ; } if ( this . withoutUnicodePtr != <NUM_LIT:0> ) unicodeStore ( ) ; return result ; } } catch ( IndexOutOfBoundsException e ) { this . currentPosition = temp ; return - <NUM_LIT:1> ; } catch ( InvalidInputException e ) { this . currentPosition = temp ; return - <NUM_LIT:1> ; } } private final void consumeDigits ( int radix ) throws InvalidInputException { consumeDigits ( radix , false ) ; } private final void consumeDigits ( int radix , boolean expectingDigitFirst ) throws InvalidInputException { final int USING_UNDERSCORE = <NUM_LIT:1> ; final int INVALID_POSITION = <NUM_LIT:2> ; switch ( consumeDigits0 ( radix , USING_UNDERSCORE , INVALID_POSITION , expectingDigitFirst ) ) { case USING_UNDERSCORE : if ( this . sourceLevel < ClassFileConstants . JDK1_7 ) { throw new InvalidInputException ( UNDERSCORES_IN_LITERALS_NOT_BELOW_17 ) ; } break ; case INVALID_POSITION : if ( this . sourceLevel < ClassFileConstants . JDK1_7 ) { throw new InvalidInputException ( UNDERSCORES_IN_LITERALS_NOT_BELOW_17 ) ; } throw new InvalidInputException ( INVALID_UNDERSCORE ) ; } } private final int consumeDigits0 ( int radix , int usingUnderscore , int invalidPosition , boolean expectingDigitFirst ) throws InvalidInputException { int kind = <NUM_LIT:0> ; if ( getNextChar ( '<CHAR_LIT:_>' ) ) { if ( expectingDigitFirst ) { return invalidPosition ; } kind = usingUnderscore ; while ( getNextChar ( '<CHAR_LIT:_>' ) ) { } } if ( getNextCharAsDigit ( radix ) ) { while ( getNextCharAsDigit ( radix ) ) { } int kind2 = consumeDigits0 ( radix , usingUnderscore , invalidPosition , false ) ; if ( kind2 == <NUM_LIT:0> ) { return kind ; } return kind2 ; } if ( kind == usingUnderscore ) return invalidPosition ; return kind ; } public final boolean getNextCharAsDigit ( ) throws InvalidInputException { if ( this . currentPosition >= this . eofPosition ) return false ; int temp = this . currentPosition ; try { if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; if ( ! ScannerHelper . isDigit ( this . currentCharacter ) ) { this . currentPosition = temp ; this . withoutUnicodePtr -- ; return false ; } return true ; } else { if ( ! ScannerHelper . isDigit ( this . currentCharacter ) ) { this . currentPosition = temp ; return false ; } if ( this . withoutUnicodePtr != <NUM_LIT:0> ) unicodeStore ( ) ; return true ; } } catch ( IndexOutOfBoundsException e ) { this . currentPosition = temp ; return false ; } catch ( InvalidInputException e ) { this . currentPosition = temp ; return false ; } } public final boolean getNextCharAsDigit ( int radix ) { if ( this . currentPosition >= this . eofPosition ) return false ; int temp = this . currentPosition ; try { if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; if ( ScannerHelper . digit ( this . currentCharacter , radix ) == - <NUM_LIT:1> ) { this . currentPosition = temp ; this . withoutUnicodePtr -- ; return false ; } return true ; } else { if ( ScannerHelper . digit ( this . currentCharacter , radix ) == - <NUM_LIT:1> ) { this . currentPosition = temp ; return false ; } if ( this . withoutUnicodePtr != <NUM_LIT:0> ) unicodeStore ( ) ; return true ; } } catch ( IndexOutOfBoundsException e ) { this . currentPosition = temp ; return false ; } catch ( InvalidInputException e ) { this . currentPosition = temp ; return false ; } } public boolean getNextCharAsJavaIdentifierPartWithBoundCheck ( ) { int pos = this . currentPosition ; if ( pos >= this . eofPosition ) return false ; int temp2 = this . withoutUnicodePtr ; try { boolean unicode = false ; this . currentCharacter = this . source [ this . currentPosition ++ ] ; if ( this . currentPosition < this . eofPosition ) { if ( this . currentCharacter == '<STR_LIT:\\>' && this . source [ this . currentPosition ] == '<CHAR_LIT>' ) { getNextUnicodeChar ( ) ; unicode = true ; } } char c = this . currentCharacter ; boolean isJavaIdentifierPart = false ; if ( c >= HIGH_SURROGATE_MIN_VALUE && c <= HIGH_SURROGATE_MAX_VALUE ) { if ( this . complianceLevel < ClassFileConstants . JDK1_5 ) { this . currentPosition = pos ; this . withoutUnicodePtr = temp2 ; return false ; } char low = ( char ) getNextCharWithBoundChecks ( ) ; if ( low < LOW_SURROGATE_MIN_VALUE || low > LOW_SURROGATE_MAX_VALUE ) { this . currentPosition = pos ; this . withoutUnicodePtr = temp2 ; return false ; } isJavaIdentifierPart = ScannerHelper . isJavaIdentifierPart ( this . complianceLevel , c , low ) ; } else if ( c >= LOW_SURROGATE_MIN_VALUE && c <= LOW_SURROGATE_MAX_VALUE ) { this . currentPosition = pos ; this . withoutUnicodePtr = temp2 ; return false ; } else { isJavaIdentifierPart = ScannerHelper . isJavaIdentifierPart ( this . complianceLevel , c ) ; } if ( unicode ) { if ( ! isJavaIdentifierPart ) { this . currentPosition = pos ; this . withoutUnicodePtr = temp2 ; return false ; } return true ; } else { if ( ! isJavaIdentifierPart ) { this . currentPosition = pos ; return false ; } if ( this . withoutUnicodePtr != <NUM_LIT:0> ) unicodeStore ( ) ; return true ; } } catch ( InvalidInputException e ) { this . currentPosition = pos ; this . withoutUnicodePtr = temp2 ; return false ; } } public boolean getNextCharAsJavaIdentifierPart ( ) { int pos ; if ( ( pos = this . currentPosition ) >= this . eofPosition ) return false ; int temp2 = this . withoutUnicodePtr ; try { boolean unicode = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; unicode = true ; } char c = this . currentCharacter ; boolean isJavaIdentifierPart = false ; if ( c >= HIGH_SURROGATE_MIN_VALUE && c <= HIGH_SURROGATE_MAX_VALUE ) { if ( this . complianceLevel < ClassFileConstants . JDK1_5 ) { this . currentPosition = pos ; this . withoutUnicodePtr = temp2 ; return false ; } char low = ( char ) getNextChar ( ) ; if ( low < LOW_SURROGATE_MIN_VALUE || low > LOW_SURROGATE_MAX_VALUE ) { this . currentPosition = pos ; this . withoutUnicodePtr = temp2 ; return false ; } isJavaIdentifierPart = ScannerHelper . isJavaIdentifierPart ( this . complianceLevel , c , low ) ; } else if ( c >= LOW_SURROGATE_MIN_VALUE && c <= LOW_SURROGATE_MAX_VALUE ) { this . currentPosition = pos ; this . withoutUnicodePtr = temp2 ; return false ; } else { isJavaIdentifierPart = ScannerHelper . isJavaIdentifierPart ( this . complianceLevel , c ) ; } if ( unicode ) { if ( ! isJavaIdentifierPart ) { this . currentPosition = pos ; this . withoutUnicodePtr = temp2 ; return false ; } return true ; } else { if ( ! isJavaIdentifierPart ) { this . currentPosition = pos ; return false ; } if ( this . withoutUnicodePtr != <NUM_LIT:0> ) unicodeStore ( ) ; return true ; } } catch ( IndexOutOfBoundsException e ) { this . currentPosition = pos ; this . withoutUnicodePtr = temp2 ; return false ; } catch ( InvalidInputException e ) { this . currentPosition = pos ; this . withoutUnicodePtr = temp2 ; return false ; } } public int scanIdentifier ( ) throws InvalidInputException { int whiteStart = <NUM_LIT:0> ; while ( true ) { this . withoutUnicodePtr = <NUM_LIT:0> ; whiteStart = this . currentPosition ; boolean isWhiteSpace , hasWhiteSpaces = false ; int offset ; int unicodePtr ; boolean checkIfUnicode = false ; do { unicodePtr = this . withoutUnicodePtr ; offset = this . currentPosition ; this . startPosition = this . currentPosition ; if ( this . currentPosition < this . eofPosition ) { this . currentCharacter = this . source [ this . currentPosition ++ ] ; checkIfUnicode = this . currentPosition < this . eofPosition && this . currentCharacter == '<STR_LIT:\\>' && this . source [ this . currentPosition ] == '<CHAR_LIT>' ; } else if ( this . tokenizeWhiteSpace && ( whiteStart != this . currentPosition - <NUM_LIT:1> ) ) { this . currentPosition -- ; this . startPosition = whiteStart ; return TokenNameWHITESPACE ; } else { return TokenNameEOF ; } if ( checkIfUnicode ) { isWhiteSpace = jumpOverUnicodeWhiteSpace ( ) ; offset = this . currentPosition - offset ; } else { offset = this . currentPosition - offset ; switch ( this . currentCharacter ) { case <NUM_LIT:10> : case <NUM_LIT:12> : case <NUM_LIT> : case <NUM_LIT:32> : case <NUM_LIT:9> : isWhiteSpace = true ; break ; default : isWhiteSpace = false ; } } if ( isWhiteSpace ) { hasWhiteSpaces = true ; } } while ( isWhiteSpace ) ; if ( hasWhiteSpaces ) { if ( this . tokenizeWhiteSpace ) { this . currentPosition -= offset ; this . startPosition = whiteStart ; if ( checkIfUnicode ) { this . withoutUnicodePtr = unicodePtr ; } return TokenNameWHITESPACE ; } else if ( checkIfUnicode ) { this . withoutUnicodePtr = <NUM_LIT:0> ; unicodeStore ( ) ; } else { this . withoutUnicodePtr = <NUM_LIT:0> ; } } char c = this . currentCharacter ; if ( c < ScannerHelper . MAX_OBVIOUS ) { if ( ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] & ScannerHelper . C_IDENT_START ) != <NUM_LIT:0> ) { return scanIdentifierOrKeywordWithBoundCheck ( ) ; } return TokenNameERROR ; } boolean isJavaIdStart ; if ( c >= HIGH_SURROGATE_MIN_VALUE && c <= HIGH_SURROGATE_MAX_VALUE ) { if ( this . complianceLevel < ClassFileConstants . JDK1_5 ) { throw new InvalidInputException ( INVALID_UNICODE_ESCAPE ) ; } char low = ( char ) getNextCharWithBoundChecks ( ) ; if ( low < LOW_SURROGATE_MIN_VALUE || low > LOW_SURROGATE_MAX_VALUE ) { throw new InvalidInputException ( INVALID_LOW_SURROGATE ) ; } isJavaIdStart = ScannerHelper . isJavaIdentifierStart ( this . complianceLevel , c , low ) ; } else if ( c >= LOW_SURROGATE_MIN_VALUE && c <= LOW_SURROGATE_MAX_VALUE ) { if ( this . complianceLevel < ClassFileConstants . JDK1_5 ) { throw new InvalidInputException ( INVALID_UNICODE_ESCAPE ) ; } throw new InvalidInputException ( INVALID_HIGH_SURROGATE ) ; } else { isJavaIdStart = ScannerHelper . isJavaIdentifierStart ( this . complianceLevel , c ) ; } if ( isJavaIdStart ) return scanIdentifierOrKeywordWithBoundCheck ( ) ; return TokenNameERROR ; } } public int getNextToken ( ) throws InvalidInputException { this . wasAcr = false ; if ( this . diet ) { jumpOverMethodBody ( ) ; this . diet = false ; return this . currentPosition > this . eofPosition ? TokenNameEOF : TokenNameRBRACE ; } int whiteStart = <NUM_LIT:0> ; try { while ( true ) { this . withoutUnicodePtr = <NUM_LIT:0> ; whiteStart = this . currentPosition ; boolean isWhiteSpace , hasWhiteSpaces = false ; int offset ; int unicodePtr ; boolean checkIfUnicode = false ; do { unicodePtr = this . withoutUnicodePtr ; offset = this . currentPosition ; this . startPosition = this . currentPosition ; try { checkIfUnicode = ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ; } catch ( IndexOutOfBoundsException e ) { if ( this . tokenizeWhiteSpace && ( whiteStart != this . currentPosition - <NUM_LIT:1> ) ) { this . currentPosition -- ; this . startPosition = whiteStart ; return TokenNameWHITESPACE ; } if ( this . currentPosition > this . eofPosition ) return TokenNameEOF ; } if ( this . currentPosition > this . eofPosition ) { if ( this . tokenizeWhiteSpace && ( whiteStart != this . currentPosition - <NUM_LIT:1> ) ) { this . currentPosition -- ; this . startPosition = whiteStart ; return TokenNameWHITESPACE ; } return TokenNameEOF ; } if ( checkIfUnicode ) { isWhiteSpace = jumpOverUnicodeWhiteSpace ( ) ; offset = this . currentPosition - offset ; } else { offset = this . currentPosition - offset ; if ( ( this . currentCharacter == '<STR_LIT>' ) || ( this . currentCharacter == '<STR_LIT:\n>' ) ) { if ( this . recordLineSeparator ) { pushLineSeparator ( ) ; } } switch ( this . currentCharacter ) { case <NUM_LIT:10> : case <NUM_LIT:12> : case <NUM_LIT> : case <NUM_LIT:32> : case <NUM_LIT:9> : isWhiteSpace = true ; break ; default : isWhiteSpace = false ; } } if ( isWhiteSpace ) { hasWhiteSpaces = true ; } } while ( isWhiteSpace ) ; if ( hasWhiteSpaces ) { if ( this . tokenizeWhiteSpace ) { this . currentPosition -= offset ; this . startPosition = whiteStart ; if ( checkIfUnicode ) { this . withoutUnicodePtr = unicodePtr ; } return TokenNameWHITESPACE ; } else if ( checkIfUnicode ) { this . withoutUnicodePtr = <NUM_LIT:0> ; unicodeStore ( ) ; } else { this . withoutUnicodePtr = <NUM_LIT:0> ; } } switch ( this . currentCharacter ) { case '<CHAR_LIT>' : return TokenNameAT ; case '<CHAR_LIT:(>' : return TokenNameLPAREN ; case '<CHAR_LIT:)>' : return TokenNameRPAREN ; case '<CHAR_LIT>' : return TokenNameLBRACE ; case '<CHAR_LIT:}>' : return TokenNameRBRACE ; case '<CHAR_LIT:[>' : return TokenNameLBRACKET ; case '<CHAR_LIT:]>' : return TokenNameRBRACKET ; case '<CHAR_LIT:;>' : return TokenNameSEMICOLON ; case '<CHAR_LIT:U+002C>' : return TokenNameCOMMA ; case '<CHAR_LIT:.>' : if ( getNextCharAsDigit ( ) ) { return scanNumber ( true ) ; } int temp = this . currentPosition ; if ( getNextChar ( '<CHAR_LIT:.>' ) ) { if ( getNextChar ( '<CHAR_LIT:.>' ) ) { return TokenNameELLIPSIS ; } else { this . currentPosition = temp ; return TokenNameDOT ; } } else { this . currentPosition = temp ; return TokenNameDOT ; } case '<CHAR_LIT>' : { int test ; if ( ( test = getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT:=>' ) ) == <NUM_LIT:0> ) return TokenNamePLUS_PLUS ; if ( test > <NUM_LIT:0> ) return TokenNamePLUS_EQUAL ; return TokenNamePLUS ; } case '<CHAR_LIT:->' : { int test ; if ( ( test = getNextChar ( '<CHAR_LIT:->' , '<CHAR_LIT:=>' ) ) == <NUM_LIT:0> ) return TokenNameMINUS_MINUS ; if ( test > <NUM_LIT:0> ) return TokenNameMINUS_EQUAL ; return TokenNameMINUS ; } case '<CHAR_LIT>' : return TokenNameTWIDDLE ; case '<CHAR_LIT>' : if ( getNextChar ( '<CHAR_LIT:=>' ) ) return TokenNameNOT_EQUAL ; return TokenNameNOT ; case '<CHAR_LIT>' : if ( getNextChar ( '<CHAR_LIT:=>' ) ) return TokenNameMULTIPLY_EQUAL ; return TokenNameMULTIPLY ; case '<CHAR_LIT>' : if ( getNextChar ( '<CHAR_LIT:=>' ) ) return TokenNameREMAINDER_EQUAL ; return TokenNameREMAINDER ; case '<CHAR_LIT>' : { int test ; if ( ( test = getNextChar ( '<CHAR_LIT:=>' , '<CHAR_LIT>' ) ) == <NUM_LIT:0> ) return TokenNameLESS_EQUAL ; if ( test > <NUM_LIT:0> ) { if ( getNextChar ( '<CHAR_LIT:=>' ) ) return TokenNameLEFT_SHIFT_EQUAL ; return TokenNameLEFT_SHIFT ; } return TokenNameLESS ; } case '<CHAR_LIT:>>' : { int test ; if ( this . returnOnlyGreater ) { return TokenNameGREATER ; } if ( ( test = getNextChar ( '<CHAR_LIT:=>' , '<CHAR_LIT:>>' ) ) == <NUM_LIT:0> ) return TokenNameGREATER_EQUAL ; if ( test > <NUM_LIT:0> ) { if ( ( test = getNextChar ( '<CHAR_LIT:=>' , '<CHAR_LIT:>>' ) ) == <NUM_LIT:0> ) return TokenNameRIGHT_SHIFT_EQUAL ; if ( test > <NUM_LIT:0> ) { if ( getNextChar ( '<CHAR_LIT:=>' ) ) return TokenNameUNSIGNED_RIGHT_SHIFT_EQUAL ; return TokenNameUNSIGNED_RIGHT_SHIFT ; } return TokenNameRIGHT_SHIFT ; } return TokenNameGREATER ; } case '<CHAR_LIT:=>' : if ( getNextChar ( '<CHAR_LIT:=>' ) ) return TokenNameEQUAL_EQUAL ; return TokenNameEQUAL ; case '<CHAR_LIT>' : { int test ; if ( ( test = getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT:=>' ) ) == <NUM_LIT:0> ) return TokenNameAND_AND ; if ( test > <NUM_LIT:0> ) return TokenNameAND_EQUAL ; return TokenNameAND ; } case '<CHAR_LIT>' : { int test ; if ( ( test = getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT:=>' ) ) == <NUM_LIT:0> ) return TokenNameOR_OR ; if ( test > <NUM_LIT:0> ) return TokenNameOR_EQUAL ; return TokenNameOR ; } case '<CHAR_LIT>' : if ( getNextChar ( '<CHAR_LIT:=>' ) ) return TokenNameXOR_EQUAL ; return TokenNameXOR ; case '<CHAR_LIT>' : return TokenNameQUESTION ; case '<CHAR_LIT::>' : return TokenNameCOLON ; case '<STR_LIT>' : { int test ; if ( ( test = getNextChar ( '<STR_LIT:\n>' , '<STR_LIT>' ) ) == <NUM_LIT:0> ) { throw new InvalidInputException ( INVALID_CHARACTER_CONSTANT ) ; } if ( test > <NUM_LIT:0> ) { for ( int lookAhead = <NUM_LIT:0> ; lookAhead < <NUM_LIT:3> ; lookAhead ++ ) { if ( this . currentPosition + lookAhead == this . eofPosition ) break ; if ( this . source [ this . currentPosition + lookAhead ] == '<STR_LIT:\n>' ) break ; if ( this . source [ this . currentPosition + lookAhead ] == '<STR_LIT>' ) { this . currentPosition += lookAhead + <NUM_LIT:1> ; break ; } } throw new InvalidInputException ( INVALID_CHARACTER_CONSTANT ) ; } } if ( getNextChar ( '<STR_LIT>' ) ) { for ( int lookAhead = <NUM_LIT:0> ; lookAhead < <NUM_LIT:3> ; lookAhead ++ ) { if ( this . currentPosition + lookAhead == this . eofPosition ) break ; if ( this . source [ this . currentPosition + lookAhead ] == '<STR_LIT:\n>' ) break ; if ( this . source [ this . currentPosition + lookAhead ] == '<STR_LIT>' ) { this . currentPosition += lookAhead + <NUM_LIT:1> ; break ; } } throw new InvalidInputException ( INVALID_CHARACTER_CONSTANT ) ; } if ( getNextChar ( '<STR_LIT:\\>' ) ) { if ( this . unicodeAsBackSlash ) { this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; } else { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } } else { this . currentCharacter = this . source [ this . currentPosition ++ ] ; } scanEscapeCharacter ( ) ; } else { this . unicodeAsBackSlash = false ; checkIfUnicode = false ; try { checkIfUnicode = ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ; } catch ( IndexOutOfBoundsException e ) { this . currentPosition -- ; throw new InvalidInputException ( INVALID_CHARACTER_CONSTANT ) ; } if ( checkIfUnicode ) { getNextUnicodeChar ( ) ; } else { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } } if ( getNextChar ( '<STR_LIT>' ) ) return TokenNameCharacterLiteral ; for ( int lookAhead = <NUM_LIT:0> ; lookAhead < <NUM_LIT:20> ; lookAhead ++ ) { if ( this . currentPosition + lookAhead == this . eofPosition ) break ; if ( this . source [ this . currentPosition + lookAhead ] == '<STR_LIT:\n>' ) break ; if ( this . source [ this . currentPosition + lookAhead ] == '<STR_LIT>' ) { this . currentPosition += lookAhead + <NUM_LIT:1> ; break ; } } throw new InvalidInputException ( INVALID_CHARACTER_CONSTANT ) ; case '<CHAR_LIT:">' : try { this . unicodeAsBackSlash = false ; boolean isUnicode = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; isUnicode = true ; } else { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } while ( this . currentCharacter != '<CHAR_LIT:">' ) { if ( this . currentPosition >= this . eofPosition ) { throw new InvalidInputException ( UNTERMINATED_STRING ) ; } if ( ( this . currentCharacter == '<STR_LIT:\n>' ) || ( this . currentCharacter == '<STR_LIT>' ) ) { if ( isUnicode ) { int start = this . currentPosition ; for ( int lookAhead = <NUM_LIT:0> ; lookAhead < <NUM_LIT> ; lookAhead ++ ) { if ( this . currentPosition >= this . eofPosition ) { this . currentPosition = start ; break ; } if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { isUnicode = true ; getNextUnicodeChar ( ) ; } else { isUnicode = false ; } if ( ! isUnicode && this . currentCharacter == '<STR_LIT:\n>' ) { this . currentPosition -- ; break ; } if ( this . currentCharacter == '<STR_LIT:\">' ) { throw new InvalidInputException ( INVALID_CHAR_IN_STRING ) ; } } } else { this . currentPosition -- ; } throw new InvalidInputException ( INVALID_CHAR_IN_STRING ) ; } if ( this . currentCharacter == '<STR_LIT:\\>' ) { if ( this . unicodeAsBackSlash ) { this . withoutUnicodePtr -- ; this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; isUnicode = true ; this . withoutUnicodePtr -- ; } else { isUnicode = false ; } } else { if ( this . withoutUnicodePtr == <NUM_LIT:0> ) { unicodeInitializeBuffer ( this . currentPosition - this . startPosition ) ; } this . withoutUnicodePtr -- ; this . currentCharacter = this . source [ this . currentPosition ++ ] ; } scanEscapeCharacter ( ) ; if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; isUnicode = true ; } else { isUnicode = false ; if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } } } catch ( IndexOutOfBoundsException e ) { this . currentPosition -- ; throw new InvalidInputException ( UNTERMINATED_STRING ) ; } catch ( InvalidInputException e ) { if ( e . getMessage ( ) . equals ( INVALID_ESCAPE ) ) { for ( int lookAhead = <NUM_LIT:0> ; lookAhead < <NUM_LIT> ; lookAhead ++ ) { if ( this . currentPosition + lookAhead == this . eofPosition ) break ; if ( this . source [ this . currentPosition + lookAhead ] == '<STR_LIT:\n>' ) break ; if ( this . source [ this . currentPosition + lookAhead ] == '<STR_LIT:\">' ) { this . currentPosition += lookAhead + <NUM_LIT:1> ; break ; } } } throw e ; } return TokenNameStringLiteral ; case '<CHAR_LIT:/>' : if ( ! this . skipComments ) { int test = getNextChar ( '<CHAR_LIT:/>' , '<CHAR_LIT>' ) ; if ( test == <NUM_LIT:0> ) { this . lastCommentLinePosition = this . currentPosition ; try { if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; } if ( this . currentCharacter == '<STR_LIT:\\>' ) { if ( this . source [ this . currentPosition ] == '<STR_LIT:\\>' ) this . currentPosition ++ ; } boolean isUnicode = false ; while ( this . currentCharacter != '<STR_LIT>' && this . currentCharacter != '<STR_LIT:\n>' ) { if ( this . currentPosition >= this . eofPosition ) { this . lastCommentLinePosition = this . currentPosition ; this . currentPosition ++ ; throw new IndexOutOfBoundsException ( ) ; } this . lastCommentLinePosition = this . currentPosition ; isUnicode = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; isUnicode = true ; } if ( this . currentCharacter == '<STR_LIT:\\>' ) { if ( this . source [ this . currentPosition ] == '<STR_LIT:\\>' ) this . currentPosition ++ ; } } if ( this . currentCharacter == '<STR_LIT>' && this . eofPosition > this . currentPosition ) { if ( this . source [ this . currentPosition ] == '<STR_LIT:\n>' ) { this . currentPosition ++ ; this . currentCharacter = '<STR_LIT:\n>' ; } else if ( ( this . source [ this . currentPosition ] == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition + <NUM_LIT:1> ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; isUnicode = true ; } } recordComment ( TokenNameCOMMENT_LINE ) ; if ( this . taskTags != null ) checkTaskTag ( this . startPosition , this . currentPosition ) ; if ( ( this . currentCharacter == '<STR_LIT>' ) || ( this . currentCharacter == '<STR_LIT:\n>' ) ) { if ( this . checkNonExternalizedStringLiterals && this . lastPosition < this . currentPosition ) { parseTags ( ) ; } if ( this . recordLineSeparator ) { if ( isUnicode ) { pushUnicodeLineSeparator ( ) ; } else { pushLineSeparator ( ) ; } } } if ( this . tokenizeComments ) { return TokenNameCOMMENT_LINE ; } } catch ( IndexOutOfBoundsException e ) { this . currentPosition -- ; recordComment ( TokenNameCOMMENT_LINE ) ; if ( this . taskTags != null ) checkTaskTag ( this . startPosition , this . currentPosition ) ; if ( this . checkNonExternalizedStringLiterals && this . lastPosition < this . currentPosition ) { parseTags ( ) ; } if ( this . tokenizeComments ) { return TokenNameCOMMENT_LINE ; } else { this . currentPosition ++ ; } } break ; } if ( test > <NUM_LIT:0> ) { try { boolean isJavadoc = false , star = false ; boolean isUnicode = false ; int previous ; this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; isUnicode = true ; } else { isUnicode = false ; if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } if ( this . currentCharacter == '<CHAR_LIT>' ) { isJavadoc = true ; star = true ; } if ( ( this . currentCharacter == '<STR_LIT>' ) || ( this . currentCharacter == '<STR_LIT:\n>' ) ) { if ( this . recordLineSeparator ) { if ( isUnicode ) { pushUnicodeLineSeparator ( ) ; } else { pushLineSeparator ( ) ; } } } isUnicode = false ; previous = this . currentPosition ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; isUnicode = true ; } else { isUnicode = false ; } if ( this . currentCharacter == '<STR_LIT:\\>' ) { if ( this . source [ this . currentPosition ] == '<STR_LIT:\\>' ) this . currentPosition ++ ; } if ( this . currentCharacter == '<CHAR_LIT:/>' ) { isJavadoc = false ; } int firstTag = <NUM_LIT:0> ; while ( ( this . currentCharacter != '<CHAR_LIT:/>' ) || ( ! star ) ) { if ( this . currentPosition >= this . eofPosition ) { throw new InvalidInputException ( UNTERMINATED_COMMENT ) ; } if ( ( this . currentCharacter == '<STR_LIT>' ) || ( this . currentCharacter == '<STR_LIT:\n>' ) ) { if ( this . recordLineSeparator ) { if ( isUnicode ) { pushUnicodeLineSeparator ( ) ; } else { pushLineSeparator ( ) ; } } } switch ( this . currentCharacter ) { case '<CHAR_LIT>' : star = true ; break ; case '<CHAR_LIT>' : if ( firstTag == <NUM_LIT:0> && this . isFirstTag ( ) ) { firstTag = previous ; } default : star = false ; } previous = this . currentPosition ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; isUnicode = true ; } else { isUnicode = false ; } if ( this . currentCharacter == '<STR_LIT:\\>' ) { if ( this . source [ this . currentPosition ] == '<STR_LIT:\\>' ) this . currentPosition ++ ; } } int token = isJavadoc ? TokenNameCOMMENT_JAVADOC : TokenNameCOMMENT_BLOCK ; recordComment ( token ) ; this . commentTagStarts [ this . commentPtr ] = firstTag ; if ( this . taskTags != null ) checkTaskTag ( this . startPosition , this . currentPosition ) ; if ( this . tokenizeComments ) { return token ; } } catch ( IndexOutOfBoundsException e ) { this . currentPosition -- ; throw new InvalidInputException ( UNTERMINATED_COMMENT ) ; } break ; } } if ( getNextChar ( '<CHAR_LIT:=>' ) ) return TokenNameDIVIDE_EQUAL ; return TokenNameDIVIDE ; case '<CHAR_LIT>' : if ( atEnd ( ) ) return TokenNameEOF ; throw new InvalidInputException ( "<STR_LIT>" ) ; default : char c = this . currentCharacter ; if ( c < ScannerHelper . MAX_OBVIOUS ) { if ( ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] & ScannerHelper . C_IDENT_START ) != <NUM_LIT:0> ) { return scanIdentifierOrKeyword ( ) ; } else if ( ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] & ScannerHelper . C_DIGIT ) != <NUM_LIT:0> ) { return scanNumber ( false ) ; } else { return TokenNameERROR ; } } boolean isJavaIdStart ; if ( c >= HIGH_SURROGATE_MIN_VALUE && c <= HIGH_SURROGATE_MAX_VALUE ) { if ( this . complianceLevel < ClassFileConstants . JDK1_5 ) { throw new InvalidInputException ( INVALID_UNICODE_ESCAPE ) ; } char low = ( char ) getNextChar ( ) ; if ( low < LOW_SURROGATE_MIN_VALUE || low > LOW_SURROGATE_MAX_VALUE ) { throw new InvalidInputException ( INVALID_LOW_SURROGATE ) ; } isJavaIdStart = ScannerHelper . isJavaIdentifierStart ( this . complianceLevel , c , low ) ; } else if ( c >= LOW_SURROGATE_MIN_VALUE && c <= LOW_SURROGATE_MAX_VALUE ) { if ( this . complianceLevel < ClassFileConstants . JDK1_5 ) { throw new InvalidInputException ( INVALID_UNICODE_ESCAPE ) ; } throw new InvalidInputException ( INVALID_HIGH_SURROGATE ) ; } else { isJavaIdStart = ScannerHelper . isJavaIdentifierStart ( this . complianceLevel , c ) ; } if ( isJavaIdStart ) return scanIdentifierOrKeyword ( ) ; if ( ScannerHelper . isDigit ( this . currentCharacter ) ) { return scanNumber ( false ) ; } return TokenNameERROR ; } } } catch ( IndexOutOfBoundsException e ) { if ( this . tokenizeWhiteSpace && ( whiteStart != this . currentPosition - <NUM_LIT:1> ) ) { this . currentPosition -- ; this . startPosition = whiteStart ; return TokenNameWHITESPACE ; } } return TokenNameEOF ; } public void getNextUnicodeChar ( ) throws InvalidInputException { int c1 = <NUM_LIT:0> , c2 = <NUM_LIT:0> , c3 = <NUM_LIT:0> , c4 = <NUM_LIT:0> , unicodeSize = <NUM_LIT:6> ; this . currentPosition ++ ; if ( this . currentPosition < this . eofPosition ) { while ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) { this . currentPosition ++ ; if ( this . currentPosition >= this . eofPosition ) { this . currentPosition -- ; throw new InvalidInputException ( INVALID_UNICODE_ESCAPE ) ; } unicodeSize ++ ; } } else { this . currentPosition -- ; throw new InvalidInputException ( INVALID_UNICODE_ESCAPE ) ; } if ( ( this . currentPosition + <NUM_LIT:4> ) > this . eofPosition ) { this . currentPosition += ( this . eofPosition - this . currentPosition ) ; throw new InvalidInputException ( INVALID_UNICODE_ESCAPE ) ; } if ( ( c1 = ScannerHelper . getNumericValue ( this . source [ this . currentPosition ++ ] ) ) > <NUM_LIT:15> || c1 < <NUM_LIT:0> || ( c2 = ScannerHelper . getNumericValue ( this . source [ this . currentPosition ++ ] ) ) > <NUM_LIT:15> || c2 < <NUM_LIT:0> || ( c3 = ScannerHelper . getNumericValue ( this . source [ this . currentPosition ++ ] ) ) > <NUM_LIT:15> || c3 < <NUM_LIT:0> || ( c4 = ScannerHelper . getNumericValue ( this . source [ this . currentPosition ++ ] ) ) > <NUM_LIT:15> || c4 < <NUM_LIT:0> ) { throw new InvalidInputException ( INVALID_UNICODE_ESCAPE ) ; } this . currentCharacter = ( char ) ( ( ( c1 * <NUM_LIT:16> + c2 ) * <NUM_LIT:16> + c3 ) * <NUM_LIT:16> + c4 ) ; if ( this . withoutUnicodePtr == <NUM_LIT:0> ) { unicodeInitializeBuffer ( this . currentPosition - unicodeSize - this . startPosition ) ; } unicodeStore ( ) ; this . unicodeAsBackSlash = this . currentCharacter == '<STR_LIT:\\>' ; } public NLSTag [ ] getNLSTags ( ) { final int length = this . nlsTagsPtr ; if ( length != <NUM_LIT:0> ) { NLSTag [ ] result = new NLSTag [ length ] ; System . arraycopy ( this . nlsTags , <NUM_LIT:0> , result , <NUM_LIT:0> , length ) ; this . nlsTagsPtr = <NUM_LIT:0> ; return result ; } return null ; } public char [ ] getSource ( ) { return this . source ; } protected boolean isFirstTag ( ) { return true ; } public final void jumpOverMethodBody ( ) { this . wasAcr = false ; int found = <NUM_LIT:1> ; try { while ( true ) { this . withoutUnicodePtr = <NUM_LIT:0> ; boolean isWhiteSpace ; do { this . startPosition = this . currentPosition ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { isWhiteSpace = jumpOverUnicodeWhiteSpace ( ) ; } else { if ( this . recordLineSeparator && ( ( this . currentCharacter == '<STR_LIT>' ) || ( this . currentCharacter == '<STR_LIT:\n>' ) ) ) { pushLineSeparator ( ) ; } isWhiteSpace = CharOperation . isWhitespace ( this . currentCharacter ) ; } } while ( isWhiteSpace ) ; NextToken : switch ( this . currentCharacter ) { case '<CHAR_LIT>' : found ++ ; break NextToken ; case '<CHAR_LIT:}>' : found -- ; if ( found == <NUM_LIT:0> ) return ; break NextToken ; case '<STR_LIT>' : { boolean test ; test = getNextChar ( '<STR_LIT:\\>' ) ; if ( test ) { try { if ( this . unicodeAsBackSlash ) { this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; } else { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } } else { this . currentCharacter = this . source [ this . currentPosition ++ ] ; } scanEscapeCharacter ( ) ; } catch ( InvalidInputException ex ) { } } else { try { this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; } else { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } } catch ( InvalidInputException ex ) { } } getNextChar ( '<STR_LIT>' ) ; break NextToken ; } case '<CHAR_LIT:">' : try { try { this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; } else { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } } catch ( InvalidInputException ex ) { } while ( this . currentCharacter != '<CHAR_LIT:">' ) { if ( this . currentPosition >= this . eofPosition ) { return ; } if ( this . currentCharacter == '<STR_LIT>' ) { if ( this . source [ this . currentPosition ] == '<STR_LIT:\n>' ) this . currentPosition ++ ; break NextToken ; } if ( this . currentCharacter == '<STR_LIT:\n>' ) { break ; } if ( this . currentCharacter == '<STR_LIT:\\>' ) { try { if ( this . unicodeAsBackSlash ) { this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; } else { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } } else { this . currentCharacter = this . source [ this . currentPosition ++ ] ; } scanEscapeCharacter ( ) ; } catch ( InvalidInputException ex ) { } } try { this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; } else { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } } catch ( InvalidInputException ex ) { } } } catch ( IndexOutOfBoundsException e ) { return ; } break NextToken ; case '<CHAR_LIT:/>' : { int test ; if ( ( test = getNextChar ( '<CHAR_LIT:/>' , '<CHAR_LIT>' ) ) == <NUM_LIT:0> ) { try { this . lastCommentLinePosition = this . currentPosition ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; } if ( this . currentCharacter == '<STR_LIT:\\>' ) { if ( this . source [ this . currentPosition ] == '<STR_LIT:\\>' ) this . currentPosition ++ ; } boolean isUnicode = false ; while ( this . currentCharacter != '<STR_LIT>' && this . currentCharacter != '<STR_LIT:\n>' ) { if ( this . currentPosition >= this . eofPosition ) { this . lastCommentLinePosition = this . currentPosition ; this . currentPosition ++ ; throw new IndexOutOfBoundsException ( ) ; } this . lastCommentLinePosition = this . currentPosition ; isUnicode = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { isUnicode = true ; getNextUnicodeChar ( ) ; } if ( this . currentCharacter == '<STR_LIT:\\>' ) { if ( this . source [ this . currentPosition ] == '<STR_LIT:\\>' ) this . currentPosition ++ ; } } if ( this . currentCharacter == '<STR_LIT>' && this . eofPosition > this . currentPosition ) { if ( this . source [ this . currentPosition ] == '<STR_LIT:\n>' ) { this . currentPosition ++ ; this . currentCharacter = '<STR_LIT:\n>' ; } else if ( ( this . source [ this . currentPosition ] == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition + <NUM_LIT:1> ] == '<CHAR_LIT>' ) ) { isUnicode = true ; getNextUnicodeChar ( ) ; } } recordComment ( TokenNameCOMMENT_LINE ) ; if ( this . recordLineSeparator && ( ( this . currentCharacter == '<STR_LIT>' ) || ( this . currentCharacter == '<STR_LIT:\n>' ) ) ) { if ( this . checkNonExternalizedStringLiterals && this . lastPosition < this . currentPosition ) { parseTags ( ) ; } if ( this . recordLineSeparator ) { if ( isUnicode ) { pushUnicodeLineSeparator ( ) ; } else { pushLineSeparator ( ) ; } } } } catch ( IndexOutOfBoundsException e ) { this . currentPosition -- ; recordComment ( TokenNameCOMMENT_LINE ) ; if ( this . checkNonExternalizedStringLiterals && this . lastPosition < this . currentPosition ) { parseTags ( ) ; } if ( ! this . tokenizeComments ) { this . currentPosition ++ ; } } break NextToken ; } if ( test > <NUM_LIT:0> ) { boolean isJavadoc = false ; try { boolean star = false ; int previous ; boolean isUnicode = false ; this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; isUnicode = true ; } else { isUnicode = false ; if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } if ( this . currentCharacter == '<CHAR_LIT>' ) { isJavadoc = true ; star = true ; } if ( ( this . currentCharacter == '<STR_LIT>' ) || ( this . currentCharacter == '<STR_LIT:\n>' ) ) { if ( this . recordLineSeparator ) { if ( isUnicode ) { pushUnicodeLineSeparator ( ) ; } else { pushLineSeparator ( ) ; } } } isUnicode = false ; previous = this . currentPosition ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; isUnicode = true ; } else { isUnicode = false ; } if ( this . currentCharacter == '<STR_LIT:\\>' ) { if ( this . source [ this . currentPosition ] == '<STR_LIT:\\>' ) this . currentPosition ++ ; } if ( this . currentCharacter == '<CHAR_LIT:/>' ) { isJavadoc = false ; } int firstTag = <NUM_LIT:0> ; while ( ( this . currentCharacter != '<CHAR_LIT:/>' ) || ( ! star ) ) { if ( this . currentPosition >= this . eofPosition ) { return ; } if ( ( this . currentCharacter == '<STR_LIT>' ) || ( this . currentCharacter == '<STR_LIT:\n>' ) ) { if ( this . recordLineSeparator ) { if ( isUnicode ) { pushUnicodeLineSeparator ( ) ; } else { pushLineSeparator ( ) ; } } } switch ( this . currentCharacter ) { case '<CHAR_LIT>' : star = true ; break ; case '<CHAR_LIT>' : if ( firstTag == <NUM_LIT:0> && this . isFirstTag ( ) ) { firstTag = previous ; } default : star = false ; } previous = this . currentPosition ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; isUnicode = true ; } else { isUnicode = false ; } if ( this . currentCharacter == '<STR_LIT:\\>' ) { if ( this . source [ this . currentPosition ] == '<STR_LIT:\\>' ) this . currentPosition ++ ; } } recordComment ( isJavadoc ? TokenNameCOMMENT_JAVADOC : TokenNameCOMMENT_BLOCK ) ; this . commentTagStarts [ this . commentPtr ] = firstTag ; } catch ( IndexOutOfBoundsException e ) { return ; } break NextToken ; } break NextToken ; } default : try { char c = this . currentCharacter ; if ( c < ScannerHelper . MAX_OBVIOUS ) { if ( ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] & ScannerHelper . C_IDENT_START ) != <NUM_LIT:0> ) { scanIdentifierOrKeyword ( ) ; break NextToken ; } else if ( ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] & ScannerHelper . C_DIGIT ) != <NUM_LIT:0> ) { scanNumber ( false ) ; break NextToken ; } else { break NextToken ; } } boolean isJavaIdStart ; if ( c >= HIGH_SURROGATE_MIN_VALUE && c <= HIGH_SURROGATE_MAX_VALUE ) { if ( this . complianceLevel < ClassFileConstants . JDK1_5 ) { throw new InvalidInputException ( INVALID_UNICODE_ESCAPE ) ; } char low = ( char ) getNextChar ( ) ; if ( low < LOW_SURROGATE_MIN_VALUE || low > LOW_SURROGATE_MAX_VALUE ) { break NextToken ; } isJavaIdStart = ScannerHelper . isJavaIdentifierStart ( this . complianceLevel , c , low ) ; } else if ( c >= LOW_SURROGATE_MIN_VALUE && c <= LOW_SURROGATE_MAX_VALUE ) { break NextToken ; } else { isJavaIdStart = ScannerHelper . isJavaIdentifierStart ( this . complianceLevel , c ) ; } if ( isJavaIdStart ) { scanIdentifierOrKeyword ( ) ; break NextToken ; } } catch ( InvalidInputException ex ) { } } } } catch ( IndexOutOfBoundsException e ) { } catch ( InvalidInputException e ) { } return ; } public final boolean jumpOverUnicodeWhiteSpace ( ) throws InvalidInputException { this . wasAcr = false ; getNextUnicodeChar ( ) ; return CharOperation . isWhitespace ( this . currentCharacter ) ; } final char [ ] optimizedCurrentTokenSource1 ( ) { char charOne = this . source [ this . startPosition ] ; switch ( charOne ) { case '<CHAR_LIT:a>' : return charArray_a ; case '<CHAR_LIT:b>' : return charArray_b ; case '<CHAR_LIT:c>' : return charArray_c ; case '<CHAR_LIT>' : return charArray_d ; case '<CHAR_LIT:e>' : return charArray_e ; case '<CHAR_LIT>' : return charArray_f ; case '<CHAR_LIT>' : return charArray_g ; case '<CHAR_LIT>' : return charArray_h ; case '<CHAR_LIT>' : return charArray_i ; case '<CHAR_LIT>' : return charArray_j ; case '<CHAR_LIT>' : return charArray_k ; case '<CHAR_LIT>' : return charArray_l ; case '<CHAR_LIT>' : return charArray_m ; case '<CHAR_LIT>' : return charArray_n ; case '<CHAR_LIT>' : return charArray_o ; case '<CHAR_LIT>' : return charArray_p ; case '<CHAR_LIT>' : return charArray_q ; case '<CHAR_LIT>' : return charArray_r ; case '<CHAR_LIT>' : return charArray_s ; case '<CHAR_LIT>' : return charArray_t ; case '<CHAR_LIT>' : return charArray_u ; case '<CHAR_LIT>' : return charArray_v ; case '<CHAR_LIT>' : return charArray_w ; case '<CHAR_LIT>' : return charArray_x ; case '<CHAR_LIT>' : return charArray_y ; case '<CHAR_LIT>' : return charArray_z ; default : return new char [ ] { charOne } ; } } final char [ ] optimizedCurrentTokenSource2 ( ) { char [ ] src = this . source ; int start = this . startPosition ; char c0 , c1 ; int hash = ( ( ( c0 = src [ start ] ) << <NUM_LIT:6> ) + ( c1 = src [ start + <NUM_LIT:1> ] ) ) % TableSize ; char [ ] [ ] table = this . charArray_length [ <NUM_LIT:0> ] [ hash ] ; int i = this . newEntry2 ; while ( ++ i < InternalTableSize ) { char [ ] charArray = table [ i ] ; if ( ( c0 == charArray [ <NUM_LIT:0> ] ) && ( c1 == charArray [ <NUM_LIT:1> ] ) ) return charArray ; } i = - <NUM_LIT:1> ; int max = this . newEntry2 ; while ( ++ i <= max ) { char [ ] charArray = table [ i ] ; if ( ( c0 == charArray [ <NUM_LIT:0> ] ) && ( c1 == charArray [ <NUM_LIT:1> ] ) ) return charArray ; } if ( ++ max >= InternalTableSize ) max = <NUM_LIT:0> ; char [ ] r ; System . arraycopy ( src , start , r = new char [ <NUM_LIT:2> ] , <NUM_LIT:0> , <NUM_LIT:2> ) ; return table [ this . newEntry2 = max ] = r ; } final char [ ] optimizedCurrentTokenSource3 ( ) { char [ ] src = this . source ; int start = this . startPosition ; char c0 , c1 = src [ start + <NUM_LIT:1> ] , c2 ; int hash = ( ( ( c0 = src [ start ] ) << <NUM_LIT:6> ) + ( c2 = src [ start + <NUM_LIT:2> ] ) ) % TableSize ; char [ ] [ ] table = this . charArray_length [ <NUM_LIT:1> ] [ hash ] ; int i = this . newEntry3 ; while ( ++ i < InternalTableSize ) { char [ ] charArray = table [ i ] ; if ( ( c0 == charArray [ <NUM_LIT:0> ] ) && ( c1 == charArray [ <NUM_LIT:1> ] ) && ( c2 == charArray [ <NUM_LIT:2> ] ) ) return charArray ; } i = - <NUM_LIT:1> ; int max = this . newEntry3 ; while ( ++ i <= max ) { char [ ] charArray = table [ i ] ; if ( ( c0 == charArray [ <NUM_LIT:0> ] ) && ( c1 == charArray [ <NUM_LIT:1> ] ) && ( c2 == charArray [ <NUM_LIT:2> ] ) ) return charArray ; } if ( ++ max >= InternalTableSize ) max = <NUM_LIT:0> ; char [ ] r ; System . arraycopy ( src , start , r = new char [ <NUM_LIT:3> ] , <NUM_LIT:0> , <NUM_LIT:3> ) ; return table [ this . newEntry3 = max ] = r ; } final char [ ] optimizedCurrentTokenSource4 ( ) { char [ ] src = this . source ; int start = this . startPosition ; char c0 , c1 = src [ start + <NUM_LIT:1> ] , c2 , c3 = src [ start + <NUM_LIT:3> ] ; int hash = ( ( ( c0 = src [ start ] ) << <NUM_LIT:6> ) + ( c2 = src [ start + <NUM_LIT:2> ] ) ) % TableSize ; char [ ] [ ] table = this . charArray_length [ <NUM_LIT:2> ] [ hash ] ; int i = this . newEntry4 ; while ( ++ i < InternalTableSize ) { char [ ] charArray = table [ i ] ; if ( ( c0 == charArray [ <NUM_LIT:0> ] ) && ( c1 == charArray [ <NUM_LIT:1> ] ) && ( c2 == charArray [ <NUM_LIT:2> ] ) && ( c3 == charArray [ <NUM_LIT:3> ] ) ) return charArray ; } i = - <NUM_LIT:1> ; int max = this . newEntry4 ; while ( ++ i <= max ) { char [ ] charArray = table [ i ] ; if ( ( c0 == charArray [ <NUM_LIT:0> ] ) && ( c1 == charArray [ <NUM_LIT:1> ] ) && ( c2 == charArray [ <NUM_LIT:2> ] ) && ( c3 == charArray [ <NUM_LIT:3> ] ) ) return charArray ; } if ( ++ max >= InternalTableSize ) max = <NUM_LIT:0> ; char [ ] r ; System . arraycopy ( src , start , r = new char [ <NUM_LIT:4> ] , <NUM_LIT:0> , <NUM_LIT:4> ) ; return table [ this . newEntry4 = max ] = r ; } final char [ ] optimizedCurrentTokenSource5 ( ) { char [ ] src = this . source ; int start = this . startPosition ; char c0 , c1 = src [ start + <NUM_LIT:1> ] , c2 , c3 = src [ start + <NUM_LIT:3> ] , c4 ; int hash = ( ( ( c0 = src [ start ] ) << <NUM_LIT:12> ) + ( ( c2 = src [ start + <NUM_LIT:2> ] ) << <NUM_LIT:6> ) + ( c4 = src [ start + <NUM_LIT:4> ] ) ) % TableSize ; char [ ] [ ] table = this . charArray_length [ <NUM_LIT:3> ] [ hash ] ; int i = this . newEntry5 ; while ( ++ i < InternalTableSize ) { char [ ] charArray = table [ i ] ; if ( ( c0 == charArray [ <NUM_LIT:0> ] ) && ( c1 == charArray [ <NUM_LIT:1> ] ) && ( c2 == charArray [ <NUM_LIT:2> ] ) && ( c3 == charArray [ <NUM_LIT:3> ] ) && ( c4 == charArray [ <NUM_LIT:4> ] ) ) return charArray ; } i = - <NUM_LIT:1> ; int max = this . newEntry5 ; while ( ++ i <= max ) { char [ ] charArray = table [ i ] ; if ( ( c0 == charArray [ <NUM_LIT:0> ] ) && ( c1 == charArray [ <NUM_LIT:1> ] ) && ( c2 == charArray [ <NUM_LIT:2> ] ) && ( c3 == charArray [ <NUM_LIT:3> ] ) && ( c4 == charArray [ <NUM_LIT:4> ] ) ) return charArray ; } if ( ++ max >= InternalTableSize ) max = <NUM_LIT:0> ; char [ ] r ; System . arraycopy ( src , start , r = new char [ <NUM_LIT:5> ] , <NUM_LIT:0> , <NUM_LIT:5> ) ; return table [ this . newEntry5 = max ] = r ; } final char [ ] optimizedCurrentTokenSource6 ( ) { char [ ] src = this . source ; int start = this . startPosition ; char c0 , c1 = src [ start + <NUM_LIT:1> ] , c2 , c3 = src [ start + <NUM_LIT:3> ] , c4 , c5 = src [ start + <NUM_LIT:5> ] ; int hash = ( ( ( c0 = src [ start ] ) << <NUM_LIT:12> ) + ( ( c2 = src [ start + <NUM_LIT:2> ] ) << <NUM_LIT:6> ) + ( c4 = src [ start + <NUM_LIT:4> ] ) ) % TableSize ; char [ ] [ ] table = this . charArray_length [ <NUM_LIT:4> ] [ hash ] ; int i = this . newEntry6 ; while ( ++ i < InternalTableSize ) { char [ ] charArray = table [ i ] ; if ( ( c0 == charArray [ <NUM_LIT:0> ] ) && ( c1 == charArray [ <NUM_LIT:1> ] ) && ( c2 == charArray [ <NUM_LIT:2> ] ) && ( c3 == charArray [ <NUM_LIT:3> ] ) && ( c4 == charArray [ <NUM_LIT:4> ] ) && ( c5 == charArray [ <NUM_LIT:5> ] ) ) return charArray ; } i = - <NUM_LIT:1> ; int max = this . newEntry6 ; while ( ++ i <= max ) { char [ ] charArray = table [ i ] ; if ( ( c0 == charArray [ <NUM_LIT:0> ] ) && ( c1 == charArray [ <NUM_LIT:1> ] ) && ( c2 == charArray [ <NUM_LIT:2> ] ) && ( c3 == charArray [ <NUM_LIT:3> ] ) && ( c4 == charArray [ <NUM_LIT:4> ] ) && ( c5 == charArray [ <NUM_LIT:5> ] ) ) return charArray ; } if ( ++ max >= InternalTableSize ) max = <NUM_LIT:0> ; char [ ] r ; System . arraycopy ( src , start , r = new char [ <NUM_LIT:6> ] , <NUM_LIT:0> , <NUM_LIT:6> ) ; return table [ this . newEntry6 = max ] = r ; } private void parseTags ( ) { int position = <NUM_LIT:0> ; final int currentStartPosition = this . startPosition ; final int currentLinePtr = this . linePtr ; if ( currentLinePtr >= <NUM_LIT:0> ) { position = this . lineEnds [ currentLinePtr ] + <NUM_LIT:1> ; } while ( ScannerHelper . isWhitespace ( this . source [ position ] ) ) { position ++ ; } if ( currentStartPosition == position ) { return ; } char [ ] s = null ; int sourceEnd = this . currentPosition ; int sourceStart = currentStartPosition ; int sourceDelta = <NUM_LIT:0> ; if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { System . arraycopy ( this . withoutUnicodeBuffer , <NUM_LIT:1> , s = new char [ this . withoutUnicodePtr ] , <NUM_LIT:0> , this . withoutUnicodePtr ) ; sourceEnd = this . withoutUnicodePtr ; sourceStart = <NUM_LIT:1> ; sourceDelta = currentStartPosition ; } else { s = this . source ; } int pos = CharOperation . indexOf ( TAG_PREFIX , s , true , sourceStart , sourceEnd ) ; if ( pos != - <NUM_LIT:1> ) { if ( this . nlsTags == null ) { this . nlsTags = new NLSTag [ <NUM_LIT:10> ] ; this . nlsTagsPtr = <NUM_LIT:0> ; } while ( pos != - <NUM_LIT:1> ) { int start = pos + TAG_PREFIX_LENGTH ; int end = CharOperation . indexOf ( TAG_POSTFIX , s , start , sourceEnd ) ; if ( end != - <NUM_LIT:1> ) { NLSTag currentTag = null ; final int currentLine = currentLinePtr + <NUM_LIT:1> ; try { currentTag = new NLSTag ( pos + sourceDelta , end + sourceDelta , currentLine , extractInt ( s , start , end ) ) ; } catch ( NumberFormatException e ) { currentTag = new NLSTag ( pos + sourceDelta , end + sourceDelta , currentLine , - <NUM_LIT:1> ) ; } if ( this . nlsTagsPtr == this . nlsTags . length ) { System . arraycopy ( this . nlsTags , <NUM_LIT:0> , ( this . nlsTags = new NLSTag [ this . nlsTagsPtr + <NUM_LIT:10> ] ) , <NUM_LIT:0> , this . nlsTagsPtr ) ; } this . nlsTags [ this . nlsTagsPtr ++ ] = currentTag ; } else { end = start ; } pos = CharOperation . indexOf ( TAG_PREFIX , s , true , end , sourceEnd ) ; } } } private int extractInt ( char [ ] array , int start , int end ) { int value = <NUM_LIT:0> ; for ( int i = start ; i < end ; i ++ ) { final char currentChar = array [ i ] ; int digit = <NUM_LIT:0> ; switch ( currentChar ) { case '<CHAR_LIT:0>' : digit = <NUM_LIT:0> ; break ; case '<CHAR_LIT:1>' : digit = <NUM_LIT:1> ; break ; case '<CHAR_LIT>' : digit = <NUM_LIT:2> ; break ; case '<CHAR_LIT>' : digit = <NUM_LIT:3> ; break ; case '<CHAR_LIT>' : digit = <NUM_LIT:4> ; break ; case '<CHAR_LIT>' : digit = <NUM_LIT:5> ; break ; case '<CHAR_LIT>' : digit = <NUM_LIT:6> ; break ; case '<CHAR_LIT>' : digit = <NUM_LIT:7> ; break ; case '<CHAR_LIT>' : digit = <NUM_LIT:8> ; break ; case '<CHAR_LIT:9>' : digit = <NUM_LIT:9> ; break ; default : throw new NumberFormatException ( ) ; } value *= <NUM_LIT:10> ; if ( digit < <NUM_LIT:0> ) throw new NumberFormatException ( ) ; value += digit ; } return value ; } public final void pushLineSeparator ( ) { final int INCREMENT = <NUM_LIT> ; if ( this . currentCharacter == '<STR_LIT>' ) { int separatorPos = this . currentPosition - <NUM_LIT:1> ; if ( ( this . linePtr >= <NUM_LIT:0> ) && ( this . lineEnds [ this . linePtr ] >= separatorPos ) ) return ; int length = this . lineEnds . length ; if ( ++ this . linePtr >= length ) System . arraycopy ( this . lineEnds , <NUM_LIT:0> , this . lineEnds = new int [ length + INCREMENT ] , <NUM_LIT:0> , length ) ; this . lineEnds [ this . linePtr ] = separatorPos ; try { if ( this . source [ this . currentPosition ] == '<STR_LIT:\n>' ) { this . lineEnds [ this . linePtr ] = this . currentPosition ; this . currentPosition ++ ; this . wasAcr = false ; } else { this . wasAcr = true ; } } catch ( IndexOutOfBoundsException e ) { this . wasAcr = true ; } } else { if ( this . currentCharacter == '<STR_LIT:\n>' ) { if ( this . wasAcr && ( this . lineEnds [ this . linePtr ] == ( this . currentPosition - <NUM_LIT:2> ) ) ) { this . lineEnds [ this . linePtr ] = this . currentPosition - <NUM_LIT:1> ; } else { int separatorPos = this . currentPosition - <NUM_LIT:1> ; if ( ( this . linePtr >= <NUM_LIT:0> ) && ( this . lineEnds [ this . linePtr ] >= separatorPos ) ) return ; int length = this . lineEnds . length ; if ( ++ this . linePtr >= length ) System . arraycopy ( this . lineEnds , <NUM_LIT:0> , this . lineEnds = new int [ length + INCREMENT ] , <NUM_LIT:0> , length ) ; this . lineEnds [ this . linePtr ] = separatorPos ; } this . wasAcr = false ; } } } public final void pushUnicodeLineSeparator ( ) { if ( this . currentCharacter == '<STR_LIT>' ) { if ( this . source [ this . currentPosition ] == '<STR_LIT:\n>' ) { this . wasAcr = false ; } else { this . wasAcr = true ; } } else { if ( this . currentCharacter == '<STR_LIT:\n>' ) { this . wasAcr = false ; } } } public void recordComment ( int token ) { int commentStart = this . startPosition ; int stopPosition = this . currentPosition ; switch ( token ) { case TokenNameCOMMENT_LINE : commentStart = - this . startPosition ; stopPosition = - this . lastCommentLinePosition ; break ; case TokenNameCOMMENT_BLOCK : stopPosition = - this . currentPosition ; break ; } int length = this . commentStops . length ; if ( ++ this . commentPtr >= length ) { int newLength = length + COMMENT_ARRAYS_SIZE * <NUM_LIT:10> ; System . arraycopy ( this . commentStops , <NUM_LIT:0> , this . commentStops = new int [ newLength ] , <NUM_LIT:0> , length ) ; System . arraycopy ( this . commentStarts , <NUM_LIT:0> , this . commentStarts = new int [ newLength ] , <NUM_LIT:0> , length ) ; System . arraycopy ( this . commentTagStarts , <NUM_LIT:0> , this . commentTagStarts = new int [ newLength ] , <NUM_LIT:0> , length ) ; } this . commentStops [ this . commentPtr ] = stopPosition ; this . commentStarts [ this . commentPtr ] = commentStart ; } public void resetTo ( int begin , int end ) { this . diet = false ; this . initialPosition = this . startPosition = this . currentPosition = begin ; if ( this . source != null && this . source . length < end ) { this . eofPosition = this . source . length ; } else { this . eofPosition = end < Integer . MAX_VALUE ? end + <NUM_LIT:1> : end ; } this . commentPtr = - <NUM_LIT:1> ; this . foundTaskCount = <NUM_LIT:0> ; } protected final void scanEscapeCharacter ( ) throws InvalidInputException { switch ( this . currentCharacter ) { case '<CHAR_LIT:b>' : this . currentCharacter = '<STR_LIT>' ; break ; case '<CHAR_LIT>' : this . currentCharacter = '<STR_LIT:\t>' ; break ; case '<CHAR_LIT>' : this . currentCharacter = '<STR_LIT:\n>' ; break ; case '<CHAR_LIT>' : this . currentCharacter = '<STR_LIT>' ; break ; case '<CHAR_LIT>' : this . currentCharacter = '<STR_LIT>' ; break ; case '<STR_LIT:\">' : this . currentCharacter = '<STR_LIT:\">' ; break ; case '<STR_LIT>' : this . currentCharacter = '<STR_LIT>' ; break ; case '<STR_LIT:\\>' : this . currentCharacter = '<STR_LIT:\\>' ; break ; default : int number = ScannerHelper . getNumericValue ( this . currentCharacter ) ; if ( number >= <NUM_LIT:0> && number <= <NUM_LIT:7> ) { boolean zeroToThreeNot = number > <NUM_LIT:3> ; if ( ScannerHelper . isDigit ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) ) { int digit = ScannerHelper . getNumericValue ( this . currentCharacter ) ; if ( digit >= <NUM_LIT:0> && digit <= <NUM_LIT:7> ) { number = ( number * <NUM_LIT:8> ) + digit ; if ( ScannerHelper . isDigit ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) ) { if ( zeroToThreeNot ) { this . currentPosition -- ; } else { digit = ScannerHelper . getNumericValue ( this . currentCharacter ) ; if ( digit >= <NUM_LIT:0> && digit <= <NUM_LIT:7> ) { number = ( number * <NUM_LIT:8> ) + digit ; } else { this . currentPosition -- ; } } } else { this . currentPosition -- ; } } else { this . currentPosition -- ; } } else { this . currentPosition -- ; } if ( number > <NUM_LIT:255> ) throw new InvalidInputException ( INVALID_ESCAPE ) ; this . currentCharacter = ( char ) number ; } else throw new InvalidInputException ( INVALID_ESCAPE ) ; } } public int scanIdentifierOrKeywordWithBoundCheck ( ) { this . useAssertAsAnIndentifier = false ; this . useEnumAsAnIndentifier = false ; char [ ] src = this . source ; identLoop : { int pos ; int srcLength = this . eofPosition ; while ( true ) { if ( ( pos = this . currentPosition ) >= srcLength ) break identLoop ; char c = src [ pos ] ; if ( c < ScannerHelper . MAX_OBVIOUS ) { if ( ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] & ( ScannerHelper . C_UPPER_LETTER | ScannerHelper . C_LOWER_LETTER | ScannerHelper . C_IDENT_PART | ScannerHelper . C_DIGIT ) ) != <NUM_LIT:0> ) { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { this . currentCharacter = c ; unicodeStore ( ) ; } this . currentPosition ++ ; } else if ( ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] & ( ScannerHelper . C_SEPARATOR | ScannerHelper . C_JLS_SPACE ) ) != <NUM_LIT:0> ) { this . currentCharacter = c ; break identLoop ; } else { while ( getNextCharAsJavaIdentifierPartWithBoundCheck ( ) ) { } break identLoop ; } } else { while ( getNextCharAsJavaIdentifierPartWithBoundCheck ( ) ) { } break identLoop ; } } } int index , length ; char [ ] data ; if ( this . withoutUnicodePtr == <NUM_LIT:0> ) { if ( ( length = this . currentPosition - this . startPosition ) == <NUM_LIT:1> ) { return TokenNameIdentifier ; } data = this . source ; index = this . startPosition ; } else { if ( ( length = this . withoutUnicodePtr ) == <NUM_LIT:1> ) return TokenNameIdentifier ; data = this . withoutUnicodeBuffer ; index = <NUM_LIT:1> ; } return internalScanIdentifierOrKeyword ( index , length , data ) ; } public int scanIdentifierOrKeyword ( ) { this . useAssertAsAnIndentifier = false ; this . useEnumAsAnIndentifier = false ; char [ ] src = this . source ; identLoop : { int pos ; int srcLength = this . eofPosition ; while ( true ) { if ( ( pos = this . currentPosition ) >= srcLength ) break identLoop ; char c = src [ pos ] ; if ( c < ScannerHelper . MAX_OBVIOUS ) { if ( ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] & ( ScannerHelper . C_UPPER_LETTER | ScannerHelper . C_LOWER_LETTER | ScannerHelper . C_IDENT_PART | ScannerHelper . C_DIGIT ) ) != <NUM_LIT:0> ) { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { this . currentCharacter = c ; unicodeStore ( ) ; } this . currentPosition ++ ; } else if ( ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] & ( ScannerHelper . C_SEPARATOR | ScannerHelper . C_JLS_SPACE ) ) != <NUM_LIT:0> ) { this . currentCharacter = c ; break identLoop ; } else { while ( getNextCharAsJavaIdentifierPart ( ) ) { } break identLoop ; } } else { while ( getNextCharAsJavaIdentifierPart ( ) ) { } break identLoop ; } } } int index , length ; char [ ] data ; if ( this . withoutUnicodePtr == <NUM_LIT:0> ) { if ( ( length = this . currentPosition - this . startPosition ) == <NUM_LIT:1> ) { return TokenNameIdentifier ; } data = this . source ; index = this . startPosition ; } else { if ( ( length = this . withoutUnicodePtr ) == <NUM_LIT:1> ) return TokenNameIdentifier ; data = this . withoutUnicodeBuffer ; index = <NUM_LIT:1> ; } return internalScanIdentifierOrKeyword ( index , length , data ) ; } private int internalScanIdentifierOrKeyword ( int index , int length , char [ ] data ) { switch ( data [ index ] ) { case '<CHAR_LIT:a>' : switch ( length ) { case <NUM_LIT:8> : if ( ( data [ ++ index ] == '<CHAR_LIT:b>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT:c>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) { return TokenNameabstract ; } else { return TokenNameIdentifier ; } case <NUM_LIT:6> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) { if ( this . sourceLevel >= ClassFileConstants . JDK1_4 ) { this . containsAssertKeyword = true ; return TokenNameassert ; } else { this . useAssertAsAnIndentifier = true ; return TokenNameIdentifier ; } } else { return TokenNameIdentifier ; } default : return TokenNameIdentifier ; } case '<CHAR_LIT:b>' : switch ( length ) { case <NUM_LIT:4> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) ) return TokenNamebyte ; else return TokenNameIdentifier ; case <NUM_LIT:5> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) && ( data [ ++ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNamebreak ; else return TokenNameIdentifier ; case <NUM_LIT:7> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) && ( data [ ++ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNameboolean ; else return TokenNameIdentifier ; default : return TokenNameIdentifier ; } case '<CHAR_LIT:c>' : switch ( length ) { case <NUM_LIT:4> : if ( data [ ++ index ] == '<CHAR_LIT:a>' ) if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) ) return TokenNamecase ; else return TokenNameIdentifier ; else if ( ( data [ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNamechar ; else return TokenNameIdentifier ; case <NUM_LIT:5> : if ( data [ ++ index ] == '<CHAR_LIT:a>' ) if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:c>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNamecatch ; else return TokenNameIdentifier ; else if ( data [ index ] == '<CHAR_LIT>' ) if ( ( data [ ++ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNameclass ; else return TokenNameIdentifier ; else if ( ( data [ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNameconst ; else return TokenNameIdentifier ; case <NUM_LIT:8> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) ) return TokenNamecontinue ; else return TokenNameIdentifier ; default : return TokenNameIdentifier ; } case '<CHAR_LIT>' : switch ( length ) { case <NUM_LIT:2> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNamedo ; else return TokenNameIdentifier ; case <NUM_LIT:6> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:b>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) ) return TokenNamedouble ; else return TokenNameIdentifier ; case <NUM_LIT:7> : if ( ( data [ ++ index ] == '<CHAR_LIT:e>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNamedefault ; else return TokenNameIdentifier ; default : return TokenNameIdentifier ; } case '<CHAR_LIT:e>' : switch ( length ) { case <NUM_LIT:4> : if ( data [ ++ index ] == '<CHAR_LIT>' ) { if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) ) { return TokenNameelse ; } else { return TokenNameIdentifier ; } } else if ( ( data [ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) { if ( this . sourceLevel >= ClassFileConstants . JDK1_5 ) { return TokenNameenum ; } else { this . useEnumAsAnIndentifier = true ; return TokenNameIdentifier ; } } return TokenNameIdentifier ; case <NUM_LIT:7> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNameextends ; else return TokenNameIdentifier ; default : return TokenNameIdentifier ; } case '<CHAR_LIT>' : switch ( length ) { case <NUM_LIT:3> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNamefor ; else return TokenNameIdentifier ; case <NUM_LIT:5> : if ( data [ ++ index ] == '<CHAR_LIT>' ) if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) { return TokenNamefinal ; } else return TokenNameIdentifier ; else if ( data [ index ] == '<CHAR_LIT>' ) if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNamefloat ; else return TokenNameIdentifier ; else if ( ( data [ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) ) return TokenNamefalse ; else return TokenNameIdentifier ; case <NUM_LIT:7> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNamefinally ; else return TokenNameIdentifier ; default : return TokenNameIdentifier ; } case '<CHAR_LIT>' : if ( length == <NUM_LIT:4> ) { if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) { return TokenNamegoto ; } } return TokenNameIdentifier ; case '<CHAR_LIT>' : switch ( length ) { case <NUM_LIT:2> : if ( data [ ++ index ] == '<CHAR_LIT>' ) return TokenNameif ; else return TokenNameIdentifier ; case <NUM_LIT:3> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNameint ; else return TokenNameIdentifier ; case <NUM_LIT:6> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNameimport ; else return TokenNameIdentifier ; case <NUM_LIT:9> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT:c>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) ) return TokenNameinterface ; else return TokenNameIdentifier ; case <NUM_LIT:10> : if ( data [ ++ index ] == '<CHAR_LIT>' ) if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNameimplements ; else return TokenNameIdentifier ; else if ( ( data [ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:c>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNameinstanceof ; else return TokenNameIdentifier ; default : return TokenNameIdentifier ; } case '<CHAR_LIT>' : if ( length == <NUM_LIT:4> ) { if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) { return TokenNamelong ; } } return TokenNameIdentifier ; case '<CHAR_LIT>' : switch ( length ) { case <NUM_LIT:3> : if ( ( data [ ++ index ] == '<CHAR_LIT:e>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNamenew ; else return TokenNameIdentifier ; case <NUM_LIT:4> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNamenull ; else return TokenNameIdentifier ; case <NUM_LIT:6> : if ( ( data [ ++ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) ) { return TokenNamenative ; } else return TokenNameIdentifier ; default : return TokenNameIdentifier ; } case '<CHAR_LIT>' : switch ( length ) { case <NUM_LIT:6> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:b>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:c>' ) ) { return TokenNamepublic ; } else return TokenNameIdentifier ; case <NUM_LIT:7> : if ( data [ ++ index ] == '<CHAR_LIT:a>' ) if ( ( data [ ++ index ] == '<CHAR_LIT:c>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) ) return TokenNamepackage ; else return TokenNameIdentifier ; else if ( ( data [ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) ) { return TokenNameprivate ; } else return TokenNameIdentifier ; case <NUM_LIT:9> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) && ( data [ ++ index ] == '<CHAR_LIT:c>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) { return TokenNameprotected ; } else return TokenNameIdentifier ; default : return TokenNameIdentifier ; } case '<CHAR_LIT>' : if ( length == <NUM_LIT:6> ) { if ( ( data [ ++ index ] == '<CHAR_LIT:e>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) { return TokenNamereturn ; } } return TokenNameIdentifier ; case '<CHAR_LIT>' : switch ( length ) { case <NUM_LIT:5> : if ( data [ ++ index ] == '<CHAR_LIT>' ) if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNameshort ; else return TokenNameIdentifier ; else if ( ( data [ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNamesuper ; else return TokenNameIdentifier ; case <NUM_LIT:6> : if ( data [ ++ index ] == '<CHAR_LIT>' ) if ( ( data [ ++ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:c>' ) ) { return TokenNamestatic ; } else return TokenNameIdentifier ; else if ( ( data [ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:c>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNameswitch ; else return TokenNameIdentifier ; case <NUM_LIT:8> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:c>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNamestrictfp ; else return TokenNameIdentifier ; case <NUM_LIT:12> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:c>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) { return TokenNamesynchronized ; } else return TokenNameIdentifier ; default : return TokenNameIdentifier ; } case '<CHAR_LIT>' : switch ( length ) { case <NUM_LIT:3> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNametry ; else return TokenNameIdentifier ; case <NUM_LIT:4> : if ( data [ ++ index ] == '<CHAR_LIT>' ) if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNamethis ; else return TokenNameIdentifier ; else if ( ( data [ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) ) return TokenNametrue ; else return TokenNameIdentifier ; case <NUM_LIT:5> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNamethrow ; else return TokenNameIdentifier ; case <NUM_LIT:6> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNamethrows ; else return TokenNameIdentifier ; case <NUM_LIT:9> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) { return TokenNametransient ; } else return TokenNameIdentifier ; default : return TokenNameIdentifier ; } case '<CHAR_LIT>' : switch ( length ) { case <NUM_LIT:4> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) ) return TokenNamevoid ; else return TokenNameIdentifier ; case <NUM_LIT:8> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:a>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) ) { return TokenNamevolatile ; } else return TokenNameIdentifier ; default : return TokenNameIdentifier ; } case '<CHAR_LIT>' : switch ( length ) { case <NUM_LIT:5> : if ( ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT>' ) && ( data [ ++ index ] == '<CHAR_LIT:e>' ) ) return TokenNamewhile ; else return TokenNameIdentifier ; default : return TokenNameIdentifier ; } default : return TokenNameIdentifier ; } } public int scanNumber ( boolean dotPrefix ) throws InvalidInputException { boolean floating = dotPrefix ; if ( ! dotPrefix && ( this . currentCharacter == '<CHAR_LIT:0>' ) ) { if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) { int start = this . currentPosition ; consumeDigits ( <NUM_LIT:16> , true ) ; int end = this . currentPosition ; if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) { if ( end == start ) { throw new InvalidInputException ( INVALID_HEXA ) ; } return TokenNameLongLiteral ; } else if ( getNextChar ( '<CHAR_LIT:.>' ) ) { boolean hasNoDigitsBeforeDot = end == start ; start = this . currentPosition ; consumeDigits ( <NUM_LIT:16> , true ) ; end = this . currentPosition ; if ( hasNoDigitsBeforeDot && end == start ) { if ( this . sourceLevel < ClassFileConstants . JDK1_5 ) { throw new InvalidInputException ( ILLEGAL_HEXA_LITERAL ) ; } throw new InvalidInputException ( INVALID_HEXA ) ; } if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) { this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; } else { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } if ( ( this . currentCharacter == '<CHAR_LIT:->' ) || ( this . currentCharacter == '<CHAR_LIT>' ) ) { this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; } else { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } } if ( ! ScannerHelper . isDigit ( this . currentCharacter ) ) { if ( this . sourceLevel < ClassFileConstants . JDK1_5 ) { throw new InvalidInputException ( ILLEGAL_HEXA_LITERAL ) ; } if ( this . currentCharacter == '<CHAR_LIT:_>' ) { consumeDigits ( <NUM_LIT:10> ) ; throw new InvalidInputException ( INVALID_UNDERSCORE ) ; } throw new InvalidInputException ( INVALID_HEXA ) ; } consumeDigits ( <NUM_LIT:10> ) ; if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) { if ( this . sourceLevel < ClassFileConstants . JDK1_5 ) { throw new InvalidInputException ( ILLEGAL_HEXA_LITERAL ) ; } return TokenNameFloatingPointLiteral ; } if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) { if ( this . sourceLevel < ClassFileConstants . JDK1_5 ) { throw new InvalidInputException ( ILLEGAL_HEXA_LITERAL ) ; } return TokenNameDoubleLiteral ; } if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) { if ( this . sourceLevel < ClassFileConstants . JDK1_5 ) { throw new InvalidInputException ( ILLEGAL_HEXA_LITERAL ) ; } throw new InvalidInputException ( INVALID_HEXA ) ; } if ( this . sourceLevel < ClassFileConstants . JDK1_5 ) { throw new InvalidInputException ( ILLEGAL_HEXA_LITERAL ) ; } return TokenNameDoubleLiteral ; } else { if ( this . sourceLevel < ClassFileConstants . JDK1_5 ) { throw new InvalidInputException ( ILLEGAL_HEXA_LITERAL ) ; } throw new InvalidInputException ( INVALID_HEXA ) ; } } else if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) { this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; } else { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } if ( ( this . currentCharacter == '<CHAR_LIT:->' ) || ( this . currentCharacter == '<CHAR_LIT>' ) ) { this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; } else { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } } if ( ! ScannerHelper . isDigit ( this . currentCharacter ) ) { if ( this . sourceLevel < ClassFileConstants . JDK1_5 ) { throw new InvalidInputException ( ILLEGAL_HEXA_LITERAL ) ; } if ( this . currentCharacter == '<CHAR_LIT:_>' ) { consumeDigits ( <NUM_LIT:10> ) ; throw new InvalidInputException ( INVALID_UNDERSCORE ) ; } throw new InvalidInputException ( INVALID_FLOAT ) ; } consumeDigits ( <NUM_LIT:10> ) ; if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) { if ( this . sourceLevel < ClassFileConstants . JDK1_5 ) { throw new InvalidInputException ( ILLEGAL_HEXA_LITERAL ) ; } return TokenNameFloatingPointLiteral ; } if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) { if ( this . sourceLevel < ClassFileConstants . JDK1_5 ) { throw new InvalidInputException ( ILLEGAL_HEXA_LITERAL ) ; } return TokenNameDoubleLiteral ; } if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) { if ( this . sourceLevel < ClassFileConstants . JDK1_5 ) { throw new InvalidInputException ( ILLEGAL_HEXA_LITERAL ) ; } throw new InvalidInputException ( INVALID_HEXA ) ; } if ( this . sourceLevel < ClassFileConstants . JDK1_5 ) { throw new InvalidInputException ( ILLEGAL_HEXA_LITERAL ) ; } return TokenNameDoubleLiteral ; } else { if ( end == start ) throw new InvalidInputException ( INVALID_HEXA ) ; return TokenNameIntegerLiteral ; } } else if ( getNextChar ( '<CHAR_LIT:b>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) { int start = this . currentPosition ; consumeDigits ( <NUM_LIT:2> , true ) ; int end = this . currentPosition ; if ( end == start ) { if ( this . sourceLevel < ClassFileConstants . JDK1_7 ) { throw new InvalidInputException ( BINARY_LITERAL_NOT_BELOW_17 ) ; } throw new InvalidInputException ( INVALID_BINARY ) ; } if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) { if ( this . sourceLevel < ClassFileConstants . JDK1_7 ) { throw new InvalidInputException ( BINARY_LITERAL_NOT_BELOW_17 ) ; } return TokenNameLongLiteral ; } if ( this . sourceLevel < ClassFileConstants . JDK1_7 ) { throw new InvalidInputException ( BINARY_LITERAL_NOT_BELOW_17 ) ; } return TokenNameIntegerLiteral ; } if ( getNextCharAsDigit ( ) ) { consumeDigits ( <NUM_LIT:10> ) ; if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) { return TokenNameLongLiteral ; } if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) { return TokenNameFloatingPointLiteral ; } if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) { return TokenNameDoubleLiteral ; } else { boolean isInteger = true ; if ( getNextChar ( '<CHAR_LIT:.>' ) ) { isInteger = false ; consumeDigits ( <NUM_LIT:10> ) ; } if ( getNextChar ( '<CHAR_LIT:e>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) { isInteger = false ; this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; } else { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } if ( ( this . currentCharacter == '<CHAR_LIT:->' ) || ( this . currentCharacter == '<CHAR_LIT>' ) ) { this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; } else { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } } if ( ! ScannerHelper . isDigit ( this . currentCharacter ) ) { if ( this . currentCharacter == '<CHAR_LIT:_>' ) { consumeDigits ( <NUM_LIT:10> ) ; throw new InvalidInputException ( INVALID_UNDERSCORE ) ; } throw new InvalidInputException ( INVALID_FLOAT ) ; } consumeDigits ( <NUM_LIT:10> ) ; } if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) return TokenNameFloatingPointLiteral ; if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> || ! isInteger ) return TokenNameDoubleLiteral ; return TokenNameIntegerLiteral ; } } else { } } consumeDigits ( <NUM_LIT:10> ) ; if ( ( ! dotPrefix ) && ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) ) return TokenNameLongLiteral ; if ( ( ! dotPrefix ) && ( getNextChar ( '<CHAR_LIT:.>' ) ) ) { consumeDigits ( <NUM_LIT:10> , true ) ; floating = true ; } if ( getNextChar ( '<CHAR_LIT:e>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) { floating = true ; this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; } else { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } if ( ( this . currentCharacter == '<CHAR_LIT:->' ) || ( this . currentCharacter == '<CHAR_LIT>' ) ) { this . unicodeAsBackSlash = false ; if ( ( ( this . currentCharacter = this . source [ this . currentPosition ++ ] ) == '<STR_LIT:\\>' ) && ( this . source [ this . currentPosition ] == '<CHAR_LIT>' ) ) { getNextUnicodeChar ( ) ; } else { if ( this . withoutUnicodePtr != <NUM_LIT:0> ) { unicodeStore ( ) ; } } } if ( ! ScannerHelper . isDigit ( this . currentCharacter ) ) { if ( this . currentCharacter == '<CHAR_LIT:_>' ) { consumeDigits ( <NUM_LIT:10> ) ; throw new InvalidInputException ( INVALID_UNDERSCORE ) ; } throw new InvalidInputException ( INVALID_FLOAT ) ; } consumeDigits ( <NUM_LIT:10> ) ; } if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) return TokenNameDoubleLiteral ; if ( getNextChar ( '<CHAR_LIT>' , '<CHAR_LIT>' ) >= <NUM_LIT:0> ) return TokenNameFloatingPointLiteral ; return floating ? TokenNameDoubleLiteral : TokenNameIntegerLiteral ; } public final int getLineNumber ( int position ) { return Util . getLineNumber ( position , this . lineEnds , <NUM_LIT:0> , this . linePtr ) ; } public final void setSource ( char [ ] sourceString ) { int sourceLength ; if ( sourceString == null ) { this . source = CharOperation . NO_CHAR ; sourceLength = <NUM_LIT:0> ; } else { this . source = sourceString ; sourceLength = sourceString . length ; } this . startPosition = - <NUM_LIT:1> ; this . eofPosition = sourceLength ; this . initialPosition = this . currentPosition = <NUM_LIT:0> ; this . containsAssertKeyword = false ; this . linePtr = - <NUM_LIT:1> ; } public final void setSource ( char [ ] contents , CompilationResult compilationResult ) { if ( contents == null ) { char [ ] cuContents = compilationResult . compilationUnit . getContents ( ) ; setSource ( cuContents ) ; } else { setSource ( contents ) ; } int [ ] lineSeparatorPositions = compilationResult . lineSeparatorPositions ; if ( lineSeparatorPositions != null ) { this . lineEnds = lineSeparatorPositions ; this . linePtr = lineSeparatorPositions . length - <NUM_LIT:1> ; } } public final void setSource ( CompilationResult compilationResult ) { setSource ( null , compilationResult ) ; } public String toString ( ) { if ( this . startPosition == this . eofPosition ) return "<STR_LIT>" + new String ( this . source ) ; if ( this . currentPosition > this . eofPosition ) return "<STR_LIT>" + new String ( this . source ) ; if ( this . currentPosition <= <NUM_LIT:0> ) return "<STR_LIT>" + new String ( this . source ) ; StringBuffer buffer = new StringBuffer ( ) ; if ( this . startPosition < <NUM_LIT:1000> ) { buffer . append ( this . source , <NUM_LIT:0> , this . startPosition ) ; } else { buffer . append ( "<STR_LIT>" ) ; int line = Util . getLineNumber ( this . startPosition - <NUM_LIT:1000> , this . lineEnds , <NUM_LIT:0> , this . linePtr ) ; int lineStart = getLineStart ( line ) ; buffer . append ( this . source , lineStart , this . startPosition - lineStart ) ; } buffer . append ( "<STR_LIT>" ) ; int middleLength = ( this . currentPosition - <NUM_LIT:1> ) - this . startPosition + <NUM_LIT:1> ; if ( middleLength > - <NUM_LIT:1> ) { buffer . append ( this . source , this . startPosition , middleLength ) ; } buffer . append ( "<STR_LIT>" ) ; buffer . append ( this . source , ( this . currentPosition - <NUM_LIT:1> ) + <NUM_LIT:1> , this . eofPosition - ( this . currentPosition - <NUM_LIT:1> ) - <NUM_LIT:1> ) ; return buffer . toString ( ) ; } public String toStringAction ( int act ) { switch ( act ) { case TokenNameIdentifier : return "<STR_LIT>" + new String ( getCurrentTokenSource ( ) ) + "<STR_LIT:)>" ; case TokenNameabstract : return "<STR_LIT>" ; case TokenNameboolean : return "<STR_LIT:boolean>" ; case TokenNamebreak : return "<STR_LIT>" ; case TokenNamebyte : return "<STR_LIT>" ; case TokenNamecase : return "<STR_LIT>" ; case TokenNamecatch : return "<STR_LIT>" ; case TokenNamechar : return "<STR_LIT>" ; case TokenNameclass : return "<STR_LIT:class>" ; case TokenNamecontinue : return "<STR_LIT>" ; case TokenNamedefault : return "<STR_LIT:default>" ; case TokenNamedo : return "<STR_LIT>" ; case TokenNamedouble : return "<STR_LIT:double>" ; case TokenNameelse : return "<STR_LIT>" ; case TokenNameextends : return "<STR_LIT>" ; case TokenNamefalse : return "<STR_LIT:false>" ; case TokenNamefinal : return "<STR_LIT>" ; case TokenNamefinally : return "<STR_LIT>" ; case TokenNamefloat : return "<STR_LIT:float>" ; case TokenNamefor : return "<STR_LIT>" ; case TokenNameif : return "<STR_LIT>" ; case TokenNameimplements : return "<STR_LIT>" ; case TokenNameimport : return "<STR_LIT>" ; case TokenNameinstanceof : return "<STR_LIT>" ; case TokenNameint : return "<STR_LIT:int>" ; case TokenNameinterface : return "<STR_LIT>" ; case TokenNamelong : return "<STR_LIT:long>" ; case TokenNamenative : return "<STR_LIT>" ; case TokenNamenew : return "<STR_LIT>" ; case TokenNamenull : return "<STR_LIT:null>" ; case TokenNamepackage : return "<STR_LIT>" ; case TokenNameprivate : return "<STR_LIT>" ; case TokenNameprotected : return "<STR_LIT>" ; case TokenNamepublic : return "<STR_LIT>" ; case TokenNamereturn : return "<STR_LIT>" ; case TokenNameshort : return "<STR_LIT>" ; case TokenNamestatic : return "<STR_LIT>" ; case TokenNamesuper : return "<STR_LIT>" ; case TokenNameswitch : return "<STR_LIT>" ; case TokenNamesynchronized : return "<STR_LIT>" ; case TokenNamethis : return "<STR_LIT>" ; case TokenNamethrow : return "<STR_LIT>" ; case TokenNamethrows : return "<STR_LIT>" ; case TokenNametransient : return "<STR_LIT>" ; case TokenNametrue : return "<STR_LIT:true>" ; case TokenNametry : return "<STR_LIT>" ; case TokenNamevoid : return "<STR_LIT>" ; case TokenNamevolatile : return "<STR_LIT>" ; case TokenNamewhile : return "<STR_LIT>" ; case TokenNameIntegerLiteral : return "<STR_LIT>" + new String ( getCurrentTokenSource ( ) ) + "<STR_LIT:)>" ; case TokenNameLongLiteral : return "<STR_LIT>" + new String ( getCurrentTokenSource ( ) ) + "<STR_LIT:)>" ; case TokenNameFloatingPointLiteral : return "<STR_LIT>" + new String ( getCurrentTokenSource ( ) ) + "<STR_LIT:)>" ; case TokenNameDoubleLiteral : return "<STR_LIT>" + new String ( getCurrentTokenSource ( ) ) + "<STR_LIT:)>" ; case TokenNameCharacterLiteral : return "<STR_LIT>" + new String ( getCurrentTokenSource ( ) ) + "<STR_LIT:)>" ; case TokenNameStringLiteral : return "<STR_LIT>" + new String ( getCurrentTokenSource ( ) ) + "<STR_LIT:)>" ; case TokenNamePLUS_PLUS : return "<STR_LIT>" ; case TokenNameMINUS_MINUS : return "<STR_LIT:-->" ; case TokenNameEQUAL_EQUAL : return "<STR_LIT>" ; case TokenNameLESS_EQUAL : return "<STR_LIT>" ; case TokenNameGREATER_EQUAL : return "<STR_LIT>" ; case TokenNameNOT_EQUAL : return "<STR_LIT>" ; case TokenNameLEFT_SHIFT : return "<STR_LIT>" ; case TokenNameRIGHT_SHIFT : return "<STR_LIT>" ; case TokenNameUNSIGNED_RIGHT_SHIFT : return "<STR_LIT>" ; case TokenNamePLUS_EQUAL : return "<STR_LIT>" ; case TokenNameMINUS_EQUAL : return "<STR_LIT>" ; case TokenNameMULTIPLY_EQUAL : return "<STR_LIT>" ; case TokenNameDIVIDE_EQUAL : return "<STR_LIT>" ; case TokenNameAND_EQUAL : return "<STR_LIT>" ; case TokenNameOR_EQUAL : return "<STR_LIT>" ; case TokenNameXOR_EQUAL : return "<STR_LIT>" ; case TokenNameREMAINDER_EQUAL : return "<STR_LIT>" ; case TokenNameLEFT_SHIFT_EQUAL : return "<STR_LIT>" ; case TokenNameRIGHT_SHIFT_EQUAL : return "<STR_LIT>" ; case TokenNameUNSIGNED_RIGHT_SHIFT_EQUAL : return "<STR_LIT>" ; case TokenNameOR_OR : return "<STR_LIT>" ; case TokenNameAND_AND : return "<STR_LIT>" ; case TokenNamePLUS : return "<STR_LIT:+>" ; case TokenNameMINUS : return "<STR_LIT:->" ; case TokenNameNOT : return "<STR_LIT:!>" ; case TokenNameREMAINDER : return "<STR_LIT:%>" ; case TokenNameXOR : return "<STR_LIT>" ; case TokenNameAND : return "<STR_LIT:&>" ; case TokenNameMULTIPLY : return "<STR_LIT:*>" ; case TokenNameOR : return "<STR_LIT:|>" ; case TokenNameTWIDDLE : return "<STR_LIT>" ; case TokenNameDIVIDE : return "<STR_LIT:/>" ; case TokenNameGREATER : return "<STR_LIT:>>" ; case TokenNameLESS : return "<STR_LIT:<>" ; case TokenNameLPAREN : return "<STR_LIT:(>" ; case TokenNameRPAREN : return "<STR_LIT:)>" ; case TokenNameLBRACE : return "<STR_LIT:{>" ; case TokenNameRBRACE : return "<STR_LIT:}>" ; case TokenNameLBRACKET : return "<STR_LIT:[>" ; case TokenNameRBRACKET : return "<STR_LIT:]>" ; case TokenNameSEMICOLON : return "<STR_LIT:;>" ; case TokenNameQUESTION : return "<STR_LIT:?>" ; case TokenNameCOLON : return "<STR_LIT::>" ; case TokenNameCOMMA : return "<STR_LIT:U+002C>" ; case TokenNameDOT : return "<STR_LIT:.>" ; case TokenNameEQUAL : return "<STR_LIT:=>" ; case TokenNameEOF : return "<STR_LIT>" ; case TokenNameWHITESPACE : return "<STR_LIT>" + new String ( getCurrentTokenSource ( ) ) + "<STR_LIT:)>" ; default : return "<STR_LIT>" ; } } public void unicodeInitializeBuffer ( int length ) { this . withoutUnicodePtr = length ; if ( this . withoutUnicodeBuffer == null ) this . withoutUnicodeBuffer = new char [ length + ( <NUM_LIT:1> + <NUM_LIT:10> ) ] ; int bLength = this . withoutUnicodeBuffer . length ; if ( <NUM_LIT:1> + length >= bLength ) { System . arraycopy ( this . withoutUnicodeBuffer , <NUM_LIT:0> , this . withoutUnicodeBuffer = new char [ length + ( <NUM_LIT:1> + <NUM_LIT:10> ) ] , <NUM_LIT:0> , bLength ) ; } System . arraycopy ( this . source , this . startPosition , this . withoutUnicodeBuffer , <NUM_LIT:1> , length ) ; } public void unicodeStore ( ) { int pos = ++ this . withoutUnicodePtr ; if ( this . withoutUnicodeBuffer == null ) this . withoutUnicodeBuffer = new char [ <NUM_LIT:10> ] ; int length = this . withoutUnicodeBuffer . length ; if ( pos == length ) { System . arraycopy ( this . withoutUnicodeBuffer , <NUM_LIT:0> , this . withoutUnicodeBuffer = new char [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; } this . withoutUnicodeBuffer [ pos ] = this . currentCharacter ; } public void unicodeStore ( char character ) { int pos = ++ this . withoutUnicodePtr ; if ( this . withoutUnicodeBuffer == null ) this . withoutUnicodeBuffer = new char [ <NUM_LIT:10> ] ; int length = this . withoutUnicodeBuffer . length ; if ( pos == length ) { System . arraycopy ( this . withoutUnicodeBuffer , <NUM_LIT:0> , this . withoutUnicodeBuffer = new char [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; } this . withoutUnicodeBuffer [ pos ] = character ; } public static boolean isIdentifier ( int token ) { return token == TerminalTokens . TokenNameIdentifier ; } public static boolean isLiteral ( int token ) { switch ( token ) { case TerminalTokens . TokenNameIntegerLiteral : case TerminalTokens . TokenNameLongLiteral : case TerminalTokens . TokenNameFloatingPointLiteral : case TerminalTokens . TokenNameDoubleLiteral : case TerminalTokens . TokenNameStringLiteral : case TerminalTokens . TokenNameCharacterLiteral : return true ; default : return false ; } } public static boolean isKeyword ( int token ) { switch ( token ) { case TerminalTokens . TokenNameabstract : case TerminalTokens . TokenNameassert : case TerminalTokens . TokenNamebyte : case TerminalTokens . TokenNamebreak : case TerminalTokens . TokenNameboolean : case TerminalTokens . TokenNamecase : case TerminalTokens . TokenNamechar : case TerminalTokens . TokenNamecatch : case TerminalTokens . TokenNameclass : case TerminalTokens . TokenNamecontinue : case TerminalTokens . TokenNamedo : case TerminalTokens . TokenNamedouble : case TerminalTokens . TokenNamedefault : case TerminalTokens . TokenNameelse : case TerminalTokens . TokenNameextends : case TerminalTokens . TokenNamefor : case TerminalTokens . TokenNamefinal : case TerminalTokens . TokenNamefloat : case TerminalTokens . TokenNamefalse : case TerminalTokens . TokenNamefinally : case TerminalTokens . TokenNameif : case TerminalTokens . TokenNameint : case TerminalTokens . TokenNameimport : case TerminalTokens . TokenNameinterface : case TerminalTokens . TokenNameimplements : case TerminalTokens . TokenNameinstanceof : case TerminalTokens . TokenNamelong : case TerminalTokens . TokenNamenew : case TerminalTokens . TokenNamenull : case TerminalTokens . TokenNamenative : case TerminalTokens . TokenNamepublic : case TerminalTokens . TokenNamepackage : case TerminalTokens . TokenNameprivate : case TerminalTokens . TokenNameprotected : case TerminalTokens . TokenNamereturn : case TerminalTokens . TokenNameshort : case TerminalTokens . TokenNamesuper : case TerminalTokens . TokenNamestatic : case TerminalTokens . TokenNameswitch : case TerminalTokens . TokenNamestrictfp : case TerminalTokens . TokenNamesynchronized : case TerminalTokens . TokenNametry : case TerminalTokens . TokenNamethis : case TerminalTokens . TokenNametrue : case TerminalTokens . TokenNamethrow : case TerminalTokens . TokenNamethrows : case TerminalTokens . TokenNametransient : case TerminalTokens . TokenNamevoid : case TerminalTokens . TokenNamevolatile : case TerminalTokens . TokenNamewhile : return true ; default : return false ; } } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . util . ClassFormatException ; import org . eclipse . jdt . core . util . IConstantPool ; import org . eclipse . jdt . core . util . IStackMapFrame ; import org . eclipse . jdt . core . util . IVerificationTypeInfo ; public class StackMapFrame extends ClassFileStruct implements IStackMapFrame { private static final IVerificationTypeInfo [ ] EMPTY_LOCALS_OR_STACK_ITEMS = new IVerificationTypeInfo [ <NUM_LIT:0> ] ; private int readOffset ; private int frameType ; private int numberOfLocals ; private int numberOfStackItems ; private IVerificationTypeInfo [ ] locals ; private IVerificationTypeInfo [ ] stackItems ; private int offsetDelta ; public StackMapFrame ( byte [ ] classFileBytes , IConstantPool constantPool , int offset ) throws ClassFormatException { final int type = u1At ( classFileBytes , <NUM_LIT:0> , offset ) ; this . frameType = type ; switch ( type ) { case <NUM_LIT> : this . offsetDelta = u2At ( classFileBytes , <NUM_LIT:1> , offset ) ; this . numberOfStackItems = <NUM_LIT:1> ; this . stackItems = new VerificationInfo [ <NUM_LIT:1> ] ; this . readOffset = <NUM_LIT:3> ; VerificationInfo info = new VerificationInfo ( classFileBytes , constantPool , offset + this . readOffset ) ; this . stackItems [ <NUM_LIT:0> ] = info ; this . readOffset += info . sizeInBytes ( ) ; this . locals = EMPTY_LOCALS_OR_STACK_ITEMS ; this . numberOfLocals = <NUM_LIT:0> ; break ; case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : this . offsetDelta = u2At ( classFileBytes , <NUM_LIT:1> , offset ) ; this . numberOfStackItems = <NUM_LIT:0> ; this . stackItems = EMPTY_LOCALS_OR_STACK_ITEMS ; this . readOffset = <NUM_LIT:3> ; this . locals = EMPTY_LOCALS_OR_STACK_ITEMS ; this . numberOfLocals = <NUM_LIT:0> ; break ; case <NUM_LIT> : this . offsetDelta = u2At ( classFileBytes , <NUM_LIT:1> , offset ) ; this . numberOfStackItems = <NUM_LIT:0> ; this . stackItems = EMPTY_LOCALS_OR_STACK_ITEMS ; this . readOffset = <NUM_LIT:3> ; this . locals = EMPTY_LOCALS_OR_STACK_ITEMS ; this . numberOfLocals = <NUM_LIT:0> ; break ; case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : this . offsetDelta = u2At ( classFileBytes , <NUM_LIT:1> , offset ) ; this . numberOfStackItems = <NUM_LIT:0> ; this . stackItems = EMPTY_LOCALS_OR_STACK_ITEMS ; this . readOffset = <NUM_LIT:3> ; int diffLocals = type - <NUM_LIT> ; this . numberOfLocals = diffLocals ; this . locals = new IVerificationTypeInfo [ diffLocals ] ; for ( int i = <NUM_LIT:0> ; i < diffLocals ; i ++ ) { VerificationInfo verificationInfo = new VerificationInfo ( classFileBytes , constantPool , offset + this . readOffset ) ; this . locals [ i ] = verificationInfo ; this . readOffset += verificationInfo . sizeInBytes ( ) ; } break ; case <NUM_LIT:255> : this . offsetDelta = u2At ( classFileBytes , <NUM_LIT:1> , offset ) ; int tempLocals = u2At ( classFileBytes , <NUM_LIT:3> , offset ) ; this . numberOfLocals = tempLocals ; this . readOffset = <NUM_LIT:5> ; if ( tempLocals != <NUM_LIT:0> ) { this . locals = new IVerificationTypeInfo [ tempLocals ] ; for ( int i = <NUM_LIT:0> ; i < tempLocals ; i ++ ) { VerificationInfo verificationInfo = new VerificationInfo ( classFileBytes , constantPool , offset + this . readOffset ) ; this . locals [ i ] = verificationInfo ; this . readOffset += verificationInfo . sizeInBytes ( ) ; } } else { this . locals = EMPTY_LOCALS_OR_STACK_ITEMS ; } int tempStackItems = u2At ( classFileBytes , this . readOffset , offset ) ; this . readOffset += <NUM_LIT:2> ; this . numberOfStackItems = tempStackItems ; if ( tempStackItems != <NUM_LIT:0> ) { this . stackItems = new IVerificationTypeInfo [ tempStackItems ] ; for ( int i = <NUM_LIT:0> ; i < tempStackItems ; i ++ ) { VerificationInfo verificationInfo = new VerificationInfo ( classFileBytes , constantPool , offset + this . readOffset ) ; this . stackItems [ i ] = verificationInfo ; this . readOffset += verificationInfo . sizeInBytes ( ) ; } } else { this . stackItems = EMPTY_LOCALS_OR_STACK_ITEMS ; } break ; default : if ( type <= <NUM_LIT> ) { this . offsetDelta = type ; this . numberOfStackItems = <NUM_LIT:0> ; this . stackItems = EMPTY_LOCALS_OR_STACK_ITEMS ; this . locals = EMPTY_LOCALS_OR_STACK_ITEMS ; this . numberOfLocals = <NUM_LIT:0> ; this . readOffset = <NUM_LIT:1> ; } else if ( type <= <NUM_LIT> ) { this . offsetDelta = type - <NUM_LIT> ; this . numberOfStackItems = <NUM_LIT:1> ; this . stackItems = new VerificationInfo [ <NUM_LIT:1> ] ; this . readOffset = <NUM_LIT:1> ; info = new VerificationInfo ( classFileBytes , constantPool , offset + this . readOffset ) ; this . stackItems [ <NUM_LIT:0> ] = info ; this . readOffset += info . sizeInBytes ( ) ; this . locals = EMPTY_LOCALS_OR_STACK_ITEMS ; this . numberOfLocals = <NUM_LIT:0> ; } } } int sizeInBytes ( ) { return this . readOffset ; } public int getFrameType ( ) { return this . frameType ; } public IVerificationTypeInfo [ ] getLocals ( ) { return this . locals ; } public int getNumberOfLocals ( ) { return this . numberOfLocals ; } public int getNumberOfStackItems ( ) { return this . numberOfStackItems ; } public int getOffsetDelta ( ) { return this . offsetDelta ; } public IVerificationTypeInfo [ ] getStackItems ( ) { return this . stackItems ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . util . ClassFormatException ; import org . eclipse . jdt . core . util . IAnnotation ; import org . eclipse . jdt . core . util . IConstantPool ; import org . eclipse . jdt . core . util . IRuntimeInvisibleAnnotationsAttribute ; public class RuntimeInvisibleAnnotationsAttribute extends ClassFileAttribute implements IRuntimeInvisibleAnnotationsAttribute { private static final IAnnotation [ ] NO_ENTRIES = new IAnnotation [ <NUM_LIT:0> ] ; private int annotationsNumber ; private IAnnotation [ ] annotations ; public RuntimeInvisibleAnnotationsAttribute ( byte [ ] classFileBytes , IConstantPool constantPool , int offset ) throws ClassFormatException { super ( classFileBytes , constantPool , offset ) ; final int length = u2At ( classFileBytes , <NUM_LIT:6> , offset ) ; this . annotationsNumber = length ; if ( length != <NUM_LIT:0> ) { int readOffset = <NUM_LIT:8> ; this . annotations = new IAnnotation [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { Annotation annotation = new Annotation ( classFileBytes , constantPool , offset + readOffset ) ; this . annotations [ i ] = annotation ; readOffset += annotation . sizeInBytes ( ) ; } } else { this . annotations = NO_ENTRIES ; } } public IAnnotation [ ] getAnnotations ( ) { return this . annotations ; } public int getAnnotationsNumber ( ) { return this . annotationsNumber ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . Signature ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . core . util . ClassFileBytesDisassembler ; import org . eclipse . jdt . core . util . IBytecodeVisitor ; import org . eclipse . jdt . core . util . ICodeAttribute ; import org . eclipse . jdt . core . util . IConstantPoolConstant ; import org . eclipse . jdt . core . util . IConstantPoolEntry ; import org . eclipse . jdt . core . util . ILocalVariableAttribute ; import org . eclipse . jdt . core . util . ILocalVariableTableEntry ; import org . eclipse . jdt . core . util . OpcodeStringValues ; import org . eclipse . jdt . core . util . IOpcodeMnemonics ; public class DefaultBytecodeVisitor implements IBytecodeVisitor { private static final String EMPTY_CLASS_NAME = "<STR_LIT>" ; private static final String EMPTY_LOCAL_NAME = "<STR_LIT>" ; private static final int T_BOOLEAN = <NUM_LIT:4> ; private static final int T_CHAR = <NUM_LIT:5> ; private static final int T_FLOAT = <NUM_LIT:6> ; private static final int T_DOUBLE = <NUM_LIT:7> ; private static final int T_BYTE = <NUM_LIT:8> ; private static final int T_SHORT = <NUM_LIT:9> ; private static final int T_INT = <NUM_LIT:10> ; private static final int T_LONG = <NUM_LIT:11> ; private StringBuffer buffer ; private String lineSeparator ; private int tabNumber ; private int digitNumberForPC ; private ILocalVariableTableEntry [ ] localVariableTableEntries ; private int localVariableAttributeLength ; private int mode ; private char [ ] [ ] parameterNames ; private boolean isStatic ; private int [ ] argumentSizes ; public DefaultBytecodeVisitor ( ICodeAttribute codeAttribute , char [ ] [ ] parameterNames , char [ ] methodDescriptor , boolean isStatic , StringBuffer buffer , String lineSeparator , int tabNumber , int mode ) { ILocalVariableAttribute localVariableAttribute = codeAttribute . getLocalVariableAttribute ( ) ; this . localVariableAttributeLength = localVariableAttribute == null ? <NUM_LIT:0> : localVariableAttribute . getLocalVariableTableLength ( ) ; if ( this . localVariableAttributeLength != <NUM_LIT:0> ) { this . localVariableTableEntries = localVariableAttribute . getLocalVariableTable ( ) ; } else { this . localVariableTableEntries = null ; } this . buffer = buffer ; this . lineSeparator = lineSeparator ; this . tabNumber = tabNumber + <NUM_LIT:1> ; long codeLength = codeAttribute . getCodeLength ( ) ; this . digitNumberForPC = Long . toString ( codeLength ) . length ( ) ; this . mode = mode ; this . parameterNames = parameterNames ; this . isStatic = isStatic ; if ( parameterNames != null ) { char [ ] [ ] parameterTypes = Signature . getParameterTypes ( methodDescriptor ) ; int length = parameterTypes . length ; this . argumentSizes = new int [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { char [ ] parameterType = parameterTypes [ i ] ; this . argumentSizes [ i ] = parameterType . length == <NUM_LIT:1> && ( parameterType [ <NUM_LIT:0> ] == '<CHAR_LIT>' || parameterType [ <NUM_LIT:0> ] == '<CHAR_LIT>' ) ? <NUM_LIT:2> : <NUM_LIT:1> ; } } } public void _aaload ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . AALOAD ] ) ; writeNewLine ( ) ; } private void dumpPcNumber ( int pc ) { writeTabs ( ) ; int digitForPC = <NUM_LIT:1> ; if ( pc != <NUM_LIT:0> ) { digitForPC = Integer . toString ( pc ) . length ( ) ; } for ( int i = <NUM_LIT:0> , max = this . digitNumberForPC - digitForPC ; i < max ; i ++ ) { this . buffer . append ( '<CHAR_LIT:U+0020>' ) ; } this . buffer . append ( pc ) ; this . buffer . append ( Messages . disassembler_indentation ) ; } public void _aastore ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . AASTORE ] ) ; writeNewLine ( ) ; } public void _aconst_null ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . ACONST_NULL ] ) ; writeNewLine ( ) ; } public void _aload_0 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_load , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . ALOAD_0 ] , getLocalVariableName ( pc , <NUM_LIT:0> ) } ) ) ; writeNewLine ( ) ; } public void _aload_1 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_load , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . ALOAD_1 ] , getLocalVariableName ( pc , <NUM_LIT:1> ) } ) ) ; writeNewLine ( ) ; } public void _aload_2 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_load , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . ALOAD_2 ] , getLocalVariableName ( pc , <NUM_LIT:2> ) } ) ) ; writeNewLine ( ) ; } public void _aload_3 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_load , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . ALOAD_3 ] , getLocalVariableName ( pc , <NUM_LIT:3> ) } ) ) ; writeNewLine ( ) ; } public void _aload ( int pc , int index ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_load , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . ALOAD ] , getLocalVariableName ( pc , index , true ) } ) ) ; writeNewLine ( ) ; } public void _anewarray ( int pc , int index , IConstantPoolEntry constantClass ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_anewarray , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . ANEWARRAY ] , Integer . toString ( index ) , returnConstantClassName ( constantClass ) } ) ) ; writeNewLine ( ) ; } public void _areturn ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . ARETURN ] ) ; writeNewLine ( ) ; } public void _arraylength ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . ARRAYLENGTH ] ) ; writeNewLine ( ) ; } public void _astore_0 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_store , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . ASTORE_0 ] , getLocalVariableName ( pc , <NUM_LIT:0> ) } ) ) ; writeNewLine ( ) ; } public void _astore_1 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_store , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . ASTORE_1 ] , getLocalVariableName ( pc , <NUM_LIT:1> ) } ) ) ; writeNewLine ( ) ; } private String getLocalVariableName ( int pc , int index ) { return getLocalVariableName ( pc , index , false ) ; } private String getLocalVariableName ( int pc , int index , boolean showIndex ) { int nextPC = pc + <NUM_LIT:1> ; switch ( index ) { case <NUM_LIT:0> : case <NUM_LIT:1> : case <NUM_LIT:2> : case <NUM_LIT:3> : break ; default : nextPC = index <= <NUM_LIT:255> ? pc + <NUM_LIT:2> : pc + <NUM_LIT:3> ; } for ( int i = <NUM_LIT:0> , max = this . localVariableAttributeLength ; i < max ; i ++ ) { final ILocalVariableTableEntry entry = this . localVariableTableEntries [ i ] ; final int startPC = entry . getStartPC ( ) ; if ( entry . getIndex ( ) == index && ( startPC <= nextPC ) && ( ( startPC + entry . getLength ( ) ) > nextPC ) ) { final StringBuffer stringBuffer = new StringBuffer ( ) ; if ( showIndex ) { stringBuffer . append ( '<CHAR_LIT:U+0020>' ) . append ( index ) ; } stringBuffer . append ( '<CHAR_LIT:U+0020>' ) . append ( '<CHAR_LIT:[>' ) . append ( entry . getName ( ) ) . append ( '<CHAR_LIT:]>' ) ; return String . valueOf ( stringBuffer ) ; } } if ( this . parameterNames != null ) { if ( index == <NUM_LIT:0> ) { if ( ! this . isStatic ) { final StringBuffer stringBuffer = new StringBuffer ( ) ; stringBuffer . append ( '<CHAR_LIT:U+0020>' ) . append ( '<CHAR_LIT:[>' ) . append ( "<STR_LIT>" ) . append ( '<CHAR_LIT:]>' ) ; return String . valueOf ( stringBuffer ) ; } } int indexInParameterNames = index ; if ( index != <NUM_LIT:0> ) { int resolvedPosition = <NUM_LIT:0> ; if ( ! this . isStatic ) { resolvedPosition = <NUM_LIT:1> ; } int i = <NUM_LIT:0> ; loop : for ( int max = this . argumentSizes . length ; i < max ; i ++ ) { if ( index == resolvedPosition ) { break loop ; } resolvedPosition += this . argumentSizes [ i ] ; } indexInParameterNames = i ; } if ( indexInParameterNames < this . parameterNames . length && this . parameterNames [ indexInParameterNames ] != null ) { final StringBuffer stringBuffer = new StringBuffer ( ) ; if ( showIndex ) { stringBuffer . append ( '<CHAR_LIT:U+0020>' ) . append ( index ) ; } stringBuffer . append ( '<CHAR_LIT:U+0020>' ) . append ( '<CHAR_LIT:[>' ) . append ( this . parameterNames [ indexInParameterNames ] ) . append ( '<CHAR_LIT:]>' ) ; return String . valueOf ( stringBuffer ) ; } } if ( showIndex ) { final StringBuffer stringBuffer = new StringBuffer ( ) ; stringBuffer . append ( '<CHAR_LIT:U+0020>' ) . append ( index ) ; return String . valueOf ( stringBuffer ) ; } return EMPTY_LOCAL_NAME ; } public void _astore_2 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_store , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . ASTORE_2 ] , getLocalVariableName ( pc , <NUM_LIT:2> ) } ) ) ; writeNewLine ( ) ; } public void _astore_3 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_store , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . ASTORE_3 ] , getLocalVariableName ( pc , <NUM_LIT:3> ) } ) ) ; writeNewLine ( ) ; } public void _astore ( int pc , int index ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_store , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . ASTORE ] , getLocalVariableName ( pc , index , true ) } ) ) ; writeNewLine ( ) ; } public void _athrow ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . ATHROW ] ) ; writeNewLine ( ) ; } public void _baload ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . BALOAD ] ) ; writeNewLine ( ) ; } public void _bastore ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . BASTORE ] ) ; writeNewLine ( ) ; } public void _bipush ( int pc , byte _byte ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . BIPUSH ] ) . append ( Messages . disassembler_space ) . append ( _byte ) ; writeNewLine ( ) ; } public void _caload ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . CALOAD ] ) ; writeNewLine ( ) ; } public void _castore ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . CASTORE ] ) ; writeNewLine ( ) ; } public void _checkcast ( int pc , int index , IConstantPoolEntry constantClass ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_checkcast , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . CHECKCAST ] , Integer . toString ( index ) , returnConstantClassName ( constantClass ) } ) ) ; writeNewLine ( ) ; } public void _d2f ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . D2F ] ) ; writeNewLine ( ) ; } public void _d2i ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . D2I ] ) ; writeNewLine ( ) ; } public void _d2l ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . D2L ] ) ; writeNewLine ( ) ; } public void _dadd ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . DADD ] ) ; writeNewLine ( ) ; } public void _daload ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . DALOAD ] ) ; writeNewLine ( ) ; } public void _dastore ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . DASTORE ] ) ; writeNewLine ( ) ; } public void _dcmpg ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . DCMPG ] ) ; writeNewLine ( ) ; } public void _dcmpl ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . DCMPL ] ) ; writeNewLine ( ) ; } public void _dconst_0 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . DCONST_0 ] ) ; writeNewLine ( ) ; } public void _dconst_1 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . DCONST_1 ] ) ; writeNewLine ( ) ; } public void _ddiv ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . DDIV ] ) ; writeNewLine ( ) ; } public void _dload_0 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_load , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . DLOAD_0 ] , getLocalVariableName ( pc , <NUM_LIT:0> ) } ) ) ; writeNewLine ( ) ; } public void _dload_1 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_load , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . DLOAD_1 ] , getLocalVariableName ( pc , <NUM_LIT:1> ) } ) ) ; writeNewLine ( ) ; } public void _dload_2 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_load , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . DLOAD_2 ] , getLocalVariableName ( pc , <NUM_LIT:2> ) } ) ) ; writeNewLine ( ) ; } public void _dload_3 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_load , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . DLOAD_3 ] , getLocalVariableName ( pc , <NUM_LIT:3> ) } ) ) ; writeNewLine ( ) ; } public void _dload ( int pc , int index ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_load , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . DLOAD ] , getLocalVariableName ( pc , index , true ) } ) ) ; writeNewLine ( ) ; } public void _dmul ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . DMUL ] ) ; writeNewLine ( ) ; } public void _dneg ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . DNEG ] ) ; writeNewLine ( ) ; } public void _drem ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . DREM ] ) ; writeNewLine ( ) ; } public void _dreturn ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . DRETURN ] ) ; writeNewLine ( ) ; } public void _dstore_0 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_store , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . DSTORE_0 ] , getLocalVariableName ( pc , <NUM_LIT:0> ) } ) ) ; writeNewLine ( ) ; } public void _dstore_1 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_store , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . DSTORE_1 ] , getLocalVariableName ( pc , <NUM_LIT:1> ) } ) ) ; writeNewLine ( ) ; } public void _dstore_2 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_store , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . DSTORE_2 ] , getLocalVariableName ( pc , <NUM_LIT:2> ) } ) ) ; writeNewLine ( ) ; } public void _dstore_3 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_store , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . DSTORE_3 ] , getLocalVariableName ( pc , <NUM_LIT:3> ) } ) ) ; writeNewLine ( ) ; } public void _dstore ( int pc , int index ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_store , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . DSTORE ] , getLocalVariableName ( pc , index , true ) } ) ) ; writeNewLine ( ) ; } public void _dsub ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . DSUB ] ) ; writeNewLine ( ) ; } public void _dup_x1 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . DUP_X1 ] ) ; writeNewLine ( ) ; } public void _dup_x2 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . DUP_X2 ] ) ; writeNewLine ( ) ; } public void _dup ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . DUP ] ) ; writeNewLine ( ) ; } public void _dup2_x1 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . DUP2_X1 ] ) ; writeNewLine ( ) ; } public void _dup2_x2 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . DUP2_X2 ] ) ; writeNewLine ( ) ; } public void _dup2 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . DUP2 ] ) ; writeNewLine ( ) ; } public void _f2d ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . F2D ] ) ; writeNewLine ( ) ; } public void _f2i ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . F2I ] ) ; writeNewLine ( ) ; } public void _f2l ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . F2L ] ) ; writeNewLine ( ) ; } public void _fadd ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . FADD ] ) ; writeNewLine ( ) ; } public void _faload ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . FALOAD ] ) ; writeNewLine ( ) ; } public void _fastore ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . FASTORE ] ) ; writeNewLine ( ) ; } public void _fcmpg ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . FCMPG ] ) ; writeNewLine ( ) ; } public void _fcmpl ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . FCMPL ] ) ; writeNewLine ( ) ; } public void _fconst_0 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . FCONST_0 ] ) ; writeNewLine ( ) ; } public void _fconst_1 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . FCONST_1 ] ) ; writeNewLine ( ) ; } public void _fconst_2 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . FCONST_2 ] ) ; writeNewLine ( ) ; } public void _fdiv ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . FDIV ] ) ; writeNewLine ( ) ; } public void _fload_0 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_load , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . FLOAD_0 ] , getLocalVariableName ( pc , <NUM_LIT:0> ) } ) ) ; writeNewLine ( ) ; } public void _fload_1 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_load , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . FLOAD_1 ] , getLocalVariableName ( pc , <NUM_LIT:1> ) } ) ) ; writeNewLine ( ) ; } public void _fload_2 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_load , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . FLOAD_2 ] , getLocalVariableName ( pc , <NUM_LIT:2> ) } ) ) ; writeNewLine ( ) ; } public void _fload_3 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_load , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . FLOAD_3 ] , getLocalVariableName ( pc , <NUM_LIT:3> ) } ) ) ; writeNewLine ( ) ; } public void _fload ( int pc , int index ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_load , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . FLOAD ] , getLocalVariableName ( pc , index , true ) } ) ) ; writeNewLine ( ) ; } public void _fmul ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . FMUL ] ) ; writeNewLine ( ) ; } public void _fneg ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . FNEG ] ) ; writeNewLine ( ) ; } public void _frem ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . FREM ] ) ; writeNewLine ( ) ; } public void _freturn ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . FRETURN ] ) ; writeNewLine ( ) ; } public void _fstore_0 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_store , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . FSTORE_0 ] , getLocalVariableName ( pc , <NUM_LIT:0> ) } ) ) ; writeNewLine ( ) ; } public void _fstore_1 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_store , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . FSTORE_1 ] , getLocalVariableName ( pc , <NUM_LIT:1> ) } ) ) ; writeNewLine ( ) ; } public void _fstore_2 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_store , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . FSTORE_2 ] , getLocalVariableName ( pc , <NUM_LIT:2> ) } ) ) ; writeNewLine ( ) ; } public void _fstore_3 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_store , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . FSTORE_3 ] , getLocalVariableName ( pc , <NUM_LIT:3> ) } ) ) ; writeNewLine ( ) ; } public void _fstore ( int pc , int index ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_store , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . FSTORE ] , getLocalVariableName ( pc , index , true ) } ) ) ; writeNewLine ( ) ; } public void _fsub ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . FSUB ] ) ; writeNewLine ( ) ; } public void _getfield ( int pc , int index , IConstantPoolEntry constantFieldref ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_getfield , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . GETFIELD ] , Integer . toString ( index ) , returnDeclaringClassName ( constantFieldref ) , new String ( constantFieldref . getFieldName ( ) ) , returnClassName ( Signature . toCharArray ( constantFieldref . getFieldDescriptor ( ) ) ) } ) ) ; writeNewLine ( ) ; } public void _getstatic ( int pc , int index , IConstantPoolEntry constantFieldref ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_getstatic , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . GETSTATIC ] , Integer . toString ( index ) , returnDeclaringClassName ( constantFieldref ) , new String ( constantFieldref . getFieldName ( ) ) , returnClassName ( Signature . toCharArray ( constantFieldref . getFieldDescriptor ( ) ) ) } ) ) ; writeNewLine ( ) ; } public void _goto_w ( int pc , int branchOffset ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . GOTO_W ] ) . append ( Messages . disassembler_space ) . append ( branchOffset + pc ) ; writeNewLine ( ) ; } public void _goto ( int pc , int branchOffset ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . GOTO ] ) . append ( Messages . disassembler_space ) . append ( branchOffset + pc ) ; writeNewLine ( ) ; } public void _i2b ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . I2B ] ) ; writeNewLine ( ) ; } public void _i2c ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . I2C ] ) ; writeNewLine ( ) ; } public void _i2d ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . I2D ] ) ; writeNewLine ( ) ; } public void _i2f ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . I2F ] ) ; writeNewLine ( ) ; } public void _i2l ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . I2L ] ) ; writeNewLine ( ) ; } public void _i2s ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . I2S ] ) ; writeNewLine ( ) ; } public void _iadd ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . IADD ] ) ; writeNewLine ( ) ; } public void _iaload ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . IALOAD ] ) ; writeNewLine ( ) ; } public void _iand ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . IAND ] ) ; writeNewLine ( ) ; } public void _iastore ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . IASTORE ] ) ; writeNewLine ( ) ; } public void _if_acmpeq ( int pc , int branchOffset ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . IF_ACMPEQ ] ) . append ( Messages . disassembler_space ) . append ( branchOffset + pc ) ; writeNewLine ( ) ; } public void _if_acmpne ( int pc , int branchOffset ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . IF_ACMPNE ] ) . append ( Messages . disassembler_space ) . append ( branchOffset + pc ) ; writeNewLine ( ) ; } public void _if_icmpeq ( int pc , int branchOffset ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . IF_ICMPEQ ] ) . append ( Messages . disassembler_space ) . append ( branchOffset + pc ) ; writeNewLine ( ) ; } public void _if_icmpge ( int pc , int branchOffset ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . IF_ICMPGE ] ) . append ( Messages . disassembler_space ) . append ( branchOffset + pc ) ; writeNewLine ( ) ; } public void _if_icmpgt ( int pc , int branchOffset ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . IF_ICMPGT ] ) . append ( Messages . disassembler_space ) . append ( branchOffset + pc ) ; writeNewLine ( ) ; } public void _if_icmple ( int pc , int branchOffset ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . IF_ICMPLE ] ) . append ( Messages . disassembler_space ) . append ( branchOffset + pc ) ; writeNewLine ( ) ; } public void _if_icmplt ( int pc , int branchOffset ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . IF_ICMPLT ] ) . append ( Messages . disassembler_space ) . append ( branchOffset + pc ) ; writeNewLine ( ) ; } public void _if_icmpne ( int pc , int branchOffset ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . IF_ICMPNE ] ) . append ( Messages . disassembler_space ) . append ( branchOffset + pc ) ; writeNewLine ( ) ; } public void _iconst_0 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . ICONST_0 ] ) ; writeNewLine ( ) ; } public void _iconst_1 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . ICONST_1 ] ) ; writeNewLine ( ) ; } public void _iconst_2 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . ICONST_2 ] ) ; writeNewLine ( ) ; } public void _iconst_3 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . ICONST_3 ] ) ; writeNewLine ( ) ; } public void _iconst_4 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . ICONST_4 ] ) ; writeNewLine ( ) ; } public void _iconst_5 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . ICONST_5 ] ) ; writeNewLine ( ) ; } public void _iconst_m1 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . ICONST_M1 ] ) ; writeNewLine ( ) ; } public void _idiv ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . IDIV ] ) ; writeNewLine ( ) ; } public void _ifeq ( int pc , int branchOffset ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . IFEQ ] ) . append ( Messages . disassembler_space ) . append ( branchOffset + pc ) ; writeNewLine ( ) ; } public void _ifge ( int pc , int branchOffset ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . IFGE ] ) . append ( Messages . disassembler_space ) . append ( branchOffset + pc ) ; writeNewLine ( ) ; } public void _ifgt ( int pc , int branchOffset ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . IFGT ] ) . append ( Messages . disassembler_space ) . append ( branchOffset + pc ) ; writeNewLine ( ) ; } public void _ifle ( int pc , int branchOffset ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . IFLE ] ) . append ( Messages . disassembler_space ) . append ( branchOffset + pc ) ; writeNewLine ( ) ; } public void _iflt ( int pc , int branchOffset ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . IFLT ] ) . append ( Messages . disassembler_space ) . append ( branchOffset + pc ) ; writeNewLine ( ) ; } public void _ifne ( int pc , int branchOffset ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . IFNE ] ) . append ( Messages . disassembler_space ) . append ( branchOffset + pc ) ; writeNewLine ( ) ; } public void _ifnonnull ( int pc , int branchOffset ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . IFNONNULL ] ) . append ( Messages . disassembler_space ) . append ( branchOffset + pc ) ; writeNewLine ( ) ; } public void _ifnull ( int pc , int branchOffset ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . IFNULL ] ) . append ( Messages . disassembler_space ) . append ( branchOffset + pc ) ; writeNewLine ( ) ; } public void _iinc ( int pc , int index , int _const ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_iinc , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . IINC ] , Integer . toString ( index ) , Integer . toString ( _const ) , getLocalVariableName ( pc , index , false ) } ) ) ; writeNewLine ( ) ; } public void _iload_0 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_load , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . ILOAD_0 ] , getLocalVariableName ( pc , <NUM_LIT:0> ) } ) ) ; writeNewLine ( ) ; } public void _iload_1 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_load , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . ILOAD_1 ] , getLocalVariableName ( pc , <NUM_LIT:1> ) } ) ) ; writeNewLine ( ) ; } public void _iload_2 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_load , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . ILOAD_2 ] , getLocalVariableName ( pc , <NUM_LIT:2> ) } ) ) ; writeNewLine ( ) ; } public void _iload_3 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_load , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . ILOAD_3 ] , getLocalVariableName ( pc , <NUM_LIT:3> ) } ) ) ; writeNewLine ( ) ; } public void _iload ( int pc , int index ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_load , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . ILOAD ] , getLocalVariableName ( pc , index , true ) } ) ) ; writeNewLine ( ) ; } public void _imul ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . IMUL ] ) ; writeNewLine ( ) ; } public void _ineg ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . INEG ] ) ; writeNewLine ( ) ; } public void _instanceof ( int pc , int index , IConstantPoolEntry constantClass ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_instanceof , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . INSTANCEOF ] , Integer . toString ( index ) , returnConstantClassName ( constantClass ) } ) ) ; writeNewLine ( ) ; } public void _invokedynamic ( int pc , int index , IConstantPoolEntry nameEntry , IConstantPoolEntry descriptorEntry ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_invokedynamic , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . INVOKEDYNAMIC ] , Integer . toString ( index ) , Util . toString ( null , nameEntry . getUtf8Value ( ) , descriptorEntry . getUtf8Value ( ) , true , isCompact ( ) ) } ) ) ; writeNewLine ( ) ; } public void _invokeinterface ( int pc , int index , byte nargs , IConstantPoolEntry constantInterfaceMethodref ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_invokeinterface , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . INVOKEINTERFACE ] , Integer . toString ( index ) , Integer . toString ( nargs ) , Util . toString ( constantInterfaceMethodref . getClassName ( ) , constantInterfaceMethodref . getMethodName ( ) , constantInterfaceMethodref . getMethodDescriptor ( ) , true , isCompact ( ) ) } ) ) ; writeNewLine ( ) ; } public void _invokespecial ( int pc , int index , IConstantPoolEntry constantMethodref ) { dumpPcNumber ( pc ) ; final String signature = returnMethodSignature ( constantMethodref ) ; this . buffer . append ( Messages . bind ( Messages . classformat_invokespecial , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . INVOKESPECIAL ] , Integer . toString ( index ) , signature } ) ) ; writeNewLine ( ) ; } public void _invokestatic ( int pc , int index , IConstantPoolEntry constantMethodref ) { dumpPcNumber ( pc ) ; final String signature = returnMethodSignature ( constantMethodref ) ; this . buffer . append ( Messages . bind ( Messages . classformat_invokestatic , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . INVOKESTATIC ] , Integer . toString ( index ) , signature } ) ) ; writeNewLine ( ) ; } public void _invokevirtual ( int pc , int index , IConstantPoolEntry constantMethodref ) { dumpPcNumber ( pc ) ; final String signature = returnMethodSignature ( constantMethodref ) ; this . buffer . append ( Messages . bind ( Messages . classformat_invokevirtual , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . INVOKEVIRTUAL ] , Integer . toString ( index ) , signature } ) ) ; writeNewLine ( ) ; } public void _ior ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . IOR ] ) ; writeNewLine ( ) ; } public void _irem ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . IREM ] ) ; writeNewLine ( ) ; } public void _ireturn ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . IRETURN ] ) ; writeNewLine ( ) ; } public void _ishl ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . ISHL ] ) ; writeNewLine ( ) ; } public void _ishr ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . ISHR ] ) ; writeNewLine ( ) ; } public void _istore_0 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_store , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . ISTORE_0 ] , getLocalVariableName ( pc , <NUM_LIT:0> ) } ) ) ; writeNewLine ( ) ; } public void _istore_1 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_store , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . ISTORE_1 ] , getLocalVariableName ( pc , <NUM_LIT:1> ) } ) ) ; writeNewLine ( ) ; } public void _istore_2 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_store , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . ISTORE_2 ] , getLocalVariableName ( pc , <NUM_LIT:2> ) } ) ) ; writeNewLine ( ) ; } public void _istore_3 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_store , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . ISTORE_3 ] , getLocalVariableName ( pc , <NUM_LIT:3> ) } ) ) ; writeNewLine ( ) ; } public void _istore ( int pc , int index ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_store , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . ISTORE ] , getLocalVariableName ( pc , index , true ) } ) ) ; writeNewLine ( ) ; } public void _isub ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . ISUB ] ) ; writeNewLine ( ) ; } public void _iushr ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . IUSHR ] ) ; writeNewLine ( ) ; } public void _ixor ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . IXOR ] ) ; writeNewLine ( ) ; } public void _jsr_w ( int pc , int branchOffset ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . JSR_W ] ) . append ( Messages . disassembler_space ) . append ( branchOffset + pc ) ; writeNewLine ( ) ; } public void _jsr ( int pc , int branchOffset ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . JSR ] ) . append ( Messages . disassembler_space ) . append ( branchOffset + pc ) ; writeNewLine ( ) ; } public void _l2d ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . L2D ] ) ; writeNewLine ( ) ; } public void _l2f ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . L2F ] ) ; writeNewLine ( ) ; } public void _l2i ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . L2I ] ) ; writeNewLine ( ) ; } public void _ladd ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LADD ] ) ; writeNewLine ( ) ; } public void _laload ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LALOAD ] ) ; writeNewLine ( ) ; } public void _land ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LAND ] ) ; writeNewLine ( ) ; } public void _lastore ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LASTORE ] ) ; writeNewLine ( ) ; } public void _lcmp ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LCMP ] ) ; writeNewLine ( ) ; } public void _lconst_0 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LCONST_0 ] ) ; writeNewLine ( ) ; } public void _lconst_1 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LCONST_1 ] ) ; writeNewLine ( ) ; } public void _ldc_w ( int pc , int index , IConstantPoolEntry constantPoolEntry ) { dumpPcNumber ( pc ) ; switch ( constantPoolEntry . getKind ( ) ) { case IConstantPoolConstant . CONSTANT_Float : this . buffer . append ( Messages . bind ( Messages . classformat_ldc_w_float , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LDC_W ] , Integer . toString ( index ) , Float . toString ( constantPoolEntry . getFloatValue ( ) ) } ) ) ; break ; case IConstantPoolConstant . CONSTANT_Integer : this . buffer . append ( Messages . bind ( Messages . classformat_ldc_w_integer , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LDC_W ] , Integer . toString ( index ) , Integer . toString ( constantPoolEntry . getIntegerValue ( ) ) } ) ) ; break ; case IConstantPoolConstant . CONSTANT_String : this . buffer . append ( Messages . bind ( Messages . classformat_ldc_w_string , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LDC_W ] , Integer . toString ( index ) , Disassembler . escapeString ( constantPoolEntry . getStringValue ( ) ) } ) ) ; break ; case IConstantPoolConstant . CONSTANT_Class : this . buffer . append ( Messages . bind ( Messages . classformat_ldc_w_class , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LDC_W ] , Integer . toString ( index ) , returnConstantClassName ( constantPoolEntry ) } ) ) ; } writeNewLine ( ) ; } public void _ldc ( int pc , int index , IConstantPoolEntry constantPoolEntry ) { dumpPcNumber ( pc ) ; switch ( constantPoolEntry . getKind ( ) ) { case IConstantPoolConstant . CONSTANT_Float : this . buffer . append ( Messages . bind ( Messages . classformat_ldc_w_float , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LDC ] , Integer . toString ( index ) , Float . toString ( constantPoolEntry . getFloatValue ( ) ) } ) ) ; break ; case IConstantPoolConstant . CONSTANT_Integer : this . buffer . append ( Messages . bind ( Messages . classformat_ldc_w_integer , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LDC ] , Integer . toString ( index ) , Integer . toString ( constantPoolEntry . getIntegerValue ( ) ) } ) ) ; break ; case IConstantPoolConstant . CONSTANT_String : this . buffer . append ( Messages . bind ( Messages . classformat_ldc_w_string , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LDC ] , Integer . toString ( index ) , Disassembler . escapeString ( constantPoolEntry . getStringValue ( ) ) } ) ) ; break ; case IConstantPoolConstant . CONSTANT_Class : this . buffer . append ( Messages . bind ( Messages . classformat_ldc_w_class , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LDC ] , Integer . toString ( index ) , returnConstantClassName ( constantPoolEntry ) } ) ) ; } writeNewLine ( ) ; } public void _ldc2_w ( int pc , int index , IConstantPoolEntry constantPoolEntry ) { dumpPcNumber ( pc ) ; switch ( constantPoolEntry . getKind ( ) ) { case IConstantPoolConstant . CONSTANT_Long : this . buffer . append ( Messages . bind ( Messages . classformat_ldc2_w_long , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LDC2_W ] , Integer . toString ( index ) , Long . toString ( constantPoolEntry . getLongValue ( ) ) } ) ) ; break ; case IConstantPoolConstant . CONSTANT_Double : this . buffer . append ( Messages . bind ( Messages . classformat_ldc2_w_double , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LDC2_W ] , Integer . toString ( index ) , Double . toString ( constantPoolEntry . getDoubleValue ( ) ) } ) ) ; } writeNewLine ( ) ; } public void _ldiv ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LDIV ] ) ; writeNewLine ( ) ; } public void _lload_0 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_load , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LLOAD_0 ] , getLocalVariableName ( pc , <NUM_LIT:0> ) } ) ) ; writeNewLine ( ) ; } public void _lload_1 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_load , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LLOAD_1 ] , getLocalVariableName ( pc , <NUM_LIT:1> ) } ) ) ; writeNewLine ( ) ; } public void _lload_2 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_load , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LLOAD_2 ] , getLocalVariableName ( pc , <NUM_LIT:2> ) } ) ) ; writeNewLine ( ) ; } public void _lload_3 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_load , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LLOAD_3 ] , getLocalVariableName ( pc , <NUM_LIT:3> ) } ) ) ; writeNewLine ( ) ; } public void _lload ( int pc , int index ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_load , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LLOAD ] , getLocalVariableName ( pc , index , true ) } ) ) ; writeNewLine ( ) ; } public void _lmul ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LMUL ] ) ; writeNewLine ( ) ; } public void _lneg ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LNEG ] ) ; writeNewLine ( ) ; } public void _lookupswitch ( int pc , int defaultoffset , int npairs , int [ ] [ ] offset_pairs ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LOOKUPSWITCH ] ) . append ( "<STR_LIT>" ) . append ( defaultoffset + pc ) ; writeNewLine ( ) ; for ( int i = <NUM_LIT:0> ; i < npairs ; i ++ ) { writeExtraTabs ( <NUM_LIT:3> ) ; this . buffer . append ( "<STR_LIT>" ) . append ( offset_pairs [ i ] [ <NUM_LIT:0> ] ) . append ( "<STR_LIT::U+0020>" ) . append ( offset_pairs [ i ] [ <NUM_LIT:1> ] + pc ) ; writeNewLine ( ) ; } } public void _lor ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LOR ] ) ; writeNewLine ( ) ; } public void _lrem ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LREM ] ) ; writeNewLine ( ) ; } public void _lreturn ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LRETURN ] ) ; writeNewLine ( ) ; } public void _lshl ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LSHL ] ) ; writeNewLine ( ) ; } public void _lshr ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LSHR ] ) ; writeNewLine ( ) ; } public void _lstore_0 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_store , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LSTORE_0 ] , getLocalVariableName ( pc , <NUM_LIT:0> ) } ) ) ; writeNewLine ( ) ; } public void _lstore_1 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_store , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LSTORE_1 ] , getLocalVariableName ( pc , <NUM_LIT:1> ) } ) ) ; writeNewLine ( ) ; } public void _lstore_2 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_store , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LSTORE_2 ] , getLocalVariableName ( pc , <NUM_LIT:2> ) } ) ) ; writeNewLine ( ) ; } public void _lstore_3 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_store , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LSTORE_3 ] , getLocalVariableName ( pc , <NUM_LIT:3> ) } ) ) ; writeNewLine ( ) ; } public void _lstore ( int pc , int index ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_store , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LSTORE ] , getLocalVariableName ( pc , index , true ) } ) ) ; writeNewLine ( ) ; } public void _lsub ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LSUB ] ) ; writeNewLine ( ) ; } public void _lushr ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LUSHR ] ) ; writeNewLine ( ) ; } public void _lxor ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . LXOR ] ) ; writeNewLine ( ) ; } public void _monitorenter ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . MONITORENTER ] ) ; writeNewLine ( ) ; } public void _monitorexit ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . MONITOREXIT ] ) ; writeNewLine ( ) ; } public void _multianewarray ( int pc , int index , int dimensions , IConstantPoolEntry constantClass ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_multianewarray , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . MULTIANEWARRAY ] , Integer . toString ( index ) , returnConstantClassName ( constantClass ) } ) ) ; writeNewLine ( ) ; } public void _new ( int pc , int index , IConstantPoolEntry constantClass ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_new , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . NEW ] , Integer . toString ( index ) , returnConstantClassName ( constantClass ) } ) ) ; writeNewLine ( ) ; } public void _newarray ( int pc , int atype ) { dumpPcNumber ( pc ) ; switch ( atype ) { case T_BOOLEAN : this . buffer . append ( Messages . bind ( Messages . classformat_newarray_boolean , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . NEWARRAY ] , Integer . toString ( atype ) } ) ) ; break ; case T_CHAR : this . buffer . append ( Messages . bind ( Messages . classformat_newarray_char , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . NEWARRAY ] , Integer . toString ( atype ) } ) ) ; break ; case T_FLOAT : this . buffer . append ( Messages . bind ( Messages . classformat_newarray_float , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . NEWARRAY ] , Integer . toString ( atype ) } ) ) ; break ; case T_DOUBLE : this . buffer . append ( Messages . bind ( Messages . classformat_newarray_double , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . NEWARRAY ] , Integer . toString ( atype ) } ) ) ; break ; case T_BYTE : this . buffer . append ( Messages . bind ( Messages . classformat_newarray_byte , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . NEWARRAY ] , Integer . toString ( atype ) } ) ) ; break ; case T_SHORT : this . buffer . append ( Messages . bind ( Messages . classformat_newarray_short , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . NEWARRAY ] , Integer . toString ( atype ) } ) ) ; break ; case T_INT : this . buffer . append ( Messages . bind ( Messages . classformat_newarray_int , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . NEWARRAY ] , Integer . toString ( atype ) } ) ) ; break ; case T_LONG : this . buffer . append ( Messages . bind ( Messages . classformat_newarray_long , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . NEWARRAY ] , Integer . toString ( atype ) } ) ) ; } writeNewLine ( ) ; } public void _nop ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . NOP ] ) ; writeNewLine ( ) ; } public void _pop ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . POP ] ) ; writeNewLine ( ) ; } public void _pop2 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . POP2 ] ) ; writeNewLine ( ) ; } public void _putfield ( int pc , int index , IConstantPoolEntry constantFieldref ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_putfield , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . PUTFIELD ] , Integer . toString ( index ) , returnDeclaringClassName ( constantFieldref ) , new String ( constantFieldref . getFieldName ( ) ) , returnClassName ( Signature . toCharArray ( constantFieldref . getFieldDescriptor ( ) ) ) } ) ) ; writeNewLine ( ) ; } public void _putstatic ( int pc , int index , IConstantPoolEntry constantFieldref ) { dumpPcNumber ( pc ) ; this . buffer . append ( Messages . bind ( Messages . classformat_putstatic , new String [ ] { OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . PUTSTATIC ] , Integer . toString ( index ) , returnDeclaringClassName ( constantFieldref ) , new String ( constantFieldref . getFieldName ( ) ) , returnClassName ( Signature . toCharArray ( constantFieldref . getFieldDescriptor ( ) ) ) } ) ) ; writeNewLine ( ) ; } public void _ret ( int pc , int index ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . RET ] ) . append ( Messages . disassembler_space ) . append ( index ) ; writeNewLine ( ) ; } public void _return ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . RETURN ] ) ; writeNewLine ( ) ; } public void _saload ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . SALOAD ] ) ; writeNewLine ( ) ; } public void _sastore ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . SASTORE ] ) ; writeNewLine ( ) ; } public void _sipush ( int pc , short value ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . SIPUSH ] ) . append ( Messages . disassembler_space ) . append ( value ) ; writeNewLine ( ) ; } public void _swap ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . SWAP ] ) ; writeNewLine ( ) ; } public void _tableswitch ( int pc , int defaultoffset , int low , int high , int [ ] jump_offsets ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . TABLESWITCH ] ) . append ( "<STR_LIT>" ) . append ( defaultoffset + pc ) ; writeNewLine ( ) ; for ( int i = low ; i < high + <NUM_LIT:1> ; i ++ ) { writeExtraTabs ( <NUM_LIT:3> ) ; this . buffer . append ( "<STR_LIT>" ) . append ( i ) . append ( "<STR_LIT::U+0020>" ) . append ( jump_offsets [ i - low ] + pc ) ; writeNewLine ( ) ; } } public void _wide ( int pc , int iincopcode , int index , int _const ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . WIDE ] ) ; writeNewLine ( ) ; _iinc ( pc + <NUM_LIT:1> , index , _const ) ; } public void _wide ( int pc , int opcode , int index ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . WIDE ] ) ; writeNewLine ( ) ; switch ( opcode ) { case IOpcodeMnemonics . ILOAD : _iload ( pc + <NUM_LIT:1> , index ) ; break ; case IOpcodeMnemonics . FLOAD : _fload ( pc + <NUM_LIT:1> , index ) ; break ; case IOpcodeMnemonics . ALOAD : _aload ( pc + <NUM_LIT:1> , index ) ; break ; case IOpcodeMnemonics . LLOAD : _lload ( pc + <NUM_LIT:1> , index ) ; break ; case IOpcodeMnemonics . DLOAD : _dload ( pc + <NUM_LIT:1> , index ) ; break ; case IOpcodeMnemonics . ISTORE : _istore ( pc + <NUM_LIT:1> , index ) ; break ; case IOpcodeMnemonics . FSTORE : _fstore ( pc + <NUM_LIT:1> , index ) ; break ; case IOpcodeMnemonics . ASTORE : _astore ( pc + <NUM_LIT:1> , index ) ; break ; case IOpcodeMnemonics . LSTORE : _lstore ( pc + <NUM_LIT:1> , index ) ; break ; case IOpcodeMnemonics . DSTORE : _dstore ( pc + <NUM_LIT:1> , index ) ; break ; case IOpcodeMnemonics . RET : _ret ( pc + <NUM_LIT:1> , index ) ; } } public void _breakpoint ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . BREAKPOINT ] ) ; writeNewLine ( ) ; } public void _impdep1 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . IMPDEP1 ] ) ; writeNewLine ( ) ; } public void _impdep2 ( int pc ) { dumpPcNumber ( pc ) ; this . buffer . append ( OpcodeStringValues . BYTECODE_NAMES [ IOpcodeMnemonics . IMPDEP2 ] ) ; writeNewLine ( ) ; } private boolean isCompact ( ) { return ( this . mode & ClassFileBytesDisassembler . COMPACT ) != <NUM_LIT:0> ; } private String returnConstantClassName ( IConstantPoolEntry constantClass ) { char [ ] className = constantClass . getClassInfoName ( ) ; if ( className . length == <NUM_LIT:0> ) { return EMPTY_CLASS_NAME ; } switch ( className [ <NUM_LIT:0> ] ) { case '<CHAR_LIT:[>' : StringBuffer classNameBuffer = new StringBuffer ( ) ; Util . appendTypeSignature ( className , <NUM_LIT:0> , classNameBuffer , isCompact ( ) ) ; return classNameBuffer . toString ( ) ; default : return returnClassName ( className ) ; } } private String returnClassName ( char [ ] classInfoName ) { if ( classInfoName . length == <NUM_LIT:0> ) { return EMPTY_CLASS_NAME ; } else if ( isCompact ( ) ) { int lastIndexOfSlash = CharOperation . lastIndexOf ( '<CHAR_LIT:/>' , classInfoName ) ; if ( lastIndexOfSlash != - <NUM_LIT:1> ) { return new String ( classInfoName , lastIndexOfSlash + <NUM_LIT:1> , classInfoName . length - lastIndexOfSlash - <NUM_LIT:1> ) ; } } CharOperation . replace ( classInfoName , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ; return new String ( classInfoName ) ; } private String returnDeclaringClassName ( IConstantPoolEntry constantRef ) { final char [ ] className = constantRef . getClassName ( ) ; return returnClassName ( className ) ; } private String returnMethodSignature ( IConstantPoolEntry constantMethodref ) { final char [ ] methodDescriptor = constantMethodref . getMethodDescriptor ( ) ; CharOperation . replace ( methodDescriptor , '<CHAR_LIT>' , '<CHAR_LIT>' ) ; final char [ ] signature = Util . toString ( constantMethodref . getClassName ( ) , constantMethodref . getMethodName ( ) , methodDescriptor , true , isCompact ( ) ) . toCharArray ( ) ; CharOperation . replace ( signature , '<CHAR_LIT>' , '<CHAR_LIT>' ) ; return String . valueOf ( signature ) ; } private void writeNewLine ( ) { this . buffer . append ( this . lineSeparator ) ; } private void writeTabs ( ) { for ( int i = <NUM_LIT:0> , max = this . tabNumber ; i < max ; i ++ ) { this . buffer . append ( Messages . disassembler_indentation ) ; } } private void writeExtraTabs ( int extraTabs ) { for ( int i = <NUM_LIT:0> , max = this . tabNumber + extraTabs ; i < max ; i ++ ) { this . buffer . append ( Messages . disassembler_indentation ) ; } } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . JavaCore ; import org . eclipse . jdt . core . Signature ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . core . util . * ; import org . eclipse . jdt . internal . compiler . codegen . AttributeNamesConstants ; import org . eclipse . jdt . internal . compiler . lookup . TypeConstants ; public class Disassembler extends ClassFileBytesDisassembler { private static final char [ ] ANY_EXCEPTION = Messages . classfileformat_anyexceptionhandler . toCharArray ( ) ; private static final String VERSION_UNKNOWN = Messages . classfileformat_versionUnknown ; private boolean appendModifier ( StringBuffer buffer , int accessFlags , int modifierConstant , String modifier , boolean firstModifier ) { if ( ( accessFlags & modifierConstant ) != <NUM_LIT:0> ) { if ( ! firstModifier ) { buffer . append ( Messages . disassembler_space ) ; } if ( firstModifier ) { firstModifier = false ; } buffer . append ( modifier ) ; } return firstModifier ; } private void decodeModifiers ( StringBuffer buffer , int accessFlags , int [ ] checkBits ) { decodeModifiers ( buffer , accessFlags , false , false , checkBits ) ; } private void decodeModifiers ( StringBuffer buffer , int accessFlags , boolean printDefault , boolean asBridge , int [ ] checkBits ) { if ( checkBits == null ) return ; boolean firstModifier = true ; for ( int i = <NUM_LIT:0> , max = checkBits . length ; i < max ; i ++ ) { switch ( checkBits [ i ] ) { case IModifierConstants . ACC_PUBLIC : firstModifier = appendModifier ( buffer , accessFlags , IModifierConstants . ACC_PUBLIC , "<STR_LIT>" , firstModifier ) ; break ; case IModifierConstants . ACC_PROTECTED : firstModifier = appendModifier ( buffer , accessFlags , IModifierConstants . ACC_PROTECTED , "<STR_LIT>" , firstModifier ) ; break ; case IModifierConstants . ACC_PRIVATE : firstModifier = appendModifier ( buffer , accessFlags , IModifierConstants . ACC_PRIVATE , "<STR_LIT>" , firstModifier ) ; break ; case IModifierConstants . ACC_ABSTRACT : firstModifier = appendModifier ( buffer , accessFlags , IModifierConstants . ACC_ABSTRACT , "<STR_LIT>" , firstModifier ) ; break ; case IModifierConstants . ACC_STATIC : firstModifier = appendModifier ( buffer , accessFlags , IModifierConstants . ACC_STATIC , "<STR_LIT>" , firstModifier ) ; break ; case IModifierConstants . ACC_FINAL : firstModifier = appendModifier ( buffer , accessFlags , IModifierConstants . ACC_FINAL , "<STR_LIT>" , firstModifier ) ; break ; case IModifierConstants . ACC_SYNCHRONIZED : firstModifier = appendModifier ( buffer , accessFlags , IModifierConstants . ACC_SYNCHRONIZED , "<STR_LIT>" , firstModifier ) ; break ; case IModifierConstants . ACC_NATIVE : firstModifier = appendModifier ( buffer , accessFlags , IModifierConstants . ACC_NATIVE , "<STR_LIT>" , firstModifier ) ; break ; case IModifierConstants . ACC_STRICT : firstModifier = appendModifier ( buffer , accessFlags , IModifierConstants . ACC_STRICT , "<STR_LIT>" , firstModifier ) ; break ; case IModifierConstants . ACC_TRANSIENT : firstModifier = appendModifier ( buffer , accessFlags , IModifierConstants . ACC_TRANSIENT , "<STR_LIT>" , firstModifier ) ; break ; case IModifierConstants . ACC_VOLATILE : if ( asBridge ) { firstModifier = appendModifier ( buffer , accessFlags , IModifierConstants . ACC_BRIDGE , "<STR_LIT>" , firstModifier ) ; } else { firstModifier = appendModifier ( buffer , accessFlags , IModifierConstants . ACC_VOLATILE , "<STR_LIT>" , firstModifier ) ; } break ; case IModifierConstants . ACC_ENUM : firstModifier = appendModifier ( buffer , accessFlags , IModifierConstants . ACC_ENUM , "<STR_LIT>" , firstModifier ) ; break ; } } if ( ! firstModifier ) { if ( ! printDefault ) buffer . append ( Messages . disassembler_space ) ; } else if ( printDefault ) { buffer . append ( "<STR_LIT:default>" ) ; } } private void decodeModifiersForField ( StringBuffer buffer , int accessFlags ) { decodeModifiers ( buffer , accessFlags , new int [ ] { IModifierConstants . ACC_PUBLIC , IModifierConstants . ACC_PROTECTED , IModifierConstants . ACC_PRIVATE , IModifierConstants . ACC_STATIC , IModifierConstants . ACC_FINAL , IModifierConstants . ACC_TRANSIENT , IModifierConstants . ACC_VOLATILE , IModifierConstants . ACC_ENUM } ) ; } private void decodeModifiersForFieldForWorkingCopy ( StringBuffer buffer , int accessFlags ) { decodeModifiers ( buffer , accessFlags , new int [ ] { IModifierConstants . ACC_PUBLIC , IModifierConstants . ACC_PROTECTED , IModifierConstants . ACC_PRIVATE , IModifierConstants . ACC_STATIC , IModifierConstants . ACC_FINAL , IModifierConstants . ACC_TRANSIENT , IModifierConstants . ACC_VOLATILE , } ) ; } private final void decodeModifiersForInnerClasses ( StringBuffer buffer , int accessFlags , boolean printDefault ) { decodeModifiers ( buffer , accessFlags , printDefault , false , new int [ ] { IModifierConstants . ACC_PUBLIC , IModifierConstants . ACC_PROTECTED , IModifierConstants . ACC_PRIVATE , IModifierConstants . ACC_ABSTRACT , IModifierConstants . ACC_STATIC , IModifierConstants . ACC_FINAL , } ) ; } private final void decodeModifiersForMethod ( StringBuffer buffer , int accessFlags ) { decodeModifiers ( buffer , accessFlags , false , true , new int [ ] { IModifierConstants . ACC_PUBLIC , IModifierConstants . ACC_PROTECTED , IModifierConstants . ACC_PRIVATE , IModifierConstants . ACC_ABSTRACT , IModifierConstants . ACC_STATIC , IModifierConstants . ACC_FINAL , IModifierConstants . ACC_SYNCHRONIZED , IModifierConstants . ACC_NATIVE , IModifierConstants . ACC_STRICT , IModifierConstants . ACC_BRIDGE , } ) ; } private final void decodeModifiersForType ( StringBuffer buffer , int accessFlags ) { decodeModifiers ( buffer , accessFlags , new int [ ] { IModifierConstants . ACC_PUBLIC , IModifierConstants . ACC_ABSTRACT , IModifierConstants . ACC_FINAL , } ) ; } public static String escapeString ( String s ) { return decodeStringValue ( s ) ; } static String decodeStringValue ( char [ ] chars ) { StringBuffer buffer = new StringBuffer ( ) ; for ( int i = <NUM_LIT:0> , max = chars . length ; i < max ; i ++ ) { char c = chars [ i ] ; escapeChar ( buffer , c ) ; } return buffer . toString ( ) ; } private static void escapeChar ( StringBuffer buffer , char c ) { switch ( c ) { case '<STR_LIT>' : buffer . append ( "<STR_LIT>" ) ; break ; case '<STR_LIT:\t>' : buffer . append ( "<STR_LIT>" ) ; break ; case '<STR_LIT:\n>' : buffer . append ( "<STR_LIT>" ) ; break ; case '<STR_LIT>' : buffer . append ( "<STR_LIT>" ) ; break ; case '<STR_LIT>' : buffer . append ( "<STR_LIT>" ) ; break ; case '<STR_LIT>' : buffer . append ( "<STR_LIT>" ) ; break ; case '<STR_LIT>' : buffer . append ( "<STR_LIT>" ) ; break ; case '<STR_LIT>' : buffer . append ( "<STR_LIT>" ) ; break ; case '<STR_LIT>' : buffer . append ( "<STR_LIT>" ) ; break ; case '<STR_LIT>' : buffer . append ( "<STR_LIT>" ) ; break ; case '<STR_LIT>' : buffer . append ( "<STR_LIT>" ) ; break ; case '<STR_LIT>' : buffer . append ( "<STR_LIT>" ) ; break ; case '<STR_LIT>' : buffer . append ( "<STR_LIT>" ) ; break ; default : buffer . append ( c ) ; } } static String decodeStringValue ( String s ) { return decodeStringValue ( s . toCharArray ( ) ) ; } public String disassemble ( byte [ ] classFileBytes , String lineSeparator ) throws ClassFormatException { try { return disassemble ( new ClassFileReader ( classFileBytes , IClassFileReader . ALL ) , lineSeparator , ClassFileBytesDisassembler . DEFAULT ) ; } catch ( ArrayIndexOutOfBoundsException e ) { throw new ClassFormatException ( e . getMessage ( ) , e ) ; } } public String disassemble ( byte [ ] classFileBytes , String lineSeparator , int mode ) throws ClassFormatException { try { return disassemble ( new ClassFileReader ( classFileBytes , IClassFileReader . ALL ) , lineSeparator , mode ) ; } catch ( ArrayIndexOutOfBoundsException e ) { throw new ClassFormatException ( e . getMessage ( ) , e ) ; } } private void disassemble ( IAnnotation annotation , StringBuffer buffer , String lineSeparator , int tabNumber , int mode ) { writeNewLine ( buffer , lineSeparator , tabNumber + <NUM_LIT:1> ) ; final int typeIndex = annotation . getTypeIndex ( ) ; final char [ ] typeName = CharOperation . replaceOnCopy ( annotation . getTypeName ( ) , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ; buffer . append ( Messages . bind ( Messages . disassembler_annotationentrystart , new String [ ] { Integer . toString ( typeIndex ) , new String ( returnClassName ( Signature . toCharArray ( typeName ) , '<CHAR_LIT:.>' , mode ) ) } ) ) ; final IAnnotationComponent [ ] components = annotation . getComponents ( ) ; for ( int i = <NUM_LIT:0> , max = components . length ; i < max ; i ++ ) { disassemble ( components [ i ] , buffer , lineSeparator , tabNumber + <NUM_LIT:1> , mode ) ; } writeNewLine ( buffer , lineSeparator , tabNumber + <NUM_LIT:1> ) ; buffer . append ( Messages . disassembler_annotationentryend ) ; } private void disassemble ( IAnnotationComponent annotationComponent , StringBuffer buffer , String lineSeparator , int tabNumber , int mode ) { writeNewLine ( buffer , lineSeparator , tabNumber + <NUM_LIT:1> ) ; buffer . append ( Messages . bind ( Messages . disassembler_annotationcomponent , new String [ ] { Integer . toString ( annotationComponent . getComponentNameIndex ( ) ) , new String ( annotationComponent . getComponentName ( ) ) } ) ) ; disassemble ( annotationComponent . getComponentValue ( ) , buffer , lineSeparator , tabNumber + <NUM_LIT:1> , mode ) ; } private void disassemble ( IAnnotationComponentValue annotationComponentValue , StringBuffer buffer , String lineSeparator , int tabNumber , int mode ) { switch ( annotationComponentValue . getTag ( ) ) { case IAnnotationComponentValue . BYTE_TAG : case IAnnotationComponentValue . CHAR_TAG : case IAnnotationComponentValue . DOUBLE_TAG : case IAnnotationComponentValue . FLOAT_TAG : case IAnnotationComponentValue . INTEGER_TAG : case IAnnotationComponentValue . LONG_TAG : case IAnnotationComponentValue . SHORT_TAG : case IAnnotationComponentValue . BOOLEAN_TAG : case IAnnotationComponentValue . STRING_TAG : IConstantPoolEntry constantPoolEntry = annotationComponentValue . getConstantValue ( ) ; String value = null ; switch ( constantPoolEntry . getKind ( ) ) { case IConstantPoolConstant . CONSTANT_Long : value = constantPoolEntry . getLongValue ( ) + "<STR_LIT>" ; break ; case IConstantPoolConstant . CONSTANT_Float : value = constantPoolEntry . getFloatValue ( ) + "<STR_LIT:f>" ; break ; case IConstantPoolConstant . CONSTANT_Double : value = Double . toString ( constantPoolEntry . getDoubleValue ( ) ) ; break ; case IConstantPoolConstant . CONSTANT_Integer : StringBuffer temp = new StringBuffer ( ) ; switch ( annotationComponentValue . getTag ( ) ) { case IAnnotationComponentValue . CHAR_TAG : temp . append ( '<STR_LIT>' ) ; escapeChar ( temp , ( char ) constantPoolEntry . getIntegerValue ( ) ) ; temp . append ( '<STR_LIT>' ) ; break ; case IAnnotationComponentValue . BOOLEAN_TAG : temp . append ( constantPoolEntry . getIntegerValue ( ) == <NUM_LIT:1> ? "<STR_LIT:true>" : "<STR_LIT:false>" ) ; break ; case IAnnotationComponentValue . BYTE_TAG : temp . append ( "<STR_LIT>" ) . append ( constantPoolEntry . getIntegerValue ( ) ) ; break ; case IAnnotationComponentValue . SHORT_TAG : temp . append ( "<STR_LIT>" ) . append ( constantPoolEntry . getIntegerValue ( ) ) ; break ; case IAnnotationComponentValue . INTEGER_TAG : temp . append ( "<STR_LIT>" ) . append ( constantPoolEntry . getIntegerValue ( ) ) ; } value = String . valueOf ( temp ) ; break ; case IConstantPoolConstant . CONSTANT_Utf8 : value = "<STR_LIT:\">" + decodeStringValue ( constantPoolEntry . getUtf8Value ( ) ) + "<STR_LIT:\">" ; } buffer . append ( Messages . bind ( Messages . disassembler_annotationdefaultvalue , value ) ) ; break ; case IAnnotationComponentValue . ENUM_TAG : final int enumConstantTypeNameIndex = annotationComponentValue . getEnumConstantTypeNameIndex ( ) ; final char [ ] typeName = CharOperation . replaceOnCopy ( annotationComponentValue . getEnumConstantTypeName ( ) , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ; final int enumConstantNameIndex = annotationComponentValue . getEnumConstantNameIndex ( ) ; final char [ ] constantName = annotationComponentValue . getEnumConstantName ( ) ; buffer . append ( Messages . bind ( Messages . disassembler_annotationenumvalue , new String [ ] { Integer . toString ( enumConstantTypeNameIndex ) , Integer . toString ( enumConstantNameIndex ) , new String ( returnClassName ( Signature . toCharArray ( typeName ) , '<CHAR_LIT:.>' , mode ) ) , new String ( constantName ) } ) ) ; break ; case IAnnotationComponentValue . CLASS_TAG : final int classIndex = annotationComponentValue . getClassInfoIndex ( ) ; constantPoolEntry = annotationComponentValue . getClassInfo ( ) ; final char [ ] className = CharOperation . replaceOnCopy ( constantPoolEntry . getUtf8Value ( ) , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ; buffer . append ( Messages . bind ( Messages . disassembler_annotationclassvalue , new String [ ] { Integer . toString ( classIndex ) , new String ( returnClassName ( Signature . toCharArray ( className ) , '<CHAR_LIT:.>' , mode ) ) } ) ) ; break ; case IAnnotationComponentValue . ANNOTATION_TAG : buffer . append ( Messages . disassembler_annotationannotationvalue ) ; IAnnotation annotation = annotationComponentValue . getAnnotationValue ( ) ; disassemble ( annotation , buffer , lineSeparator , tabNumber + <NUM_LIT:1> , mode ) ; break ; case IAnnotationComponentValue . ARRAY_TAG : buffer . append ( Messages . disassembler_annotationarrayvaluestart ) ; final IAnnotationComponentValue [ ] annotationComponentValues = annotationComponentValue . getAnnotationComponentValues ( ) ; for ( int i = <NUM_LIT:0> , max = annotationComponentValues . length ; i < max ; i ++ ) { writeNewLine ( buffer , lineSeparator , tabNumber + <NUM_LIT:1> ) ; disassemble ( annotationComponentValues [ i ] , buffer , lineSeparator , tabNumber + <NUM_LIT:1> , mode ) ; } writeNewLine ( buffer , lineSeparator , tabNumber + <NUM_LIT:1> ) ; buffer . append ( Messages . disassembler_annotationarrayvalueend ) ; } } private void disassemble ( IAnnotationDefaultAttribute annotationDefaultAttribute , StringBuffer buffer , String lineSeparator , int tabNumber , int mode ) { writeNewLine ( buffer , lineSeparator , tabNumber + <NUM_LIT:1> ) ; buffer . append ( Messages . disassembler_annotationdefaultheader ) ; IAnnotationComponentValue componentValue = annotationDefaultAttribute . getMemberValue ( ) ; writeNewLine ( buffer , lineSeparator , tabNumber + <NUM_LIT:2> ) ; disassemble ( componentValue , buffer , lineSeparator , tabNumber + <NUM_LIT:1> , mode ) ; } private void disassemble ( IClassFileAttribute classFileAttribute , StringBuffer buffer , String lineSeparator , int tabNumber , int mode ) { writeNewLine ( buffer , lineSeparator , tabNumber + <NUM_LIT:1> ) ; buffer . append ( Messages . bind ( Messages . disassembler_genericattributeheader , new String [ ] { new String ( classFileAttribute . getAttributeName ( ) ) , Long . toString ( classFileAttribute . getAttributeLength ( ) ) } ) ) ; } private void disassembleEnumConstructor ( IClassFileReader classFileReader , char [ ] className , IMethodInfo methodInfo , StringBuffer buffer , String lineSeparator , int tabNumber , int mode ) { writeNewLine ( buffer , lineSeparator , tabNumber ) ; final ICodeAttribute codeAttribute = methodInfo . getCodeAttribute ( ) ; char [ ] methodDescriptor = methodInfo . getDescriptor ( ) ; final IClassFileAttribute runtimeVisibleAnnotationsAttribute = Util . getAttribute ( methodInfo , IAttributeNamesConstants . RUNTIME_VISIBLE_ANNOTATIONS ) ; final IClassFileAttribute runtimeInvisibleAnnotationsAttribute = Util . getAttribute ( methodInfo , IAttributeNamesConstants . RUNTIME_INVISIBLE_ANNOTATIONS ) ; if ( runtimeInvisibleAnnotationsAttribute != null ) { disassembleAsModifier ( ( IRuntimeInvisibleAnnotationsAttribute ) runtimeInvisibleAnnotationsAttribute , buffer , lineSeparator , tabNumber , mode ) ; writeNewLine ( buffer , lineSeparator , tabNumber ) ; } if ( runtimeVisibleAnnotationsAttribute != null ) { disassembleAsModifier ( ( IRuntimeVisibleAnnotationsAttribute ) runtimeVisibleAnnotationsAttribute , buffer , lineSeparator , tabNumber , mode ) ; writeNewLine ( buffer , lineSeparator , tabNumber ) ; } final int accessFlags = methodInfo . getAccessFlags ( ) ; decodeModifiersForMethod ( buffer , accessFlags & IModifierConstants . ACC_PRIVATE ) ; CharOperation . replace ( methodDescriptor , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ; final boolean isVarArgs = ( accessFlags & IModifierConstants . ACC_VARARGS ) != <NUM_LIT:0> ; final char [ ] signature = Signature . toCharArray ( methodDescriptor , returnClassName ( className , '<CHAR_LIT:.>' , COMPACT ) , getParameterNames ( methodDescriptor , codeAttribute , accessFlags ) , ! checkMode ( mode , COMPACT ) , false , isVarArgs ) ; int index = CharOperation . indexOf ( '<CHAR_LIT:U+002C>' , signature ) ; index = CharOperation . indexOf ( '<CHAR_LIT:U+002C>' , signature , index + <NUM_LIT:1> ) ; buffer . append ( signature , <NUM_LIT:0> , CharOperation . indexOf ( '<CHAR_LIT:(>' , signature ) + <NUM_LIT:1> ) ; buffer . append ( signature , index + <NUM_LIT:2> , signature . length - index - <NUM_LIT:2> ) ; IExceptionAttribute exceptionAttribute = methodInfo . getExceptionAttribute ( ) ; if ( exceptionAttribute != null ) { buffer . append ( "<STR_LIT>" ) ; char [ ] [ ] exceptionNames = exceptionAttribute . getExceptionNames ( ) ; int length = exceptionNames . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( i != <NUM_LIT:0> ) { buffer . append ( Messages . disassembler_comma ) . append ( Messages . disassembler_space ) ; } char [ ] exceptionName = exceptionNames [ i ] ; CharOperation . replace ( exceptionName , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ; buffer . append ( returnClassName ( exceptionName , '<CHAR_LIT:.>' , mode ) ) ; } } if ( ( ( accessFlags & IModifierConstants . ACC_NATIVE ) == <NUM_LIT:0> ) && ( ( accessFlags & IModifierConstants . ACC_ABSTRACT ) == <NUM_LIT:0> ) ) { buffer . append ( "<STR_LIT>" ) ; final char [ ] returnType = Signature . getReturnType ( methodDescriptor ) ; if ( returnType . length == <NUM_LIT:1> ) { switch ( returnType [ <NUM_LIT:0> ] ) { case '<CHAR_LIT>' : writeNewLine ( buffer , lineSeparator , tabNumber ) ; break ; case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : writeNewLine ( buffer , lineSeparator , tabNumber + <NUM_LIT:1> ) ; buffer . append ( "<STR_LIT>" ) ; writeNewLine ( buffer , lineSeparator , tabNumber ) ; break ; default : writeNewLine ( buffer , lineSeparator , tabNumber + <NUM_LIT:1> ) ; buffer . append ( "<STR_LIT>" ) ; writeNewLine ( buffer , lineSeparator , tabNumber ) ; } } else { writeNewLine ( buffer , lineSeparator , tabNumber + <NUM_LIT:1> ) ; buffer . append ( "<STR_LIT>" ) ; writeNewLine ( buffer , lineSeparator , tabNumber ) ; } buffer . append ( '<CHAR_LIT:}>' ) ; } else { buffer . append ( '<CHAR_LIT:;>' ) ; } } private void disassemble ( IClassFileReader classFileReader , char [ ] className , IMethodInfo methodInfo , StringBuffer buffer , String lineSeparator , int tabNumber , int mode ) { writeNewLine ( buffer , lineSeparator , tabNumber ) ; final ICodeAttribute codeAttribute = methodInfo . getCodeAttribute ( ) ; final char [ ] methodDescriptor = methodInfo . getDescriptor ( ) ; final ISignatureAttribute signatureAttribute = ( ISignatureAttribute ) Util . getAttribute ( methodInfo , IAttributeNamesConstants . SIGNATURE ) ; final IClassFileAttribute runtimeVisibleAnnotationsAttribute = Util . getAttribute ( methodInfo , IAttributeNamesConstants . RUNTIME_VISIBLE_ANNOTATIONS ) ; final IClassFileAttribute runtimeInvisibleAnnotationsAttribute = Util . getAttribute ( methodInfo , IAttributeNamesConstants . RUNTIME_INVISIBLE_ANNOTATIONS ) ; final IClassFileAttribute runtimeVisibleParameterAnnotationsAttribute = Util . getAttribute ( methodInfo , IAttributeNamesConstants . RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS ) ; final IClassFileAttribute runtimeInvisibleParameterAnnotationsAttribute = Util . getAttribute ( methodInfo , IAttributeNamesConstants . RUNTIME_INVISIBLE_PARAMETER_ANNOTATIONS ) ; final IClassFileAttribute annotationDefaultAttribute = Util . getAttribute ( methodInfo , IAttributeNamesConstants . ANNOTATION_DEFAULT ) ; if ( checkMode ( mode , SYSTEM | DETAILED ) ) { buffer . append ( Messages . bind ( Messages . classfileformat_methoddescriptor , new String [ ] { Integer . toString ( methodInfo . getDescriptorIndex ( ) ) , new String ( methodDescriptor ) } ) ) ; if ( methodInfo . isDeprecated ( ) ) { buffer . append ( Messages . disassembler_deprecated ) ; } writeNewLine ( buffer , lineSeparator , tabNumber ) ; if ( signatureAttribute != null ) { buffer . append ( Messages . bind ( Messages . disassembler_signatureattributeheader , new String ( signatureAttribute . getSignature ( ) ) ) ) ; writeNewLine ( buffer , lineSeparator , tabNumber ) ; } if ( codeAttribute != null ) { buffer . append ( Messages . bind ( Messages . classfileformat_stacksAndLocals , new String [ ] { Integer . toString ( codeAttribute . getMaxStack ( ) ) , Integer . toString ( codeAttribute . getMaxLocals ( ) ) } ) ) ; writeNewLine ( buffer , lineSeparator , tabNumber ) ; } } if ( checkMode ( mode , DETAILED ) ) { if ( runtimeInvisibleAnnotationsAttribute != null ) { disassembleAsModifier ( ( IRuntimeInvisibleAnnotationsAttribute ) runtimeInvisibleAnnotationsAttribute , buffer , lineSeparator , tabNumber , mode ) ; writeNewLine ( buffer , lineSeparator , tabNumber ) ; } if ( runtimeVisibleAnnotationsAttribute != null ) { disassembleAsModifier ( ( IRuntimeVisibleAnnotationsAttribute ) runtimeVisibleAnnotationsAttribute , buffer , lineSeparator , tabNumber , mode ) ; writeNewLine ( buffer , lineSeparator , tabNumber ) ; } } final int accessFlags = methodInfo . getAccessFlags ( ) ; decodeModifiersForMethod ( buffer , accessFlags ) ; if ( methodInfo . isSynthetic ( ) && ! checkMode ( mode , WORKING_COPY ) ) { buffer . append ( "<STR_LIT>" ) ; buffer . append ( Messages . disassembler_space ) ; } CharOperation . replace ( methodDescriptor , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ; final boolean isVarArgs = isVarArgs ( methodInfo ) ; char [ ] methodHeader = null ; char [ ] [ ] parameterNames = null ; if ( ! methodInfo . isClinit ( ) ) { parameterNames = getParameterNames ( methodDescriptor , codeAttribute , accessFlags ) ; } if ( methodInfo . isConstructor ( ) ) { if ( checkMode ( mode , WORKING_COPY ) && signatureAttribute != null ) { final char [ ] signature = signatureAttribute . getSignature ( ) ; CharOperation . replace ( signature , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ; disassembleGenericSignature ( mode , buffer , signature ) ; buffer . append ( '<CHAR_LIT:U+0020>' ) ; methodHeader = Signature . toCharArray ( signature , returnClassName ( className , '<CHAR_LIT:.>' , COMPACT ) , parameterNames , ! checkMode ( mode , COMPACT ) , false , isVarArgs ) ; } else { methodHeader = Signature . toCharArray ( methodDescriptor , returnClassName ( className , '<CHAR_LIT:.>' , COMPACT ) , parameterNames , ! checkMode ( mode , COMPACT ) , false , isVarArgs ) ; } } else if ( methodInfo . isClinit ( ) ) { methodHeader = Messages . bind ( Messages . classfileformat_clinitname ) . toCharArray ( ) ; } else { if ( checkMode ( mode , WORKING_COPY ) && signatureAttribute != null ) { final char [ ] signature = signatureAttribute . getSignature ( ) ; CharOperation . replace ( signature , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ; disassembleGenericSignature ( mode , buffer , signature ) ; buffer . append ( '<CHAR_LIT:U+0020>' ) ; methodHeader = Signature . toCharArray ( signature , methodInfo . getName ( ) , parameterNames , ! checkMode ( mode , COMPACT ) , true , isVarArgs ) ; } else { methodHeader = Signature . toCharArray ( methodDescriptor , methodInfo . getName ( ) , parameterNames , ! checkMode ( mode , COMPACT ) , true , isVarArgs ) ; } } if ( checkMode ( mode , DETAILED ) && ( runtimeInvisibleParameterAnnotationsAttribute != null || runtimeVisibleParameterAnnotationsAttribute != null ) ) { IParameterAnnotation [ ] invisibleParameterAnnotations = null ; IParameterAnnotation [ ] visibleParameterAnnotations = null ; int length = - <NUM_LIT:1> ; if ( runtimeInvisibleParameterAnnotationsAttribute != null ) { IRuntimeInvisibleParameterAnnotationsAttribute attribute = ( IRuntimeInvisibleParameterAnnotationsAttribute ) runtimeInvisibleParameterAnnotationsAttribute ; invisibleParameterAnnotations = attribute . getParameterAnnotations ( ) ; length = invisibleParameterAnnotations . length ; if ( length > <NUM_LIT:0> ) { int parameterNamesLength = parameterNames . length ; if ( length < parameterNamesLength ) { System . arraycopy ( invisibleParameterAnnotations , <NUM_LIT:0> , ( invisibleParameterAnnotations = new IParameterAnnotation [ parameterNamesLength ] ) , <NUM_LIT:1> , length ) ; length = parameterNamesLength ; } } } if ( runtimeVisibleParameterAnnotationsAttribute != null ) { IRuntimeVisibleParameterAnnotationsAttribute attribute = ( IRuntimeVisibleParameterAnnotationsAttribute ) runtimeVisibleParameterAnnotationsAttribute ; visibleParameterAnnotations = attribute . getParameterAnnotations ( ) ; length = visibleParameterAnnotations . length ; if ( length > <NUM_LIT:0> ) { int parameterNamesLength = parameterNames . length ; if ( length < parameterNamesLength ) { System . arraycopy ( visibleParameterAnnotations , <NUM_LIT:0> , ( visibleParameterAnnotations = new IParameterAnnotation [ parameterNamesLength ] ) , <NUM_LIT:1> , length ) ; length = parameterNamesLength ; } } } int insertionPosition = CharOperation . indexOf ( '<CHAR_LIT:(>' , methodHeader ) + <NUM_LIT:1> ; int start = <NUM_LIT:0> ; StringBuffer stringBuffer = new StringBuffer ( ) ; stringBuffer . append ( methodHeader , <NUM_LIT:0> , insertionPosition ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( i > <NUM_LIT:0> ) { stringBuffer . append ( '<CHAR_LIT:U+0020>' ) ; } int stringBufferSize = stringBuffer . length ( ) ; if ( visibleParameterAnnotations != null ) { disassembleAsModifier ( visibleParameterAnnotations , stringBuffer , i , lineSeparator , tabNumber , mode ) ; } if ( invisibleParameterAnnotations != null ) { if ( stringBuffer . length ( ) != stringBufferSize ) { stringBuffer . append ( '<CHAR_LIT:U+0020>' ) ; stringBufferSize = stringBuffer . length ( ) ; } disassembleAsModifier ( invisibleParameterAnnotations , stringBuffer , i , lineSeparator , tabNumber , mode ) ; } if ( i == <NUM_LIT:0> && stringBuffer . length ( ) != stringBufferSize ) { stringBuffer . append ( '<CHAR_LIT:U+0020>' ) ; } start = insertionPosition ; insertionPosition = CharOperation . indexOf ( '<CHAR_LIT:U+002C>' , methodHeader , start + <NUM_LIT:1> ) + <NUM_LIT:1> ; if ( insertionPosition == <NUM_LIT:0> ) { stringBuffer . append ( methodHeader , start , methodHeader . length - start ) ; } else { stringBuffer . append ( methodHeader , start , insertionPosition - start ) ; } } buffer . append ( stringBuffer ) ; } else { buffer . append ( methodHeader ) ; } IExceptionAttribute exceptionAttribute = methodInfo . getExceptionAttribute ( ) ; if ( exceptionAttribute != null ) { buffer . append ( "<STR_LIT>" ) ; char [ ] [ ] exceptionNames = exceptionAttribute . getExceptionNames ( ) ; int length = exceptionNames . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( i != <NUM_LIT:0> ) { buffer . append ( Messages . disassembler_comma ) . append ( Messages . disassembler_space ) ; } char [ ] exceptionName = exceptionNames [ i ] ; CharOperation . replace ( exceptionName , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ; buffer . append ( returnClassName ( exceptionName , '<CHAR_LIT:.>' , mode ) ) ; } } if ( checkMode ( mode , DETAILED ) ) { if ( annotationDefaultAttribute != null ) { buffer . append ( "<STR_LIT>" ) ; disassembleAsModifier ( ( IAnnotationDefaultAttribute ) annotationDefaultAttribute , buffer , lineSeparator , tabNumber , mode ) ; } } if ( checkMode ( mode , WORKING_COPY ) ) { if ( annotationDefaultAttribute != null ) { buffer . append ( "<STR_LIT>" ) ; disassembleAsModifier ( ( IAnnotationDefaultAttribute ) annotationDefaultAttribute , buffer , lineSeparator , tabNumber , mode ) ; } if ( ( ( accessFlags & IModifierConstants . ACC_NATIVE ) == <NUM_LIT:0> ) && ( ( accessFlags & IModifierConstants . ACC_ABSTRACT ) == <NUM_LIT:0> ) ) { buffer . append ( "<STR_LIT>" ) ; final char [ ] returnType = Signature . getReturnType ( methodDescriptor ) ; if ( returnType . length == <NUM_LIT:1> ) { switch ( returnType [ <NUM_LIT:0> ] ) { case '<CHAR_LIT>' : writeNewLine ( buffer , lineSeparator , tabNumber ) ; break ; case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : writeNewLine ( buffer , lineSeparator , tabNumber + <NUM_LIT:1> ) ; buffer . append ( "<STR_LIT>" ) ; writeNewLine ( buffer , lineSeparator , tabNumber ) ; break ; default : writeNewLine ( buffer , lineSeparator , tabNumber + <NUM_LIT:1> ) ; buffer . append ( "<STR_LIT>" ) ; writeNewLine ( buffer , lineSeparator , tabNumber ) ; } } else { writeNewLine ( buffer , lineSeparator , tabNumber + <NUM_LIT:1> ) ; buffer . append ( "<STR_LIT>" ) ; writeNewLine ( buffer , lineSeparator , tabNumber ) ; } buffer . append ( '<CHAR_LIT:}>' ) ; } else { buffer . append ( '<CHAR_LIT:;>' ) ; } } else { buffer . append ( Messages . disassembler_endofmethodheader ) ; } if ( checkMode ( mode , SYSTEM | DETAILED ) ) { if ( codeAttribute != null ) { disassemble ( codeAttribute , parameterNames , methodDescriptor , ( accessFlags & IModifierConstants . ACC_STATIC ) != <NUM_LIT:0> , buffer , lineSeparator , tabNumber , mode ) ; } } if ( checkMode ( mode , SYSTEM ) ) { IClassFileAttribute [ ] attributes = methodInfo . getAttributes ( ) ; int length = attributes . length ; if ( length != <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { IClassFileAttribute attribute = attributes [ i ] ; if ( attribute != codeAttribute && attribute != exceptionAttribute && attribute != signatureAttribute && attribute != annotationDefaultAttribute && attribute != runtimeInvisibleAnnotationsAttribute && attribute != runtimeVisibleAnnotationsAttribute && attribute != runtimeInvisibleParameterAnnotationsAttribute && attribute != runtimeVisibleParameterAnnotationsAttribute && ! CharOperation . equals ( attribute . getAttributeName ( ) , IAttributeNamesConstants . DEPRECATED ) && ! CharOperation . equals ( attribute . getAttributeName ( ) , IAttributeNamesConstants . SYNTHETIC ) ) { disassemble ( attribute , buffer , lineSeparator , tabNumber , mode ) ; writeNewLine ( buffer , lineSeparator , tabNumber ) ; } } } if ( annotationDefaultAttribute != null ) { disassemble ( ( IAnnotationDefaultAttribute ) annotationDefaultAttribute , buffer , lineSeparator , tabNumber , mode ) ; } if ( runtimeVisibleAnnotationsAttribute != null ) { disassemble ( ( IRuntimeVisibleAnnotationsAttribute ) runtimeVisibleAnnotationsAttribute , buffer , lineSeparator , tabNumber , mode ) ; } if ( runtimeInvisibleAnnotationsAttribute != null ) { disassemble ( ( IRuntimeInvisibleAnnotationsAttribute ) runtimeInvisibleAnnotationsAttribute , buffer , lineSeparator , tabNumber , mode ) ; } if ( runtimeVisibleParameterAnnotationsAttribute != null ) { disassemble ( ( IRuntimeVisibleParameterAnnotationsAttribute ) runtimeVisibleParameterAnnotationsAttribute , buffer , lineSeparator , tabNumber , mode ) ; } if ( runtimeInvisibleParameterAnnotationsAttribute != null ) { disassemble ( ( IRuntimeInvisibleParameterAnnotationsAttribute ) runtimeInvisibleParameterAnnotationsAttribute , buffer , lineSeparator , tabNumber , mode ) ; } } } public String disassemble ( IClassFileReader classFileReader , String lineSeparator ) { return disassemble ( classFileReader , lineSeparator , ClassFileBytesDisassembler . DEFAULT ) ; } public String disassemble ( IClassFileReader classFileReader , String lineSeparator , int mode ) { if ( classFileReader == null ) return org . eclipse . jdt . internal . compiler . util . Util . EMPTY_STRING ; char [ ] className = classFileReader . getClassName ( ) ; if ( className == null ) { return org . eclipse . jdt . internal . compiler . util . Util . EMPTY_STRING ; } className = CharOperation . replaceOnCopy ( className , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ; final int classNameLength = className . length ; final int accessFlags = classFileReader . getAccessFlags ( ) ; final boolean isEnum = ( accessFlags & IModifierConstants . ACC_ENUM ) != <NUM_LIT:0> ; StringBuffer buffer = new StringBuffer ( ) ; ISourceAttribute sourceAttribute = classFileReader . getSourceFileAttribute ( ) ; IClassFileAttribute classFileAttribute = Util . getAttribute ( classFileReader , IAttributeNamesConstants . SIGNATURE ) ; ISignatureAttribute signatureAttribute = ( ISignatureAttribute ) classFileAttribute ; if ( checkMode ( mode , SYSTEM | DETAILED ) ) { int minorVersion = classFileReader . getMinorVersion ( ) ; int majorVersion = classFileReader . getMajorVersion ( ) ; buffer . append ( Messages . disassembler_begincommentline ) ; if ( sourceAttribute != null ) { buffer . append ( Messages . disassembler_sourceattributeheader ) ; buffer . append ( sourceAttribute . getSourceFileName ( ) ) ; } String versionNumber = VERSION_UNKNOWN ; if ( minorVersion == <NUM_LIT:3> && majorVersion == <NUM_LIT> ) { versionNumber = JavaCore . VERSION_1_1 ; } else if ( minorVersion == <NUM_LIT:0> && majorVersion == <NUM_LIT> ) { versionNumber = JavaCore . VERSION_1_2 ; } else if ( minorVersion == <NUM_LIT:0> && majorVersion == <NUM_LIT> ) { versionNumber = JavaCore . VERSION_1_3 ; } else if ( minorVersion == <NUM_LIT:0> && majorVersion == <NUM_LIT> ) { versionNumber = JavaCore . VERSION_1_4 ; } else if ( minorVersion == <NUM_LIT:0> && majorVersion == <NUM_LIT> ) { versionNumber = JavaCore . VERSION_1_5 ; } else if ( minorVersion == <NUM_LIT:0> && majorVersion == <NUM_LIT> ) { versionNumber = JavaCore . VERSION_1_6 ; } else if ( minorVersion == <NUM_LIT:0> && majorVersion == <NUM_LIT> ) { versionNumber = JavaCore . VERSION_1_7 ; } buffer . append ( Messages . bind ( Messages . classfileformat_versiondetails , new String [ ] { versionNumber , Integer . toString ( majorVersion ) , Integer . toString ( minorVersion ) , ( ( accessFlags & IModifierConstants . ACC_SUPER ) != <NUM_LIT:0> ? Messages . classfileformat_superflagisset : Messages . classfileformat_superflagisnotset ) + ( isDeprecated ( classFileReader ) ? "<STR_LIT>" : org . eclipse . jdt . internal . compiler . util . Util . EMPTY_STRING ) } ) ) ; writeNewLine ( buffer , lineSeparator , <NUM_LIT:0> ) ; if ( signatureAttribute != null ) { buffer . append ( Messages . bind ( Messages . disassembler_signatureattributeheader , new String ( signatureAttribute . getSignature ( ) ) ) ) ; writeNewLine ( buffer , lineSeparator , <NUM_LIT:0> ) ; } } final int lastDotIndexInClassName = CharOperation . lastIndexOf ( '<CHAR_LIT:.>' , className ) ; if ( checkMode ( mode , WORKING_COPY ) && lastDotIndexInClassName != - <NUM_LIT:1> ) { buffer . append ( "<STR_LIT>" ) ; buffer . append ( className , <NUM_LIT:0> , lastDotIndexInClassName ) ; buffer . append ( '<CHAR_LIT:;>' ) ; writeNewLine ( buffer , lineSeparator , <NUM_LIT:0> ) ; } IInnerClassesAttribute innerClassesAttribute = classFileReader . getInnerClassesAttribute ( ) ; IClassFileAttribute runtimeVisibleAnnotationsAttribute = Util . getAttribute ( classFileReader , IAttributeNamesConstants . RUNTIME_VISIBLE_ANNOTATIONS ) ; IClassFileAttribute runtimeInvisibleAnnotationsAttribute = Util . getAttribute ( classFileReader , IAttributeNamesConstants . RUNTIME_INVISIBLE_ANNOTATIONS ) ; if ( checkMode ( mode , DETAILED ) ) { if ( runtimeInvisibleAnnotationsAttribute != null ) { disassembleAsModifier ( ( IRuntimeInvisibleAnnotationsAttribute ) runtimeInvisibleAnnotationsAttribute , buffer , lineSeparator , <NUM_LIT:0> , mode ) ; writeNewLine ( buffer , lineSeparator , <NUM_LIT:0> ) ; } if ( runtimeVisibleAnnotationsAttribute != null ) { disassembleAsModifier ( ( IRuntimeVisibleAnnotationsAttribute ) runtimeVisibleAnnotationsAttribute , buffer , lineSeparator , <NUM_LIT:0> , mode ) ; writeNewLine ( buffer , lineSeparator , <NUM_LIT:0> ) ; } } boolean decoded = false ; if ( isEnum && checkMode ( mode , WORKING_COPY ) ) { decodeModifiersForType ( buffer , accessFlags & IModifierConstants . ACC_PUBLIC ) ; } else { if ( innerClassesAttribute != null ) { IInnerClassesAttributeEntry [ ] entries = innerClassesAttribute . getInnerClassAttributesEntries ( ) ; for ( int i = <NUM_LIT:0> , max = entries . length ; i < max ; i ++ ) { IInnerClassesAttributeEntry entry = entries [ i ] ; char [ ] innerClassName = entry . getInnerClassName ( ) ; if ( innerClassName != null ) { if ( CharOperation . equals ( classFileReader . getClassName ( ) , innerClassName ) ) { decodeModifiersForInnerClasses ( buffer , entry . getAccessFlags ( ) , false ) ; decoded = true ; } } } } if ( ! decoded ) { decodeModifiersForType ( buffer , accessFlags ) ; if ( isSynthetic ( classFileReader ) ) { buffer . append ( "<STR_LIT>" ) ; buffer . append ( Messages . disassembler_space ) ; } } } final boolean isAnnotation = ( accessFlags & IModifierConstants . ACC_ANNOTATION ) != <NUM_LIT:0> ; boolean isInterface = false ; if ( isEnum ) { buffer . append ( "<STR_LIT>" ) ; } else if ( classFileReader . isClass ( ) ) { buffer . append ( "<STR_LIT>" ) ; } else { if ( isAnnotation ) { buffer . append ( "<STR_LIT:@>" ) ; } buffer . append ( "<STR_LIT>" ) ; isInterface = true ; } if ( checkMode ( mode , WORKING_COPY ) ) { final int start = lastDotIndexInClassName + <NUM_LIT:1> ; buffer . append ( className , start , classNameLength - start ) ; className = CharOperation . subarray ( className , start , classNameLength ) ; if ( signatureAttribute != null ) { disassembleGenericSignature ( mode , buffer , signatureAttribute . getSignature ( ) ) ; } } else { buffer . append ( className ) ; } char [ ] superclassName = classFileReader . getSuperclassName ( ) ; if ( superclassName != null ) { CharOperation . replace ( superclassName , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ; if ( ! isJavaLangObject ( superclassName ) && ! isEnum ) { buffer . append ( "<STR_LIT>" ) ; buffer . append ( returnClassName ( superclassName , '<CHAR_LIT:.>' , mode ) ) ; } } if ( ! isAnnotation || ! checkMode ( mode , WORKING_COPY ) ) { char [ ] [ ] superclassInterfaces = classFileReader . getInterfaceNames ( ) ; int length = superclassInterfaces . length ; if ( length != <NUM_LIT:0> ) { if ( isInterface ) { buffer . append ( "<STR_LIT>" ) ; } else { buffer . append ( "<STR_LIT>" ) ; } for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( i != <NUM_LIT:0> ) { buffer . append ( Messages . disassembler_comma ) . append ( Messages . disassembler_space ) ; } char [ ] superinterface = superclassInterfaces [ i ] ; CharOperation . replace ( superinterface , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ; buffer . append ( returnClassName ( superinterface , '<CHAR_LIT:.>' , mode ) ) ; } } } buffer . append ( Messages . bind ( Messages . disassembler_opentypedeclaration ) ) ; if ( checkMode ( mode , SYSTEM ) ) { disassemble ( classFileReader . getConstantPool ( ) , buffer , lineSeparator , <NUM_LIT:1> ) ; } disassembleTypeMembers ( classFileReader , className , buffer , lineSeparator , <NUM_LIT:1> , mode , isEnum ) ; if ( checkMode ( mode , SYSTEM | DETAILED ) ) { IClassFileAttribute [ ] attributes = classFileReader . getAttributes ( ) ; int length = attributes . length ; IEnclosingMethodAttribute enclosingMethodAttribute = getEnclosingMethodAttribute ( classFileReader ) ; int remainingAttributesLength = length ; if ( innerClassesAttribute != null ) { remainingAttributesLength -- ; } if ( enclosingMethodAttribute != null ) { remainingAttributesLength -- ; } if ( sourceAttribute != null ) { remainingAttributesLength -- ; } if ( signatureAttribute != null ) { remainingAttributesLength -- ; } if ( innerClassesAttribute != null || enclosingMethodAttribute != null || remainingAttributesLength != <NUM_LIT:0> ) { writeNewLine ( buffer , lineSeparator , <NUM_LIT:0> ) ; } if ( innerClassesAttribute != null ) { disassemble ( innerClassesAttribute , buffer , lineSeparator , <NUM_LIT:1> ) ; } if ( enclosingMethodAttribute != null ) { disassemble ( enclosingMethodAttribute , buffer , lineSeparator , <NUM_LIT:0> ) ; } if ( checkMode ( mode , SYSTEM ) ) { if ( runtimeVisibleAnnotationsAttribute != null ) { disassemble ( ( IRuntimeVisibleAnnotationsAttribute ) runtimeVisibleAnnotationsAttribute , buffer , lineSeparator , <NUM_LIT:0> , mode ) ; } if ( runtimeInvisibleAnnotationsAttribute != null ) { disassemble ( ( IRuntimeInvisibleAnnotationsAttribute ) runtimeInvisibleAnnotationsAttribute , buffer , lineSeparator , <NUM_LIT:0> , mode ) ; } if ( length != <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { IClassFileAttribute attribute = attributes [ i ] ; if ( attribute != innerClassesAttribute && attribute != sourceAttribute && attribute != signatureAttribute && attribute != enclosingMethodAttribute && attribute != runtimeInvisibleAnnotationsAttribute && attribute != runtimeVisibleAnnotationsAttribute && ! CharOperation . equals ( attribute . getAttributeName ( ) , IAttributeNamesConstants . DEPRECATED ) && ! CharOperation . equals ( attribute . getAttributeName ( ) , IAttributeNamesConstants . SYNTHETIC ) ) { disassemble ( attribute , buffer , lineSeparator , <NUM_LIT:0> , mode ) ; } } } } } writeNewLine ( buffer , lineSeparator , <NUM_LIT:0> ) ; buffer . append ( Messages . disassembler_closetypedeclaration ) ; return buffer . toString ( ) ; } private void disassembleGenericSignature ( int mode , StringBuffer buffer , final char [ ] signature ) { CharOperation . replace ( signature , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ; final char [ ] [ ] typeParameters = Signature . getTypeParameters ( signature ) ; final int typeParametersLength = typeParameters . length ; if ( typeParametersLength != <NUM_LIT:0> ) { buffer . append ( '<CHAR_LIT>' ) ; for ( int i = <NUM_LIT:0> ; i < typeParametersLength ; i ++ ) { if ( i != <NUM_LIT:0> ) { buffer . append ( Messages . disassembler_comma ) ; } buffer . append ( typeParameters [ i ] , <NUM_LIT:0> , CharOperation . indexOf ( '<CHAR_LIT::>' , typeParameters [ i ] ) ) ; final char [ ] [ ] bounds = Signature . getTypeParameterBounds ( typeParameters [ i ] ) ; final int boundsLength = bounds . length ; if ( boundsLength != <NUM_LIT:0> ) { if ( boundsLength == <NUM_LIT:1> ) { final char [ ] bound = bounds [ <NUM_LIT:0> ] ; if ( ! isJavaLangObject ( Signature . toCharArray ( bound ) ) ) { buffer . append ( "<STR_LIT>" ) ; buffer . append ( returnClassName ( Signature . toCharArray ( bound ) , '<CHAR_LIT:.>' , mode ) ) ; } } else { buffer . append ( "<STR_LIT>" ) ; for ( int j = <NUM_LIT:0> ; j < boundsLength ; j ++ ) { if ( j != <NUM_LIT:0> ) { buffer . append ( "<STR_LIT>" ) ; } buffer . append ( returnClassName ( Signature . toCharArray ( bounds [ j ] ) , '<CHAR_LIT:.>' , mode ) ) ; } } } } buffer . append ( '<CHAR_LIT:>>' ) ; } } private boolean isJavaLangObject ( final char [ ] className ) { return CharOperation . equals ( TypeConstants . JAVA_LANG_OBJECT , CharOperation . splitOn ( '<CHAR_LIT:.>' , className ) ) ; } private boolean isVarArgs ( IMethodInfo methodInfo ) { int accessFlags = methodInfo . getAccessFlags ( ) ; if ( ( accessFlags & IModifierConstants . ACC_VARARGS ) != <NUM_LIT:0> ) return true ; return Util . getAttribute ( methodInfo , AttributeNamesConstants . VarargsName ) != null ; } private void disassemble ( ICodeAttribute codeAttribute , char [ ] [ ] parameterNames , char [ ] methodDescriptor , boolean isStatic , StringBuffer buffer , String lineSeparator , int tabNumber , int mode ) { writeNewLine ( buffer , lineSeparator , tabNumber - <NUM_LIT:1> ) ; DefaultBytecodeVisitor visitor = new DefaultBytecodeVisitor ( codeAttribute , parameterNames , methodDescriptor , isStatic , buffer , lineSeparator , tabNumber , mode ) ; try { codeAttribute . traverse ( visitor ) ; } catch ( ClassFormatException e ) { dumpTab ( tabNumber + <NUM_LIT:2> , buffer ) ; buffer . append ( Messages . classformat_classformatexception ) ; writeNewLine ( buffer , lineSeparator , tabNumber + <NUM_LIT:1> ) ; } final int exceptionTableLength = codeAttribute . getExceptionTableLength ( ) ; boolean isFirstAttribute = true ; if ( exceptionTableLength != <NUM_LIT:0> ) { final int tabNumberForExceptionAttribute = tabNumber + <NUM_LIT:2> ; isFirstAttribute = false ; dumpTab ( tabNumberForExceptionAttribute , buffer ) ; final IExceptionTableEntry [ ] exceptionTableEntries = codeAttribute . getExceptionTable ( ) ; buffer . append ( Messages . disassembler_exceptiontableheader ) ; writeNewLine ( buffer , lineSeparator , tabNumberForExceptionAttribute + <NUM_LIT:1> ) ; for ( int i = <NUM_LIT:0> ; i < exceptionTableLength ; i ++ ) { if ( i != <NUM_LIT:0> ) { writeNewLine ( buffer , lineSeparator , tabNumberForExceptionAttribute + <NUM_LIT:1> ) ; } IExceptionTableEntry exceptionTableEntry = exceptionTableEntries [ i ] ; char [ ] catchType ; if ( exceptionTableEntry . getCatchTypeIndex ( ) != <NUM_LIT:0> ) { catchType = exceptionTableEntry . getCatchType ( ) ; CharOperation . replace ( catchType , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ; catchType = returnClassName ( catchType , '<CHAR_LIT:.>' , mode ) ; } else { catchType = ANY_EXCEPTION ; } buffer . append ( Messages . bind ( Messages . classfileformat_exceptiontableentry , new String [ ] { Integer . toString ( exceptionTableEntry . getStartPC ( ) ) , Integer . toString ( exceptionTableEntry . getEndPC ( ) ) , Integer . toString ( exceptionTableEntry . getHandlerPC ( ) ) , new String ( catchType ) , } ) ) ; } } final ILineNumberAttribute lineNumberAttribute = codeAttribute . getLineNumberAttribute ( ) ; final int lineAttributeLength = lineNumberAttribute == null ? <NUM_LIT:0> : lineNumberAttribute . getLineNumberTableLength ( ) ; if ( lineAttributeLength != <NUM_LIT:0> ) { int tabNumberForLineAttribute = tabNumber + <NUM_LIT:2> ; if ( ! isFirstAttribute ) { writeNewLine ( buffer , lineSeparator , tabNumberForLineAttribute ) ; } else { dumpTab ( tabNumberForLineAttribute , buffer ) ; isFirstAttribute = false ; } buffer . append ( Messages . disassembler_linenumberattributeheader ) ; writeNewLine ( buffer , lineSeparator , tabNumberForLineAttribute + <NUM_LIT:1> ) ; int [ ] [ ] lineattributesEntries = lineNumberAttribute . getLineNumberTable ( ) ; for ( int i = <NUM_LIT:0> ; i < lineAttributeLength ; i ++ ) { if ( i != <NUM_LIT:0> ) { writeNewLine ( buffer , lineSeparator , tabNumberForLineAttribute + <NUM_LIT:1> ) ; } buffer . append ( Messages . bind ( Messages . classfileformat_linenumbertableentry , new String [ ] { Integer . toString ( lineattributesEntries [ i ] [ <NUM_LIT:0> ] ) , Integer . toString ( lineattributesEntries [ i ] [ <NUM_LIT:1> ] ) } ) ) ; } } final ILocalVariableAttribute localVariableAttribute = codeAttribute . getLocalVariableAttribute ( ) ; final int localVariableAttributeLength = localVariableAttribute == null ? <NUM_LIT:0> : localVariableAttribute . getLocalVariableTableLength ( ) ; if ( localVariableAttributeLength != <NUM_LIT:0> ) { int tabNumberForLocalVariableAttribute = tabNumber + <NUM_LIT:2> ; if ( ! isFirstAttribute ) { writeNewLine ( buffer , lineSeparator , tabNumberForLocalVariableAttribute ) ; } else { isFirstAttribute = false ; dumpTab ( tabNumberForLocalVariableAttribute , buffer ) ; } buffer . append ( Messages . disassembler_localvariabletableattributeheader ) ; writeNewLine ( buffer , lineSeparator , tabNumberForLocalVariableAttribute + <NUM_LIT:1> ) ; ILocalVariableTableEntry [ ] localVariableTableEntries = localVariableAttribute . getLocalVariableTable ( ) ; for ( int i = <NUM_LIT:0> ; i < localVariableAttributeLength ; i ++ ) { if ( i != <NUM_LIT:0> ) { writeNewLine ( buffer , lineSeparator , tabNumberForLocalVariableAttribute + <NUM_LIT:1> ) ; } ILocalVariableTableEntry localVariableTableEntry = localVariableTableEntries [ i ] ; int index = localVariableTableEntry . getIndex ( ) ; int startPC = localVariableTableEntry . getStartPC ( ) ; int length = localVariableTableEntry . getLength ( ) ; final char [ ] typeName = Signature . toCharArray ( localVariableTableEntry . getDescriptor ( ) ) ; CharOperation . replace ( typeName , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ; buffer . append ( Messages . bind ( Messages . classfileformat_localvariabletableentry , new String [ ] { Integer . toString ( startPC ) , Integer . toString ( startPC + length ) , new String ( localVariableTableEntry . getName ( ) ) , Integer . toString ( index ) , new String ( returnClassName ( typeName , '<CHAR_LIT:.>' , mode ) ) } ) ) ; } } final ILocalVariableTypeTableAttribute localVariableTypeAttribute = ( ILocalVariableTypeTableAttribute ) getAttribute ( IAttributeNamesConstants . LOCAL_VARIABLE_TYPE_TABLE , codeAttribute ) ; final int localVariableTypeTableLength = localVariableTypeAttribute == null ? <NUM_LIT:0> : localVariableTypeAttribute . getLocalVariableTypeTableLength ( ) ; if ( localVariableTypeTableLength != <NUM_LIT:0> ) { int tabNumberForLocalVariableAttribute = tabNumber + <NUM_LIT:2> ; if ( ! isFirstAttribute ) { writeNewLine ( buffer , lineSeparator , tabNumberForLocalVariableAttribute ) ; } else { isFirstAttribute = false ; dumpTab ( tabNumberForLocalVariableAttribute , buffer ) ; } buffer . append ( Messages . disassembler_localvariabletypetableattributeheader ) ; writeNewLine ( buffer , lineSeparator , tabNumberForLocalVariableAttribute + <NUM_LIT:1> ) ; ILocalVariableTypeTableEntry [ ] localVariableTypeTableEntries = localVariableTypeAttribute . getLocalVariableTypeTable ( ) ; for ( int i = <NUM_LIT:0> ; i < localVariableTypeTableLength ; i ++ ) { if ( i != <NUM_LIT:0> ) { writeNewLine ( buffer , lineSeparator , tabNumberForLocalVariableAttribute + <NUM_LIT:1> ) ; } ILocalVariableTypeTableEntry localVariableTypeTableEntry = localVariableTypeTableEntries [ i ] ; int index = localVariableTypeTableEntry . getIndex ( ) ; int startPC = localVariableTypeTableEntry . getStartPC ( ) ; int length = localVariableTypeTableEntry . getLength ( ) ; final char [ ] typeName = Signature . toCharArray ( localVariableTypeTableEntry . getSignature ( ) ) ; CharOperation . replace ( typeName , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ; buffer . append ( Messages . bind ( Messages . classfileformat_localvariabletableentry , new String [ ] { Integer . toString ( startPC ) , Integer . toString ( startPC + length ) , new String ( localVariableTypeTableEntry . getName ( ) ) , Integer . toString ( index ) , new String ( returnClassName ( typeName , '<CHAR_LIT:.>' , mode ) ) } ) ) ; } } final int length = codeAttribute . getAttributesCount ( ) ; if ( length != <NUM_LIT:0> ) { IClassFileAttribute [ ] attributes = codeAttribute . getAttributes ( ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { IClassFileAttribute attribute = attributes [ i ] ; if ( CharOperation . equals ( attribute . getAttributeName ( ) , IAttributeNamesConstants . STACK_MAP_TABLE ) ) { IStackMapTableAttribute stackMapTableAttribute = ( IStackMapTableAttribute ) attribute ; if ( ! isFirstAttribute ) { writeNewLine ( buffer , lineSeparator , tabNumber + <NUM_LIT:2> ) ; } else { isFirstAttribute = false ; dumpTab ( tabNumber + <NUM_LIT:1> , buffer ) ; } int numberOfEntries = stackMapTableAttribute . getNumberOfEntries ( ) ; buffer . append ( Messages . bind ( Messages . disassembler_stackmaptableattributeheader , Integer . toString ( numberOfEntries ) ) ) ; if ( numberOfEntries != <NUM_LIT:0> ) { disassemble ( stackMapTableAttribute , buffer , lineSeparator , tabNumber , mode ) ; } } else if ( CharOperation . equals ( attribute . getAttributeName ( ) , IAttributeNamesConstants . STACK_MAP ) ) { IStackMapAttribute stackMapAttribute = ( IStackMapAttribute ) attribute ; if ( ! isFirstAttribute ) { writeNewLine ( buffer , lineSeparator , tabNumber + <NUM_LIT:2> ) ; } else { isFirstAttribute = false ; dumpTab ( tabNumber + <NUM_LIT:1> , buffer ) ; } int numberOfEntries = stackMapAttribute . getNumberOfEntries ( ) ; buffer . append ( Messages . bind ( Messages . disassembler_stackmapattributeheader , Integer . toString ( numberOfEntries ) ) ) ; if ( numberOfEntries != <NUM_LIT:0> ) { disassemble ( stackMapAttribute , buffer , lineSeparator , tabNumber , mode ) ; } } else if ( attribute != lineNumberAttribute && attribute != localVariableAttribute && attribute != localVariableTypeAttribute ) { if ( ! isFirstAttribute ) { writeNewLine ( buffer , lineSeparator , tabNumber + <NUM_LIT:2> ) ; } else { isFirstAttribute = false ; dumpTab ( tabNumber + <NUM_LIT:1> , buffer ) ; } buffer . append ( Messages . bind ( Messages . disassembler_genericattributeheader , new String [ ] { new String ( attribute . getAttributeName ( ) ) , Long . toString ( attribute . getAttributeLength ( ) ) } ) ) ; } } } } private void disassemble ( IStackMapTableAttribute attribute , StringBuffer buffer , String lineSeparator , int tabNumber , int mode ) { writeNewLine ( buffer , lineSeparator , tabNumber + <NUM_LIT:3> ) ; int numberOfEntries = attribute . getNumberOfEntries ( ) ; final IStackMapFrame [ ] stackMapFrames = attribute . getStackMapFrame ( ) ; int absolutePC = - <NUM_LIT:1> ; for ( int j = <NUM_LIT:0> ; j < numberOfEntries ; j ++ ) { if ( j > <NUM_LIT:0> ) { writeNewLine ( buffer , lineSeparator , tabNumber + <NUM_LIT:3> ) ; } final IStackMapFrame frame = stackMapFrames [ j ] ; int type = frame . getFrameType ( ) ; int offsetDelta = frame . getOffsetDelta ( ) ; if ( absolutePC == - <NUM_LIT:1> ) { absolutePC = offsetDelta ; } else { absolutePC += ( offsetDelta + <NUM_LIT:1> ) ; } switch ( type ) { case <NUM_LIT> : buffer . append ( Messages . bind ( Messages . disassembler_frame_same_locals_1_stack_item_extended , Integer . toString ( absolutePC ) , disassemble ( frame . getStackItems ( ) , mode ) ) ) ; break ; case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : buffer . append ( Messages . bind ( Messages . disassembler_frame_chop , Integer . toString ( absolutePC ) , Integer . toString ( <NUM_LIT> - type ) ) ) ; break ; case <NUM_LIT> : buffer . append ( Messages . bind ( Messages . disassembler_frame_same_frame_extended , Integer . toString ( absolutePC ) ) ) ; break ; case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : buffer . append ( Messages . bind ( Messages . disassembler_frame_append , Integer . toString ( absolutePC ) , disassemble ( frame . getLocals ( ) , mode ) ) ) ; break ; case <NUM_LIT:255> : buffer . append ( Messages . bind ( Messages . disassembler_frame_full_frame , new String [ ] { Integer . toString ( absolutePC ) , Integer . toString ( frame . getNumberOfLocals ( ) ) , disassemble ( frame . getLocals ( ) , mode ) , Integer . toString ( frame . getNumberOfStackItems ( ) ) , disassemble ( frame . getStackItems ( ) , mode ) , dumpNewLineWithTabs ( lineSeparator , tabNumber + <NUM_LIT:5> ) } ) ) ; break ; default : if ( type <= <NUM_LIT> ) { offsetDelta = type ; buffer . append ( Messages . bind ( Messages . disassembler_frame_same_frame , Integer . toString ( absolutePC ) ) ) ; } else if ( type <= <NUM_LIT> ) { offsetDelta = type - <NUM_LIT> ; buffer . append ( Messages . bind ( Messages . disassembler_frame_same_locals_1_stack_item , Integer . toString ( absolutePC ) , disassemble ( frame . getStackItems ( ) , mode ) ) ) ; } } } } private void disassemble ( IStackMapAttribute attribute , StringBuffer buffer , String lineSeparator , int tabNumber , int mode ) { writeNewLine ( buffer , lineSeparator , tabNumber + <NUM_LIT:3> ) ; int numberOfEntries = attribute . getNumberOfEntries ( ) ; final IStackMapFrame [ ] stackMapFrames = attribute . getStackMapFrame ( ) ; for ( int j = <NUM_LIT:0> ; j < numberOfEntries ; j ++ ) { if ( j > <NUM_LIT:0> ) { writeNewLine ( buffer , lineSeparator , tabNumber + <NUM_LIT:3> ) ; } final IStackMapFrame frame = stackMapFrames [ j ] ; buffer . append ( Messages . bind ( Messages . disassembler_frame_full_frame , new String [ ] { Integer . toString ( frame . getOffsetDelta ( ) ) , Integer . toString ( frame . getNumberOfLocals ( ) ) , disassemble ( frame . getLocals ( ) , mode ) , Integer . toString ( frame . getNumberOfStackItems ( ) ) , disassemble ( frame . getStackItems ( ) , mode ) , dumpNewLineWithTabs ( lineSeparator , tabNumber + <NUM_LIT:5> ) } ) ) ; } } private void disassemble ( IConstantPool constantPool , StringBuffer buffer , String lineSeparator , int tabNumber ) { writeNewLine ( buffer , lineSeparator , tabNumber ) ; int length = constantPool . getConstantPoolCount ( ) ; buffer . append ( Messages . disassembler_constantpoolheader ) ; writeNewLine ( buffer , lineSeparator , tabNumber + <NUM_LIT:1> ) ; for ( int i = <NUM_LIT:1> ; i < length ; i ++ ) { if ( i != <NUM_LIT:1> ) { writeNewLine ( buffer , lineSeparator , tabNumber + <NUM_LIT:1> ) ; } IConstantPoolEntry constantPoolEntry = constantPool . decodeEntry ( i ) ; switch ( constantPool . getEntryKind ( i ) ) { case IConstantPoolConstant . CONSTANT_Class : buffer . append ( Messages . bind ( Messages . disassembler_constantpool_class , new String [ ] { Integer . toString ( i ) , Integer . toString ( constantPoolEntry . getClassInfoNameIndex ( ) ) , new String ( constantPoolEntry . getClassInfoName ( ) ) } ) ) ; break ; case IConstantPoolConstant . CONSTANT_Double : buffer . append ( Messages . bind ( Messages . disassembler_constantpool_double , new String [ ] { Integer . toString ( i ) , Double . toString ( constantPoolEntry . getDoubleValue ( ) ) } ) ) ; break ; case IConstantPoolConstant . CONSTANT_Fieldref : buffer . append ( Messages . bind ( Messages . disassembler_constantpool_fieldref , new String [ ] { Integer . toString ( i ) , Integer . toString ( constantPoolEntry . getClassIndex ( ) ) , Integer . toString ( constantPoolEntry . getNameAndTypeIndex ( ) ) , new String ( constantPoolEntry . getClassName ( ) ) , new String ( constantPoolEntry . getFieldName ( ) ) , new String ( constantPoolEntry . getFieldDescriptor ( ) ) } ) ) ; break ; case IConstantPoolConstant . CONSTANT_Float : buffer . append ( Messages . bind ( Messages . disassembler_constantpool_float , new String [ ] { Integer . toString ( i ) , Float . toString ( constantPoolEntry . getFloatValue ( ) ) } ) ) ; break ; case IConstantPoolConstant . CONSTANT_Integer : buffer . append ( Messages . bind ( Messages . disassembler_constantpool_integer , new String [ ] { Integer . toString ( i ) , Integer . toString ( constantPoolEntry . getIntegerValue ( ) ) } ) ) ; break ; case IConstantPoolConstant . CONSTANT_InterfaceMethodref : buffer . append ( Messages . bind ( Messages . disassembler_constantpool_interfacemethodref , new String [ ] { Integer . toString ( i ) , Integer . toString ( constantPoolEntry . getClassIndex ( ) ) , Integer . toString ( constantPoolEntry . getNameAndTypeIndex ( ) ) , new String ( constantPoolEntry . getClassName ( ) ) , new String ( constantPoolEntry . getMethodName ( ) ) , new String ( constantPoolEntry . getMethodDescriptor ( ) ) } ) ) ; break ; case IConstantPoolConstant . CONSTANT_Long : buffer . append ( Messages . bind ( Messages . disassembler_constantpool_long , new String [ ] { Integer . toString ( i ) , Long . toString ( constantPoolEntry . getLongValue ( ) ) } ) ) ; break ; case IConstantPoolConstant . CONSTANT_Methodref : buffer . append ( Messages . bind ( Messages . disassembler_constantpool_methodref , new String [ ] { Integer . toString ( i ) , Integer . toString ( constantPoolEntry . getClassIndex ( ) ) , Integer . toString ( constantPoolEntry . getNameAndTypeIndex ( ) ) , new String ( constantPoolEntry . getClassName ( ) ) , new String ( constantPoolEntry . getMethodName ( ) ) , new String ( constantPoolEntry . getMethodDescriptor ( ) ) } ) ) ; break ; case IConstantPoolConstant . CONSTANT_NameAndType : int nameIndex = constantPoolEntry . getNameAndTypeInfoNameIndex ( ) ; int typeIndex = constantPoolEntry . getNameAndTypeInfoDescriptorIndex ( ) ; IConstantPoolEntry entry = constantPool . decodeEntry ( nameIndex ) ; char [ ] nameValue = entry . getUtf8Value ( ) ; entry = constantPool . decodeEntry ( typeIndex ) ; char [ ] typeValue = entry . getUtf8Value ( ) ; buffer . append ( Messages . bind ( Messages . disassembler_constantpool_name_and_type , new String [ ] { Integer . toString ( i ) , Integer . toString ( nameIndex ) , Integer . toString ( typeIndex ) , String . valueOf ( nameValue ) , String . valueOf ( typeValue ) } ) ) ; break ; case IConstantPoolConstant . CONSTANT_String : buffer . append ( Messages . bind ( Messages . disassembler_constantpool_string , new String [ ] { Integer . toString ( i ) , Integer . toString ( constantPoolEntry . getStringIndex ( ) ) , decodeStringValue ( constantPoolEntry . getStringValue ( ) ) } ) ) ; break ; case IConstantPoolConstant . CONSTANT_Utf8 : buffer . append ( Messages . bind ( Messages . disassembler_constantpool_utf8 , new String [ ] { Integer . toString ( i ) , decodeStringValue ( new String ( constantPoolEntry . getUtf8Value ( ) ) ) } ) ) ; break ; } } } private void disassemble ( IEnclosingMethodAttribute enclosingMethodAttribute , StringBuffer buffer , String lineSeparator , int tabNumber ) { writeNewLine ( buffer , lineSeparator , tabNumber + <NUM_LIT:1> ) ; buffer . append ( Messages . disassembler_enclosingmethodheader ) ; buffer . append ( Messages . disassembler_constantpoolindex ) . append ( enclosingMethodAttribute . getEnclosingClassIndex ( ) ) . append ( "<STR_LIT:U+0020>" ) . append ( Messages . disassembler_constantpoolindex ) . append ( enclosingMethodAttribute . getMethodNameAndTypeIndex ( ) ) . append ( "<STR_LIT:U+0020>" ) . append ( enclosingMethodAttribute . getEnclosingClass ( ) ) ; if ( enclosingMethodAttribute . getMethodNameAndTypeIndex ( ) != <NUM_LIT:0> ) { buffer . append ( "<STR_LIT:.>" ) . append ( enclosingMethodAttribute . getMethodName ( ) ) . append ( enclosingMethodAttribute . getMethodDescriptor ( ) ) ; } } private void disassembleEnumConstants ( IFieldInfo fieldInfo , StringBuffer buffer , String lineSeparator , int tabNumber , char [ ] [ ] argumentTypes , int mode ) { writeNewLine ( buffer , lineSeparator , tabNumber ) ; final IClassFileAttribute runtimeVisibleAnnotationsAttribute = Util . getAttribute ( fieldInfo , IAttributeNamesConstants . RUNTIME_VISIBLE_ANNOTATIONS ) ; final IClassFileAttribute runtimeInvisibleAnnotationsAttribute = Util . getAttribute ( fieldInfo , IAttributeNamesConstants . RUNTIME_INVISIBLE_ANNOTATIONS ) ; if ( runtimeInvisibleAnnotationsAttribute != null ) { disassembleAsModifier ( ( IRuntimeInvisibleAnnotationsAttribute ) runtimeInvisibleAnnotationsAttribute , buffer , lineSeparator , tabNumber , mode ) ; writeNewLine ( buffer , lineSeparator , tabNumber ) ; } if ( runtimeVisibleAnnotationsAttribute != null ) { disassembleAsModifier ( ( IRuntimeVisibleAnnotationsAttribute ) runtimeVisibleAnnotationsAttribute , buffer , lineSeparator , tabNumber , mode ) ; writeNewLine ( buffer , lineSeparator , tabNumber ) ; } buffer . append ( new String ( fieldInfo . getName ( ) ) ) ; buffer . append ( '<CHAR_LIT:(>' ) ; final int length = argumentTypes . length ; if ( length != <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( i != <NUM_LIT:0> ) { buffer . append ( Messages . disassembler_comma ) ; } final char [ ] type = argumentTypes [ i ] ; switch ( type . length ) { case <NUM_LIT:1> : switch ( type [ <NUM_LIT:0> ] ) { case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : buffer . append ( '<CHAR_LIT:0>' ) ; break ; case '<CHAR_LIT:Z>' : buffer . append ( "<STR_LIT:false>" ) ; break ; case '<CHAR_LIT>' : buffer . append ( "<STR_LIT>" ) ; break ; } break ; default : buffer . append ( "<STR_LIT:null>" ) ; } } } buffer . append ( '<CHAR_LIT:)>' ) . append ( Messages . disassembler_comma ) ; } private void disassemble ( IFieldInfo fieldInfo , StringBuffer buffer , String lineSeparator , int tabNumber , int mode ) { writeNewLine ( buffer , lineSeparator , tabNumber ) ; final char [ ] fieldDescriptor = fieldInfo . getDescriptor ( ) ; final ISignatureAttribute signatureAttribute = ( ISignatureAttribute ) Util . getAttribute ( fieldInfo , IAttributeNamesConstants . SIGNATURE ) ; if ( checkMode ( mode , SYSTEM | DETAILED ) ) { buffer . append ( Messages . bind ( Messages . classfileformat_fieldddescriptor , new String [ ] { Integer . toString ( fieldInfo . getDescriptorIndex ( ) ) , new String ( fieldDescriptor ) } ) ) ; if ( fieldInfo . isDeprecated ( ) ) { buffer . append ( Messages . disassembler_deprecated ) ; } writeNewLine ( buffer , lineSeparator , tabNumber ) ; if ( signatureAttribute != null ) { buffer . append ( Messages . bind ( Messages . disassembler_signatureattributeheader , new String ( signatureAttribute . getSignature ( ) ) ) ) ; writeNewLine ( buffer , lineSeparator , tabNumber ) ; } } final IClassFileAttribute runtimeVisibleAnnotationsAttribute = Util . getAttribute ( fieldInfo , IAttributeNamesConstants . RUNTIME_VISIBLE_ANNOTATIONS ) ; final IClassFileAttribute runtimeInvisibleAnnotationsAttribute = Util . getAttribute ( fieldInfo , IAttributeNamesConstants . RUNTIME_INVISIBLE_ANNOTATIONS ) ; if ( checkMode ( mode , DETAILED ) ) { if ( runtimeInvisibleAnnotationsAttribute != null ) { disassembleAsModifier ( ( IRuntimeInvisibleAnnotationsAttribute ) runtimeInvisibleAnnotationsAttribute , buffer , lineSeparator , tabNumber , mode ) ; writeNewLine ( buffer , lineSeparator , tabNumber ) ; } if ( runtimeVisibleAnnotationsAttribute != null ) { disassembleAsModifier ( ( IRuntimeVisibleAnnotationsAttribute ) runtimeVisibleAnnotationsAttribute , buffer , lineSeparator , tabNumber , mode ) ; writeNewLine ( buffer , lineSeparator , tabNumber ) ; } } if ( checkMode ( mode , WORKING_COPY ) ) { decodeModifiersForFieldForWorkingCopy ( buffer , fieldInfo . getAccessFlags ( ) ) ; if ( signatureAttribute != null ) { buffer . append ( returnClassName ( getSignatureForField ( signatureAttribute . getSignature ( ) ) , '<CHAR_LIT:.>' , mode ) ) ; } else { buffer . append ( returnClassName ( getSignatureForField ( fieldDescriptor ) , '<CHAR_LIT:.>' , mode ) ) ; } } else { decodeModifiersForField ( buffer , fieldInfo . getAccessFlags ( ) ) ; if ( fieldInfo . isSynthetic ( ) ) { buffer . append ( "<STR_LIT>" ) ; buffer . append ( Messages . disassembler_space ) ; } buffer . append ( returnClassName ( getSignatureForField ( fieldDescriptor ) , '<CHAR_LIT:.>' , mode ) ) ; } buffer . append ( '<CHAR_LIT:U+0020>' ) ; buffer . append ( new String ( fieldInfo . getName ( ) ) ) ; IConstantValueAttribute constantValueAttribute = fieldInfo . getConstantValueAttribute ( ) ; if ( constantValueAttribute != null ) { buffer . append ( Messages . disassembler_fieldhasconstant ) ; IConstantPoolEntry constantPoolEntry = constantValueAttribute . getConstantValue ( ) ; switch ( constantPoolEntry . getKind ( ) ) { case IConstantPoolConstant . CONSTANT_Long : buffer . append ( constantPoolEntry . getLongValue ( ) + "<STR_LIT>" ) ; break ; case IConstantPoolConstant . CONSTANT_Float : buffer . append ( constantPoolEntry . getFloatValue ( ) + "<STR_LIT:f>" ) ; break ; case IConstantPoolConstant . CONSTANT_Double : final double doubleValue = constantPoolEntry . getDoubleValue ( ) ; if ( checkMode ( mode , ClassFileBytesDisassembler . WORKING_COPY ) ) { if ( doubleValue == Double . POSITIVE_INFINITY ) { buffer . append ( "<STR_LIT>" ) ; } else if ( doubleValue == Double . NEGATIVE_INFINITY ) { buffer . append ( "<STR_LIT>" ) ; } else { buffer . append ( constantPoolEntry . getDoubleValue ( ) ) ; } } else { buffer . append ( constantPoolEntry . getDoubleValue ( ) ) ; } break ; case IConstantPoolConstant . CONSTANT_Integer : switch ( fieldDescriptor [ <NUM_LIT:0> ] ) { case '<CHAR_LIT>' : buffer . append ( "<STR_LIT:'>" + ( char ) constantPoolEntry . getIntegerValue ( ) + "<STR_LIT:'>" ) ; break ; case '<CHAR_LIT:Z>' : buffer . append ( constantPoolEntry . getIntegerValue ( ) == <NUM_LIT:1> ? "<STR_LIT:true>" : "<STR_LIT:false>" ) ; break ; case '<CHAR_LIT>' : buffer . append ( constantPoolEntry . getIntegerValue ( ) ) ; break ; case '<CHAR_LIT>' : buffer . append ( constantPoolEntry . getIntegerValue ( ) ) ; break ; case '<CHAR_LIT>' : buffer . append ( constantPoolEntry . getIntegerValue ( ) ) ; } break ; case IConstantPoolConstant . CONSTANT_String : buffer . append ( "<STR_LIT:\">" + decodeStringValue ( constantPoolEntry . getStringValue ( ) ) + "<STR_LIT:\">" ) ; } } buffer . append ( Messages . disassembler_endoffieldheader ) ; if ( checkMode ( mode , SYSTEM ) ) { IClassFileAttribute [ ] attributes = fieldInfo . getAttributes ( ) ; int length = attributes . length ; if ( length != <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { IClassFileAttribute attribute = attributes [ i ] ; if ( attribute != constantValueAttribute && attribute != signatureAttribute && attribute != runtimeInvisibleAnnotationsAttribute && attribute != runtimeVisibleAnnotationsAttribute && ! CharOperation . equals ( attribute . getAttributeName ( ) , IAttributeNamesConstants . DEPRECATED ) && ! CharOperation . equals ( attribute . getAttributeName ( ) , IAttributeNamesConstants . SYNTHETIC ) ) { disassemble ( attribute , buffer , lineSeparator , tabNumber , mode ) ; } } } if ( runtimeVisibleAnnotationsAttribute != null ) { disassemble ( ( IRuntimeVisibleAnnotationsAttribute ) runtimeVisibleAnnotationsAttribute , buffer , lineSeparator , tabNumber , mode ) ; } if ( runtimeInvisibleAnnotationsAttribute != null ) { disassemble ( ( IRuntimeInvisibleAnnotationsAttribute ) runtimeInvisibleAnnotationsAttribute , buffer , lineSeparator , tabNumber , mode ) ; } } } private void disassemble ( IInnerClassesAttribute innerClassesAttribute , StringBuffer buffer , String lineSeparator , int tabNumber ) { writeNewLine ( buffer , lineSeparator , tabNumber ) ; buffer . append ( Messages . disassembler_innerattributesheader ) ; writeNewLine ( buffer , lineSeparator , tabNumber + <NUM_LIT:1> ) ; IInnerClassesAttributeEntry [ ] innerClassesAttributeEntries = innerClassesAttribute . getInnerClassAttributesEntries ( ) ; int length = innerClassesAttributeEntries . length ; int innerClassNameIndex , outerClassNameIndex , innerNameIndex , accessFlags ; IInnerClassesAttributeEntry innerClassesAttributeEntry ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( i != <NUM_LIT:0> ) { buffer . append ( Messages . disassembler_comma ) ; writeNewLine ( buffer , lineSeparator , tabNumber + <NUM_LIT:1> ) ; } innerClassesAttributeEntry = innerClassesAttributeEntries [ i ] ; innerClassNameIndex = innerClassesAttributeEntry . getInnerClassNameIndex ( ) ; outerClassNameIndex = innerClassesAttributeEntry . getOuterClassNameIndex ( ) ; innerNameIndex = innerClassesAttributeEntry . getInnerNameIndex ( ) ; accessFlags = innerClassesAttributeEntry . getAccessFlags ( ) ; buffer . append ( Messages . disassembler_openinnerclassentry ) . append ( Messages . disassembler_inner_class_info_name ) . append ( Messages . disassembler_constantpoolindex ) . append ( innerClassNameIndex ) ; if ( innerClassNameIndex != <NUM_LIT:0> ) { buffer . append ( Messages . disassembler_space ) . append ( innerClassesAttributeEntry . getInnerClassName ( ) ) ; } buffer . append ( Messages . disassembler_comma ) . append ( Messages . disassembler_space ) . append ( Messages . disassembler_outer_class_info_name ) . append ( Messages . disassembler_constantpoolindex ) . append ( outerClassNameIndex ) ; if ( outerClassNameIndex != <NUM_LIT:0> ) { buffer . append ( Messages . disassembler_space ) . append ( innerClassesAttributeEntry . getOuterClassName ( ) ) ; } writeNewLine ( buffer , lineSeparator , tabNumber ) ; dumpTab ( tabNumber , buffer ) ; buffer . append ( Messages . disassembler_space ) ; buffer . append ( Messages . disassembler_inner_name ) . append ( Messages . disassembler_constantpoolindex ) . append ( innerNameIndex ) ; if ( innerNameIndex != <NUM_LIT:0> ) { buffer . append ( Messages . disassembler_space ) . append ( innerClassesAttributeEntry . getInnerName ( ) ) ; } buffer . append ( Messages . disassembler_comma ) . append ( Messages . disassembler_space ) . append ( Messages . disassembler_inner_accessflags ) . append ( accessFlags ) . append ( Messages . disassembler_space ) ; decodeModifiersForInnerClasses ( buffer , accessFlags , true ) ; buffer . append ( Messages . disassembler_closeinnerclassentry ) ; } } private void disassemble ( int index , IParameterAnnotation parameterAnnotation , StringBuffer buffer , String lineSeparator , int tabNumber , int mode ) { IAnnotation [ ] annotations = parameterAnnotation . getAnnotations ( ) ; writeNewLine ( buffer , lineSeparator , tabNumber + <NUM_LIT:1> ) ; buffer . append ( Messages . bind ( Messages . disassembler_parameterannotationentrystart , new String [ ] { Integer . toString ( index ) , Integer . toString ( annotations . length ) } ) ) ; for ( int i = <NUM_LIT:0> , max = annotations . length ; i < max ; i ++ ) { disassemble ( annotations [ i ] , buffer , lineSeparator , tabNumber + <NUM_LIT:1> , mode ) ; } } private void disassemble ( IRuntimeInvisibleAnnotationsAttribute runtimeInvisibleAnnotationsAttribute , StringBuffer buffer , String lineSeparator , int tabNumber , int mode ) { writeNewLine ( buffer , lineSeparator , tabNumber + <NUM_LIT:1> ) ; buffer . append ( Messages . disassembler_runtimeinvisibleannotationsattributeheader ) ; IAnnotation [ ] annotations = runtimeInvisibleAnnotationsAttribute . getAnnotations ( ) ; for ( int i = <NUM_LIT:0> , max = annotations . length ; i < max ; i ++ ) { disassemble ( annotations [ i ] , buffer , lineSeparator , tabNumber + <NUM_LIT:1> , mode ) ; } } private void disassemble ( IRuntimeInvisibleParameterAnnotationsAttribute runtimeInvisibleParameterAnnotationsAttribute , StringBuffer buffer , String lineSeparator , int tabNumber , int mode ) { writeNewLine ( buffer , lineSeparator , tabNumber + <NUM_LIT:1> ) ; buffer . append ( Messages . disassembler_runtimeinvisibleparameterannotationsattributeheader ) ; IParameterAnnotation [ ] parameterAnnotations = runtimeInvisibleParameterAnnotationsAttribute . getParameterAnnotations ( ) ; for ( int i = <NUM_LIT:0> , max = parameterAnnotations . length ; i < max ; i ++ ) { disassemble ( i , parameterAnnotations [ i ] , buffer , lineSeparator , tabNumber + <NUM_LIT:1> , mode ) ; } } private void disassemble ( IRuntimeVisibleAnnotationsAttribute runtimeVisibleAnnotationsAttribute , StringBuffer buffer , String lineSeparator , int tabNumber , int mode ) { writeNewLine ( buffer , lineSeparator , tabNumber + <NUM_LIT:1> ) ; buffer . append ( Messages . disassembler_runtimevisibleannotationsattributeheader ) ; IAnnotation [ ] annotations = runtimeVisibleAnnotationsAttribute . getAnnotations ( ) ; for ( int i = <NUM_LIT:0> , max = annotations . length ; i < max ; i ++ ) { disassemble ( annotations [ i ] , buffer , lineSeparator , tabNumber + <NUM_LIT:1> , mode ) ; } } private void disassemble ( IRuntimeVisibleParameterAnnotationsAttribute runtimeVisibleParameterAnnotationsAttribute , StringBuffer buffer , String lineSeparator , int tabNumber , int mode ) { writeNewLine ( buffer , lineSeparator , tabNumber + <NUM_LIT:1> ) ; buffer . append ( Messages . disassembler_runtimevisibleparameterannotationsattributeheader ) ; IParameterAnnotation [ ] parameterAnnotations = runtimeVisibleParameterAnnotationsAttribute . getParameterAnnotations ( ) ; for ( int i = <NUM_LIT:0> , max = parameterAnnotations . length ; i < max ; i ++ ) { disassemble ( i , parameterAnnotations [ i ] , buffer , lineSeparator , tabNumber + <NUM_LIT:1> , mode ) ; } } private String disassemble ( IVerificationTypeInfo [ ] infos , int mode ) { StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( '<CHAR_LIT>' ) ; for ( int i = <NUM_LIT:0> , max = infos . length ; i < max ; i ++ ) { if ( i != <NUM_LIT:0> ) { buffer . append ( Messages . disassembler_comma ) . append ( Messages . disassembler_space ) ; } switch ( infos [ i ] . getTag ( ) ) { case IVerificationTypeInfo . ITEM_DOUBLE : buffer . append ( "<STR_LIT:double>" ) ; break ; case IVerificationTypeInfo . ITEM_FLOAT : buffer . append ( "<STR_LIT:float>" ) ; break ; case IVerificationTypeInfo . ITEM_INTEGER : buffer . append ( "<STR_LIT:int>" ) ; break ; case IVerificationTypeInfo . ITEM_LONG : buffer . append ( "<STR_LIT:long>" ) ; break ; case IVerificationTypeInfo . ITEM_NULL : buffer . append ( "<STR_LIT:null>" ) ; break ; case IVerificationTypeInfo . ITEM_OBJECT : char [ ] classTypeName = infos [ i ] . getClassTypeName ( ) ; CharOperation . replace ( classTypeName , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ; if ( classTypeName . length > <NUM_LIT:0> && classTypeName [ <NUM_LIT:0> ] == '<CHAR_LIT:[>' ) { classTypeName = Signature . toCharArray ( classTypeName ) ; } buffer . append ( returnClassName ( classTypeName , '<CHAR_LIT:.>' , mode ) ) ; break ; case IVerificationTypeInfo . ITEM_TOP : buffer . append ( "<STR_LIT:_>" ) ; break ; case IVerificationTypeInfo . ITEM_UNINITIALIZED : buffer . append ( "<STR_LIT>" ) ; buffer . append ( infos [ i ] . getOffset ( ) ) ; buffer . append ( '<CHAR_LIT:)>' ) ; break ; case IVerificationTypeInfo . ITEM_UNINITIALIZED_THIS : buffer . append ( "<STR_LIT>" ) ; } } buffer . append ( '<CHAR_LIT:}>' ) ; return String . valueOf ( buffer ) ; } private void disassembleAsModifier ( IAnnotation annotation , StringBuffer buffer , String lineSeparator , int tabNumber , int mode ) { final char [ ] typeName = CharOperation . replaceOnCopy ( annotation . getTypeName ( ) , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ; buffer . append ( '<CHAR_LIT>' ) . append ( returnClassName ( Signature . toCharArray ( typeName ) , '<CHAR_LIT:.>' , mode ) ) ; final IAnnotationComponent [ ] components = annotation . getComponents ( ) ; final int length = components . length ; if ( length != <NUM_LIT:0> ) { buffer . append ( '<CHAR_LIT:(>' ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( i > <NUM_LIT:0> ) { buffer . append ( '<CHAR_LIT:U+002C>' ) ; writeNewLine ( buffer , lineSeparator , tabNumber ) ; } disassembleAsModifier ( components [ i ] , buffer , lineSeparator , tabNumber + <NUM_LIT:1> , mode ) ; } buffer . append ( '<CHAR_LIT:)>' ) ; } } private void disassembleAsModifier ( IAnnotationComponent annotationComponent , StringBuffer buffer , String lineSeparator , int tabNumber , int mode ) { buffer . append ( annotationComponent . getComponentName ( ) ) . append ( '<CHAR_LIT:=>' ) ; disassembleAsModifier ( annotationComponent . getComponentValue ( ) , buffer , lineSeparator , tabNumber + <NUM_LIT:1> , mode ) ; } private void disassembleAsModifier ( IAnnotationComponentValue annotationComponentValue , StringBuffer buffer , String lineSeparator , int tabNumber , int mode ) { switch ( annotationComponentValue . getTag ( ) ) { case IAnnotationComponentValue . BYTE_TAG : case IAnnotationComponentValue . CHAR_TAG : case IAnnotationComponentValue . DOUBLE_TAG : case IAnnotationComponentValue . FLOAT_TAG : case IAnnotationComponentValue . INTEGER_TAG : case IAnnotationComponentValue . LONG_TAG : case IAnnotationComponentValue . SHORT_TAG : case IAnnotationComponentValue . BOOLEAN_TAG : case IAnnotationComponentValue . STRING_TAG : IConstantPoolEntry constantPoolEntry = annotationComponentValue . getConstantValue ( ) ; String value = null ; switch ( constantPoolEntry . getKind ( ) ) { case IConstantPoolConstant . CONSTANT_Long : value = constantPoolEntry . getLongValue ( ) + "<STR_LIT>" ; break ; case IConstantPoolConstant . CONSTANT_Float : value = constantPoolEntry . getFloatValue ( ) + "<STR_LIT:f>" ; break ; case IConstantPoolConstant . CONSTANT_Double : value = Double . toString ( constantPoolEntry . getDoubleValue ( ) ) ; break ; case IConstantPoolConstant . CONSTANT_Integer : StringBuffer temp = new StringBuffer ( ) ; switch ( annotationComponentValue . getTag ( ) ) { case IAnnotationComponentValue . CHAR_TAG : temp . append ( '<STR_LIT>' ) ; escapeChar ( temp , ( char ) constantPoolEntry . getIntegerValue ( ) ) ; temp . append ( '<STR_LIT>' ) ; break ; case IAnnotationComponentValue . BOOLEAN_TAG : temp . append ( constantPoolEntry . getIntegerValue ( ) == <NUM_LIT:1> ? "<STR_LIT:true>" : "<STR_LIT:false>" ) ; break ; case IAnnotationComponentValue . BYTE_TAG : temp . append ( "<STR_LIT>" ) . append ( constantPoolEntry . getIntegerValue ( ) ) ; break ; case IAnnotationComponentValue . SHORT_TAG : temp . append ( "<STR_LIT>" ) . append ( constantPoolEntry . getIntegerValue ( ) ) ; break ; case IAnnotationComponentValue . INTEGER_TAG : temp . append ( "<STR_LIT>" ) . append ( constantPoolEntry . getIntegerValue ( ) ) ; } value = String . valueOf ( temp ) ; break ; case IConstantPoolConstant . CONSTANT_Utf8 : value = "<STR_LIT:\">" + decodeStringValue ( constantPoolEntry . getUtf8Value ( ) ) + "<STR_LIT:\">" ; } buffer . append ( value ) ; break ; case IAnnotationComponentValue . ENUM_TAG : final char [ ] typeName = CharOperation . replaceOnCopy ( annotationComponentValue . getEnumConstantTypeName ( ) , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ; final char [ ] constantName = annotationComponentValue . getEnumConstantName ( ) ; buffer . append ( returnClassName ( Signature . toCharArray ( typeName ) , '<CHAR_LIT:.>' , mode ) ) . append ( '<CHAR_LIT:.>' ) . append ( constantName ) ; break ; case IAnnotationComponentValue . CLASS_TAG : constantPoolEntry = annotationComponentValue . getClassInfo ( ) ; final char [ ] className = CharOperation . replaceOnCopy ( constantPoolEntry . getUtf8Value ( ) , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ; buffer . append ( returnClassName ( Signature . toCharArray ( className ) , '<CHAR_LIT:.>' , mode ) ) ; break ; case IAnnotationComponentValue . ANNOTATION_TAG : IAnnotation annotation = annotationComponentValue . getAnnotationValue ( ) ; disassembleAsModifier ( annotation , buffer , lineSeparator , tabNumber + <NUM_LIT:1> , mode ) ; break ; case IAnnotationComponentValue . ARRAY_TAG : final IAnnotationComponentValue [ ] annotationComponentValues = annotationComponentValue . getAnnotationComponentValues ( ) ; buffer . append ( '<CHAR_LIT>' ) ; for ( int i = <NUM_LIT:0> , max = annotationComponentValues . length ; i < max ; i ++ ) { if ( i > <NUM_LIT:0> ) { buffer . append ( '<CHAR_LIT:U+002C>' ) ; } disassembleAsModifier ( annotationComponentValues [ i ] , buffer , lineSeparator , tabNumber + <NUM_LIT:1> , mode ) ; } buffer . append ( '<CHAR_LIT:}>' ) ; } } private void disassembleAsModifier ( IAnnotationDefaultAttribute annotationDefaultAttribute , StringBuffer buffer , String lineSeparator , int tabNumber , int mode ) { IAnnotationComponentValue componentValue = annotationDefaultAttribute . getMemberValue ( ) ; disassembleAsModifier ( componentValue , buffer , lineSeparator , tabNumber + <NUM_LIT:1> , mode ) ; } private void disassembleAsModifier ( IRuntimeInvisibleAnnotationsAttribute runtimeInvisibleAnnotationsAttribute , StringBuffer buffer , String lineSeparator , int tabNumber , int mode ) { IAnnotation [ ] annotations = runtimeInvisibleAnnotationsAttribute . getAnnotations ( ) ; for ( int i = <NUM_LIT:0> , max = annotations . length ; i < max ; i ++ ) { disassembleAsModifier ( annotations [ i ] , buffer , lineSeparator , tabNumber + <NUM_LIT:1> , mode ) ; } } private void disassembleAsModifier ( IParameterAnnotation [ ] parameterAnnotations , StringBuffer buffer , int index , String lineSeparator , int tabNumber , int mode ) { if ( parameterAnnotations . length > index ) { disassembleAsModifier ( parameterAnnotations [ index ] , buffer , lineSeparator , tabNumber + <NUM_LIT:1> , mode ) ; } } private void disassembleAsModifier ( IParameterAnnotation parameterAnnotation , StringBuffer buffer , String lineSeparator , int tabNumber , int mode ) { if ( parameterAnnotation == null ) return ; IAnnotation [ ] annotations = parameterAnnotation . getAnnotations ( ) ; for ( int i = <NUM_LIT:0> , max = annotations . length ; i < max ; i ++ ) { if ( i > <NUM_LIT:0> ) { buffer . append ( '<CHAR_LIT:U+0020>' ) ; } disassembleAsModifier ( annotations [ i ] , buffer , lineSeparator , tabNumber + <NUM_LIT:1> , mode ) ; } } private void disassembleAsModifier ( IRuntimeVisibleAnnotationsAttribute runtimeVisibleAnnotationsAttribute , StringBuffer buffer , String lineSeparator , int tabNumber , int mode ) { IAnnotation [ ] annotations = runtimeVisibleAnnotationsAttribute . getAnnotations ( ) ; for ( int i = <NUM_LIT:0> , max = annotations . length ; i < max ; i ++ ) { if ( i > <NUM_LIT:0> ) { writeNewLine ( buffer , lineSeparator , tabNumber ) ; } disassembleAsModifier ( annotations [ i ] , buffer , lineSeparator , tabNumber + <NUM_LIT:1> , mode ) ; } } private void disassembleTypeMembers ( IClassFileReader classFileReader , char [ ] className , StringBuffer buffer , String lineSeparator , int tabNumber , int mode , boolean isEnum ) { IFieldInfo [ ] fields = classFileReader . getFieldInfos ( ) ; if ( isEnum && checkMode ( mode , WORKING_COPY ) ) { int index = <NUM_LIT:0> ; final int fieldsLength = fields . length ; IMethodInfo [ ] methods = classFileReader . getMethodInfos ( ) ; char [ ] [ ] constructorArguments = getConstructorArgumentsForEnum ( methods ) ; enumConstantLoop : for ( ; index < fieldsLength ; index ++ ) { final IFieldInfo fieldInfo = fields [ index ] ; final int accessFlags = fieldInfo . getAccessFlags ( ) ; if ( ( accessFlags & IModifierConstants . ACC_ENUM ) != <NUM_LIT:0> ) { writeNewLine ( buffer , lineSeparator , tabNumber ) ; disassembleEnumConstants ( fields [ index ] , buffer , lineSeparator , tabNumber , constructorArguments , mode ) ; } else { break enumConstantLoop ; } } buffer . append ( '<CHAR_LIT:;>' ) ; boolean foundSyntheticField = false ; fieldLoop : for ( ; index < fieldsLength ; index ++ ) { if ( ! foundSyntheticField && CharOperation . equals ( TypeConstants . SYNTHETIC_ENUM_VALUES , fields [ index ] . getName ( ) ) ) { foundSyntheticField = true ; continue fieldLoop ; } writeNewLine ( buffer , lineSeparator , tabNumber ) ; disassemble ( fields [ index ] , buffer , lineSeparator , tabNumber , mode ) ; } methodLoop : for ( int i = <NUM_LIT:0> , max = methods . length ; i < max ; i ++ ) { final IMethodInfo methodInfo = methods [ i ] ; if ( CharOperation . equals ( methodInfo . getName ( ) , TypeConstants . VALUES ) ) { final char [ ] descriptor = methodInfo . getDescriptor ( ) ; CharOperation . replace ( descriptor , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ; if ( Signature . getParameterCount ( descriptor ) == <NUM_LIT:0> ) { if ( CharOperation . equals ( returnClassName ( Signature . getReturnType ( descriptor ) , '<CHAR_LIT:.>' , mode ) , CharOperation . concat ( new char [ ] { '<CHAR_LIT:[>' , '<CHAR_LIT>' } , className , new char [ ] { '<CHAR_LIT:;>' } ) ) ) { continue methodLoop ; } } } else if ( CharOperation . equals ( methodInfo . getName ( ) , TypeConstants . VALUEOF ) ) { final char [ ] descriptor = methodInfo . getDescriptor ( ) ; CharOperation . replace ( descriptor , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ; final char [ ] [ ] parameterTypes = Signature . getParameterTypes ( descriptor ) ; if ( parameterTypes . length == <NUM_LIT:1> && CharOperation . equals ( parameterTypes [ <NUM_LIT:0> ] , "<STR_LIT>" . toCharArray ( ) ) ) { if ( CharOperation . equals ( returnClassName ( Signature . getReturnType ( descriptor ) , '<CHAR_LIT:.>' , mode ) , CharOperation . concat ( '<CHAR_LIT>' , className , '<CHAR_LIT:;>' ) ) ) { continue methodLoop ; } } } else if ( methodInfo . isClinit ( ) || methodInfo . isSynthetic ( ) ) { continue methodLoop ; } else if ( methodInfo . isConstructor ( ) ) { writeNewLine ( buffer , lineSeparator , tabNumber ) ; disassembleEnumConstructor ( classFileReader , className , methodInfo , buffer , lineSeparator , tabNumber , mode ) ; } else { writeNewLine ( buffer , lineSeparator , tabNumber ) ; disassemble ( classFileReader , className , methodInfo , buffer , lineSeparator , tabNumber , mode ) ; } } } else { for ( int i = <NUM_LIT:0> , max = fields . length ; i < max ; i ++ ) { writeNewLine ( buffer , lineSeparator , tabNumber ) ; disassemble ( fields [ i ] , buffer , lineSeparator , tabNumber , mode ) ; } IMethodInfo [ ] methods = classFileReader . getMethodInfos ( ) ; for ( int i = <NUM_LIT:0> , max = methods . length ; i < max ; i ++ ) { writeNewLine ( buffer , lineSeparator , tabNumber ) ; disassemble ( classFileReader , className , methods [ i ] , buffer , lineSeparator , tabNumber , mode ) ; } } } private char [ ] [ ] getConstructorArgumentsForEnum ( final IMethodInfo [ ] methods ) { loop : for ( int i = <NUM_LIT:0> , max = methods . length ; i < max ; i ++ ) { IMethodInfo methodInfo = methods [ i ] ; if ( methodInfo . isConstructor ( ) ) { char [ ] [ ] parameterTypes = Signature . getParameterTypes ( methodInfo . getDescriptor ( ) ) ; final int length = parameterTypes . length ; if ( length >= <NUM_LIT:2> ) { return CharOperation . subarray ( parameterTypes , <NUM_LIT:2> , length ) ; } } else { continue loop ; } } return null ; } private final void dumpTab ( int tabNumber , StringBuffer buffer ) { for ( int i = <NUM_LIT:0> ; i < tabNumber ; i ++ ) { buffer . append ( Messages . disassembler_indentation ) ; } } private final String dumpNewLineWithTabs ( String lineSeparator , int tabNumber ) { StringBuffer buffer = new StringBuffer ( ) ; writeNewLine ( buffer , lineSeparator , tabNumber ) ; return String . valueOf ( buffer ) ; } public String getDescription ( ) { return Messages . disassembler_description ; } private IEnclosingMethodAttribute getEnclosingMethodAttribute ( IClassFileReader classFileReader ) { IClassFileAttribute [ ] attributes = classFileReader . getAttributes ( ) ; for ( int i = <NUM_LIT:0> , max = attributes . length ; i < max ; i ++ ) { if ( CharOperation . equals ( attributes [ i ] . getAttributeName ( ) , IAttributeNamesConstants . ENCLOSING_METHOD ) ) { return ( IEnclosingMethodAttribute ) attributes [ i ] ; } } return null ; } private IClassFileAttribute getAttribute ( final char [ ] attributeName , final ICodeAttribute codeAttribute ) { IClassFileAttribute [ ] attributes = codeAttribute . getAttributes ( ) ; for ( int i = <NUM_LIT:0> , max = attributes . length ; i < max ; i ++ ) { if ( CharOperation . equals ( attributes [ i ] . getAttributeName ( ) , attributeName ) ) { return attributes [ i ] ; } } return null ; } private char [ ] [ ] getParameterNames ( char [ ] methodDescriptor , ICodeAttribute codeAttribute , int accessFlags ) { int paramCount = Signature . getParameterCount ( methodDescriptor ) ; char [ ] [ ] parameterNames = new char [ paramCount ] [ ] ; if ( codeAttribute != null ) { ILocalVariableAttribute localVariableAttribute = codeAttribute . getLocalVariableAttribute ( ) ; if ( localVariableAttribute != null ) { ILocalVariableTableEntry [ ] entries = localVariableAttribute . getLocalVariableTable ( ) ; final int startingIndex = ( accessFlags & IModifierConstants . ACC_STATIC ) != <NUM_LIT:0> ? <NUM_LIT:0> : <NUM_LIT:1> ; for ( int i = <NUM_LIT:0> ; i < paramCount ; i ++ ) { ILocalVariableTableEntry searchedEntry = getEntryFor ( getLocalIndex ( startingIndex , i , methodDescriptor ) , entries ) ; if ( searchedEntry != null ) { parameterNames [ i ] = searchedEntry . getName ( ) ; } else { parameterNames [ i ] = CharOperation . concat ( Messages . disassembler_parametername . toCharArray ( ) , Integer . toString ( i ) . toCharArray ( ) ) ; } } } else { for ( int i = <NUM_LIT:0> ; i < paramCount ; i ++ ) { parameterNames [ i ] = CharOperation . concat ( Messages . disassembler_parametername . toCharArray ( ) , Integer . toString ( i ) . toCharArray ( ) ) ; } } } else { for ( int i = <NUM_LIT:0> ; i < paramCount ; i ++ ) { parameterNames [ i ] = CharOperation . concat ( Messages . disassembler_parametername . toCharArray ( ) , Integer . toString ( i ) . toCharArray ( ) ) ; } } return parameterNames ; } private int getLocalIndex ( final int startingSlot , final int index , final char [ ] methodDescriptor ) { int slot = startingSlot ; final char [ ] [ ] types = Signature . getParameterTypes ( methodDescriptor ) ; for ( int i = <NUM_LIT:0> ; i < index ; i ++ ) { final char [ ] type = types [ i ] ; switch ( type . length ) { case <NUM_LIT:1> : switch ( type [ <NUM_LIT:0> ] ) { case '<CHAR_LIT>' : case '<CHAR_LIT>' : slot += <NUM_LIT:2> ; break ; default : slot ++ ; } break ; default : slot ++ ; } } return slot ; } private ILocalVariableTableEntry getEntryFor ( final int index , final ILocalVariableTableEntry [ ] entries ) { for ( int i = <NUM_LIT:0> , max = entries . length ; i < max ; i ++ ) { ILocalVariableTableEntry entry = entries [ i ] ; if ( index == entry . getIndex ( ) ) { return entry ; } } return null ; } private char [ ] getSignatureForField ( char [ ] fieldDescriptor ) { char [ ] newFieldDescriptor = CharOperation . replaceOnCopy ( fieldDescriptor , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ; newFieldDescriptor = CharOperation . replaceOnCopy ( newFieldDescriptor , '<CHAR_LIT>' , '<CHAR_LIT>' ) ; char [ ] fieldDescriptorSignature = Signature . toCharArray ( newFieldDescriptor ) ; CharOperation . replace ( fieldDescriptorSignature , '<CHAR_LIT>' , '<CHAR_LIT>' ) ; return fieldDescriptorSignature ; } private boolean isDeprecated ( IClassFileReader classFileReader ) { IClassFileAttribute [ ] attributes = classFileReader . getAttributes ( ) ; for ( int i = <NUM_LIT:0> , max = attributes . length ; i < max ; i ++ ) { if ( CharOperation . equals ( attributes [ i ] . getAttributeName ( ) , IAttributeNamesConstants . DEPRECATED ) ) { return true ; } } return false ; } private boolean isSynthetic ( IClassFileReader classFileReader ) { int flags = classFileReader . getAccessFlags ( ) ; if ( ( flags & IModifierConstants . ACC_SYNTHETIC ) != <NUM_LIT:0> ) { return true ; } IClassFileAttribute [ ] attributes = classFileReader . getAttributes ( ) ; for ( int i = <NUM_LIT:0> , max = attributes . length ; i < max ; i ++ ) { if ( CharOperation . equals ( attributes [ i ] . getAttributeName ( ) , IAttributeNamesConstants . SYNTHETIC ) ) { return true ; } } return false ; } private boolean checkMode ( int mode , int flag ) { return ( mode & flag ) != <NUM_LIT:0> ; } private boolean isCompact ( int mode ) { return ( mode & ClassFileBytesDisassembler . COMPACT ) != <NUM_LIT:0> ; } private char [ ] returnClassName ( char [ ] classInfoName , char separator , int mode ) { if ( classInfoName . length == <NUM_LIT:0> ) { return CharOperation . NO_CHAR ; } else if ( isCompact ( mode ) ) { int lastIndexOfSlash = CharOperation . lastIndexOf ( separator , classInfoName ) ; if ( lastIndexOfSlash != - <NUM_LIT:1> ) { return CharOperation . subarray ( classInfoName , lastIndexOfSlash + <NUM_LIT:1> , classInfoName . length ) ; } } return classInfoName ; } private void writeNewLine ( StringBuffer buffer , String lineSeparator , int tabNumber ) { buffer . append ( lineSeparator ) ; dumpTab ( tabNumber , buffer ) ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import java . lang . ref . ReferenceQueue ; import java . lang . ref . WeakReference ; import org . eclipse . jdt . core . compiler . CharOperation ; public class WeakHashSetOfCharArray { public static class HashableWeakReference extends WeakReference { public int hashCode ; public HashableWeakReference ( char [ ] referent , ReferenceQueue queue ) { super ( referent , queue ) ; this . hashCode = CharOperation . hashCode ( referent ) ; } public boolean equals ( Object obj ) { if ( ! ( obj instanceof HashableWeakReference ) ) return false ; char [ ] referent = ( char [ ] ) get ( ) ; char [ ] other = ( char [ ] ) ( ( HashableWeakReference ) obj ) . get ( ) ; if ( referent == null ) return other == null ; return CharOperation . equals ( referent , other ) ; } public int hashCode ( ) { return this . hashCode ; } public String toString ( ) { char [ ] referent = ( char [ ] ) get ( ) ; if ( referent == null ) return "<STR_LIT>" + this . hashCode + "<STR_LIT>" ; return "<STR_LIT>" + this . hashCode + "<STR_LIT>" + new String ( referent ) + '<STR_LIT:\">' ; } } HashableWeakReference [ ] values ; public int elementSize ; int threshold ; ReferenceQueue referenceQueue = new ReferenceQueue ( ) ; public WeakHashSetOfCharArray ( ) { this ( <NUM_LIT:5> ) ; } public WeakHashSetOfCharArray ( int size ) { this . elementSize = <NUM_LIT:0> ; this . threshold = size ; int extraRoom = ( int ) ( size * <NUM_LIT> ) ; if ( this . threshold == extraRoom ) extraRoom ++ ; this . values = new HashableWeakReference [ extraRoom ] ; } public char [ ] add ( char [ ] array ) { cleanupGarbageCollectedValues ( ) ; int valuesLength = this . values . length , index = ( CharOperation . hashCode ( array ) & <NUM_LIT> ) % valuesLength ; HashableWeakReference currentValue ; while ( ( currentValue = this . values [ index ] ) != null ) { char [ ] referent ; if ( CharOperation . equals ( array , referent = ( char [ ] ) currentValue . get ( ) ) ) { return referent ; } if ( ++ index == valuesLength ) { index = <NUM_LIT:0> ; } } this . values [ index ] = new HashableWeakReference ( array , this . referenceQueue ) ; if ( ++ this . elementSize > this . threshold ) rehash ( ) ; return array ; } private void addValue ( HashableWeakReference value ) { char [ ] array = ( char [ ] ) value . get ( ) ; if ( array == null ) return ; int valuesLength = this . values . length ; int index = ( value . hashCode & <NUM_LIT> ) % valuesLength ; HashableWeakReference currentValue ; while ( ( currentValue = this . values [ index ] ) != null ) { if ( CharOperation . equals ( array , ( char [ ] ) currentValue . get ( ) ) ) { return ; } if ( ++ index == valuesLength ) { index = <NUM_LIT:0> ; } } this . values [ index ] = value ; if ( ++ this . elementSize > this . threshold ) rehash ( ) ; } private void cleanupGarbageCollectedValues ( ) { HashableWeakReference toBeRemoved ; while ( ( toBeRemoved = ( HashableWeakReference ) this . referenceQueue . poll ( ) ) != null ) { int hashCode = toBeRemoved . hashCode ; int valuesLength = this . values . length ; int index = ( hashCode & <NUM_LIT> ) % valuesLength ; HashableWeakReference currentValue ; while ( ( currentValue = this . values [ index ] ) != null ) { if ( currentValue == toBeRemoved ) { int sameHash = index ; int current ; while ( ( currentValue = this . values [ current = ( sameHash + <NUM_LIT:1> ) % valuesLength ] ) != null && currentValue . hashCode == hashCode ) sameHash = current ; this . values [ index ] = this . values [ sameHash ] ; this . values [ sameHash ] = null ; this . elementSize -- ; break ; } if ( ++ index == valuesLength ) { index = <NUM_LIT:0> ; } } } } public boolean contains ( char [ ] array ) { return get ( array ) != null ; } public char [ ] get ( char [ ] array ) { cleanupGarbageCollectedValues ( ) ; int valuesLength = this . values . length ; int index = ( CharOperation . hashCode ( array ) & <NUM_LIT> ) % valuesLength ; HashableWeakReference currentValue ; while ( ( currentValue = this . values [ index ] ) != null ) { char [ ] referent ; if ( CharOperation . equals ( array , referent = ( char [ ] ) currentValue . get ( ) ) ) { return referent ; } if ( ++ index == valuesLength ) { index = <NUM_LIT:0> ; } } return null ; } private void rehash ( ) { WeakHashSetOfCharArray newHashSet = new WeakHashSetOfCharArray ( this . elementSize * <NUM_LIT:2> ) ; newHashSet . referenceQueue = this . referenceQueue ; HashableWeakReference currentValue ; for ( int i = <NUM_LIT:0> , length = this . values . length ; i < length ; i ++ ) if ( ( currentValue = this . values [ i ] ) != null ) newHashSet . addValue ( currentValue ) ; this . values = newHashSet . values ; this . threshold = newHashSet . threshold ; this . elementSize = newHashSet . elementSize ; } public char [ ] remove ( char [ ] array ) { cleanupGarbageCollectedValues ( ) ; int valuesLength = this . values . length ; int index = ( CharOperation . hashCode ( array ) & <NUM_LIT> ) % valuesLength ; HashableWeakReference currentValue ; while ( ( currentValue = this . values [ index ] ) != null ) { char [ ] referent ; if ( CharOperation . equals ( array , referent = ( char [ ] ) currentValue . get ( ) ) ) { this . elementSize -- ; this . values [ index ] = null ; rehash ( ) ; return referent ; } if ( ++ index == valuesLength ) { index = <NUM_LIT:0> ; } } return null ; } public int size ( ) { return this . elementSize ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( "<STR_LIT:{>" ) ; for ( int i = <NUM_LIT:0> , length = this . values . length ; i < length ; i ++ ) { HashableWeakReference value = this . values [ i ] ; if ( value != null ) { char [ ] ref = ( char [ ] ) value . get ( ) ; if ( ref != null ) { buffer . append ( '<STR_LIT:\">' ) ; buffer . append ( ref ) ; buffer . append ( "<STR_LIT>" ) ; } } } buffer . append ( "<STR_LIT:}>" ) ; return buffer . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . internal . compiler . ast . CompilationUnitDeclaration ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . parser . Parser ; import org . eclipse . jdt . internal . compiler . parser . Scanner ; import org . eclipse . jdt . internal . compiler . problem . ProblemReporter ; import org . eclipse . jdt . internal . compiler . problem . ProblemSeverities ; public class CommentRecorderParser extends Parser { int [ ] commentStops = new int [ <NUM_LIT:10> ] ; int [ ] commentStarts = new int [ <NUM_LIT:10> ] ; int commentPtr = - <NUM_LIT:1> ; protected final static int CommentIncrement = <NUM_LIT:100> ; public CommentRecorderParser ( ProblemReporter problemReporter , boolean optimizeStringLiterals ) { super ( problemReporter , optimizeStringLiterals ) ; } public void checkComment ( ) { if ( ! ( this . diet && this . dietInt == <NUM_LIT:0> ) && this . scanner . commentPtr >= <NUM_LIT:0> ) { flushCommentsDefinedPriorTo ( this . endStatementPosition ) ; } boolean deprecated = false ; boolean checkDeprecated = false ; int lastCommentIndex = - <NUM_LIT:1> ; nextComment : for ( lastCommentIndex = this . scanner . commentPtr ; lastCommentIndex >= <NUM_LIT:0> ; lastCommentIndex -- ) { int commentSourceStart = this . scanner . commentStarts [ lastCommentIndex ] ; if ( ( commentSourceStart < <NUM_LIT:0> ) || ( this . modifiersSourceStart != - <NUM_LIT:1> && this . modifiersSourceStart < commentSourceStart ) || ( this . scanner . commentStops [ lastCommentIndex ] < <NUM_LIT:0> ) ) { continue nextComment ; } checkDeprecated = true ; int commentSourceEnd = this . scanner . commentStops [ lastCommentIndex ] - <NUM_LIT:1> ; if ( this . javadocParser . shouldReportProblems ) { this . javadocParser . reportProblems = this . currentElement == null || commentSourceEnd > this . lastJavadocEnd ; } else { this . javadocParser . reportProblems = false ; } deprecated = this . javadocParser . checkDeprecation ( lastCommentIndex ) ; this . javadoc = this . javadocParser . docComment ; if ( this . currentElement == null ) this . lastJavadocEnd = commentSourceEnd ; break nextComment ; } if ( deprecated ) { checkAndSetModifiers ( ClassFileConstants . AccDeprecated ) ; } if ( lastCommentIndex >= <NUM_LIT:0> && checkDeprecated ) { this . modifiersSourceStart = this . scanner . commentStarts [ lastCommentIndex ] ; if ( this . modifiersSourceStart < <NUM_LIT:0> ) { this . modifiersSourceStart = - this . modifiersSourceStart ; } } } protected void consumeClassHeader ( ) { pushOnCommentsStack ( <NUM_LIT:0> , this . scanner . commentPtr ) ; super . consumeClassHeader ( ) ; } protected void consumeEmptyTypeDeclaration ( ) { pushOnCommentsStack ( <NUM_LIT:0> , this . scanner . commentPtr ) ; super . consumeEmptyTypeDeclaration ( ) ; } protected void consumeInterfaceHeader ( ) { pushOnCommentsStack ( <NUM_LIT:0> , this . scanner . commentPtr ) ; super . consumeInterfaceHeader ( ) ; } protected CompilationUnitDeclaration endParse ( int act ) { CompilationUnitDeclaration unit = super . endParse ( act ) ; if ( unit . comments == null ) { pushOnCommentsStack ( <NUM_LIT:0> , this . scanner . commentPtr ) ; unit . comments = getCommentsPositions ( ) ; } return unit ; } public int flushCommentsDefinedPriorTo ( int position ) { int lastCommentIndex = this . scanner . commentPtr ; if ( lastCommentIndex < <NUM_LIT:0> ) return position ; int index = lastCommentIndex ; int validCount = <NUM_LIT:0> ; while ( index >= <NUM_LIT:0> ) { int commentEnd = this . scanner . commentStops [ index ] ; if ( commentEnd < <NUM_LIT:0> ) commentEnd = - commentEnd ; if ( commentEnd <= position ) { break ; } index -- ; validCount ++ ; } if ( validCount > <NUM_LIT:0> ) { int immediateCommentEnd = <NUM_LIT:0> ; while ( index < lastCommentIndex && ( immediateCommentEnd = - this . scanner . commentStops [ index + <NUM_LIT:1> ] ) > <NUM_LIT:0> ) { immediateCommentEnd -- ; if ( org . eclipse . jdt . internal . compiler . util . Util . getLineNumber ( position , this . scanner . lineEnds , <NUM_LIT:0> , this . scanner . linePtr ) != org . eclipse . jdt . internal . compiler . util . Util . getLineNumber ( immediateCommentEnd , this . scanner . lineEnds , <NUM_LIT:0> , this . scanner . linePtr ) ) break ; position = immediateCommentEnd ; validCount -- ; index ++ ; } } if ( index < <NUM_LIT:0> ) return position ; pushOnCommentsStack ( <NUM_LIT:0> , index ) ; switch ( validCount ) { case <NUM_LIT:0> : break ; case <NUM_LIT:2> : this . scanner . commentStarts [ <NUM_LIT:0> ] = this . scanner . commentStarts [ index + <NUM_LIT:1> ] ; this . scanner . commentStops [ <NUM_LIT:0> ] = this . scanner . commentStops [ index + <NUM_LIT:1> ] ; this . scanner . commentTagStarts [ <NUM_LIT:0> ] = this . scanner . commentTagStarts [ index + <NUM_LIT:1> ] ; this . scanner . commentStarts [ <NUM_LIT:1> ] = this . scanner . commentStarts [ index + <NUM_LIT:2> ] ; this . scanner . commentStops [ <NUM_LIT:1> ] = this . scanner . commentStops [ index + <NUM_LIT:2> ] ; this . scanner . commentTagStarts [ <NUM_LIT:1> ] = this . scanner . commentTagStarts [ index + <NUM_LIT:2> ] ; break ; case <NUM_LIT:1> : this . scanner . commentStarts [ <NUM_LIT:0> ] = this . scanner . commentStarts [ index + <NUM_LIT:1> ] ; this . scanner . commentStops [ <NUM_LIT:0> ] = this . scanner . commentStops [ index + <NUM_LIT:1> ] ; this . scanner . commentTagStarts [ <NUM_LIT:0> ] = this . scanner . commentTagStarts [ index + <NUM_LIT:1> ] ; break ; default : System . arraycopy ( this . scanner . commentStarts , index + <NUM_LIT:1> , this . scanner . commentStarts , <NUM_LIT:0> , validCount ) ; System . arraycopy ( this . scanner . commentStops , index + <NUM_LIT:1> , this . scanner . commentStops , <NUM_LIT:0> , validCount ) ; System . arraycopy ( this . scanner . commentTagStarts , index + <NUM_LIT:1> , this . scanner . commentTagStarts , <NUM_LIT:0> , validCount ) ; } this . scanner . commentPtr = validCount - <NUM_LIT:1> ; return position ; } public int [ ] [ ] getCommentsPositions ( ) { int [ ] [ ] positions = new int [ this . commentPtr + <NUM_LIT:1> ] [ <NUM_LIT:2> ] ; for ( int i = <NUM_LIT:0> , max = this . commentPtr ; i <= max ; i ++ ) { positions [ i ] [ <NUM_LIT:0> ] = this . commentStarts [ i ] ; positions [ i ] [ <NUM_LIT:1> ] = this . commentStops [ i ] ; } return positions ; } public void initialize ( boolean initializeNLS ) { super . initialize ( initializeNLS ) ; this . commentPtr = - <NUM_LIT:1> ; } public void initialize ( ) { super . initialize ( ) ; this . commentPtr = - <NUM_LIT:1> ; } public void initializeScanner ( ) { this . scanner = new Scanner ( false , false , this . options . getSeverity ( CompilerOptions . NonExternalizedString ) != ProblemSeverities . Ignore , this . options . sourceLevel , this . options . taskTags , this . options . taskPriorities , this . options . isTaskCaseSensitive ) ; this . options . taskPriorities = this . scanner . taskPriorities ; } private void pushOnCommentsStack ( int start , int end ) { for ( int i = start ; i <= end ; i ++ ) { int scannerStart = this . scanner . commentStarts [ i ] < <NUM_LIT:0> ? - this . scanner . commentStarts [ i ] : this . scanner . commentStarts [ i ] ; int commentStart = this . commentPtr == - <NUM_LIT:1> ? - <NUM_LIT:1> : ( this . commentStarts [ this . commentPtr ] < <NUM_LIT:0> ? - this . commentStarts [ this . commentPtr ] : this . commentStarts [ this . commentPtr ] ) ; if ( commentStart == - <NUM_LIT:1> || scannerStart > commentStart ) { int stackLength = this . commentStarts . length ; if ( ++ this . commentPtr >= stackLength ) { System . arraycopy ( this . commentStarts , <NUM_LIT:0> , this . commentStarts = new int [ stackLength + CommentIncrement ] , <NUM_LIT:0> , stackLength ) ; System . arraycopy ( this . commentStops , <NUM_LIT:0> , this . commentStops = new int [ stackLength + CommentIncrement ] , <NUM_LIT:0> , stackLength ) ; } this . commentStarts [ this . commentPtr ] = this . scanner . commentStarts [ i ] ; this . commentStops [ this . commentPtr ] = this . scanner . commentStops [ i ] ; } } } protected void resetModifiers ( ) { pushOnCommentsStack ( <NUM_LIT:0> , this . scanner . commentPtr ) ; super . resetModifiers ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . util . ClassFormatException ; import org . eclipse . jdt . core . util . IConstantPool ; import org . eclipse . jdt . core . util . IStackMapFrame ; import org . eclipse . jdt . core . util . IStackMapTableAttribute ; public class StackMapTableAttribute extends ClassFileAttribute implements IStackMapTableAttribute { private static final IStackMapFrame [ ] NO_FRAMES = new IStackMapFrame [ <NUM_LIT:0> ] ; private static final byte [ ] NO_ENTRIES = new byte [ <NUM_LIT:0> ] ; private int numberOfEntries ; private IStackMapFrame [ ] frames ; private byte [ ] bytes ; public StackMapTableAttribute ( byte [ ] classFileBytes , IConstantPool constantPool , int offset ) throws ClassFormatException { super ( classFileBytes , constantPool , offset ) ; final int length = u2At ( classFileBytes , <NUM_LIT:6> , offset ) ; this . numberOfEntries = length ; if ( length != <NUM_LIT:0> ) { int readOffset = <NUM_LIT:8> ; this . frames = new IStackMapFrame [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { StackMapFrame frame = new StackMapFrame ( classFileBytes , constantPool , offset + readOffset ) ; this . frames [ i ] = frame ; readOffset += frame . sizeInBytes ( ) ; } } else { this . frames = NO_FRAMES ; } final int byteLength = ( int ) u4At ( classFileBytes , <NUM_LIT:2> , offset ) ; if ( length != <NUM_LIT:0> ) { System . arraycopy ( classFileBytes , offset + <NUM_LIT:6> , this . bytes = new byte [ byteLength ] , <NUM_LIT:0> , byteLength ) ; } else { this . bytes = NO_ENTRIES ; } } public int getNumberOfEntries ( ) { return this . numberOfEntries ; } public IStackMapFrame [ ] getStackMapFrame ( ) { return this . frames ; } public byte [ ] getBytes ( ) { return this . bytes ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . util . ClassFormatException ; import org . eclipse . jdt . core . util . IAttributeNamesConstants ; import org . eclipse . jdt . core . util . IBytecodeVisitor ; import org . eclipse . jdt . core . util . IClassFileAttribute ; import org . eclipse . jdt . core . util . ICodeAttribute ; import org . eclipse . jdt . core . util . IConstantPool ; import org . eclipse . jdt . core . util . IConstantPoolConstant ; import org . eclipse . jdt . core . util . IConstantPoolEntry ; import org . eclipse . jdt . core . util . IExceptionTableEntry ; import org . eclipse . jdt . core . util . ILineNumberAttribute ; import org . eclipse . jdt . core . util . ILocalVariableAttribute ; import org . eclipse . jdt . core . util . IOpcodeMnemonics ; public class CodeAttribute extends ClassFileAttribute implements ICodeAttribute { private static final IExceptionTableEntry [ ] NO_EXCEPTION_TABLE = new IExceptionTableEntry [ <NUM_LIT:0> ] ; private IClassFileAttribute [ ] attributes ; private int attributesCount ; private byte [ ] bytecodes ; private byte [ ] classFileBytes ; private long codeLength ; private int codeOffset ; private IConstantPool constantPool ; private IExceptionTableEntry [ ] exceptionTableEntries ; private int exceptionTableLength ; private ILineNumberAttribute lineNumberAttribute ; private ILocalVariableAttribute localVariableAttribute ; private int maxLocals ; private int maxStack ; CodeAttribute ( byte [ ] classFileBytes , IConstantPool constantPool , int offset ) throws ClassFormatException { super ( classFileBytes , constantPool , offset ) ; this . classFileBytes = classFileBytes ; this . constantPool = constantPool ; this . maxStack = u2At ( classFileBytes , <NUM_LIT:6> , offset ) ; this . maxLocals = u2At ( classFileBytes , <NUM_LIT:8> , offset ) ; this . codeLength = u4At ( classFileBytes , <NUM_LIT:10> , offset ) ; this . codeOffset = offset + <NUM_LIT> ; int readOffset = ( int ) ( <NUM_LIT> + this . codeLength ) ; this . exceptionTableLength = u2At ( classFileBytes , readOffset , offset ) ; readOffset += <NUM_LIT:2> ; this . exceptionTableEntries = NO_EXCEPTION_TABLE ; if ( this . exceptionTableLength != <NUM_LIT:0> ) { this . exceptionTableEntries = new ExceptionTableEntry [ this . exceptionTableLength ] ; for ( int i = <NUM_LIT:0> ; i < this . exceptionTableLength ; i ++ ) { this . exceptionTableEntries [ i ] = new ExceptionTableEntry ( classFileBytes , constantPool , offset + readOffset ) ; readOffset += <NUM_LIT:8> ; } } this . attributesCount = u2At ( classFileBytes , readOffset , offset ) ; this . attributes = ClassFileAttribute . NO_ATTRIBUTES ; if ( this . attributesCount != <NUM_LIT:0> ) { this . attributes = new IClassFileAttribute [ this . attributesCount ] ; } int attributesIndex = <NUM_LIT:0> ; readOffset += <NUM_LIT:2> ; for ( int i = <NUM_LIT:0> ; i < this . attributesCount ; i ++ ) { IConstantPoolEntry constantPoolEntry = constantPool . decodeEntry ( u2At ( classFileBytes , readOffset , offset ) ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Utf8 ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } char [ ] attributeName = constantPoolEntry . getUtf8Value ( ) ; if ( equals ( attributeName , IAttributeNamesConstants . LINE_NUMBER ) ) { this . lineNumberAttribute = new LineNumberAttribute ( classFileBytes , constantPool , offset + readOffset ) ; this . attributes [ attributesIndex ++ ] = this . lineNumberAttribute ; } else if ( equals ( attributeName , IAttributeNamesConstants . LOCAL_VARIABLE ) ) { this . localVariableAttribute = new LocalVariableAttribute ( classFileBytes , constantPool , offset + readOffset ) ; this . attributes [ attributesIndex ++ ] = this . localVariableAttribute ; } else if ( equals ( attributeName , IAttributeNamesConstants . LOCAL_VARIABLE_TYPE_TABLE ) ) { this . attributes [ attributesIndex ++ ] = new LocalVariableTypeAttribute ( classFileBytes , constantPool , offset + readOffset ) ; } else if ( equals ( attributeName , IAttributeNamesConstants . STACK_MAP_TABLE ) ) { this . attributes [ attributesIndex ++ ] = new StackMapTableAttribute ( classFileBytes , constantPool , offset + readOffset ) ; } else if ( equals ( attributeName , IAttributeNamesConstants . STACK_MAP ) ) { this . attributes [ attributesIndex ++ ] = new StackMapAttribute ( classFileBytes , constantPool , offset + readOffset ) ; } else { this . attributes [ attributesIndex ++ ] = new ClassFileAttribute ( classFileBytes , constantPool , offset + readOffset ) ; } readOffset += ( <NUM_LIT:6> + u4At ( classFileBytes , readOffset + <NUM_LIT:2> , offset ) ) ; } } public IClassFileAttribute [ ] getAttributes ( ) { return this . attributes ; } public int getAttributesCount ( ) { return this . attributesCount ; } public byte [ ] getBytecodes ( ) { if ( this . bytecodes == null ) { System . arraycopy ( this . classFileBytes , this . codeOffset , ( this . bytecodes = new byte [ ( int ) this . codeLength ] ) , <NUM_LIT:0> , ( int ) this . codeLength ) ; } return this . bytecodes ; } public long getCodeLength ( ) { return this . codeLength ; } public IExceptionTableEntry [ ] getExceptionTable ( ) { return this . exceptionTableEntries ; } public int getExceptionTableLength ( ) { return this . exceptionTableLength ; } public ILineNumberAttribute getLineNumberAttribute ( ) { return this . lineNumberAttribute ; } public ILocalVariableAttribute getLocalVariableAttribute ( ) { return this . localVariableAttribute ; } public int getMaxLocals ( ) { return this . maxLocals ; } public int getMaxStack ( ) { return this . maxStack ; } public void traverse ( IBytecodeVisitor visitor ) throws ClassFormatException { int pc = this . codeOffset ; int opcode , index , _const , branchOffset ; IConstantPoolEntry constantPoolEntry ; while ( true ) { opcode = u1At ( this . classFileBytes , <NUM_LIT:0> , pc ) ; switch ( opcode ) { case IOpcodeMnemonics . NOP : visitor . _nop ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . ACONST_NULL : visitor . _aconst_null ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . ICONST_M1 : visitor . _iconst_m1 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . ICONST_0 : visitor . _iconst_0 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . ICONST_1 : visitor . _iconst_1 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . ICONST_2 : visitor . _iconst_2 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . ICONST_3 : visitor . _iconst_3 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . ICONST_4 : visitor . _iconst_4 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . ICONST_5 : visitor . _iconst_5 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . LCONST_0 : visitor . _lconst_0 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . LCONST_1 : visitor . _lconst_1 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . FCONST_0 : visitor . _fconst_0 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . FCONST_1 : visitor . _fconst_1 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . FCONST_2 : visitor . _fconst_2 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . DCONST_0 : visitor . _dconst_0 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . DCONST_1 : visitor . _dconst_1 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . BIPUSH : visitor . _bipush ( pc - this . codeOffset , ( byte ) i1At ( this . classFileBytes , <NUM_LIT:1> , pc ) ) ; pc += <NUM_LIT:2> ; break ; case IOpcodeMnemonics . SIPUSH : visitor . _sipush ( pc - this . codeOffset , ( short ) i2At ( this . classFileBytes , <NUM_LIT:1> , pc ) ) ; pc += <NUM_LIT:3> ; break ; case IOpcodeMnemonics . LDC : index = u1At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; constantPoolEntry = this . constantPool . decodeEntry ( index ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Float && constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Integer && constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_String && constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Class ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } visitor . _ldc ( pc - this . codeOffset , index , constantPoolEntry ) ; pc += <NUM_LIT:2> ; break ; case IOpcodeMnemonics . LDC_W : index = u2At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; constantPoolEntry = this . constantPool . decodeEntry ( index ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Float && constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Integer && constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_String && constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Class ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } visitor . _ldc_w ( pc - this . codeOffset , index , constantPoolEntry ) ; pc += <NUM_LIT:3> ; break ; case IOpcodeMnemonics . LDC2_W : index = u2At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; constantPoolEntry = this . constantPool . decodeEntry ( index ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Double && constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Long ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } visitor . _ldc2_w ( pc - this . codeOffset , index , constantPoolEntry ) ; pc += <NUM_LIT:3> ; break ; case IOpcodeMnemonics . ILOAD : index = u1At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; visitor . _iload ( pc - this . codeOffset , index ) ; pc += <NUM_LIT:2> ; break ; case IOpcodeMnemonics . LLOAD : index = u1At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; visitor . _lload ( pc - this . codeOffset , index ) ; pc += <NUM_LIT:2> ; break ; case IOpcodeMnemonics . FLOAD : index = u1At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; visitor . _fload ( pc - this . codeOffset , index ) ; pc += <NUM_LIT:2> ; break ; case IOpcodeMnemonics . DLOAD : index = u1At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; visitor . _dload ( pc - this . codeOffset , index ) ; pc += <NUM_LIT:2> ; break ; case IOpcodeMnemonics . ALOAD : index = u1At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; visitor . _aload ( pc - this . codeOffset , index ) ; pc += <NUM_LIT:2> ; break ; case IOpcodeMnemonics . ILOAD_0 : visitor . _iload_0 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . ILOAD_1 : visitor . _iload_1 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . ILOAD_2 : visitor . _iload_2 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . ILOAD_3 : visitor . _iload_3 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . LLOAD_0 : visitor . _lload_0 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . LLOAD_1 : visitor . _lload_1 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . LLOAD_2 : visitor . _lload_2 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . LLOAD_3 : visitor . _lload_3 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . FLOAD_0 : visitor . _fload_0 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . FLOAD_1 : visitor . _fload_1 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . FLOAD_2 : visitor . _fload_2 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . FLOAD_3 : visitor . _fload_3 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . DLOAD_0 : visitor . _dload_0 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . DLOAD_1 : visitor . _dload_1 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . DLOAD_2 : visitor . _dload_2 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . DLOAD_3 : visitor . _dload_3 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . ALOAD_0 : visitor . _aload_0 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . ALOAD_1 : visitor . _aload_1 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . ALOAD_2 : visitor . _aload_2 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . ALOAD_3 : visitor . _aload_3 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . IALOAD : visitor . _iaload ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . LALOAD : visitor . _laload ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . FALOAD : visitor . _faload ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . DALOAD : visitor . _daload ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . AALOAD : visitor . _aaload ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . BALOAD : visitor . _baload ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . CALOAD : visitor . _caload ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . SALOAD : visitor . _saload ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . ISTORE : index = u1At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; visitor . _istore ( pc - this . codeOffset , index ) ; pc += <NUM_LIT:2> ; break ; case IOpcodeMnemonics . LSTORE : index = u1At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; visitor . _lstore ( pc - this . codeOffset , index ) ; pc += <NUM_LIT:2> ; break ; case IOpcodeMnemonics . FSTORE : index = u1At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; visitor . _fstore ( pc - this . codeOffset , index ) ; pc += <NUM_LIT:2> ; break ; case IOpcodeMnemonics . DSTORE : index = u1At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; visitor . _dstore ( pc - this . codeOffset , index ) ; pc += <NUM_LIT:2> ; break ; case IOpcodeMnemonics . ASTORE : index = u1At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; visitor . _astore ( pc - this . codeOffset , index ) ; pc += <NUM_LIT:2> ; break ; case IOpcodeMnemonics . ISTORE_0 : visitor . _istore_0 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . ISTORE_1 : visitor . _istore_1 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . ISTORE_2 : visitor . _istore_2 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . ISTORE_3 : visitor . _istore_3 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . LSTORE_0 : visitor . _lstore_0 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . LSTORE_1 : visitor . _lstore_1 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . LSTORE_2 : visitor . _lstore_2 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . LSTORE_3 : visitor . _lstore_3 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . FSTORE_0 : visitor . _fstore_0 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . FSTORE_1 : visitor . _fstore_1 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . FSTORE_2 : visitor . _fstore_2 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . FSTORE_3 : visitor . _fstore_3 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . DSTORE_0 : visitor . _dstore_0 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . DSTORE_1 : visitor . _dstore_1 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . DSTORE_2 : visitor . _dstore_2 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . DSTORE_3 : visitor . _dstore_3 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . ASTORE_0 : visitor . _astore_0 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . ASTORE_1 : visitor . _astore_1 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . ASTORE_2 : visitor . _astore_2 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . ASTORE_3 : visitor . _astore_3 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . IASTORE : visitor . _iastore ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . LASTORE : visitor . _lastore ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . FASTORE : visitor . _fastore ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . DASTORE : visitor . _dastore ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . AASTORE : visitor . _aastore ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . BASTORE : visitor . _bastore ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . CASTORE : visitor . _castore ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . SASTORE : visitor . _sastore ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . POP : visitor . _pop ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . POP2 : visitor . _pop2 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . DUP : visitor . _dup ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . DUP_X1 : visitor . _dup_x1 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . DUP_X2 : visitor . _dup_x2 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . DUP2 : visitor . _dup2 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . DUP2_X1 : visitor . _dup2_x1 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . DUP2_X2 : visitor . _dup2_x2 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . SWAP : visitor . _swap ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . IADD : visitor . _iadd ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . LADD : visitor . _ladd ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . FADD : visitor . _fadd ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . DADD : visitor . _dadd ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . ISUB : visitor . _isub ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . LSUB : visitor . _lsub ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . FSUB : visitor . _fsub ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . DSUB : visitor . _dsub ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . IMUL : visitor . _imul ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . LMUL : visitor . _lmul ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . FMUL : visitor . _fmul ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . DMUL : visitor . _dmul ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . IDIV : visitor . _idiv ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . LDIV : visitor . _ldiv ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . FDIV : visitor . _fdiv ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . DDIV : visitor . _ddiv ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . IREM : visitor . _irem ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . LREM : visitor . _lrem ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . FREM : visitor . _frem ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . DREM : visitor . _drem ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . INEG : visitor . _ineg ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . LNEG : visitor . _lneg ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . FNEG : visitor . _fneg ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . DNEG : visitor . _dneg ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . ISHL : visitor . _ishl ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . LSHL : visitor . _lshl ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . ISHR : visitor . _ishr ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . LSHR : visitor . _lshr ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . IUSHR : visitor . _iushr ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . LUSHR : visitor . _lushr ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . IAND : visitor . _iand ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . LAND : visitor . _land ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . IOR : visitor . _ior ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . LOR : visitor . _lor ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . IXOR : visitor . _ixor ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . LXOR : visitor . _lxor ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . IINC : index = u1At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; _const = i1At ( this . classFileBytes , <NUM_LIT:2> , pc ) ; visitor . _iinc ( pc - this . codeOffset , index , _const ) ; pc += <NUM_LIT:3> ; break ; case IOpcodeMnemonics . I2L : visitor . _i2l ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . I2F : visitor . _i2f ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . I2D : visitor . _i2d ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . L2I : visitor . _l2i ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . L2F : visitor . _l2f ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . L2D : visitor . _l2d ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . F2I : visitor . _f2i ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . F2L : visitor . _f2l ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . F2D : visitor . _f2d ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . D2I : visitor . _d2i ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . D2L : visitor . _d2l ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . D2F : visitor . _d2f ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . I2B : visitor . _i2b ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . I2C : visitor . _i2c ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . I2S : visitor . _i2s ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . LCMP : visitor . _lcmp ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . FCMPL : visitor . _fcmpl ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . FCMPG : visitor . _fcmpg ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . DCMPL : visitor . _dcmpl ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . DCMPG : visitor . _dcmpg ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . IFEQ : branchOffset = i2At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; visitor . _ifeq ( pc - this . codeOffset , branchOffset ) ; pc += <NUM_LIT:3> ; break ; case IOpcodeMnemonics . IFNE : branchOffset = i2At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; visitor . _ifne ( pc - this . codeOffset , branchOffset ) ; pc += <NUM_LIT:3> ; break ; case IOpcodeMnemonics . IFLT : branchOffset = i2At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; visitor . _iflt ( pc - this . codeOffset , branchOffset ) ; pc += <NUM_LIT:3> ; break ; case IOpcodeMnemonics . IFGE : branchOffset = i2At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; visitor . _ifge ( pc - this . codeOffset , branchOffset ) ; pc += <NUM_LIT:3> ; break ; case IOpcodeMnemonics . IFGT : branchOffset = i2At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; visitor . _ifgt ( pc - this . codeOffset , branchOffset ) ; pc += <NUM_LIT:3> ; break ; case IOpcodeMnemonics . IFLE : branchOffset = i2At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; visitor . _ifle ( pc - this . codeOffset , branchOffset ) ; pc += <NUM_LIT:3> ; break ; case IOpcodeMnemonics . IF_ICMPEQ : branchOffset = i2At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; visitor . _if_icmpeq ( pc - this . codeOffset , branchOffset ) ; pc += <NUM_LIT:3> ; break ; case IOpcodeMnemonics . IF_ICMPNE : branchOffset = i2At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; visitor . _if_icmpne ( pc - this . codeOffset , branchOffset ) ; pc += <NUM_LIT:3> ; break ; case IOpcodeMnemonics . IF_ICMPLT : branchOffset = i2At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; visitor . _if_icmplt ( pc - this . codeOffset , branchOffset ) ; pc += <NUM_LIT:3> ; break ; case IOpcodeMnemonics . IF_ICMPGE : branchOffset = i2At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; visitor . _if_icmpge ( pc - this . codeOffset , branchOffset ) ; pc += <NUM_LIT:3> ; break ; case IOpcodeMnemonics . IF_ICMPGT : branchOffset = i2At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; visitor . _if_icmpgt ( pc - this . codeOffset , branchOffset ) ; pc += <NUM_LIT:3> ; break ; case IOpcodeMnemonics . IF_ICMPLE : branchOffset = i2At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; visitor . _if_icmple ( pc - this . codeOffset , branchOffset ) ; pc += <NUM_LIT:3> ; break ; case IOpcodeMnemonics . IF_ACMPEQ : branchOffset = i2At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; visitor . _if_acmpeq ( pc - this . codeOffset , branchOffset ) ; pc += <NUM_LIT:3> ; break ; case IOpcodeMnemonics . IF_ACMPNE : branchOffset = i2At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; visitor . _if_acmpne ( pc - this . codeOffset , branchOffset ) ; pc += <NUM_LIT:3> ; break ; case IOpcodeMnemonics . GOTO : branchOffset = i2At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; visitor . _goto ( pc - this . codeOffset , branchOffset ) ; pc += <NUM_LIT:3> ; break ; case IOpcodeMnemonics . JSR : branchOffset = i2At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; visitor . _jsr ( pc - this . codeOffset , branchOffset ) ; pc += <NUM_LIT:3> ; break ; case IOpcodeMnemonics . RET : index = u1At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; visitor . _ret ( pc - this . codeOffset , index ) ; pc += <NUM_LIT:2> ; break ; case IOpcodeMnemonics . TABLESWITCH : int startpc = pc ; pc ++ ; while ( ( ( pc - this . codeOffset ) & <NUM_LIT> ) != <NUM_LIT:0> ) { pc ++ ; } int defaultOffset = i4At ( this . classFileBytes , <NUM_LIT:0> , pc ) ; pc += <NUM_LIT:4> ; int low = i4At ( this . classFileBytes , <NUM_LIT:0> , pc ) ; pc += <NUM_LIT:4> ; int high = i4At ( this . classFileBytes , <NUM_LIT:0> , pc ) ; pc += <NUM_LIT:4> ; int length = high - low + <NUM_LIT:1> ; int [ ] jumpOffsets = new int [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { jumpOffsets [ i ] = i4At ( this . classFileBytes , <NUM_LIT:0> , pc ) ; pc += <NUM_LIT:4> ; } visitor . _tableswitch ( startpc - this . codeOffset , defaultOffset , low , high , jumpOffsets ) ; break ; case IOpcodeMnemonics . LOOKUPSWITCH : startpc = pc ; pc ++ ; while ( ( ( pc - this . codeOffset ) & <NUM_LIT> ) != <NUM_LIT:0> ) { pc ++ ; } defaultOffset = i4At ( this . classFileBytes , <NUM_LIT:0> , pc ) ; pc += <NUM_LIT:4> ; int npairs = ( int ) u4At ( this . classFileBytes , <NUM_LIT:0> , pc ) ; int [ ] [ ] offset_pairs = new int [ npairs ] [ <NUM_LIT:2> ] ; pc += <NUM_LIT:4> ; for ( int i = <NUM_LIT:0> ; i < npairs ; i ++ ) { offset_pairs [ i ] [ <NUM_LIT:0> ] = i4At ( this . classFileBytes , <NUM_LIT:0> , pc ) ; pc += <NUM_LIT:4> ; offset_pairs [ i ] [ <NUM_LIT:1> ] = i4At ( this . classFileBytes , <NUM_LIT:0> , pc ) ; pc += <NUM_LIT:4> ; } visitor . _lookupswitch ( startpc - this . codeOffset , defaultOffset , npairs , offset_pairs ) ; break ; case IOpcodeMnemonics . IRETURN : visitor . _ireturn ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . LRETURN : visitor . _lreturn ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . FRETURN : visitor . _freturn ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . DRETURN : visitor . _dreturn ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . ARETURN : visitor . _areturn ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . RETURN : visitor . _return ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . GETSTATIC : index = u2At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; constantPoolEntry = this . constantPool . decodeEntry ( index ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Fieldref ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } visitor . _getstatic ( pc - this . codeOffset , index , constantPoolEntry ) ; pc += <NUM_LIT:3> ; break ; case IOpcodeMnemonics . PUTSTATIC : index = u2At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; constantPoolEntry = this . constantPool . decodeEntry ( index ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Fieldref ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } visitor . _putstatic ( pc - this . codeOffset , index , constantPoolEntry ) ; pc += <NUM_LIT:3> ; break ; case IOpcodeMnemonics . GETFIELD : index = u2At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; constantPoolEntry = this . constantPool . decodeEntry ( index ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Fieldref ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } visitor . _getfield ( pc - this . codeOffset , index , constantPoolEntry ) ; pc += <NUM_LIT:3> ; break ; case IOpcodeMnemonics . PUTFIELD : index = u2At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; constantPoolEntry = this . constantPool . decodeEntry ( index ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Fieldref ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } visitor . _putfield ( pc - this . codeOffset , index , constantPoolEntry ) ; pc += <NUM_LIT:3> ; break ; case IOpcodeMnemonics . INVOKEVIRTUAL : index = u2At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; constantPoolEntry = this . constantPool . decodeEntry ( index ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Methodref ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } visitor . _invokevirtual ( pc - this . codeOffset , index , constantPoolEntry ) ; pc += <NUM_LIT:3> ; break ; case IOpcodeMnemonics . INVOKESPECIAL : index = u2At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; constantPoolEntry = this . constantPool . decodeEntry ( index ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Methodref ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } visitor . _invokespecial ( pc - this . codeOffset , index , constantPoolEntry ) ; pc += <NUM_LIT:3> ; break ; case IOpcodeMnemonics . INVOKESTATIC : index = u2At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; constantPoolEntry = this . constantPool . decodeEntry ( index ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Methodref ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } visitor . _invokestatic ( pc - this . codeOffset , index , constantPoolEntry ) ; pc += <NUM_LIT:3> ; break ; case IOpcodeMnemonics . INVOKEINTERFACE : index = u2At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; constantPoolEntry = this . constantPool . decodeEntry ( index ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_InterfaceMethodref ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } byte count = ( byte ) u1At ( this . classFileBytes , <NUM_LIT:3> , pc ) ; int extraArgs = u1At ( this . classFileBytes , <NUM_LIT:4> , pc ) ; if ( extraArgs != <NUM_LIT:0> ) { throw new ClassFormatException ( ClassFormatException . INVALID_ARGUMENTS_FOR_INVOKEINTERFACE ) ; } visitor . _invokeinterface ( pc - this . codeOffset , index , count , constantPoolEntry ) ; pc += <NUM_LIT:5> ; break ; case IOpcodeMnemonics . INVOKEDYNAMIC : index = u2At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; constantPoolEntry = this . constantPool . decodeEntry ( index ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_NameAndType ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } visitor . _invokedynamic ( pc - this . codeOffset , index , this . constantPool . decodeEntry ( constantPoolEntry . getNameAndTypeInfoNameIndex ( ) ) , this . constantPool . decodeEntry ( constantPoolEntry . getNameAndTypeInfoDescriptorIndex ( ) ) ) ; pc += <NUM_LIT:5> ; break ; case IOpcodeMnemonics . NEW : index = u2At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; constantPoolEntry = this . constantPool . decodeEntry ( index ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Class ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } visitor . _new ( pc - this . codeOffset , index , constantPoolEntry ) ; pc += <NUM_LIT:3> ; break ; case IOpcodeMnemonics . NEWARRAY : int atype = u1At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; visitor . _newarray ( pc - this . codeOffset , atype ) ; pc += <NUM_LIT:2> ; break ; case IOpcodeMnemonics . ANEWARRAY : index = u2At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; constantPoolEntry = this . constantPool . decodeEntry ( index ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Class ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } visitor . _anewarray ( pc - this . codeOffset , index , constantPoolEntry ) ; pc += <NUM_LIT:3> ; break ; case IOpcodeMnemonics . ARRAYLENGTH : visitor . _arraylength ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . ATHROW : visitor . _athrow ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . CHECKCAST : index = u2At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; constantPoolEntry = this . constantPool . decodeEntry ( index ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Class ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } visitor . _checkcast ( pc - this . codeOffset , index , constantPoolEntry ) ; pc += <NUM_LIT:3> ; break ; case IOpcodeMnemonics . INSTANCEOF : index = u2At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; constantPoolEntry = this . constantPool . decodeEntry ( index ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Class ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } visitor . _instanceof ( pc - this . codeOffset , index , constantPoolEntry ) ; pc += <NUM_LIT:3> ; break ; case IOpcodeMnemonics . MONITORENTER : visitor . _monitorenter ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . MONITOREXIT : visitor . _monitorexit ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . WIDE : opcode = u1At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; if ( opcode == IOpcodeMnemonics . IINC ) { index = u2At ( this . classFileBytes , <NUM_LIT:2> , pc ) ; _const = i2At ( this . classFileBytes , <NUM_LIT:4> , pc ) ; visitor . _wide ( pc - this . codeOffset , opcode , index , _const ) ; pc += <NUM_LIT:6> ; } else { index = u2At ( this . classFileBytes , <NUM_LIT:2> , pc ) ; visitor . _wide ( pc - this . codeOffset , opcode , index ) ; pc += <NUM_LIT:4> ; } break ; case IOpcodeMnemonics . MULTIANEWARRAY : index = u2At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; constantPoolEntry = this . constantPool . decodeEntry ( index ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Class ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } int dimensions = u1At ( this . classFileBytes , <NUM_LIT:3> , pc ) ; visitor . _multianewarray ( pc - this . codeOffset , index , dimensions , constantPoolEntry ) ; pc += <NUM_LIT:4> ; break ; case IOpcodeMnemonics . IFNULL : branchOffset = i2At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; visitor . _ifnull ( pc - this . codeOffset , branchOffset ) ; pc += <NUM_LIT:3> ; break ; case IOpcodeMnemonics . IFNONNULL : branchOffset = i2At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; visitor . _ifnonnull ( pc - this . codeOffset , branchOffset ) ; pc += <NUM_LIT:3> ; break ; case IOpcodeMnemonics . GOTO_W : branchOffset = i4At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; visitor . _goto_w ( pc - this . codeOffset , branchOffset ) ; pc += <NUM_LIT:5> ; break ; case IOpcodeMnemonics . JSR_W : branchOffset = i4At ( this . classFileBytes , <NUM_LIT:1> , pc ) ; visitor . _jsr_w ( pc - this . codeOffset , branchOffset ) ; pc += <NUM_LIT:5> ; break ; case IOpcodeMnemonics . BREAKPOINT : visitor . _breakpoint ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . IMPDEP1 : visitor . _impdep1 ( pc - this . codeOffset ) ; pc ++ ; break ; case IOpcodeMnemonics . IMPDEP2 : visitor . _impdep2 ( pc - this . codeOffset ) ; pc ++ ; break ; default : throw new ClassFormatException ( ClassFormatException . INVALID_BYTECODE ) ; } if ( pc >= ( this . codeLength + this . codeOffset ) ) { break ; } } } } </s>
<s> package org . eclipse . jdt . internal . core . util ; public abstract class ClassFileStruct { protected double doubleAt ( byte [ ] reference , int relativeOffset , int structOffset ) { return ( Double . longBitsToDouble ( i8At ( reference , relativeOffset , structOffset ) ) ) ; } protected float floatAt ( byte [ ] reference , int relativeOffset , int structOffset ) { return ( Float . intBitsToFloat ( i4At ( reference , relativeOffset , structOffset ) ) ) ; } protected int i1At ( byte [ ] reference , int relativeOffset , int structOffset ) { return reference [ relativeOffset + structOffset ] ; } protected int i2At ( byte [ ] reference , int relativeOffset , int structOffset ) { int position = relativeOffset + structOffset ; return ( reference [ position ++ ] << <NUM_LIT:8> ) + ( reference [ position ] & <NUM_LIT> ) ; } protected int i4At ( byte [ ] reference , int relativeOffset , int structOffset ) { int position = relativeOffset + structOffset ; return ( ( reference [ position ++ ] & <NUM_LIT> ) << <NUM_LIT:24> ) + ( ( reference [ position ++ ] & <NUM_LIT> ) << <NUM_LIT:16> ) + ( ( reference [ position ++ ] & <NUM_LIT> ) << <NUM_LIT:8> ) + ( reference [ position ] & <NUM_LIT> ) ; } protected long i8At ( byte [ ] reference , int relativeOffset , int structOffset ) { int position = relativeOffset + structOffset ; return ( ( ( long ) ( reference [ position ++ ] & <NUM_LIT> ) ) << <NUM_LIT> ) + ( ( ( long ) ( reference [ position ++ ] & <NUM_LIT> ) ) << <NUM_LIT> ) + ( ( ( long ) ( reference [ position ++ ] & <NUM_LIT> ) ) << <NUM_LIT> ) + ( ( ( long ) ( reference [ position ++ ] & <NUM_LIT> ) ) << <NUM_LIT:32> ) + ( ( ( long ) ( reference [ position ++ ] & <NUM_LIT> ) ) << <NUM_LIT:24> ) + ( ( ( long ) ( reference [ position ++ ] & <NUM_LIT> ) ) << <NUM_LIT:16> ) + ( ( ( long ) ( reference [ position ++ ] & <NUM_LIT> ) ) << <NUM_LIT:8> ) + ( reference [ position ++ ] & <NUM_LIT> ) ; } protected int u1At ( byte [ ] reference , int relativeOffset , int structOffset ) { return ( reference [ relativeOffset + structOffset ] & <NUM_LIT> ) ; } protected int u2At ( byte [ ] reference , int relativeOffset , int structOffset ) { int position = relativeOffset + structOffset ; return ( ( reference [ position ++ ] & <NUM_LIT> ) << <NUM_LIT:8> ) + ( reference [ position ] & <NUM_LIT> ) ; } protected long u4At ( byte [ ] reference , int relativeOffset , int structOffset ) { int position = relativeOffset + structOffset ; return ( ( ( reference [ position ++ ] & <NUM_LIT> ) << <NUM_LIT:24> ) + ( ( reference [ position ++ ] & <NUM_LIT> ) << <NUM_LIT:16> ) + ( ( reference [ position ++ ] & <NUM_LIT> ) << <NUM_LIT:8> ) + ( reference [ position ] & <NUM_LIT> ) ) ; } protected char [ ] utf8At ( byte [ ] reference , int relativeOffset , int structOffset , int bytesAvailable ) { int length = bytesAvailable ; char outputBuf [ ] = new char [ bytesAvailable ] ; int outputPos = <NUM_LIT:0> ; int readOffset = structOffset + relativeOffset ; while ( length != <NUM_LIT:0> ) { int x = reference [ readOffset ++ ] & <NUM_LIT> ; length -- ; if ( ( <NUM_LIT> & x ) != <NUM_LIT:0> ) { if ( ( x & <NUM_LIT> ) != <NUM_LIT:0> ) { length -= <NUM_LIT:2> ; x = ( ( x & <NUM_LIT> ) << <NUM_LIT:12> ) + ( ( reference [ readOffset ++ ] & <NUM_LIT> ) << <NUM_LIT:6> ) + ( reference [ readOffset ++ ] & <NUM_LIT> ) ; } else { length -- ; x = ( ( x & <NUM_LIT> ) << <NUM_LIT:6> ) + ( reference [ readOffset ++ ] & <NUM_LIT> ) ; } } outputBuf [ outputPos ++ ] = ( char ) x ; } if ( outputPos != bytesAvailable ) { System . arraycopy ( outputBuf , <NUM_LIT:0> , ( outputBuf = new char [ outputPos ] ) , <NUM_LIT:0> , outputPos ) ; } return outputBuf ; } 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 ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . util . ClassFormatException ; import org . eclipse . jdt . core . util . IAnnotation ; import org . eclipse . jdt . core . util . IAnnotationComponent ; import org . eclipse . jdt . core . util . IConstantPool ; import org . eclipse . jdt . core . util . IConstantPoolConstant ; import org . eclipse . jdt . core . util . IConstantPoolEntry ; public class Annotation extends ClassFileStruct implements IAnnotation { private static final IAnnotationComponent [ ] NO_ENTRIES = new IAnnotationComponent [ <NUM_LIT:0> ] ; private int typeIndex ; private char [ ] typeName ; private int componentsNumber ; private IAnnotationComponent [ ] components ; private int readOffset ; public Annotation ( byte [ ] classFileBytes , IConstantPool constantPool , int offset ) throws ClassFormatException { final int index = u2At ( classFileBytes , <NUM_LIT:0> , offset ) ; this . typeIndex = index ; if ( index != <NUM_LIT:0> ) { IConstantPoolEntry constantPoolEntry = constantPool . decodeEntry ( index ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Utf8 ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } this . typeName = constantPoolEntry . getUtf8Value ( ) ; } else { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } final int length = u2At ( classFileBytes , <NUM_LIT:2> , offset ) ; this . componentsNumber = length ; this . readOffset = <NUM_LIT:4> ; if ( length != <NUM_LIT:0> ) { this . components = new IAnnotationComponent [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { AnnotationComponent component = new AnnotationComponent ( classFileBytes , constantPool , offset + this . readOffset ) ; this . components [ i ] = component ; this . readOffset += component . sizeInBytes ( ) ; } } else { this . components = NO_ENTRIES ; } } public int getTypeIndex ( ) { return this . typeIndex ; } public int getComponentsNumber ( ) { return this . componentsNumber ; } public IAnnotationComponent [ ] getComponents ( ) { return this . components ; } int sizeInBytes ( ) { return this . readOffset ; } public char [ ] getTypeName ( ) { return this . typeName ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . util . ClassFormatException ; import org . eclipse . jdt . core . util . IConstantPool ; import org . eclipse . jdt . core . util . ILineNumberAttribute ; public class LineNumberAttribute extends ClassFileAttribute implements ILineNumberAttribute { private static final int [ ] [ ] NO_ENTRIES = new int [ <NUM_LIT:0> ] [ <NUM_LIT:0> ] ; private int lineNumberTableLength ; private int [ ] [ ] lineNumberTable ; public LineNumberAttribute ( byte [ ] classFileBytes , IConstantPool constantPool , int offset ) throws ClassFormatException { super ( classFileBytes , constantPool , offset ) ; final int length = u2At ( classFileBytes , <NUM_LIT:6> , offset ) ; this . lineNumberTableLength = length ; if ( length != <NUM_LIT:0> ) { this . lineNumberTable = new int [ length ] [ <NUM_LIT:2> ] ; int readOffset = <NUM_LIT:8> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { this . lineNumberTable [ i ] [ <NUM_LIT:0> ] = u2At ( classFileBytes , readOffset , offset ) ; this . lineNumberTable [ i ] [ <NUM_LIT:1> ] = u2At ( classFileBytes , readOffset + <NUM_LIT:2> , offset ) ; readOffset += <NUM_LIT:4> ; } } else { this . lineNumberTable = NO_ENTRIES ; } } public int [ ] [ ] getLineNumberTable ( ) { return this . lineNumberTable ; } public int getLineNumberTableLength ( ) { return this . lineNumberTableLength ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; public final class HashtableOfArrayToObject implements Cloneable { public Object [ ] [ ] keyTable ; public Object [ ] valueTable ; public int elementSize ; int threshold ; public HashtableOfArrayToObject ( ) { this ( <NUM_LIT> ) ; } public HashtableOfArrayToObject ( int size ) { this . elementSize = <NUM_LIT:0> ; this . threshold = size ; int extraRoom = ( int ) ( size * <NUM_LIT> ) ; if ( this . threshold == extraRoom ) extraRoom ++ ; this . keyTable = new Object [ extraRoom ] [ ] ; this . valueTable = new Object [ extraRoom ] ; } public Object clone ( ) throws CloneNotSupportedException { HashtableOfArrayToObject result = ( HashtableOfArrayToObject ) super . clone ( ) ; result . elementSize = this . elementSize ; result . threshold = this . threshold ; int length = this . keyTable . length ; result . keyTable = new Object [ length ] [ ] ; System . arraycopy ( this . keyTable , <NUM_LIT:0> , result . keyTable , <NUM_LIT:0> , length ) ; length = this . valueTable . length ; result . valueTable = new Object [ length ] ; System . arraycopy ( this . valueTable , <NUM_LIT:0> , result . valueTable , <NUM_LIT:0> , length ) ; return result ; } public boolean containsKey ( Object [ ] key ) { int length = this . keyTable . length ; int index = hashCode ( key ) % length ; int keyLength = key . length ; Object [ ] currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != null ) { if ( currentKey . length == keyLength && Util . equalArraysOrNull ( currentKey , key ) ) return true ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return false ; } public Object get ( Object [ ] key ) { int length = this . keyTable . length ; int index = hashCode ( key ) % length ; int keyLength = key . length ; Object [ ] currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != null ) { if ( currentKey . length == keyLength && Util . equalArraysOrNull ( currentKey , key ) ) return this . valueTable [ index ] ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return null ; } public int getIndex ( Object [ ] key ) { int length = this . keyTable . length ; int index = hashCode ( key ) % length ; int keyLength = key . length ; Object [ ] currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != null ) { if ( currentKey . length == keyLength && Util . equalArraysOrNull ( currentKey , key ) ) return index ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return - <NUM_LIT:1> ; } public Object [ ] getKey ( Object [ ] key , int keyLength ) { int length = this . keyTable . length ; int index = hashCode ( key , keyLength ) % length ; Object [ ] currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != null ) { if ( currentKey . length == keyLength && Util . equalArrays ( currentKey , key , keyLength ) ) return currentKey ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return null ; } private int hashCode ( Object [ ] element ) { return hashCode ( element , element . length ) ; } private int hashCode ( Object [ ] element , int length ) { int hash = <NUM_LIT:0> ; for ( int i = length - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) hash = Util . combineHashCodes ( hash , element [ i ] . hashCode ( ) ) ; return hash & <NUM_LIT> ; } public Object put ( Object [ ] key , Object value ) { int length = this . keyTable . length ; int index = hashCode ( key ) % length ; int keyLength = key . length ; Object [ ] currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != null ) { if ( currentKey . length == keyLength && Util . equalArraysOrNull ( currentKey , key ) ) return this . valueTable [ index ] = value ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } this . keyTable [ index ] = key ; this . valueTable [ index ] = value ; if ( ++ this . elementSize > this . threshold ) rehash ( ) ; return value ; } public Object removeKey ( Object [ ] key ) { int length = this . keyTable . length ; int index = hashCode ( key ) % length ; int keyLength = key . length ; Object [ ] currentKey ; while ( ( currentKey = this . keyTable [ index ] ) != null ) { if ( currentKey . length == keyLength && Util . equalArraysOrNull ( currentKey , key ) ) { Object value = this . valueTable [ index ] ; this . elementSize -- ; this . keyTable [ index ] = null ; this . valueTable [ index ] = null ; rehash ( ) ; return value ; } if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return null ; } private void rehash ( ) { HashtableOfArrayToObject newHashtable = new HashtableOfArrayToObject ( this . elementSize * <NUM_LIT:2> ) ; Object [ ] currentKey ; for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) if ( ( currentKey = this . keyTable [ i ] ) != null ) newHashtable . put ( currentKey , this . valueTable [ i ] ) ; this . keyTable = newHashtable . keyTable ; this . valueTable = newHashtable . valueTable ; this . threshold = newHashtable . threshold ; } public int size ( ) { return this . elementSize ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; Object [ ] element ; for ( int i = <NUM_LIT:0> , length = this . keyTable . length ; i < length ; i ++ ) if ( ( element = this . keyTable [ i ] ) != null ) { buffer . append ( '<CHAR_LIT>' ) ; for ( int j = <NUM_LIT:0> , length2 = element . length ; j < length2 ; j ++ ) { buffer . append ( element [ j ] ) ; if ( j != length2 - <NUM_LIT:1> ) buffer . append ( "<STR_LIT:U+002CU+0020>" ) ; } buffer . append ( "<STR_LIT>" ) ; buffer . append ( this . valueTable [ i ] ) ; if ( i != length - <NUM_LIT:1> ) buffer . append ( '<STR_LIT:\n>' ) ; } return buffer . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import java . util . ArrayList ; import org . eclipse . jdt . core . Signature ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . Wildcard ; import org . eclipse . jdt . internal . compiler . codegen . ConstantPool ; public class KeyToSignature extends BindingKeyParser { public static final int SIGNATURE = <NUM_LIT:0> ; public static final int TYPE_ARGUMENTS = <NUM_LIT:1> ; public static final int DECLARING_TYPE = <NUM_LIT:2> ; public static final int THROWN_EXCEPTIONS = <NUM_LIT:3> ; public StringBuffer signature = new StringBuffer ( ) ; private int kind ; private ArrayList arguments = new ArrayList ( ) ; private ArrayList typeArguments = new ArrayList ( ) ; private ArrayList typeParameters = new ArrayList ( ) ; private ArrayList thrownExceptions = new ArrayList ( ) ; private int mainTypeStart = - <NUM_LIT:1> ; private int mainTypeEnd ; private int typeSigStart = - <NUM_LIT:1> ; public KeyToSignature ( BindingKeyParser parser ) { super ( parser ) ; this . kind = ( ( KeyToSignature ) parser ) . kind ; } public KeyToSignature ( String key , int kind ) { super ( key ) ; this . kind = kind ; } public void consumeArrayDimension ( char [ ] brakets ) { this . signature . append ( brakets ) ; } public void consumeBaseType ( char [ ] baseTypeSig ) { this . typeSigStart = this . signature . length ( ) ; this . signature . append ( baseTypeSig ) ; } public void consumeCapture ( int position ) { this . signature . append ( '<CHAR_LIT>' ) ; this . signature . append ( ( ( KeyToSignature ) this . arguments . get ( <NUM_LIT:0> ) ) . signature ) ; } public void consumeLocalType ( char [ ] uniqueKey ) { this . signature = new StringBuffer ( ) ; uniqueKey = CharOperation . subarray ( uniqueKey , <NUM_LIT:0> , uniqueKey . length - <NUM_LIT:1> ) ; CharOperation . replace ( uniqueKey , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ; this . signature . append ( uniqueKey ) ; } public void consumeMethod ( char [ ] selector , char [ ] methodSignature ) { this . arguments = new ArrayList ( ) ; this . typeArguments = new ArrayList ( ) ; CharOperation . replace ( methodSignature , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ; switch ( this . kind ) { case SIGNATURE : this . signature = new StringBuffer ( ) ; this . signature . append ( methodSignature ) ; break ; case THROWN_EXCEPTIONS : if ( CharOperation . indexOf ( '<CHAR_LIT>' , methodSignature ) > <NUM_LIT:0> ) { char [ ] [ ] types = Signature . getThrownExceptionTypes ( methodSignature ) ; int length = types . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { this . thrownExceptions . add ( new String ( types [ i ] ) ) ; } } break ; } } public void consumeMemberType ( char [ ] simpleTypeName ) { this . signature . append ( '<CHAR_LIT>' ) ; this . signature . append ( simpleTypeName ) ; } public void consumePackage ( char [ ] pkgName ) { this . signature . append ( pkgName ) ; } public void consumeParameterizedGenericMethod ( ) { this . typeArguments = this . arguments ; int typeParametersSize = this . arguments . size ( ) ; if ( typeParametersSize > <NUM_LIT:0> ) { int sigLength = this . signature . length ( ) ; char [ ] methodSignature = new char [ sigLength ] ; this . signature . getChars ( <NUM_LIT:0> , sigLength , methodSignature , <NUM_LIT:0> ) ; char [ ] [ ] typeParameterSigs = Signature . getTypeParameters ( methodSignature ) ; if ( typeParameterSigs . length != typeParametersSize ) return ; this . signature = new StringBuffer ( ) ; for ( int i = <NUM_LIT:0> ; i < typeParametersSize ; i ++ ) typeParameterSigs [ i ] = CharOperation . concat ( Signature . C_TYPE_VARIABLE , Signature . getTypeVariable ( typeParameterSigs [ i ] ) , Signature . C_SEMICOLON ) ; int paramStart = CharOperation . indexOf ( Signature . C_PARAM_START , methodSignature ) ; char [ ] typeParametersString = CharOperation . subarray ( methodSignature , <NUM_LIT:0> , paramStart ) ; this . signature . append ( typeParametersString ) ; this . signature . append ( Signature . C_PARAM_START ) ; char [ ] [ ] parameters = Signature . getParameterTypes ( methodSignature ) ; for ( int i = <NUM_LIT:0> , parametersLength = parameters . length ; i < parametersLength ; i ++ ) substitute ( parameters [ i ] , typeParameterSigs , typeParametersSize ) ; this . signature . append ( Signature . C_PARAM_END ) ; char [ ] returnType = Signature . getReturnType ( methodSignature ) ; substitute ( returnType , typeParameterSigs , typeParametersSize ) ; char [ ] [ ] exceptions = Signature . getThrownExceptionTypes ( methodSignature ) ; for ( int i = <NUM_LIT:0> , exceptionsLength = exceptions . length ; i < exceptionsLength ; i ++ ) { this . signature . append ( Signature . C_EXCEPTION_START ) ; substitute ( exceptions [ i ] , typeParameterSigs , typeParametersSize ) ; } } } private void substitute ( char [ ] parameter , char [ ] [ ] typeParameterSigs , int typeParametersLength ) { for ( int i = <NUM_LIT:0> ; i < typeParametersLength ; i ++ ) { if ( CharOperation . equals ( parameter , typeParameterSigs [ i ] ) ) { String typeArgument = ( ( KeyToSignature ) this . arguments . get ( i ) ) . signature . toString ( ) ; this . signature . append ( typeArgument ) ; return ; } } int genericStart = CharOperation . indexOf ( Signature . C_GENERIC_START , parameter ) ; if ( genericStart > - <NUM_LIT:1> ) { this . signature . append ( CharOperation . subarray ( parameter , <NUM_LIT:0> , genericStart ) ) ; char [ ] [ ] parameters = Signature . getTypeArguments ( parameter ) ; this . signature . append ( Signature . C_GENERIC_START ) ; for ( int j = <NUM_LIT:0> , paramsLength = parameters . length ; j < paramsLength ; j ++ ) substitute ( parameters [ j ] , typeParameterSigs , typeParametersLength ) ; this . signature . append ( Signature . C_GENERIC_END ) ; this . signature . append ( Signature . C_SEMICOLON ) ; } else { int index = <NUM_LIT:0> ; int length = parameter . length ; loop : while ( index < length ) { char current = parameter [ index ] ; switch ( current ) { case Signature . C_CAPTURE : case Signature . C_EXTENDS : case Signature . C_SUPER : case Signature . C_ARRAY : this . signature . append ( current ) ; index ++ ; break ; default : break loop ; } } if ( index > <NUM_LIT:0> ) substitute ( CharOperation . subarray ( parameter , index , length ) , typeParameterSigs , typeParametersLength ) ; else this . signature . append ( parameter ) ; } } public void consumeParameterizedType ( char [ ] simpleTypeName , boolean isRaw ) { if ( simpleTypeName != null ) { this . signature . append ( '<CHAR_LIT:.>' ) ; this . signature . append ( simpleTypeName ) ; } if ( ! isRaw ) { this . signature . append ( '<CHAR_LIT>' ) ; int length = this . arguments . size ( ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { this . signature . append ( ( ( KeyToSignature ) this . arguments . get ( i ) ) . signature ) ; } this . signature . append ( '<CHAR_LIT:>>' ) ; this . typeArguments = this . arguments ; this . arguments = new ArrayList ( ) ; } } public void consumeParser ( BindingKeyParser parser ) { this . arguments . add ( parser ) ; } public void consumeField ( char [ ] fieldName ) { if ( this . kind == SIGNATURE ) { this . signature = ( ( KeyToSignature ) this . arguments . get ( <NUM_LIT:0> ) ) . signature ; } } public void consumeException ( ) { int size = this . arguments . size ( ) ; if ( size > <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) { this . thrownExceptions . add ( ( ( KeyToSignature ) this . arguments . get ( i ) ) . signature . toString ( ) ) ; } this . arguments = new ArrayList ( ) ; this . typeArguments = new ArrayList ( ) ; } } public void consumeFullyQualifiedName ( char [ ] fullyQualifiedName ) { this . typeSigStart = this . signature . length ( ) ; this . signature . append ( '<CHAR_LIT>' ) ; this . signature . append ( CharOperation . replaceOnCopy ( fullyQualifiedName , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ) ; } public void consumeSecondaryType ( char [ ] simpleTypeName ) { this . signature . append ( '<CHAR_LIT>' ) ; this . mainTypeStart = this . signature . lastIndexOf ( "<STR_LIT:.>" ) + <NUM_LIT:1> ; if ( this . mainTypeStart == <NUM_LIT:0> ) { this . mainTypeStart = <NUM_LIT:1> ; int i = <NUM_LIT:0> ; while ( this . signature . charAt ( i ) == Signature . C_ARRAY ) { this . mainTypeStart ++ ; i ++ ; } } this . mainTypeEnd = this . signature . length ( ) ; this . signature . append ( simpleTypeName ) ; } public void consumeType ( ) { if ( this . mainTypeStart != - <NUM_LIT:1> ) { this . signature . replace ( this . mainTypeStart , this . mainTypeEnd , "<STR_LIT>" ) ; } int length = this . typeParameters . size ( ) ; if ( length > <NUM_LIT:0> ) { StringBuffer typeParametersSig = new StringBuffer ( ) ; typeParametersSig . append ( '<CHAR_LIT>' ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { char [ ] typeParameterSig = Signature . createTypeParameterSignature ( ( char [ ] ) this . typeParameters . get ( i ) , new char [ ] [ ] { ConstantPool . ObjectSignature } ) ; typeParametersSig . append ( typeParameterSig ) ; } typeParametersSig . append ( '<CHAR_LIT:>>' ) ; this . signature . insert ( this . typeSigStart , typeParametersSig . toString ( ) ) ; this . typeParameters = new ArrayList ( ) ; } this . signature . append ( '<CHAR_LIT:;>' ) ; } public void consumeTypeParameter ( char [ ] typeParameterName ) { this . typeParameters . add ( typeParameterName ) ; } public void consumeTypeVariable ( char [ ] position , char [ ] typeVariableName ) { this . signature = new StringBuffer ( ) ; this . signature . append ( '<CHAR_LIT>' ) ; this . signature . append ( typeVariableName ) ; this . signature . append ( '<CHAR_LIT:;>' ) ; } public void consumeTypeWithCapture ( ) { KeyToSignature keyToSignature = ( KeyToSignature ) this . arguments . get ( <NUM_LIT:0> ) ; this . signature = keyToSignature . signature ; this . arguments = keyToSignature . arguments ; this . typeArguments = keyToSignature . typeArguments ; this . thrownExceptions = keyToSignature . thrownExceptions ; } public void consumeWildCard ( int wildCardKind ) { this . signature = new StringBuffer ( ) ; switch ( wildCardKind ) { case Wildcard . UNBOUND : this . signature . append ( '<CHAR_LIT>' ) ; break ; case Wildcard . EXTENDS : this . signature . append ( '<CHAR_LIT>' ) ; this . signature . append ( ( ( KeyToSignature ) this . arguments . get ( <NUM_LIT:0> ) ) . signature ) ; break ; case Wildcard . SUPER : this . signature . append ( '<CHAR_LIT:->' ) ; this . signature . append ( ( ( KeyToSignature ) this . arguments . get ( <NUM_LIT:0> ) ) . signature ) ; break ; default : return ; } } public String [ ] getThrownExceptions ( ) { int length = this . thrownExceptions . size ( ) ; String [ ] result = new String [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { result [ i ] = ( String ) this . thrownExceptions . get ( i ) ; } return result ; } public String [ ] getTypeArguments ( ) { int length = this . typeArguments . size ( ) ; String [ ] result = new String [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { result [ i ] = ( ( KeyToSignature ) this . typeArguments . get ( i ) ) . signature . toString ( ) ; } return result ; } public BindingKeyParser newParser ( ) { return new KeyToSignature ( this ) ; } public String toString ( ) { return this . signature . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . util . ClassFormatException ; import org . eclipse . jdt . core . util . IConstantPool ; import org . eclipse . jdt . core . util . IConstantPoolConstant ; import org . eclipse . jdt . core . util . IConstantPoolEntry ; import org . eclipse . jdt . core . util . ISignatureAttribute ; public class SignatureAttribute extends ClassFileAttribute implements ISignatureAttribute { private int signatureIndex ; private char [ ] signature ; SignatureAttribute ( byte [ ] classFileBytes , IConstantPool constantPool , int offset ) throws ClassFormatException { super ( classFileBytes , constantPool , offset ) ; final int index = u2At ( classFileBytes , <NUM_LIT:6> , offset ) ; this . signatureIndex = index ; IConstantPoolEntry constantPoolEntry = constantPool . decodeEntry ( index ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Utf8 ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } this . signature = constantPoolEntry . getUtf8Value ( ) ; } public int getSignatureIndex ( ) { return this . signatureIndex ; } public char [ ] getSignature ( ) { return this . signature ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; public class ToStringSorter { Object [ ] sortedObjects ; String [ ] sortedStrings ; public boolean compare ( String stringOne , String stringTwo ) { return stringOne . compareTo ( stringTwo ) < <NUM_LIT:0> ; } private void quickSort ( int left , int right ) { int originalLeft = left ; int originalRight = right ; int midIndex = left + ( right - left ) / <NUM_LIT:2> ; String midToString = this . sortedStrings [ midIndex ] ; do { while ( compare ( this . sortedStrings [ left ] , midToString ) ) left ++ ; while ( compare ( midToString , this . sortedStrings [ right ] ) ) right -- ; if ( left <= right ) { Object tmp = this . sortedObjects [ left ] ; this . sortedObjects [ left ] = this . sortedObjects [ right ] ; this . sortedObjects [ right ] = tmp ; String tmpToString = this . sortedStrings [ left ] ; this . sortedStrings [ left ] = this . sortedStrings [ right ] ; this . sortedStrings [ right ] = tmpToString ; left ++ ; right -- ; } } while ( left <= right ) ; if ( originalLeft < right ) quickSort ( originalLeft , right ) ; if ( left < originalRight ) quickSort ( left , originalRight ) ; } public void sort ( Object [ ] unSortedObjects , String [ ] unsortedStrings ) { int size = unSortedObjects . length ; this . sortedObjects = new Object [ size ] ; this . sortedStrings = new String [ size ] ; System . arraycopy ( unSortedObjects , <NUM_LIT:0> , this . sortedObjects , <NUM_LIT:0> , size ) ; System . arraycopy ( unsortedStrings , <NUM_LIT:0> , this . sortedStrings , <NUM_LIT:0> , size ) ; if ( size > <NUM_LIT:1> ) quickSort ( <NUM_LIT:0> , size - <NUM_LIT:1> ) ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . util . ClassFormatException ; import org . eclipse . jdt . core . util . IAttributeNamesConstants ; import org . eclipse . jdt . core . util . IClassFileAttribute ; import org . eclipse . jdt . core . util . IConstantPool ; import org . eclipse . jdt . core . util . IConstantPoolConstant ; import org . eclipse . jdt . core . util . IConstantPoolEntry ; import org . eclipse . jdt . core . util . IConstantValueAttribute ; import org . eclipse . jdt . core . util . IFieldInfo ; import org . eclipse . jdt . core . util . IModifierConstants ; public class FieldInfo extends ClassFileStruct implements IFieldInfo { private int accessFlags ; private int attributeBytes ; private IClassFileAttribute [ ] attributes ; private int attributesCount ; private IConstantValueAttribute constantValueAttribute ; private char [ ] descriptor ; private int descriptorIndex ; private boolean isDeprecated ; private boolean isSynthetic ; private char [ ] name ; private int nameIndex ; public FieldInfo ( byte classFileBytes [ ] , IConstantPool constantPool , int offset ) throws ClassFormatException { final int flags = u2At ( classFileBytes , <NUM_LIT:0> , offset ) ; this . accessFlags = flags ; if ( ( flags & IModifierConstants . ACC_SYNTHETIC ) != <NUM_LIT:0> ) { this . isSynthetic = true ; } this . nameIndex = u2At ( classFileBytes , <NUM_LIT:2> , offset ) ; IConstantPoolEntry constantPoolEntry = constantPool . decodeEntry ( this . nameIndex ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Utf8 ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } this . name = constantPoolEntry . getUtf8Value ( ) ; this . descriptorIndex = u2At ( classFileBytes , <NUM_LIT:4> , offset ) ; constantPoolEntry = constantPool . decodeEntry ( this . descriptorIndex ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Utf8 ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } this . descriptor = constantPoolEntry . getUtf8Value ( ) ; this . attributesCount = u2At ( classFileBytes , <NUM_LIT:6> , offset ) ; this . attributes = ClassFileAttribute . NO_ATTRIBUTES ; int readOffset = <NUM_LIT:8> ; if ( this . attributesCount != <NUM_LIT:0> ) { this . attributes = new IClassFileAttribute [ this . attributesCount ] ; } int attributesIndex = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < this . attributesCount ; i ++ ) { constantPoolEntry = constantPool . decodeEntry ( u2At ( classFileBytes , readOffset , offset ) ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Utf8 ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } char [ ] attributeName = constantPoolEntry . getUtf8Value ( ) ; if ( equals ( attributeName , IAttributeNamesConstants . DEPRECATED ) ) { this . isDeprecated = true ; this . attributes [ attributesIndex ++ ] = new ClassFileAttribute ( classFileBytes , constantPool , offset + readOffset ) ; } else if ( equals ( attributeName , IAttributeNamesConstants . SYNTHETIC ) ) { this . isSynthetic = true ; this . attributes [ attributesIndex ++ ] = new ClassFileAttribute ( classFileBytes , constantPool , offset + readOffset ) ; } else if ( equals ( attributeName , IAttributeNamesConstants . CONSTANT_VALUE ) ) { this . constantValueAttribute = new ConstantValueAttribute ( classFileBytes , constantPool , offset + readOffset ) ; this . attributes [ attributesIndex ++ ] = this . constantValueAttribute ; } else if ( equals ( attributeName , IAttributeNamesConstants . SIGNATURE ) ) { this . attributes [ attributesIndex ++ ] = new SignatureAttribute ( classFileBytes , constantPool , offset + readOffset ) ; } else if ( equals ( attributeName , IAttributeNamesConstants . RUNTIME_VISIBLE_ANNOTATIONS ) ) { this . attributes [ attributesIndex ++ ] = new RuntimeVisibleAnnotationsAttribute ( classFileBytes , constantPool , offset + readOffset ) ; } else if ( equals ( attributeName , IAttributeNamesConstants . RUNTIME_INVISIBLE_ANNOTATIONS ) ) { this . attributes [ attributesIndex ++ ] = new RuntimeInvisibleAnnotationsAttribute ( classFileBytes , constantPool , offset + readOffset ) ; } else { this . attributes [ attributesIndex ++ ] = new ClassFileAttribute ( classFileBytes , constantPool , offset + readOffset ) ; } readOffset += ( <NUM_LIT:6> + u4At ( classFileBytes , readOffset + <NUM_LIT:2> , offset ) ) ; } this . attributeBytes = readOffset ; } public int getAccessFlags ( ) { return this . accessFlags ; } public int getAttributeCount ( ) { return this . attributesCount ; } public IClassFileAttribute [ ] getAttributes ( ) { return this . attributes ; } public IConstantValueAttribute getConstantValueAttribute ( ) { return this . constantValueAttribute ; } public char [ ] getDescriptor ( ) { return this . descriptor ; } public int getDescriptorIndex ( ) { return this . descriptorIndex ; } public char [ ] getName ( ) { return this . name ; } public int getNameIndex ( ) { return this . nameIndex ; } public boolean hasConstantValueAttribute ( ) { return this . constantValueAttribute != null ; } public boolean isDeprecated ( ) { return this . isDeprecated ; } public boolean isSynthetic ( ) { return this . isSynthetic ; } int sizeInBytes ( ) { return this . attributeBytes ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import java . util . HashMap ; import java . util . HashSet ; import org . eclipse . core . resources . IFile ; import org . eclipse . core . resources . IProject ; import org . eclipse . core . resources . ResourcesPlugin ; import org . eclipse . core . runtime . CoreException ; import org . eclipse . core . runtime . IPath ; import org . eclipse . core . runtime . Path ; import org . eclipse . jdt . core . IClassFile ; import org . eclipse . jdt . core . IClasspathEntry ; import org . eclipse . jdt . core . ICompilationUnit ; import org . eclipse . jdt . core . IJavaElement ; import org . eclipse . jdt . core . IJavaProject ; import org . eclipse . jdt . core . IMember ; import org . eclipse . jdt . core . IPackageFragment ; import org . eclipse . jdt . core . IPackageFragmentRoot ; import org . eclipse . jdt . core . IType ; import org . eclipse . jdt . core . JavaCore ; import org . eclipse . jdt . core . JavaModelException ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . core . search . IJavaSearchScope ; import org . eclipse . jdt . internal . compiler . ast . * ; import org . eclipse . jdt . internal . compiler . lookup . ClassScope ; import org . eclipse . jdt . internal . compiler . lookup . MethodScope ; import org . eclipse . jdt . internal . compiler . lookup . Scope ; import org . eclipse . jdt . internal . core . * ; import org . eclipse . jdt . internal . core . search . AbstractJavaSearchScope ; import org . eclipse . jdt . internal . core . util . Util ; public class HandleFactory { private String lastPkgFragmentRootPath ; private PackageFragmentRoot lastPkgFragmentRoot ; private HashtableOfArrayToObject packageHandles ; private JavaModel javaModel ; public HandleFactory ( ) { this . javaModel = JavaModelManager . getJavaModelManager ( ) . getJavaModel ( ) ; } public Openable createOpenable ( String resourcePath , IJavaSearchScope scope ) { int separatorIndex ; if ( ( separatorIndex = resourcePath . indexOf ( IJavaSearchScope . JAR_FILE_ENTRY_SEPARATOR ) ) > - <NUM_LIT:1> ) { int rootPathLength ; if ( this . lastPkgFragmentRootPath == null || ( rootPathLength = this . lastPkgFragmentRootPath . length ( ) ) != resourcePath . length ( ) || ! resourcePath . regionMatches ( <NUM_LIT:0> , this . lastPkgFragmentRootPath , <NUM_LIT:0> , rootPathLength ) ) { String jarPath = resourcePath . substring ( <NUM_LIT:0> , separatorIndex ) ; PackageFragmentRoot root = getJarPkgFragmentRoot ( resourcePath , separatorIndex , jarPath , scope ) ; if ( root == null ) return null ; this . lastPkgFragmentRootPath = jarPath ; this . lastPkgFragmentRoot = root ; this . packageHandles = new HashtableOfArrayToObject ( <NUM_LIT:5> ) ; } String classFilePath = resourcePath . substring ( separatorIndex + <NUM_LIT:1> ) ; String [ ] simpleNames = new Path ( classFilePath ) . segments ( ) ; String [ ] pkgName ; int length = simpleNames . length - <NUM_LIT:1> ; if ( length > <NUM_LIT:0> ) { pkgName = new String [ length ] ; System . arraycopy ( simpleNames , <NUM_LIT:0> , pkgName , <NUM_LIT:0> , length ) ; } else { pkgName = CharOperation . NO_STRINGS ; } IPackageFragment pkgFragment = ( IPackageFragment ) this . packageHandles . get ( pkgName ) ; if ( pkgFragment == null ) { pkgFragment = this . lastPkgFragmentRoot . getPackageFragment ( pkgName ) ; this . packageHandles . put ( pkgName , pkgFragment ) ; } IClassFile classFile = pkgFragment . getClassFile ( simpleNames [ length ] ) ; return ( Openable ) classFile ; } else { int rootPathLength = - <NUM_LIT:1> ; if ( this . lastPkgFragmentRootPath == null || ! ( resourcePath . startsWith ( this . lastPkgFragmentRootPath ) && ! org . eclipse . jdt . internal . compiler . util . Util . isExcluded ( resourcePath . toCharArray ( ) , this . lastPkgFragmentRoot . fullInclusionPatternChars ( ) , this . lastPkgFragmentRoot . fullExclusionPatternChars ( ) , false ) && ( rootPathLength = this . lastPkgFragmentRootPath . length ( ) ) > <NUM_LIT:0> && resourcePath . charAt ( rootPathLength ) == '<CHAR_LIT:/>' ) ) { PackageFragmentRoot root = getPkgFragmentRoot ( resourcePath ) ; if ( root == null ) return null ; this . lastPkgFragmentRoot = root ; this . lastPkgFragmentRootPath = this . lastPkgFragmentRoot . internalPath ( ) . toString ( ) ; this . packageHandles = new HashtableOfArrayToObject ( <NUM_LIT:5> ) ; } resourcePath = resourcePath . substring ( this . lastPkgFragmentRootPath . length ( ) + <NUM_LIT:1> ) ; String [ ] simpleNames = new Path ( resourcePath ) . segments ( ) ; String [ ] pkgName ; int length = simpleNames . length - <NUM_LIT:1> ; if ( length > <NUM_LIT:0> ) { pkgName = new String [ length ] ; System . arraycopy ( simpleNames , <NUM_LIT:0> , pkgName , <NUM_LIT:0> , length ) ; } else { pkgName = CharOperation . NO_STRINGS ; } IPackageFragment pkgFragment = ( IPackageFragment ) this . packageHandles . get ( pkgName ) ; if ( pkgFragment == null ) { pkgFragment = this . lastPkgFragmentRoot . getPackageFragment ( pkgName ) ; this . packageHandles . put ( pkgName , pkgFragment ) ; } String simpleName = simpleNames [ length ] ; if ( org . eclipse . jdt . internal . core . util . Util . isJavaLikeFileName ( simpleName ) ) { ICompilationUnit unit = pkgFragment . getCompilationUnit ( simpleName ) ; return ( Openable ) unit ; } else if ( org . eclipse . jdt . internal . compiler . util . Util . isClassFileName ( simpleName ) ) { IClassFile classFile = pkgFragment . getClassFile ( simpleName ) ; return ( Openable ) classFile ; } return null ; } } public IJavaElement createElement ( ClassScope scope , ICompilationUnit unit , HashSet existingElements , HashMap knownScopes ) { return createElement ( scope , scope . referenceContext . sourceStart , unit , existingElements , knownScopes ) ; } private IJavaElement createElement ( Scope scope , int elementPosition , ICompilationUnit unit , HashSet existingElements , HashMap knownScopes ) { IJavaElement newElement = ( IJavaElement ) knownScopes . get ( scope ) ; if ( newElement != null ) return newElement ; switch ( scope . kind ) { case Scope . COMPILATION_UNIT_SCOPE : newElement = unit ; break ; case Scope . CLASS_SCOPE : IJavaElement parentElement = createElement ( scope . parent , elementPosition , unit , existingElements , knownScopes ) ; switch ( parentElement . getElementType ( ) ) { case IJavaElement . COMPILATION_UNIT : newElement = ( ( ICompilationUnit ) parentElement ) . getType ( new String ( scope . enclosingSourceType ( ) . sourceName ) ) ; break ; case IJavaElement . TYPE : newElement = ( ( IType ) parentElement ) . getType ( new String ( scope . enclosingSourceType ( ) . sourceName ) ) ; break ; case IJavaElement . FIELD : case IJavaElement . INITIALIZER : case IJavaElement . METHOD : IMember member = ( IMember ) parentElement ; if ( member . isBinary ( ) ) { return null ; } else { newElement = member . getType ( new String ( scope . enclosingSourceType ( ) . sourceName ) , <NUM_LIT:1> ) ; if ( newElement != null ) { while ( ! existingElements . add ( newElement ) ) ( ( SourceRefElement ) newElement ) . occurrenceCount ++ ; } } break ; } if ( newElement != null ) { knownScopes . put ( scope , newElement ) ; } break ; case Scope . METHOD_SCOPE : IType parentType = ( IType ) createElement ( scope . parent , elementPosition , unit , existingElements , knownScopes ) ; MethodScope methodScope = ( MethodScope ) scope ; if ( methodScope . isInsideInitializer ( ) ) { TypeDeclaration type = methodScope . referenceType ( ) ; int occurenceCount = <NUM_LIT:1> ; int length = type . fields == null ? <NUM_LIT:0> : type . fields . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { FieldDeclaration field = type . fields [ i ] ; if ( field . declarationSourceStart <= elementPosition && elementPosition <= field . declarationSourceEnd ) { switch ( field . getKind ( ) ) { case AbstractVariableDeclaration . FIELD : case AbstractVariableDeclaration . ENUM_CONSTANT : newElement = parentType . getField ( new String ( field . name ) ) ; break ; case AbstractVariableDeclaration . INITIALIZER : newElement = parentType . getInitializer ( occurenceCount ) ; break ; } break ; } else if ( field . getKind ( ) == AbstractVariableDeclaration . INITIALIZER ) { occurenceCount ++ ; } } } else { AbstractMethodDeclaration method = methodScope . referenceMethod ( ) ; newElement = parentType . getMethod ( new String ( method . selector ) , Util . typeParameterSignatures ( method ) ) ; if ( newElement != null ) { knownScopes . put ( scope , newElement ) ; } } break ; case Scope . BLOCK_SCOPE : newElement = createElement ( scope . parent , elementPosition , unit , existingElements , knownScopes ) ; break ; } return newElement ; } private PackageFragmentRoot getJarPkgFragmentRoot ( String resourcePathString , int jarSeparatorIndex , String jarPathString , IJavaSearchScope scope ) { IPath jarPath = new Path ( jarPathString ) ; Object target = JavaModel . getTarget ( jarPath , false ) ; if ( target instanceof IFile ) { IFile jarFile = ( IFile ) target ; JavaProject javaProject = ( JavaProject ) this . javaModel . getJavaProject ( jarFile ) ; try { IClasspathEntry entry = javaProject . getClasspathEntryFor ( jarPath ) ; if ( entry != null ) { return ( PackageFragmentRoot ) javaProject . getPackageFragmentRoot ( jarFile ) ; } } catch ( JavaModelException e ) { } } IJavaProject [ ] projects ; if ( scope != null ) { if ( scope instanceof AbstractJavaSearchScope ) { PackageFragmentRoot root = ( PackageFragmentRoot ) ( ( AbstractJavaSearchScope ) scope ) . packageFragmentRoot ( resourcePathString , jarSeparatorIndex , jarPathString ) ; if ( root != null ) return root ; } else { IPath [ ] enclosingProjectsAndJars = scope . enclosingProjectsAndJars ( ) ; int length = enclosingProjectsAndJars . length ; projects = new IJavaProject [ length ] ; int index = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { IPath path = enclosingProjectsAndJars [ i ] ; if ( path . segmentCount ( ) == <NUM_LIT:1> ) { projects [ index ++ ] = this . javaModel . getJavaProject ( path . segment ( <NUM_LIT:0> ) ) ; } } if ( index < length ) { System . arraycopy ( projects , <NUM_LIT:0> , projects = new IJavaProject [ index ] , <NUM_LIT:0> , index ) ; } PackageFragmentRoot root = getJarPkgFragmentRoot ( jarPath , target , projects ) ; if ( root != null ) { return root ; } } } try { projects = this . javaModel . getJavaProjects ( ) ; } catch ( JavaModelException e ) { return null ; } return getJarPkgFragmentRoot ( jarPath , target , projects ) ; } private PackageFragmentRoot getJarPkgFragmentRoot ( IPath jarPath , Object target , IJavaProject [ ] projects ) { for ( int i = <NUM_LIT:0> , projectCount = projects . length ; i < projectCount ; i ++ ) { try { JavaProject javaProject = ( JavaProject ) projects [ i ] ; IClasspathEntry classpathEnty = javaProject . getClasspathEntryFor ( jarPath ) ; if ( classpathEnty != null ) { if ( target instanceof IFile ) { return ( PackageFragmentRoot ) javaProject . getPackageFragmentRoot ( ( IFile ) target ) ; } else { return ( PackageFragmentRoot ) javaProject . getPackageFragmentRoot0 ( jarPath ) ; } } } catch ( JavaModelException e ) { } } return null ; } private PackageFragmentRoot getPkgFragmentRoot ( String pathString ) { IPath path = new Path ( pathString ) ; IProject [ ] projects = ResourcesPlugin . getWorkspace ( ) . getRoot ( ) . getProjects ( ) ; for ( int i = <NUM_LIT:0> , max = projects . length ; i < max ; i ++ ) { try { IProject project = projects [ i ] ; if ( ! project . isAccessible ( ) || ! project . hasNature ( JavaCore . NATURE_ID ) ) continue ; IJavaProject javaProject = this . javaModel . getJavaProject ( project ) ; IPackageFragmentRoot [ ] roots = javaProject . getPackageFragmentRoots ( ) ; for ( int j = <NUM_LIT:0> , rootCount = roots . length ; j < rootCount ; j ++ ) { PackageFragmentRoot root = ( PackageFragmentRoot ) roots [ j ] ; if ( root . internalPath ( ) . isPrefixOf ( path ) && ! Util . isExcluded ( path , root . fullInclusionPatternChars ( ) , root . fullExclusionPatternChars ( ) , false ) ) { return root ; } } } catch ( CoreException e ) { } } return null ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . Wildcard ; public class BindingKeyParser { int keyStart ; static final char C_THROWN = '<CHAR_LIT>' ; static class Scanner { static final int PACKAGE = <NUM_LIT:0> ; static final int TYPE = <NUM_LIT:1> ; static final int FIELD = <NUM_LIT:2> ; static final int METHOD = <NUM_LIT:3> ; static final int ARRAY = <NUM_LIT:4> ; static final int LOCAL_VAR = <NUM_LIT:5> ; static final int FLAGS = <NUM_LIT:6> ; static final int WILDCARD = <NUM_LIT:7> ; static final int CAPTURE = <NUM_LIT:8> ; static final int BASE_TYPE = <NUM_LIT:9> ; static final int END = <NUM_LIT:10> ; static final int START = - <NUM_LIT:1> ; int index = <NUM_LIT:0> , start ; char [ ] source ; int token = START ; Scanner ( char [ ] source ) { this . source = source ; } char [ ] getTokenSource ( ) { int length = this . index - this . start ; char [ ] result = new char [ length ] ; System . arraycopy ( this . source , this . start , result , <NUM_LIT:0> , length ) ; return result ; } boolean isAtAnnotationStart ( ) { return this . index < this . source . length && this . source [ this . index ] == '<CHAR_LIT>' ; } boolean isAtCaptureStart ( ) { return this . index < this . source . length && this . source [ this . index ] == '<CHAR_LIT>' ; } boolean isAtFieldOrMethodStart ( ) { return this . index < this . source . length && this . source [ this . index ] == '<CHAR_LIT:.>' ; } boolean isAtLocalVariableStart ( ) { return this . index < this . source . length && this . source [ this . index ] == '<CHAR_LIT>' ; } boolean isAtMemberTypeStart ( ) { return this . index < this . source . length && ( this . source [ this . index ] == '<CHAR_LIT>' || ( this . source [ this . index ] == '<CHAR_LIT:.>' && this . source [ this . index - <NUM_LIT:1> ] == '<CHAR_LIT:>>' ) ) ; } boolean isAtParametersEnd ( ) { return this . index < this . source . length && this . source [ this . index ] == '<CHAR_LIT:>>' ; } boolean isAtParametersStart ( ) { char currentChar ; return this . index > <NUM_LIT:0> && this . index < this . source . length && ( ( currentChar = this . source [ this . index ] ) == '<CHAR_LIT>' || currentChar == '<CHAR_LIT>' ) ; } boolean isAtRawTypeEnd ( ) { return this . index > <NUM_LIT:0> && this . index < this . source . length && this . source [ this . index ] == '<CHAR_LIT:>>' ; } boolean isAtSecondaryTypeStart ( ) { return this . index < this . source . length && this . source [ this . index ] == '<CHAR_LIT>' ; } boolean isAtWildcardStart ( ) { return this . index < this . source . length && this . source [ this . index ] == '<CHAR_LIT>' ; } boolean isAtTypeParameterStart ( ) { return this . index < this . source . length && this . source [ this . index ] == '<CHAR_LIT>' ; } boolean isAtTypeArgumentStart ( ) { return this . index < this . source . length && "<STR_LIT>" . indexOf ( this . source [ this . index ] ) != - <NUM_LIT:1> ; } boolean isAtThrownStart ( ) { return this . index < this . source . length && this . source [ this . index ] == C_THROWN ; } boolean isAtTypeVariableStart ( ) { return this . index < this . source . length && this . source [ this . index ] == '<CHAR_LIT::>' ; } boolean isAtTypeWithCaptureStart ( ) { return this . index < this . source . length && this . source [ this . index ] == '<CHAR_LIT>' ; } int nextToken ( ) { int previousTokenEnd = this . index ; this . start = this . index ; int dollarIndex = - <NUM_LIT:1> ; int length = this . source . length ; while ( this . index <= length ) { char currentChar = this . index == length ? Character . MIN_VALUE : this . source [ this . index ] ; switch ( currentChar ) { case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT:Z>' : if ( this . index == previousTokenEnd && ( this . index == <NUM_LIT:0> || this . source [ this . index - <NUM_LIT:1> ] != '<CHAR_LIT:.>' ) ) { this . index ++ ; this . token = BASE_TYPE ; return this . token ; } break ; case '<CHAR_LIT>' : case '<CHAR_LIT>' : if ( this . index == previousTokenEnd && ( this . index == <NUM_LIT:0> || this . source [ this . index - <NUM_LIT:1> ] != '<CHAR_LIT:.>' ) ) { this . start = this . index + <NUM_LIT:1> ; dollarIndex = - <NUM_LIT:1> ; } break ; case '<CHAR_LIT:;>' : if ( this . index == previousTokenEnd ) { this . start = this . index + <NUM_LIT:1> ; dollarIndex = - <NUM_LIT:1> ; previousTokenEnd = this . start ; } else { if ( dollarIndex != - <NUM_LIT:1> ) this . index = dollarIndex ; this . token = TYPE ; return this . token ; } break ; case '<CHAR_LIT>' : if ( this . index == previousTokenEnd ) { this . start = this . index + <NUM_LIT:1> ; dollarIndex = - <NUM_LIT:1> ; } else { if ( dollarIndex == - <NUM_LIT:1> ) { dollarIndex = this . index ; break ; } this . index = dollarIndex ; this . token = TYPE ; return this . token ; } break ; case '<CHAR_LIT>' : if ( this . index == previousTokenEnd ) { this . start = this . index + <NUM_LIT:1> ; dollarIndex = - <NUM_LIT:1> ; } else { this . token = TYPE ; return this . token ; } break ; case '<CHAR_LIT:.>' : case '<CHAR_LIT>' : case '<CHAR_LIT::>' : case '<CHAR_LIT:>>' : case '<CHAR_LIT>' : this . start = this . index + <NUM_LIT:1> ; dollarIndex = - <NUM_LIT:1> ; previousTokenEnd = this . start ; break ; case '<CHAR_LIT:[>' : while ( this . index < length && this . source [ this . index ] == '<CHAR_LIT:[>' ) this . index ++ ; this . token = ARRAY ; return this . token ; case '<CHAR_LIT>' : if ( this . start > <NUM_LIT:0> ) { switch ( this . source [ this . start - <NUM_LIT:1> ] ) { case '<CHAR_LIT:.>' : if ( this . source [ this . start - <NUM_LIT:2> ] == '<CHAR_LIT:>>' ) { if ( dollarIndex != - <NUM_LIT:1> ) this . index = dollarIndex ; this . token = TYPE ; } else { this . token = METHOD ; } return this . token ; default : if ( this . index == previousTokenEnd ) { this . start = this . index + <NUM_LIT:1> ; dollarIndex = - <NUM_LIT:1> ; previousTokenEnd = this . start ; } else { if ( dollarIndex != - <NUM_LIT:1> ) this . index = dollarIndex ; this . token = TYPE ; return this . token ; } } } break ; case '<CHAR_LIT:(>' : this . token = METHOD ; return this . token ; case '<CHAR_LIT:)>' : if ( this . token == TYPE ) { this . token = FIELD ; return this . token ; } this . start = this . index + <NUM_LIT:1> ; dollarIndex = - <NUM_LIT:1> ; previousTokenEnd = this . start ; break ; case '<CHAR_LIT>' : if ( this . index == previousTokenEnd ) { this . start = this . index + <NUM_LIT:1> ; dollarIndex = - <NUM_LIT:1> ; previousTokenEnd = this . start ; } else { this . token = LOCAL_VAR ; return this . token ; } break ; case Character . MIN_VALUE : switch ( this . token ) { case START : this . token = PACKAGE ; break ; case METHOD : case LOCAL_VAR : this . token = LOCAL_VAR ; break ; case TYPE : if ( this . index > this . start && this . source [ this . start - <NUM_LIT:1> ] == '<CHAR_LIT:.>' ) this . token = FIELD ; else this . token = END ; break ; case WILDCARD : this . token = TYPE ; break ; default : this . token = END ; break ; } return this . token ; case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT:->' : this . index ++ ; this . token = WILDCARD ; return this . token ; case '<CHAR_LIT>' : case '<CHAR_LIT>' : this . index ++ ; this . token = CAPTURE ; return this . token ; } this . index ++ ; } this . token = END ; return this . token ; } void skipMethodSignature ( ) { this . start = this . index ; int braket = <NUM_LIT:0> ; while ( this . index < this . source . length ) { switch ( this . source [ this . index ] ) { case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case C_THROWN : return ; case '<CHAR_LIT::>' : if ( braket == <NUM_LIT:0> ) return ; break ; case '<CHAR_LIT>' : case '<CHAR_LIT:(>' : braket ++ ; break ; case '<CHAR_LIT:>>' : case '<CHAR_LIT:)>' : braket -- ; break ; } this . index ++ ; } } void skipRank ( ) { this . start = this . index ; while ( this . index < this . source . length && "<STR_LIT>" . indexOf ( this . source [ this . index ] ) != - <NUM_LIT:1> ) this . index ++ ; } void skipThrownStart ( ) { while ( this . index < this . source . length && this . source [ this . index ] == C_THROWN ) this . index ++ ; } void skipParametersStart ( ) { while ( this . index < this . source . length && ( this . source [ this . index ] == '<CHAR_LIT>' || this . source [ this . index ] == '<CHAR_LIT>' ) ) this . index ++ ; } void skipParametersEnd ( ) { while ( this . index < this . source . length && this . source [ this . index ] != '<CHAR_LIT:>>' ) this . index ++ ; this . index ++ ; } void skipTypeEnd ( ) { if ( this . index < this . source . length && this . source [ this . index ] == '<CHAR_LIT:;>' ) this . index ++ ; } void skipRankStart ( ) { if ( this . index < this . source . length && this . source [ this . index ] == '<CHAR_LIT>' ) this . index ++ ; } void skipRankEnd ( ) { if ( this . index < this . source . length && this . source [ this . index ] == '<CHAR_LIT:}>' ) this . index ++ ; this . start = this . index ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; switch ( this . token ) { case START : buffer . append ( "<STR_LIT>" ) ; break ; case PACKAGE : buffer . append ( "<STR_LIT>" ) ; break ; case TYPE : buffer . append ( "<STR_LIT>" ) ; break ; case FIELD : buffer . append ( "<STR_LIT>" ) ; break ; case METHOD : buffer . append ( "<STR_LIT>" ) ; break ; case ARRAY : buffer . append ( "<STR_LIT>" ) ; break ; case LOCAL_VAR : buffer . append ( "<STR_LIT>" ) ; break ; case FLAGS : buffer . append ( "<STR_LIT>" ) ; break ; case WILDCARD : buffer . append ( "<STR_LIT>" ) ; break ; case CAPTURE : buffer . append ( "<STR_LIT>" ) ; break ; case BASE_TYPE : buffer . append ( "<STR_LIT>" ) ; break ; case END : buffer . append ( "<STR_LIT>" ) ; break ; } if ( this . index < <NUM_LIT:0> ) { buffer . append ( "<STR_LIT>" ) ; buffer . append ( this . source ) ; } else if ( this . index <= this . source . length ) { buffer . append ( this . source , <NUM_LIT:0> , this . start ) ; buffer . append ( '<CHAR_LIT>' ) ; if ( this . start <= this . index ) { buffer . append ( this . source , this . start , this . index - this . start ) ; buffer . append ( '<CHAR_LIT>' ) ; buffer . append ( this . source , this . index , this . source . length - this . index ) ; } else { buffer . append ( '<CHAR_LIT>' ) ; buffer . append ( this . source , this . start , this . source . length - this . start ) ; } } else { buffer . append ( this . source ) ; buffer . append ( "<STR_LIT>" ) ; } return buffer . toString ( ) ; } } private boolean parsingPaused ; private Scanner scanner ; private boolean hasTypeName = true ; private boolean isMalformed ; private boolean isParsingThrownExceptions = false ; public BindingKeyParser ( BindingKeyParser parser ) { this ( "<STR_LIT>" ) ; this . scanner = parser . scanner ; } public BindingKeyParser ( String key ) { this . scanner = new Scanner ( key . toCharArray ( ) ) ; } public void consumeAnnotation ( ) { } public void consumeArrayDimension ( char [ ] brakets ) { } public void consumeBaseType ( char [ ] baseTypeSig ) { } public void consumeCapture ( int position ) { } public void consumeException ( ) { } public void consumeField ( char [ ] fieldName ) { } public void consumeParameterizedGenericMethod ( ) { } public void consumeLocalType ( char [ ] uniqueKey ) { } public void consumeLocalVar ( char [ ] varName , int occurrenceCount ) { } public void consumeMethod ( char [ ] selector , char [ ] signature ) { } public void consumeModifiers ( char [ ] modifiers ) { } public void consumeNonGenericType ( ) { } public void consumeMemberType ( char [ ] simpleTypeName ) { } public void consumePackage ( char [ ] pkgName ) { } public void consumeParameterizedType ( char [ ] simpleTypeName , boolean isRaw ) { } public void consumeParser ( BindingKeyParser parser ) { } public void consumeRawType ( ) { } public void consumeScope ( int scopeNumber ) { } public void consumeSecondaryType ( char [ ] simpleTypeName ) { } public void consumeFullyQualifiedName ( char [ ] fullyQualifiedName ) { } public void consumeKey ( ) { } public void consumeTopLevelType ( ) { } public void consumeType ( ) { } public void consumeTypeParameter ( char [ ] typeParameterName ) { } public void consumeTypeVariable ( char [ ] position , char [ ] typeVariableName ) { } public void consumeTypeWithCapture ( ) { } public void consumeWildCard ( int kind ) { } public void consumeWildcardRank ( int rank ) { } public String getKey ( ) { return new String ( this . scanner . source ) ; } public boolean hasTypeName ( ) { return this . hasTypeName ; } public void malformedKey ( ) { this . isMalformed = true ; } public BindingKeyParser newParser ( ) { return new BindingKeyParser ( this ) ; } public void parse ( ) { parse ( false ) ; } public void parse ( boolean pauseAfterFullyQualifiedName ) { if ( ! this . parsingPaused ) { parseFullyQualifiedName ( ) ; parseSecondaryType ( ) ; if ( pauseAfterFullyQualifiedName ) { this . parsingPaused = true ; return ; } } if ( ! hasTypeName ( ) ) { consumeKey ( ) ; return ; } consumeTopLevelType ( ) ; parseInnerType ( ) ; if ( this . scanner . isAtParametersStart ( ) ) { this . scanner . skipParametersStart ( ) ; if ( this . scanner . isAtTypeParameterStart ( ) ) { parseGenericType ( ) ; this . scanner . skipParametersEnd ( ) ; parseInnerType ( ) ; } else if ( this . scanner . isAtTypeArgumentStart ( ) ) parseParameterizedType ( null , false ) ; else if ( this . scanner . isAtRawTypeEnd ( ) ) parseRawType ( ) ; } else { consumeNonGenericType ( ) ; } consumeType ( ) ; this . scanner . skipTypeEnd ( ) ; if ( this . scanner . isAtFieldOrMethodStart ( ) ) { switch ( this . scanner . nextToken ( ) ) { case Scanner . FIELD : parseField ( ) ; if ( this . scanner . isAtAnnotationStart ( ) ) { parseAnnotation ( ) ; } return ; case Scanner . METHOD : parseMethod ( ) ; if ( this . scanner . isAtLocalVariableStart ( ) ) { parseLocalVariable ( ) ; } else if ( this . scanner . isAtTypeVariableStart ( ) ) { parseTypeVariable ( ) ; } else if ( this . scanner . isAtAnnotationStart ( ) ) { parseAnnotation ( ) ; } break ; default : malformedKey ( ) ; return ; } } else if ( ! this . isParsingThrownExceptions && this . scanner . isAtTypeVariableStart ( ) ) { parseTypeVariable ( ) ; } else if ( this . scanner . isAtWildcardStart ( ) ) { parseWildcard ( ) ; } else if ( this . scanner . isAtTypeWithCaptureStart ( ) ) { parseTypeWithCapture ( ) ; } else if ( this . scanner . isAtAnnotationStart ( ) ) { parseAnnotation ( ) ; } consumeKey ( ) ; } private void parseFullyQualifiedName ( ) { if ( this . scanner . isAtCaptureStart ( ) ) { parseCapture ( ) ; this . hasTypeName = false ; return ; } switch ( this . scanner . nextToken ( ) ) { case Scanner . PACKAGE : this . keyStart = <NUM_LIT:0> ; consumePackage ( this . scanner . getTokenSource ( ) ) ; this . hasTypeName = false ; return ; case Scanner . TYPE : this . keyStart = this . scanner . start - <NUM_LIT:1> ; consumeFullyQualifiedName ( this . scanner . getTokenSource ( ) ) ; break ; case Scanner . BASE_TYPE : this . keyStart = this . scanner . start - <NUM_LIT:1> ; consumeBaseType ( this . scanner . getTokenSource ( ) ) ; this . hasTypeName = false ; break ; case Scanner . ARRAY : this . keyStart = this . scanner . start ; consumeArrayDimension ( this . scanner . getTokenSource ( ) ) ; switch ( this . scanner . nextToken ( ) ) { case Scanner . TYPE : consumeFullyQualifiedName ( this . scanner . getTokenSource ( ) ) ; break ; case Scanner . BASE_TYPE : consumeBaseType ( this . scanner . getTokenSource ( ) ) ; this . hasTypeName = false ; break ; default : malformedKey ( ) ; return ; } break ; default : malformedKey ( ) ; return ; } } private void parseParameterizedMethod ( ) { this . scanner . skipParametersStart ( ) ; while ( ! this . scanner . isAtParametersEnd ( ) && ! this . isMalformed ) { parseTypeArgument ( ) ; } consumeParameterizedGenericMethod ( ) ; } private void parseGenericType ( ) { while ( ! this . scanner . isAtParametersEnd ( ) && ! this . isMalformed ) { if ( this . scanner . nextToken ( ) != Scanner . TYPE ) { malformedKey ( ) ; return ; } consumeTypeParameter ( this . scanner . getTokenSource ( ) ) ; this . scanner . skipTypeEnd ( ) ; } } private void parseInnerType ( ) { if ( ! this . scanner . isAtMemberTypeStart ( ) || this . scanner . nextToken ( ) != Scanner . TYPE ) return ; char [ ] typeName = this . scanner . getTokenSource ( ) ; if ( typeName . length == <NUM_LIT:0> ) return ; if ( Character . isDigit ( typeName [ <NUM_LIT:0> ] ) ) { int nextToken = Scanner . TYPE ; while ( this . scanner . isAtMemberTypeStart ( ) && ! this . isMalformed ) nextToken = this . scanner . nextToken ( ) ; typeName = nextToken == Scanner . END ? this . scanner . source : CharOperation . subarray ( this . scanner . source , this . keyStart , this . scanner . index + <NUM_LIT:1> ) ; consumeLocalType ( typeName ) ; } else { consumeMemberType ( typeName ) ; parseInnerType ( ) ; } } private void parseLocalVariable ( ) { if ( this . scanner . nextToken ( ) != Scanner . LOCAL_VAR ) { malformedKey ( ) ; return ; } char [ ] varName = this . scanner . getTokenSource ( ) ; if ( Character . isDigit ( varName [ <NUM_LIT:0> ] ) ) { int index = Integer . parseInt ( new String ( varName ) ) ; consumeScope ( index ) ; if ( ! this . scanner . isAtLocalVariableStart ( ) ) { malformedKey ( ) ; return ; } parseLocalVariable ( ) ; } else { int occurrenceCount = <NUM_LIT:0> ; if ( this . scanner . isAtLocalVariableStart ( ) ) { if ( this . scanner . nextToken ( ) != Scanner . LOCAL_VAR ) { malformedKey ( ) ; return ; } char [ ] occurrence = this . scanner . getTokenSource ( ) ; occurrenceCount = Integer . parseInt ( new String ( occurrence ) ) ; } consumeLocalVar ( varName , occurrenceCount ) ; } } private void parseMethod ( ) { char [ ] selector = this . scanner . getTokenSource ( ) ; this . scanner . skipMethodSignature ( ) ; char [ ] signature = this . scanner . getTokenSource ( ) ; consumeMethod ( selector , signature ) ; if ( this . scanner . isAtThrownStart ( ) ) { parseThrownExceptions ( ) ; } if ( this . scanner . isAtParametersStart ( ) ) parseParameterizedMethod ( ) ; } private void parseAnnotation ( ) { int token = this . scanner . token ; BindingKeyParser parser = newParser ( ) ; parser . parse ( ) ; consumeParser ( parser ) ; consumeAnnotation ( ) ; this . isMalformed = parser . isMalformed ; this . scanner . token = token ; } private void parseCapture ( ) { if ( this . scanner . nextToken ( ) != Scanner . CAPTURE ) return ; parseCaptureWildcard ( ) ; if ( this . scanner . nextToken ( ) != Scanner . TYPE ) { malformedKey ( ) ; return ; } char [ ] positionChars = this . scanner . getTokenSource ( ) ; int position = Integer . parseInt ( new String ( positionChars ) ) ; consumeCapture ( position ) ; this . scanner . skipTypeEnd ( ) ; } private void parseCaptureWildcard ( ) { int token = this . scanner . token ; BindingKeyParser parser = newParser ( ) ; parser . parse ( ) ; consumeParser ( parser ) ; this . isMalformed = parser . isMalformed ; this . scanner . token = token ; } private void parseField ( ) { char [ ] fieldName = this . scanner . getTokenSource ( ) ; parseReturnType ( ) ; consumeField ( fieldName ) ; } private void parseThrownExceptions ( ) { int token = this . scanner . token ; while ( this . scanner . isAtThrownStart ( ) && ! this . isMalformed ) { this . scanner . skipThrownStart ( ) ; BindingKeyParser parser = newParser ( ) ; parser . isParsingThrownExceptions = true ; parser . parse ( ) ; consumeParser ( parser ) ; consumeException ( ) ; this . isMalformed = parser . isMalformed ; } this . scanner . token = token ; } private void parseParameterizedType ( char [ ] typeName , boolean isRaw ) { if ( ! isRaw ) { while ( ! this . scanner . isAtParametersEnd ( ) && ! this . isMalformed ) { parseTypeArgument ( ) ; } } this . scanner . skipParametersEnd ( ) ; consumeParameterizedType ( typeName , isRaw ) ; this . scanner . skipTypeEnd ( ) ; if ( this . scanner . isAtMemberTypeStart ( ) && this . scanner . nextToken ( ) == Scanner . TYPE ) { typeName = this . scanner . getTokenSource ( ) ; if ( this . scanner . isAtParametersStart ( ) ) { this . scanner . skipParametersStart ( ) ; parseParameterizedType ( typeName , this . scanner . isAtRawTypeEnd ( ) ) ; } else consumeParameterizedType ( typeName , true ) ; } } private void parseRawType ( ) { this . scanner . skipParametersEnd ( ) ; consumeRawType ( ) ; this . scanner . skipTypeEnd ( ) ; if ( this . scanner . isAtMemberTypeStart ( ) && this . scanner . nextToken ( ) == Scanner . TYPE ) { char [ ] typeName = this . scanner . getTokenSource ( ) ; if ( this . scanner . isAtParametersStart ( ) ) { this . scanner . skipParametersStart ( ) ; parseParameterizedType ( typeName , this . scanner . isAtRawTypeEnd ( ) ) ; } else consumeParameterizedType ( typeName , true ) ; } } private void parseReturnType ( ) { this . scanner . index ++ ; int token = this . scanner . token ; BindingKeyParser parser = newParser ( ) ; parser . parse ( ) ; consumeParser ( parser ) ; this . isMalformed = parser . isMalformed ; this . scanner . token = token ; } private void parseSecondaryType ( ) { if ( ! this . scanner . isAtSecondaryTypeStart ( ) || this . scanner . nextToken ( ) != Scanner . TYPE ) return ; consumeSecondaryType ( this . scanner . getTokenSource ( ) ) ; } private void parseTypeArgument ( ) { int token = this . scanner . token ; BindingKeyParser parser = newParser ( ) ; parser . parse ( ) ; consumeParser ( parser ) ; this . isMalformed = parser . isMalformed ; this . scanner . token = token ; } private void parseTypeWithCapture ( ) { if ( this . scanner . nextToken ( ) != Scanner . CAPTURE ) return ; int token = this . scanner . token ; BindingKeyParser parser = newParser ( ) ; parser . parse ( ) ; consumeParser ( parser ) ; consumeTypeWithCapture ( ) ; this . isMalformed = parser . isMalformed ; this . scanner . token = token ; } private void parseTypeVariable ( ) { if ( this . scanner . nextToken ( ) != Scanner . TYPE ) { malformedKey ( ) ; return ; } char [ ] typeVariableName = this . scanner . getTokenSource ( ) ; char [ ] position ; int length = typeVariableName . length ; if ( length > <NUM_LIT:0> && Character . isDigit ( typeVariableName [ <NUM_LIT:0> ] ) ) { int firstT = CharOperation . indexOf ( '<CHAR_LIT>' , typeVariableName ) ; position = CharOperation . subarray ( typeVariableName , <NUM_LIT:0> , firstT ) ; typeVariableName = CharOperation . subarray ( typeVariableName , firstT + <NUM_LIT:1> , typeVariableName . length ) ; } else { position = CharOperation . NO_CHAR ; } consumeTypeVariable ( position , typeVariableName ) ; this . scanner . skipTypeEnd ( ) ; } private void parseWildcard ( ) { parseWildcardRank ( ) ; if ( this . scanner . nextToken ( ) != Scanner . WILDCARD ) return ; char [ ] source = this . scanner . getTokenSource ( ) ; if ( source . length == <NUM_LIT:0> ) { malformedKey ( ) ; return ; } int kind = - <NUM_LIT:1> ; switch ( source [ <NUM_LIT:0> ] ) { case '<CHAR_LIT>' : kind = Wildcard . UNBOUND ; break ; case '<CHAR_LIT>' : kind = Wildcard . EXTENDS ; break ; case '<CHAR_LIT:->' : kind = Wildcard . SUPER ; break ; } if ( kind == - <NUM_LIT:1> ) { malformedKey ( ) ; return ; } if ( kind != Wildcard . UNBOUND ) parseWildcardBound ( ) ; consumeWildCard ( kind ) ; } private void parseWildcardRank ( ) { this . scanner . skipRankStart ( ) ; this . scanner . skipRank ( ) ; char [ ] source = this . scanner . getTokenSource ( ) ; consumeWildcardRank ( Integer . parseInt ( new String ( source ) ) ) ; this . scanner . skipRankEnd ( ) ; } private void parseWildcardBound ( ) { int token = this . scanner . token ; BindingKeyParser parser = newParser ( ) ; parser . parse ( ) ; consumeParser ( parser ) ; this . isMalformed = parser . isMalformed ; this . scanner . token = token ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . IInitializer ; import org . eclipse . jdt . core . IMember ; import org . eclipse . jdt . core . ISourceRange ; import org . eclipse . jdt . core . JavaModelException ; import org . eclipse . jdt . core . dom . ASTNode ; import org . eclipse . jdt . core . dom . ASTVisitor ; import org . eclipse . jdt . core . dom . AnnotationTypeDeclaration ; import org . eclipse . jdt . core . dom . AnnotationTypeMemberDeclaration ; import org . eclipse . jdt . core . dom . AnonymousClassDeclaration ; import org . eclipse . jdt . core . dom . ClassInstanceCreation ; import org . eclipse . jdt . core . dom . CompilationUnit ; import org . eclipse . jdt . core . dom . EnumConstantDeclaration ; import org . eclipse . jdt . core . dom . EnumDeclaration ; import org . eclipse . jdt . core . dom . IBinding ; import org . eclipse . jdt . core . dom . ImportDeclaration ; import org . eclipse . jdt . core . dom . Initializer ; import org . eclipse . jdt . core . dom . MarkerAnnotation ; import org . eclipse . jdt . core . dom . MethodDeclaration ; import org . eclipse . jdt . core . dom . NormalAnnotation ; import org . eclipse . jdt . core . dom . PackageDeclaration ; import org . eclipse . jdt . core . dom . ParameterizedType ; import org . eclipse . jdt . core . dom . SingleMemberAnnotation ; import org . eclipse . jdt . core . dom . TypeDeclaration ; import org . eclipse . jdt . core . dom . TypeParameter ; import org . eclipse . jdt . core . dom . VariableDeclarationFragment ; import org . eclipse . jdt . internal . core . SourceRefElement ; public class DOMFinder extends ASTVisitor { public ASTNode foundNode = null ; public IBinding foundBinding = null ; private CompilationUnit ast ; private SourceRefElement element ; private boolean resolveBinding ; private int rangeStart = - <NUM_LIT:1> , rangeLength = <NUM_LIT:0> ; public DOMFinder ( CompilationUnit ast , SourceRefElement element , boolean resolveBinding ) { this . ast = ast ; this . element = element ; this . resolveBinding = resolveBinding ; } protected boolean found ( ASTNode node , ASTNode name ) { if ( name . getStartPosition ( ) == this . rangeStart && name . getLength ( ) == this . rangeLength ) { this . foundNode = node ; return true ; } return false ; } public ASTNode search ( ) throws JavaModelException { ISourceRange range = null ; if ( this . element instanceof IMember && ! ( this . element instanceof IInitializer ) ) range = ( ( IMember ) this . element ) . getNameRange ( ) ; else range = this . element . getSourceRange ( ) ; this . rangeStart = range . getOffset ( ) ; this . rangeLength = range . getLength ( ) ; this . ast . accept ( this ) ; return this . foundNode ; } public boolean visit ( AnnotationTypeDeclaration node ) { if ( found ( node , node . getName ( ) ) && this . resolveBinding ) this . foundBinding = node . resolveBinding ( ) ; return true ; } public boolean visit ( AnnotationTypeMemberDeclaration node ) { if ( found ( node , node . getName ( ) ) && this . resolveBinding ) this . foundBinding = node . resolveBinding ( ) ; return true ; } public boolean visit ( AnonymousClassDeclaration node ) { ASTNode name ; ASTNode parent = node . getParent ( ) ; switch ( parent . getNodeType ( ) ) { case ASTNode . CLASS_INSTANCE_CREATION : name = ( ( ClassInstanceCreation ) parent ) . getType ( ) ; if ( name . getNodeType ( ) == ASTNode . PARAMETERIZED_TYPE ) { name = ( ( ParameterizedType ) name ) . getType ( ) ; } break ; case ASTNode . ENUM_CONSTANT_DECLARATION : name = ( ( EnumConstantDeclaration ) parent ) . getName ( ) ; break ; default : return true ; } if ( found ( node , name ) && this . resolveBinding ) this . foundBinding = node . resolveBinding ( ) ; return true ; } public boolean visit ( EnumConstantDeclaration node ) { if ( found ( node , node . getName ( ) ) && this . resolveBinding ) this . foundBinding = node . resolveVariable ( ) ; return true ; } public boolean visit ( EnumDeclaration node ) { if ( found ( node , node . getName ( ) ) && this . resolveBinding ) this . foundBinding = node . resolveBinding ( ) ; return true ; } public boolean visit ( ImportDeclaration node ) { if ( found ( node , node ) && this . resolveBinding ) this . foundBinding = node . resolveBinding ( ) ; return true ; } public boolean visit ( Initializer node ) { found ( node , node ) ; return true ; } public boolean visit ( MarkerAnnotation node ) { if ( found ( node , node ) && this . resolveBinding ) this . foundBinding = node . resolveAnnotationBinding ( ) ; return true ; } public boolean visit ( MethodDeclaration node ) { if ( found ( node , node . getName ( ) ) && this . resolveBinding ) this . foundBinding = node . resolveBinding ( ) ; return true ; } public boolean visit ( NormalAnnotation node ) { if ( found ( node , node ) && this . resolveBinding ) this . foundBinding = node . resolveAnnotationBinding ( ) ; return true ; } public boolean visit ( PackageDeclaration node ) { if ( found ( node , node ) && this . resolveBinding ) this . foundBinding = node . resolveBinding ( ) ; return true ; } public boolean visit ( SingleMemberAnnotation node ) { if ( found ( node , node ) && this . resolveBinding ) this . foundBinding = node . resolveAnnotationBinding ( ) ; return true ; } public boolean visit ( TypeDeclaration node ) { if ( found ( node , node . getName ( ) ) && this . resolveBinding ) this . foundBinding = node . resolveBinding ( ) ; return true ; } public boolean visit ( TypeParameter node ) { if ( found ( node , node . getName ( ) ) && this . resolveBinding ) this . foundBinding = node . resolveBinding ( ) ; return true ; } public boolean visit ( VariableDeclarationFragment node ) { if ( found ( node , node . getName ( ) ) && this . resolveBinding ) this . foundBinding = node . resolveBinding ( ) ; return true ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; public interface ILRUCacheable { public int getCacheFootprint ( ) ; } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jface . text . IDocument ; import org . eclipse . jface . text . IDocumentListener ; import org . eclipse . jface . text . IDocumentPartitioner ; import org . eclipse . jface . text . IDocumentPartitioningListener ; import org . eclipse . jface . text . IPositionUpdater ; import org . eclipse . jface . text . IRegion ; import org . eclipse . jface . text . ITypedRegion ; import org . eclipse . jface . text . Position ; public class SimpleDocument implements IDocument { private StringBuffer buffer ; public SimpleDocument ( String source ) { this . buffer = new StringBuffer ( source ) ; } public char getChar ( int offset ) { return <NUM_LIT:0> ; } public int getLength ( ) { return this . buffer . length ( ) ; } public String get ( ) { return this . buffer . toString ( ) ; } public String get ( int offset , int length ) { return this . buffer . substring ( offset , offset + length ) ; } public void set ( String text ) { } public void replace ( int offset , int length , String text ) { this . buffer . replace ( offset , offset + length , text ) ; } public void addDocumentListener ( IDocumentListener listener ) { } public void removeDocumentListener ( IDocumentListener listener ) { } public void addPrenotifiedDocumentListener ( IDocumentListener documentAdapter ) { } public void removePrenotifiedDocumentListener ( IDocumentListener documentAdapter ) { } public void addPositionCategory ( String category ) { } public void removePositionCategory ( String category ) { } public String [ ] getPositionCategories ( ) { return null ; } public boolean containsPositionCategory ( String category ) { return false ; } public void addPosition ( Position position ) { } public void removePosition ( Position position ) { } public void addPosition ( String category , Position position ) { } public void removePosition ( String category , Position position ) { } public Position [ ] getPositions ( String category ) { return null ; } public boolean containsPosition ( String category , int offset , int length ) { return false ; } public int computeIndexInCategory ( String category , int offset ) { return <NUM_LIT:0> ; } public void addPositionUpdater ( IPositionUpdater updater ) { } public void removePositionUpdater ( IPositionUpdater updater ) { } public void insertPositionUpdater ( IPositionUpdater updater , int index ) { } public IPositionUpdater [ ] getPositionUpdaters ( ) { return null ; } public String [ ] getLegalContentTypes ( ) { return null ; } public String getContentType ( int offset ) { return null ; } public ITypedRegion getPartition ( int offset ) { return null ; } public ITypedRegion [ ] computePartitioning ( int offset , int length ) { return null ; } public void addDocumentPartitioningListener ( IDocumentPartitioningListener listener ) { } public void removeDocumentPartitioningListener ( IDocumentPartitioningListener listener ) { } public void setDocumentPartitioner ( IDocumentPartitioner partitioner ) { } public IDocumentPartitioner getDocumentPartitioner ( ) { return null ; } public int getLineLength ( int line ) { return <NUM_LIT:0> ; } public int getLineOfOffset ( int offset ) { return <NUM_LIT:0> ; } public int getLineOffset ( int line ) { return <NUM_LIT:0> ; } public IRegion getLineInformation ( int line ) { return null ; } public IRegion getLineInformationOfOffset ( int offset ) { return null ; } public int getNumberOfLines ( ) { return <NUM_LIT:0> ; } public int getNumberOfLines ( int offset , int length ) { return <NUM_LIT:0> ; } public int computeNumberOfLines ( String text ) { return <NUM_LIT:0> ; } public String [ ] getLegalLineDelimiters ( ) { return null ; } public String getLineDelimiter ( int line ) { return null ; } public int search ( int startOffset , String findString , boolean forwardSearch , boolean caseSensitive , boolean wholeWord ) { return <NUM_LIT:0> ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import java . net . URI ; import org . eclipse . core . resources . IFile ; import org . eclipse . core . runtime . CoreException ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . batch . CompilationUnit ; public class ResourceCompilationUnit extends CompilationUnit { private IFile file ; public ResourceCompilationUnit ( IFile file , URI location ) { super ( null , location == null ? file . getFullPath ( ) . toString ( ) : location . getPath ( ) , null ) ; this . file = file ; } public char [ ] getContents ( ) { if ( this . contents != null ) return this . contents ; try { return Util . getResourceContentsAsCharArray ( this . file ) ; } catch ( CoreException e ) { return CharOperation . NO_CHAR ; } } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . util . ClassFormatException ; import org . eclipse . jdt . core . util . IConstantPool ; import org . eclipse . jdt . core . util . IConstantPoolConstant ; import org . eclipse . jdt . core . util . IConstantPoolEntry ; import org . eclipse . jdt . core . util . ILocalVariableTypeTableEntry ; public class LocalVariableTypeTableEntry extends ClassFileStruct implements ILocalVariableTypeTableEntry { private int startPC ; private int length ; private int nameIndex ; private int signatureIndex ; private char [ ] name ; private char [ ] signature ; private int index ; public LocalVariableTypeTableEntry ( byte [ ] classFileBytes , IConstantPool constantPool , int offset ) throws ClassFormatException { this . startPC = u2At ( classFileBytes , <NUM_LIT:0> , offset ) ; this . length = u2At ( classFileBytes , <NUM_LIT:2> , offset ) ; this . nameIndex = u2At ( classFileBytes , <NUM_LIT:4> , offset ) ; this . signatureIndex = u2At ( classFileBytes , <NUM_LIT:6> , offset ) ; this . index = u2At ( classFileBytes , <NUM_LIT:8> , offset ) ; IConstantPoolEntry constantPoolEntry = constantPool . decodeEntry ( this . nameIndex ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Utf8 ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } this . name = constantPoolEntry . getUtf8Value ( ) ; constantPoolEntry = constantPool . decodeEntry ( this . signatureIndex ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Utf8 ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } this . signature = constantPoolEntry . getUtf8Value ( ) ; } public int getStartPC ( ) { return this . startPC ; } public int getLength ( ) { return this . length ; } public int getNameIndex ( ) { return this . nameIndex ; } public int getSignatureIndex ( ) { return this . signatureIndex ; } public int getIndex ( ) { return this . index ; } public char [ ] getName ( ) { return this . name ; } public char [ ] getSignature ( ) { return this . signature ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import java . util . Enumeration ; public interface ICacheEnumeration extends Enumeration { public Object getValue ( ) ; } </s>
<s> package org . eclipse . jdt . internal . core . util ; public final class HashSetOfArray implements Cloneable { public Object [ ] [ ] set ; public int elementSize ; int threshold ; public HashSetOfArray ( ) { this ( <NUM_LIT> ) ; } public HashSetOfArray ( int size ) { this . elementSize = <NUM_LIT:0> ; this . threshold = size ; int extraRoom = ( int ) ( size * <NUM_LIT> ) ; if ( this . threshold == extraRoom ) extraRoom ++ ; this . set = new Object [ extraRoom ] [ ] ; } public Object clone ( ) throws CloneNotSupportedException { HashSetOfArray result = ( HashSetOfArray ) super . clone ( ) ; result . elementSize = this . elementSize ; result . threshold = this . threshold ; int length = this . set . length ; result . set = new Object [ length ] [ ] ; System . arraycopy ( this . set , <NUM_LIT:0> , result . set , <NUM_LIT:0> , length ) ; return result ; } public boolean contains ( Object [ ] array ) { int length = this . set . length ; int index = hashCode ( array ) % length ; int arrayLength = array . length ; Object [ ] currentArray ; while ( ( currentArray = this . set [ index ] ) != null ) { if ( currentArray . length == arrayLength && Util . equalArraysOrNull ( currentArray , array ) ) return true ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return false ; } private int hashCode ( Object [ ] element ) { return hashCode ( element , element . length ) ; } private int hashCode ( Object [ ] element , int length ) { int hash = <NUM_LIT:0> ; for ( int i = length - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) hash = Util . combineHashCodes ( hash , element [ i ] . hashCode ( ) ) ; return hash & <NUM_LIT> ; } public Object add ( Object [ ] array ) { int length = this . set . length ; int index = hashCode ( array ) % length ; int arrayLength = array . length ; Object [ ] currentArray ; while ( ( currentArray = this . set [ index ] ) != null ) { if ( currentArray . length == arrayLength && Util . equalArraysOrNull ( currentArray , array ) ) return this . set [ index ] = array ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } this . set [ index ] = array ; if ( ++ this . elementSize > this . threshold ) rehash ( ) ; return array ; } public Object remove ( Object [ ] array ) { int length = this . set . length ; int index = hashCode ( array ) % length ; int arrayLength = array . length ; Object [ ] currentArray ; while ( ( currentArray = this . set [ index ] ) != null ) { if ( currentArray . length == arrayLength && Util . equalArraysOrNull ( currentArray , array ) ) { Object existing = this . set [ index ] ; this . elementSize -- ; this . set [ index ] = null ; rehash ( ) ; return existing ; } if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return null ; } private void rehash ( ) { HashSetOfArray newHashSet = new HashSetOfArray ( this . elementSize * <NUM_LIT:2> ) ; Object [ ] currentArray ; for ( int i = this . set . length ; -- i >= <NUM_LIT:0> ; ) if ( ( currentArray = this . set [ i ] ) != null ) newHashSet . add ( currentArray ) ; this . set = newHashSet . set ; this . threshold = newHashSet . threshold ; } public int size ( ) { return this . elementSize ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; Object [ ] element ; for ( int i = <NUM_LIT:0> , length = this . set . length ; i < length ; i ++ ) if ( ( element = this . set [ i ] ) != null ) { buffer . append ( '<CHAR_LIT>' ) ; for ( int j = <NUM_LIT:0> , length2 = element . length ; j < length2 ; j ++ ) { buffer . append ( element [ j ] ) ; if ( j != length2 - <NUM_LIT:1> ) buffer . append ( "<STR_LIT:U+002CU+0020>" ) ; } buffer . append ( "<STR_LIT:}>" ) ; if ( i != length - <NUM_LIT:1> ) buffer . append ( '<STR_LIT:\n>' ) ; } return buffer . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . util . ClassFormatException ; import org . eclipse . jdt . core . util . IConstantPool ; import org . eclipse . jdt . core . util . IConstantPoolConstant ; import org . eclipse . jdt . core . util . IConstantPoolEntry ; import org . eclipse . jdt . core . util . IEnclosingMethodAttribute ; public class EnclosingMethodAttribute extends ClassFileAttribute implements IEnclosingMethodAttribute { private int enclosingClassIndex ; private char [ ] enclosingClassName ; private int methodDescriptorIndex ; private char [ ] methodDescriptor ; private int methodNameIndex ; private char [ ] methodName ; private int methodNameAndTypeIndex ; EnclosingMethodAttribute ( byte [ ] classFileBytes , IConstantPool constantPool , int offset ) throws ClassFormatException { super ( classFileBytes , constantPool , offset ) ; int index = u2At ( classFileBytes , <NUM_LIT:6> , offset ) ; this . enclosingClassIndex = index ; IConstantPoolEntry constantPoolEntry = constantPool . decodeEntry ( index ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Class ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } this . enclosingClassName = constantPoolEntry . getClassInfoName ( ) ; this . methodNameAndTypeIndex = u2At ( classFileBytes , <NUM_LIT:8> , offset ) ; if ( this . methodNameAndTypeIndex != <NUM_LIT:0> ) { constantPoolEntry = constantPool . decodeEntry ( this . methodNameAndTypeIndex ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_NameAndType ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } this . methodDescriptorIndex = constantPoolEntry . getNameAndTypeInfoDescriptorIndex ( ) ; this . methodNameIndex = constantPoolEntry . getNameAndTypeInfoNameIndex ( ) ; constantPoolEntry = constantPool . decodeEntry ( this . methodDescriptorIndex ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Utf8 ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } this . methodDescriptor = constantPoolEntry . getUtf8Value ( ) ; constantPoolEntry = constantPool . decodeEntry ( this . methodNameIndex ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Utf8 ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } this . methodName = constantPoolEntry . getUtf8Value ( ) ; } } public char [ ] getEnclosingClass ( ) { return this . enclosingClassName ; } public int getEnclosingClassIndex ( ) { return this . enclosingClassIndex ; } public char [ ] getMethodDescriptor ( ) { return this . methodDescriptor ; } public int getMethodDescriptorIndex ( ) { return this . methodDescriptorIndex ; } public char [ ] getMethodName ( ) { return this . methodName ; } public int getMethodNameIndex ( ) { return this . methodNameIndex ; } public int getMethodNameAndTypeIndex ( ) { return this . methodNameAndTypeIndex ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . util . ClassFormatException ; import org . eclipse . jdt . core . util . IConstantPool ; import org . eclipse . jdt . core . util . IConstantPoolConstant ; import org . eclipse . jdt . core . util . IConstantPoolEntry ; import org . eclipse . jdt . core . util . IVerificationTypeInfo ; public class VerificationInfo extends ClassFileStruct implements IVerificationTypeInfo { private int tag ; private int offset ; private int constantPoolIndex ; private char [ ] classTypeName ; private int readOffset ; public VerificationInfo ( byte [ ] classFileBytes , IConstantPool constantPool , int offset ) throws ClassFormatException { final int t = u1At ( classFileBytes , <NUM_LIT:0> , offset ) ; this . tag = t ; this . readOffset = <NUM_LIT:1> ; switch ( t ) { case IVerificationTypeInfo . ITEM_OBJECT : final int constantIndex = u2At ( classFileBytes , <NUM_LIT:1> , offset ) ; this . constantPoolIndex = constantIndex ; if ( constantIndex != <NUM_LIT:0> ) { IConstantPoolEntry constantPoolEntry = constantPool . decodeEntry ( constantIndex ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Class ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } this . classTypeName = constantPoolEntry . getClassInfoName ( ) ; } this . readOffset += <NUM_LIT:2> ; break ; case IVerificationTypeInfo . ITEM_UNINITIALIZED : this . offset = u2At ( classFileBytes , <NUM_LIT:1> , offset ) ; this . readOffset += <NUM_LIT:2> ; } } public int getTag ( ) { return this . tag ; } public int getOffset ( ) { return this . offset ; } public int getConstantPoolIndex ( ) { return this . constantPoolIndex ; } public char [ ] getClassTypeName ( ) { return this . classTypeName ; } public int sizeInBytes ( ) { return this . readOffset ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import java . io . * ; import java . net . URI ; import java . util . * ; import java . util . zip . ZipEntry ; import java . util . zip . ZipFile ; import org . eclipse . core . filesystem . EFS ; import org . eclipse . core . filesystem . IFileStore ; import org . eclipse . core . resources . * ; import org . eclipse . core . runtime . * ; import org . eclipse . core . runtime . content . IContentType ; import org . eclipse . core . runtime . preferences . IScopeContext ; import org . eclipse . core . runtime . preferences . InstanceScope ; import org . eclipse . jdt . core . * ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . core . dom . ASTNode ; import org . eclipse . jdt . core . dom . ArrayType ; import org . eclipse . jdt . core . dom . ParameterizedType ; import org . eclipse . jdt . core . dom . PrimitiveType ; import org . eclipse . jdt . core . dom . QualifiedType ; import org . eclipse . jdt . core . dom . SimpleType ; import org . eclipse . jdt . core . dom . Type ; import org . eclipse . jdt . core . dom . WildcardType ; import org . eclipse . jdt . core . util . IClassFileAttribute ; import org . eclipse . jdt . core . util . IClassFileReader ; import org . eclipse . jdt . core . util . ICodeAttribute ; import org . eclipse . jdt . core . util . IFieldInfo ; import org . eclipse . jdt . core . util . IMethodInfo ; import org . eclipse . jdt . internal . compiler . ast . AbstractMethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . AnnotationMethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . Argument ; import org . eclipse . jdt . internal . compiler . ast . UnionTypeReference ; import org . eclipse . jdt . internal . compiler . ast . MethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . TypeReference ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileReader ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFormatException ; import org . eclipse . jdt . internal . compiler . env . ClassSignature ; import org . eclipse . jdt . internal . compiler . env . EnumConstantSignature ; import org . eclipse . jdt . internal . compiler . env . IBinaryAnnotation ; import org . eclipse . jdt . internal . compiler . env . IDependent ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . Binding ; import org . eclipse . jdt . internal . compiler . lookup . FieldBinding ; import org . eclipse . jdt . internal . compiler . lookup . MethodBinding ; import org . eclipse . jdt . internal . compiler . lookup . ReferenceBinding ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; import org . eclipse . jdt . internal . compiler . parser . ScannerHelper ; import org . eclipse . jdt . internal . compiler . util . SuffixConstants ; import org . eclipse . jdt . internal . core . Annotation ; import org . eclipse . jdt . internal . core . ClassFile ; import org . eclipse . jdt . internal . core . JavaElement ; import org . eclipse . jdt . internal . core . JavaModelManager ; import org . eclipse . jdt . internal . core . Member ; import org . eclipse . jdt . internal . core . MemberValuePair ; import org . eclipse . jdt . internal . core . PackageFragment ; import org . eclipse . jdt . internal . core . PackageFragmentRoot ; import org . eclipse . jface . text . BadLocationException ; import org . eclipse . text . edits . MalformedTreeException ; import org . eclipse . text . edits . TextEdit ; public class Util { public interface Comparable { int compareTo ( Comparable c ) ; } public interface Comparer { int compare ( Object a , Object b ) ; } public static interface BindingsToNodesMap { public org . eclipse . jdt . internal . compiler . ast . ASTNode get ( Binding binding ) ; } private static final char ARGUMENTS_DELIMITER = '<CHAR_LIT>' ; private static final String EMPTY_ARGUMENT = "<STR_LIT>" ; private static char [ ] [ ] JAVA_LIKE_EXTENSIONS ; private static final char [ ] BOOLEAN = "<STR_LIT:boolean>" . toCharArray ( ) ; private static final char [ ] BYTE = "<STR_LIT>" . toCharArray ( ) ; private static final char [ ] CHAR = "<STR_LIT>" . toCharArray ( ) ; private static final char [ ] DOUBLE = "<STR_LIT:double>" . toCharArray ( ) ; private static final char [ ] FLOAT = "<STR_LIT:float>" . toCharArray ( ) ; private static final char [ ] INT = "<STR_LIT:int>" . toCharArray ( ) ; private static final char [ ] LONG = "<STR_LIT:long>" . toCharArray ( ) ; private static final char [ ] SHORT = "<STR_LIT>" . toCharArray ( ) ; private static final char [ ] VOID = "<STR_LIT>" . toCharArray ( ) ; private static final char [ ] INIT = "<STR_LIT>" . toCharArray ( ) ; private static final String TASK_PRIORITIES_PROBLEM = "<STR_LIT>" ; private static List fgRepeatedMessages = new ArrayList ( <NUM_LIT:5> ) ; private Util ( ) { } public static final String [ ] arrayConcat ( String [ ] first , String second ) { if ( second == null ) return first ; if ( first == null ) return new String [ ] { second } ; int length = first . length ; if ( first . length == <NUM_LIT:0> ) { return new String [ ] { second } ; } String [ ] result = new String [ length + <NUM_LIT:1> ] ; System . arraycopy ( first , <NUM_LIT:0> , result , <NUM_LIT:0> , length ) ; result [ length ] = second ; return result ; } private static int checkTypeSignature ( String sig , int start , int end , boolean allowVoid ) { if ( start >= end ) return - <NUM_LIT:1> ; int i = start ; char c = sig . charAt ( i ++ ) ; int nestingDepth = <NUM_LIT:0> ; while ( c == '<CHAR_LIT:[>' ) { ++ nestingDepth ; if ( i >= end ) return - <NUM_LIT:1> ; c = sig . charAt ( i ++ ) ; } switch ( c ) { case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT:Z>' : break ; case '<CHAR_LIT>' : if ( ! allowVoid ) return - <NUM_LIT:1> ; if ( nestingDepth != <NUM_LIT:0> ) return - <NUM_LIT:1> ; break ; case '<CHAR_LIT>' : int semicolon = sig . indexOf ( '<CHAR_LIT:;>' , i ) ; if ( semicolon <= i || semicolon >= end ) return - <NUM_LIT:1> ; i = semicolon + <NUM_LIT:1> ; break ; default : return - <NUM_LIT:1> ; } return i ; } public static int combineHashCodes ( int hashCode1 , int hashCode2 ) { return hashCode1 * <NUM_LIT> + hashCode2 ; } public static int compare ( byte [ ] a , byte [ ] b ) { if ( a == b ) return <NUM_LIT:0> ; if ( a == null ) return - <NUM_LIT:1> ; if ( b == null ) return <NUM_LIT:1> ; int len = Math . min ( a . length , b . length ) ; for ( int i = <NUM_LIT:0> ; i < len ; ++ i ) { int diff = a [ i ] - b [ i ] ; if ( diff != <NUM_LIT:0> ) return diff ; } if ( a . length > len ) return <NUM_LIT:1> ; if ( b . length > len ) return - <NUM_LIT:1> ; return <NUM_LIT:0> ; } public static int compare ( char [ ] str1 , char [ ] str2 ) { int len1 = str1 . length ; int len2 = str2 . length ; int n = Math . min ( len1 , len2 ) ; int i = <NUM_LIT:0> ; while ( n -- != <NUM_LIT:0> ) { char c1 = str1 [ i ] ; char c2 = str2 [ i ++ ] ; if ( c1 != c2 ) { return c1 - c2 ; } } return len1 - len2 ; } public static char [ ] concatCompoundNameToCharArray ( String [ ] compoundName ) { if ( compoundName == null ) return null ; int length = compoundName . length ; if ( length == <NUM_LIT:0> ) return new char [ <NUM_LIT:0> ] ; int size = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { size += compoundName [ i ] . length ( ) ; } char [ ] compoundChars = new char [ size + length - <NUM_LIT:1> ] ; int pos = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { String name = compoundName [ i ] ; if ( i > <NUM_LIT:0> ) compoundChars [ pos ++ ] = '<CHAR_LIT:.>' ; int nameLength = name . length ( ) ; name . getChars ( <NUM_LIT:0> , nameLength , compoundChars , pos ) ; pos += nameLength ; } return compoundChars ; } public static String concatenateName ( String name1 , String name2 , char separator ) { StringBuffer buf = new StringBuffer ( ) ; if ( name1 != null && name1 . length ( ) > <NUM_LIT:0> ) { buf . append ( name1 ) ; } if ( name2 != null && name2 . length ( ) > <NUM_LIT:0> ) { if ( buf . length ( ) > <NUM_LIT:0> ) { buf . append ( separator ) ; } buf . append ( name2 ) ; } return buf . toString ( ) ; } public static final String concatWith ( String [ ] array , char separator ) { StringBuffer buffer = new StringBuffer ( ) ; for ( int i = <NUM_LIT:0> , length = array . length ; i < length ; i ++ ) { buffer . append ( array [ i ] ) ; if ( i < length - <NUM_LIT:1> ) buffer . append ( separator ) ; } return buffer . toString ( ) ; } public static final String concatWith ( String [ ] array , String name , char separator ) { if ( array == null || array . length == <NUM_LIT:0> ) return name ; if ( name == null || name . length ( ) == <NUM_LIT:0> ) return concatWith ( array , separator ) ; StringBuffer buffer = new StringBuffer ( ) ; for ( int i = <NUM_LIT:0> , length = array . length ; i < length ; i ++ ) { buffer . append ( array [ i ] ) ; buffer . append ( separator ) ; } buffer . append ( name ) ; return buffer . toString ( ) ; } public static String convertTypeSignature ( char [ ] sig , int start , int length ) { return new String ( sig , start , length ) . replace ( '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ; } public static String defaultJavaExtension ( ) { return SuffixConstants . SUFFIX_STRING_java ; } public final static String editedString ( String original , TextEdit edit ) { if ( edit == null ) { return original ; } SimpleDocument document = new SimpleDocument ( original ) ; try { edit . apply ( document , TextEdit . NONE ) ; return document . get ( ) ; } catch ( MalformedTreeException e ) { e . printStackTrace ( ) ; } catch ( BadLocationException e ) { e . printStackTrace ( ) ; } return original ; } public final static boolean endsWithIgnoreCase ( String str , String end ) { int strLength = str == null ? <NUM_LIT:0> : str . length ( ) ; int endLength = end == null ? <NUM_LIT:0> : end . length ( ) ; if ( endLength > strLength ) return false ; for ( int i = <NUM_LIT:1> ; i <= endLength ; i ++ ) { if ( ScannerHelper . toLowerCase ( end . charAt ( endLength - i ) ) != ScannerHelper . toLowerCase ( str . charAt ( strLength - i ) ) ) return false ; } return true ; } public static boolean equalArrays ( Object [ ] a , Object [ ] b , int len ) { if ( a == b ) return true ; if ( a . length < len || b . length < len ) return false ; for ( int i = <NUM_LIT:0> ; i < len ; ++ i ) { if ( a [ i ] == null ) { if ( b [ i ] != null ) return false ; } else { if ( ! a [ i ] . equals ( b [ i ] ) ) return false ; } } return true ; } public static boolean equalArraysOrNull ( int [ ] a , int [ ] b ) { if ( a == b ) return true ; if ( a == null || b == null ) return false ; int len = a . length ; if ( len != b . length ) return false ; for ( int i = <NUM_LIT:0> ; i < len ; ++ i ) { if ( a [ i ] != b [ i ] ) return false ; } return true ; } public static boolean equalArraysOrNull ( Object [ ] a , Object [ ] b ) { if ( a == b ) return true ; if ( a == null || b == null ) return false ; int len = a . length ; if ( len != b . length ) return false ; for ( int i = len - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) { if ( a [ i ] == null ) { if ( b [ i ] != null ) return false ; } else { if ( ! a [ i ] . equals ( b [ i ] ) ) return false ; } } return true ; } public static boolean equalArraysOrNullSortFirst ( Comparable [ ] a , Comparable [ ] b ) { if ( a == b ) return true ; if ( a == null || b == null ) return false ; int len = a . length ; if ( len != b . length ) return false ; if ( len >= <NUM_LIT:2> ) { a = sortCopy ( a ) ; b = sortCopy ( b ) ; } for ( int i = <NUM_LIT:0> ; i < len ; ++ i ) { if ( ! a [ i ] . equals ( b [ i ] ) ) return false ; } return true ; } public static boolean equalArraysOrNullSortFirst ( String [ ] a , String [ ] b ) { if ( a == b ) return true ; if ( a == null || b == null ) return false ; int len = a . length ; if ( len != b . length ) return false ; if ( len >= <NUM_LIT:2> ) { a = sortCopy ( a ) ; b = sortCopy ( b ) ; } for ( int i = <NUM_LIT:0> ; i < len ; ++ i ) { if ( ! a [ i ] . equals ( b [ i ] ) ) return false ; } return true ; } public static boolean equalOrNull ( Object a , Object b ) { if ( a == b ) { return true ; } if ( a == null || b == null ) { return false ; } return a . equals ( b ) ; } public static boolean equalsIgnoreJavaLikeExtension ( String fileName , String string ) { int fileNameLength = fileName . length ( ) ; int stringLength = string . length ( ) ; if ( fileNameLength < stringLength ) return false ; for ( int i = <NUM_LIT:0> ; i < stringLength ; i ++ ) { if ( fileName . charAt ( i ) != string . charAt ( i ) ) { return false ; } } char [ ] [ ] javaLikeExtensions = getJavaLikeExtensions ( ) ; suffixes : for ( int i = <NUM_LIT:0> , length = javaLikeExtensions . length ; i < length ; i ++ ) { char [ ] suffix = javaLikeExtensions [ i ] ; int extensionStart = stringLength + <NUM_LIT:1> ; if ( extensionStart + suffix . length != fileNameLength ) continue ; if ( fileName . charAt ( stringLength ) != '<CHAR_LIT:.>' ) continue ; for ( int j = extensionStart ; j < fileNameLength ; j ++ ) { if ( fileName . charAt ( j ) != suffix [ j - extensionStart ] ) continue suffixes ; } return true ; } return false ; } public static String extractLastName ( String qualifiedName ) { int i = qualifiedName . lastIndexOf ( '<CHAR_LIT:.>' ) ; if ( i == - <NUM_LIT:1> ) return qualifiedName ; return qualifiedName . substring ( i + <NUM_LIT:1> ) ; } public static String [ ] extractParameterTypes ( char [ ] sig ) { int count = getParameterCount ( sig ) ; String [ ] result = new String [ count ] ; if ( count == <NUM_LIT:0> ) return result ; int i = CharOperation . indexOf ( '<CHAR_LIT:(>' , sig ) + <NUM_LIT:1> ; count = <NUM_LIT:0> ; int len = sig . length ; int start = i ; for ( ; ; ) { if ( i == len ) break ; char c = sig [ i ] ; if ( c == '<CHAR_LIT:)>' ) break ; if ( c == '<CHAR_LIT:[>' ) { ++ i ; } else if ( c == '<CHAR_LIT>' ) { i = CharOperation . indexOf ( '<CHAR_LIT:;>' , sig , i + <NUM_LIT:1> ) + <NUM_LIT:1> ; Assert . isTrue ( i != <NUM_LIT:0> ) ; result [ count ++ ] = convertTypeSignature ( sig , start , i - start ) ; start = i ; } else { ++ i ; result [ count ++ ] = convertTypeSignature ( sig , start , i - start ) ; start = i ; } } return result ; } public static String extractReturnType ( String sig ) { int i = sig . lastIndexOf ( '<CHAR_LIT:)>' ) ; Assert . isTrue ( i != - <NUM_LIT:1> ) ; return sig . substring ( i + <NUM_LIT:1> ) ; } private static IFile findFirstClassFile ( IFolder folder ) { try { IResource [ ] members = folder . members ( ) ; for ( int i = <NUM_LIT:0> , max = members . length ; i < max ; i ++ ) { IResource member = members [ i ] ; if ( member . getType ( ) == IResource . FOLDER ) { return findFirstClassFile ( ( IFolder ) member ) ; } else if ( org . eclipse . jdt . internal . compiler . util . Util . isClassFileName ( member . getName ( ) ) ) { return ( IFile ) member ; } } } catch ( CoreException e ) { } return null ; } public static String findLineSeparator ( char [ ] text ) { int length = text . length ; if ( length > <NUM_LIT:0> ) { char nextChar = text [ <NUM_LIT:0> ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { char currentChar = nextChar ; nextChar = i < length - <NUM_LIT:1> ? text [ i + <NUM_LIT:1> ] : '<CHAR_LIT:U+0020>' ; switch ( currentChar ) { case '<STR_LIT:\n>' : return "<STR_LIT:n>" ; case '<STR_LIT>' : return nextChar == '<STR_LIT:\n>' ? "<STR_LIT>" : "<STR_LIT:r>" ; } } } return null ; } public static IClassFileAttribute getAttribute ( IClassFileReader classFileReader , char [ ] attributeName ) { IClassFileAttribute [ ] attributes = classFileReader . getAttributes ( ) ; for ( int i = <NUM_LIT:0> , max = attributes . length ; i < max ; i ++ ) { if ( CharOperation . equals ( attributes [ i ] . getAttributeName ( ) , attributeName ) ) { return attributes [ i ] ; } } return null ; } public static IClassFileAttribute getAttribute ( ICodeAttribute codeAttribute , char [ ] attributeName ) { IClassFileAttribute [ ] attributes = codeAttribute . getAttributes ( ) ; for ( int i = <NUM_LIT:0> , max = attributes . length ; i < max ; i ++ ) { if ( CharOperation . equals ( attributes [ i ] . getAttributeName ( ) , attributeName ) ) { return attributes [ i ] ; } } return null ; } public static IClassFileAttribute getAttribute ( IFieldInfo fieldInfo , char [ ] attributeName ) { IClassFileAttribute [ ] attributes = fieldInfo . getAttributes ( ) ; for ( int i = <NUM_LIT:0> , max = attributes . length ; i < max ; i ++ ) { if ( CharOperation . equals ( attributes [ i ] . getAttributeName ( ) , attributeName ) ) { return attributes [ i ] ; } } return null ; } public static IClassFileAttribute getAttribute ( IMethodInfo methodInfo , char [ ] attributeName ) { IClassFileAttribute [ ] attributes = methodInfo . getAttributes ( ) ; for ( int i = <NUM_LIT:0> , max = attributes . length ; i < max ; i ++ ) { if ( CharOperation . equals ( attributes [ i ] . getAttributeName ( ) , attributeName ) ) { return attributes [ i ] ; } } return null ; } private static IClassFile getClassFile ( char [ ] fileName ) { int jarSeparator = CharOperation . indexOf ( IDependent . JAR_FILE_ENTRY_SEPARATOR , fileName ) ; int pkgEnd = CharOperation . lastIndexOf ( '<CHAR_LIT:/>' , fileName ) ; if ( pkgEnd == - <NUM_LIT:1> ) pkgEnd = CharOperation . lastIndexOf ( File . separatorChar , fileName ) ; if ( jarSeparator != - <NUM_LIT:1> && pkgEnd < jarSeparator ) pkgEnd = jarSeparator ; if ( pkgEnd == - <NUM_LIT:1> ) return null ; IPackageFragment pkg = getPackageFragment ( fileName , pkgEnd , jarSeparator ) ; if ( pkg == null ) return null ; int start ; return pkg . getClassFile ( new String ( fileName , start = pkgEnd + <NUM_LIT:1> , fileName . length - start ) ) ; } private static ICompilationUnit getCompilationUnit ( char [ ] fileName , WorkingCopyOwner workingCopyOwner ) { char [ ] slashSeparatedFileName = CharOperation . replaceOnCopy ( fileName , File . separatorChar , '<CHAR_LIT:/>' ) ; int pkgEnd = CharOperation . lastIndexOf ( '<CHAR_LIT:/>' , slashSeparatedFileName ) ; if ( pkgEnd == - <NUM_LIT:1> ) return null ; IPackageFragment pkg = getPackageFragment ( slashSeparatedFileName , pkgEnd , - <NUM_LIT:1> ) ; if ( pkg == null ) return null ; int start ; ICompilationUnit cu = pkg . getCompilationUnit ( new String ( slashSeparatedFileName , start = pkgEnd + <NUM_LIT:1> , slashSeparatedFileName . length - start ) ) ; if ( workingCopyOwner != null ) { ICompilationUnit workingCopy = cu . findWorkingCopy ( workingCopyOwner ) ; if ( workingCopy != null ) return workingCopy ; } return cu ; } public static char [ ] [ ] getJavaLikeExtensions ( ) { if ( JAVA_LIKE_EXTENSIONS == null ) { IContentType javaContentType = Platform . getContentTypeManager ( ) . getContentType ( JavaCore . JAVA_SOURCE_CONTENT_TYPE ) ; HashSet fileExtensions = new HashSet ( ) ; IContentType [ ] contentTypes = Platform . getContentTypeManager ( ) . getAllContentTypes ( ) ; for ( int i = <NUM_LIT:0> , length = contentTypes . length ; i < length ; i ++ ) { if ( contentTypes [ i ] . isKindOf ( javaContentType ) ) { String [ ] fileExtension = contentTypes [ i ] . getFileSpecs ( IContentType . FILE_EXTENSION_SPEC ) ; for ( int j = <NUM_LIT:0> , length2 = fileExtension . length ; j < length2 ; j ++ ) { fileExtensions . add ( fileExtension [ j ] ) ; } } } int length = fileExtensions . size ( ) ; char [ ] [ ] extensions = new char [ length ] [ ] ; extensions [ <NUM_LIT:0> ] = SuffixConstants . EXTENSION_java . toCharArray ( ) ; int index = <NUM_LIT:1> ; Iterator iterator = fileExtensions . iterator ( ) ; while ( iterator . hasNext ( ) ) { String fileExtension = ( String ) iterator . next ( ) ; if ( SuffixConstants . EXTENSION_java . equals ( fileExtension ) ) continue ; extensions [ index ++ ] = fileExtension . toCharArray ( ) ; } JAVA_LIKE_EXTENSIONS = extensions ; } return JAVA_LIKE_EXTENSIONS ; } public static long getJdkLevel ( Object targetLibrary ) { try { ClassFileReader reader = null ; if ( targetLibrary instanceof IFolder ) { IFile classFile = findFirstClassFile ( ( IFolder ) targetLibrary ) ; if ( classFile != null ) reader = Util . newClassFileReader ( classFile ) ; } else { ZipFile jar = null ; try { IPath path = null ; if ( targetLibrary instanceof IResource ) { path = ( ( IResource ) targetLibrary ) . getFullPath ( ) ; } else if ( targetLibrary instanceof File ) { File f = ( File ) targetLibrary ; if ( ! f . isDirectory ( ) ) { path = new Path ( ( ( File ) targetLibrary ) . getPath ( ) ) ; } } if ( path != null ) { jar = JavaModelManager . getJavaModelManager ( ) . getZipFile ( path ) ; for ( Enumeration e = jar . entries ( ) ; e . hasMoreElements ( ) ; ) { ZipEntry member = ( ZipEntry ) e . nextElement ( ) ; String entryName = member . getName ( ) ; if ( org . eclipse . jdt . internal . compiler . util . Util . isClassFileName ( entryName ) ) { reader = ClassFileReader . read ( jar , entryName ) ; break ; } } } } catch ( CoreException e ) { } finally { JavaModelManager . getJavaModelManager ( ) . closeZipFile ( jar ) ; } } if ( reader != null ) { return reader . getVersion ( ) ; } } catch ( CoreException e ) { } catch ( ClassFormatException e ) { } catch ( IOException e ) { } return <NUM_LIT:0> ; } public static String getNameWithoutJavaLikeExtension ( String fileName ) { int index = indexOfJavaLikeExtension ( fileName ) ; if ( index == - <NUM_LIT:1> ) return fileName ; return fileName . substring ( <NUM_LIT:0> , index ) ; } public static String getLineSeparator ( String text , IJavaProject project ) { String lineSeparator = null ; if ( text != null && text . length ( ) != <NUM_LIT:0> ) { lineSeparator = findLineSeparator ( text . toCharArray ( ) ) ; if ( lineSeparator != null ) return lineSeparator ; } if ( Platform . isRunning ( ) ) { IScopeContext [ ] scopeContext ; if ( project != null ) { scopeContext = new IScopeContext [ ] { new ProjectScope ( project . getProject ( ) ) } ; lineSeparator = Platform . getPreferencesService ( ) . getString ( Platform . PI_RUNTIME , Platform . PREF_LINE_SEPARATOR , null , scopeContext ) ; if ( lineSeparator != null ) return lineSeparator ; } scopeContext = new IScopeContext [ ] { InstanceScope . INSTANCE } ; lineSeparator = Platform . getPreferencesService ( ) . getString ( Platform . PI_RUNTIME , Platform . PREF_LINE_SEPARATOR , null , scopeContext ) ; if ( lineSeparator != null ) return lineSeparator ; } return org . eclipse . jdt . internal . compiler . util . Util . LINE_SEPARATOR ; } private static String getLineSeparator ( char [ ] text , char [ ] buffer ) { String lineSeparator = findLineSeparator ( buffer ) ; if ( lineSeparator == null ) { lineSeparator = findLineSeparator ( text ) ; if ( lineSeparator == null ) { return getLineSeparator ( ( String ) null , ( IJavaProject ) null ) ; } } return lineSeparator ; } private static IPackageFragment getPackageFragment ( char [ ] fileName , int pkgEnd , int jarSeparator ) { if ( jarSeparator != - <NUM_LIT:1> ) { String jarMemento = new String ( fileName , <NUM_LIT:0> , jarSeparator ) ; PackageFragmentRoot root = ( PackageFragmentRoot ) JavaCore . create ( jarMemento ) ; if ( pkgEnd == jarSeparator ) return root . getPackageFragment ( CharOperation . NO_STRINGS ) ; char [ ] pkgName = CharOperation . subarray ( fileName , jarSeparator + <NUM_LIT:1> , pkgEnd ) ; char [ ] [ ] compoundName = CharOperation . splitOn ( '<CHAR_LIT:/>' , pkgName ) ; return root . getPackageFragment ( CharOperation . toStrings ( compoundName ) ) ; } else { Path path = new Path ( new String ( fileName , <NUM_LIT:0> , pkgEnd ) ) ; IWorkspaceRoot workspaceRoot = ResourcesPlugin . getWorkspace ( ) . getRoot ( ) ; IContainer folder = path . segmentCount ( ) == <NUM_LIT:1> ? workspaceRoot . getProject ( path . lastSegment ( ) ) : ( IContainer ) workspaceRoot . getFolder ( path ) ; IJavaElement element = JavaCore . create ( folder ) ; if ( element == null ) return null ; switch ( element . getElementType ( ) ) { case IJavaElement . PACKAGE_FRAGMENT : return ( IPackageFragment ) element ; case IJavaElement . PACKAGE_FRAGMENT_ROOT : return ( ( PackageFragmentRoot ) element ) . getPackageFragment ( CharOperation . NO_STRINGS ) ; case IJavaElement . JAVA_PROJECT : PackageFragmentRoot root = ( PackageFragmentRoot ) ( ( IJavaProject ) element ) . getPackageFragmentRoot ( folder ) ; if ( root == null ) return null ; return root . getPackageFragment ( CharOperation . NO_STRINGS ) ; } return null ; } } public static int getParameterCount ( char [ ] sig ) { int i = CharOperation . indexOf ( '<CHAR_LIT:(>' , sig ) + <NUM_LIT:1> ; Assert . isTrue ( i != <NUM_LIT:0> ) ; int count = <NUM_LIT:0> ; int len = sig . length ; for ( ; ; ) { if ( i == len ) break ; char c = sig [ i ] ; if ( c == '<CHAR_LIT:)>' ) break ; if ( c == '<CHAR_LIT:[>' ) { ++ i ; } else if ( c == '<CHAR_LIT>' ) { ++ count ; i = CharOperation . indexOf ( '<CHAR_LIT:;>' , sig , i + <NUM_LIT:1> ) + <NUM_LIT:1> ; Assert . isTrue ( i != <NUM_LIT:0> ) ; } else { ++ count ; ++ i ; } } return count ; } public static String getProblemArgumentsForMarker ( String [ ] arguments ) { StringBuffer args = new StringBuffer ( <NUM_LIT:10> ) ; args . append ( arguments . length ) ; args . append ( '<CHAR_LIT::>' ) ; for ( int j = <NUM_LIT:0> ; j < arguments . length ; j ++ ) { if ( j != <NUM_LIT:0> ) args . append ( ARGUMENTS_DELIMITER ) ; if ( arguments [ j ] . length ( ) == <NUM_LIT:0> ) { args . append ( EMPTY_ARGUMENT ) ; } else { encodeArgument ( arguments [ j ] , args ) ; } } return args . toString ( ) ; } private static void encodeArgument ( String argument , StringBuffer buffer ) { for ( int i = <NUM_LIT:0> , max = argument . length ( ) ; i < max ; i ++ ) { char charAt = argument . charAt ( i ) ; switch ( charAt ) { case ARGUMENTS_DELIMITER : buffer . append ( ARGUMENTS_DELIMITER ) . append ( ARGUMENTS_DELIMITER ) ; break ; default : buffer . append ( charAt ) ; } } } public static String [ ] getProblemArgumentsFromMarker ( String argumentsString ) { if ( argumentsString == null ) { return null ; } int index = argumentsString . indexOf ( '<CHAR_LIT::>' ) ; if ( index == - <NUM_LIT:1> ) return null ; int length = argumentsString . length ( ) ; int numberOfArg = <NUM_LIT:0> ; try { numberOfArg = Integer . parseInt ( argumentsString . substring ( <NUM_LIT:0> , index ) ) ; } catch ( NumberFormatException e ) { return null ; } argumentsString = argumentsString . substring ( index + <NUM_LIT:1> , length ) ; return decodeArgumentString ( numberOfArg , argumentsString ) ; } private static String [ ] decodeArgumentString ( int length , String argumentsString ) { if ( length == <NUM_LIT:0> ) { if ( argumentsString . length ( ) != <NUM_LIT:0> ) { return null ; } return CharOperation . NO_STRINGS ; } String [ ] result = new String [ length ] ; int count = <NUM_LIT:0> ; StringBuffer buffer = new StringBuffer ( ) ; for ( int i = <NUM_LIT:0> , max = argumentsString . length ( ) ; i < max ; i ++ ) { char current = argumentsString . charAt ( i ) ; switch ( current ) { case ARGUMENTS_DELIMITER : if ( ( i + <NUM_LIT:1> ) == max ) { return null ; } char next = argumentsString . charAt ( i + <NUM_LIT:1> ) ; if ( next == ARGUMENTS_DELIMITER ) { buffer . append ( ARGUMENTS_DELIMITER ) ; i ++ ; } else { String currentArgumentContents = String . valueOf ( buffer ) ; if ( EMPTY_ARGUMENT . equals ( currentArgumentContents ) ) { currentArgumentContents = org . eclipse . jdt . internal . compiler . util . Util . EMPTY_STRING ; } result [ count ++ ] = currentArgumentContents ; if ( count > length ) { return null ; } buffer . delete ( <NUM_LIT:0> , buffer . length ( ) ) ; } break ; default : buffer . append ( current ) ; } } String currentArgumentContents = String . valueOf ( buffer ) ; if ( EMPTY_ARGUMENT . equals ( currentArgumentContents ) ) { currentArgumentContents = org . eclipse . jdt . internal . compiler . util . Util . EMPTY_STRING ; } result [ count ++ ] = currentArgumentContents ; if ( count > length ) { return null ; } buffer . delete ( <NUM_LIT:0> , buffer . length ( ) ) ; return result ; } public static byte [ ] getResourceContentsAsByteArray ( IFile file ) throws JavaModelException { InputStream stream = null ; try { stream = file . getContents ( true ) ; } catch ( CoreException e ) { throw new JavaModelException ( e ) ; } try { return org . eclipse . jdt . internal . compiler . util . Util . getInputStreamAsByteArray ( stream , - <NUM_LIT:1> ) ; } catch ( IOException e ) { throw new JavaModelException ( e , IJavaModelStatusConstants . IO_EXCEPTION ) ; } finally { try { stream . close ( ) ; } catch ( IOException e ) { } } } public static char [ ] getResourceContentsAsCharArray ( IFile file ) throws JavaModelException { String encoding ; try { encoding = file . getCharset ( ) ; } catch ( CoreException ce ) { encoding = null ; } return getResourceContentsAsCharArray ( file , encoding ) ; } public static char [ ] getResourceContentsAsCharArray ( IFile file , String encoding ) throws JavaModelException { IPath location = file . getLocation ( ) ; long length ; if ( location == null ) { try { URI locationURI = file . getLocationURI ( ) ; if ( locationURI == null ) throw new CoreException ( new Status ( IStatus . ERROR , JavaCore . PLUGIN_ID , Messages . bind ( Messages . file_notFound , file . getFullPath ( ) . toString ( ) ) ) ) ; length = EFS . getStore ( locationURI ) . fetchInfo ( ) . getLength ( ) ; } catch ( CoreException e ) { throw new JavaModelException ( e , IJavaModelStatusConstants . ELEMENT_DOES_NOT_EXIST ) ; } } else { length = location . toFile ( ) . length ( ) ; } InputStream stream = null ; try { stream = file . getContents ( true ) ; } catch ( CoreException e ) { throw new JavaModelException ( e , IJavaModelStatusConstants . ELEMENT_DOES_NOT_EXIST ) ; } try { return org . eclipse . jdt . internal . compiler . util . Util . getInputStreamAsCharArray ( stream , ( int ) length , encoding ) ; } catch ( IOException e ) { throw new JavaModelException ( e , IJavaModelStatusConstants . IO_EXCEPTION ) ; } finally { try { stream . close ( ) ; } catch ( IOException e ) { } } } public static String getSignature ( Type type ) { StringBuffer buffer = new StringBuffer ( ) ; getFullyQualifiedName ( type , buffer ) ; return Signature . createTypeSignature ( buffer . toString ( ) , false ) ; } public static String getSourceAttachmentProperty ( IPath path ) throws JavaModelException { Map rootPathToAttachments = JavaModelManager . getJavaModelManager ( ) . rootPathToAttachments ; String property = ( String ) rootPathToAttachments . get ( path ) ; if ( property == null ) { try { property = ResourcesPlugin . getWorkspace ( ) . getRoot ( ) . getPersistentProperty ( getSourceAttachmentPropertyName ( path ) ) ; if ( property == null ) { rootPathToAttachments . put ( path , PackageFragmentRoot . NO_SOURCE_ATTACHMENT ) ; return null ; } rootPathToAttachments . put ( path , property ) ; return property ; } catch ( CoreException e ) { throw new JavaModelException ( e ) ; } } else if ( property . equals ( PackageFragmentRoot . NO_SOURCE_ATTACHMENT ) ) { return null ; } else return property ; } private static QualifiedName getSourceAttachmentPropertyName ( IPath path ) { return new QualifiedName ( JavaCore . PLUGIN_ID , "<STR_LIT>" + path . toOSString ( ) ) ; } public static void setSourceAttachmentProperty ( IPath path , String property ) { if ( property == null ) { JavaModelManager . getJavaModelManager ( ) . rootPathToAttachments . put ( path , PackageFragmentRoot . NO_SOURCE_ATTACHMENT ) ; } else { JavaModelManager . getJavaModelManager ( ) . rootPathToAttachments . put ( path , property ) ; } try { ResourcesPlugin . getWorkspace ( ) . getRoot ( ) . setPersistentProperty ( getSourceAttachmentPropertyName ( path ) , property ) ; } catch ( CoreException e ) { e . printStackTrace ( ) ; } } public static String getDeclaringTypeSignature ( String key ) { KeyToSignature keyToSignature = new KeyToSignature ( key , KeyToSignature . DECLARING_TYPE ) ; keyToSignature . parse ( ) ; return keyToSignature . signature . toString ( ) ; } private static void getFullyQualifiedName ( Type type , StringBuffer buffer ) { switch ( type . getNodeType ( ) ) { case ASTNode . ARRAY_TYPE : ArrayType arrayType = ( ArrayType ) type ; getFullyQualifiedName ( arrayType . getElementType ( ) , buffer ) ; for ( int i = <NUM_LIT:0> , length = arrayType . getDimensions ( ) ; i < length ; i ++ ) { buffer . append ( '<CHAR_LIT:[>' ) ; buffer . append ( '<CHAR_LIT:]>' ) ; } break ; case ASTNode . PARAMETERIZED_TYPE : ParameterizedType parameterizedType = ( ParameterizedType ) type ; getFullyQualifiedName ( parameterizedType . getType ( ) , buffer ) ; buffer . append ( '<CHAR_LIT>' ) ; Iterator iterator = parameterizedType . typeArguments ( ) . iterator ( ) ; boolean isFirst = true ; while ( iterator . hasNext ( ) ) { if ( ! isFirst ) buffer . append ( '<CHAR_LIT:U+002C>' ) ; else isFirst = false ; Type typeArgument = ( Type ) iterator . next ( ) ; getFullyQualifiedName ( typeArgument , buffer ) ; } buffer . append ( '<CHAR_LIT:>>' ) ; break ; case ASTNode . PRIMITIVE_TYPE : buffer . append ( ( ( PrimitiveType ) type ) . getPrimitiveTypeCode ( ) . toString ( ) ) ; break ; case ASTNode . QUALIFIED_TYPE : buffer . append ( ( ( QualifiedType ) type ) . getName ( ) . getFullyQualifiedName ( ) ) ; break ; case ASTNode . SIMPLE_TYPE : buffer . append ( ( ( SimpleType ) type ) . getName ( ) . getFullyQualifiedName ( ) ) ; break ; case ASTNode . WILDCARD_TYPE : buffer . append ( '<CHAR_LIT>' ) ; WildcardType wildcardType = ( WildcardType ) type ; Type bound = wildcardType . getBound ( ) ; if ( bound == null ) return ; if ( wildcardType . isUpperBound ( ) ) { buffer . append ( "<STR_LIT>" ) ; } else { buffer . append ( "<STR_LIT>" ) ; } getFullyQualifiedName ( bound , buffer ) ; break ; } } public static String [ ] getTrimmedSimpleNames ( String name ) { String [ ] result = Signature . getSimpleNames ( name ) ; for ( int i = <NUM_LIT:0> , length = result . length ; i < length ; i ++ ) { result [ i ] = result [ i ] . trim ( ) ; } return result ; } public static JavaElement getUnresolvedJavaElement ( FieldBinding binding , WorkingCopyOwner workingCopyOwner , BindingsToNodesMap bindingsToNodes ) { if ( binding . declaringClass == null ) return null ; JavaElement unresolvedJavaElement = getUnresolvedJavaElement ( binding . declaringClass , workingCopyOwner , bindingsToNodes ) ; if ( unresolvedJavaElement == null || unresolvedJavaElement . getElementType ( ) != IJavaElement . TYPE ) { return null ; } return ( JavaElement ) ( ( IType ) unresolvedJavaElement ) . getField ( String . valueOf ( binding . name ) ) ; } public static JavaElement getUnresolvedJavaElement ( int localSourceStart , int localSourceEnd , JavaElement type ) { try { if ( ! ( type instanceof IType ) ) return null ; IInitializer [ ] initializers = ( ( IType ) type ) . getInitializers ( ) ; for ( int i = <NUM_LIT:0> ; i < initializers . length ; i ++ ) { IInitializer initializer = initializers [ i ] ; ISourceRange sourceRange = initializer . getSourceRange ( ) ; if ( sourceRange != null ) { int initializerStart = sourceRange . getOffset ( ) ; int initializerEnd = initializerStart + sourceRange . getLength ( ) ; if ( initializerStart <= localSourceStart && localSourceEnd <= initializerEnd ) { return ( JavaElement ) initializer ; } } } return null ; } catch ( JavaModelException e ) { return null ; } } public static JavaElement getUnresolvedJavaElement ( MethodBinding methodBinding , WorkingCopyOwner workingCopyOwner , BindingsToNodesMap bindingsToNodes ) { JavaElement unresolvedJavaElement = getUnresolvedJavaElement ( methodBinding . declaringClass , workingCopyOwner , bindingsToNodes ) ; if ( unresolvedJavaElement == null || unresolvedJavaElement . getElementType ( ) != IJavaElement . TYPE ) { return null ; } IType declaringType = ( IType ) unresolvedJavaElement ; org . eclipse . jdt . internal . compiler . ast . ASTNode node = bindingsToNodes == null ? null : bindingsToNodes . get ( methodBinding ) ; if ( node != null && ! declaringType . isBinary ( ) ) { if ( node instanceof AnnotationMethodDeclaration ) { AnnotationMethodDeclaration typeMemberDeclaration = ( AnnotationMethodDeclaration ) node ; return ( JavaElement ) declaringType . getMethod ( String . valueOf ( typeMemberDeclaration . selector ) , CharOperation . NO_STRINGS ) ; } else { MethodDeclaration methodDeclaration = ( MethodDeclaration ) node ; Argument [ ] arguments = methodDeclaration . arguments ; String [ ] parameterSignatures ; if ( arguments != null ) { parameterSignatures = new String [ arguments . length ] ; for ( int i = <NUM_LIT:0> ; i < arguments . length ; i ++ ) { Argument argument = arguments [ i ] ; TypeReference typeReference = argument . type ; int arrayDim = typeReference . dimensions ( ) ; String typeSig = Signature . createTypeSignature ( CharOperation . concatWith ( typeReference . getTypeName ( ) , '<CHAR_LIT:.>' ) , false ) ; if ( arrayDim > <NUM_LIT:0> ) { typeSig = Signature . createArraySignature ( typeSig , arrayDim ) ; } parameterSignatures [ i ] = typeSig ; } } else { parameterSignatures = CharOperation . NO_STRINGS ; } return ( JavaElement ) declaringType . getMethod ( String . valueOf ( methodDeclaration . selector ) , parameterSignatures ) ; } } else { org . eclipse . jdt . internal . compiler . lookup . MethodBinding original = methodBinding . original ( ) ; String selector = original . isConstructor ( ) ? declaringType . getElementName ( ) : new String ( original . selector ) ; boolean isBinary = declaringType . isBinary ( ) ; ReferenceBinding enclosingType = original . declaringClass . enclosingType ( ) ; boolean isInnerBinaryTypeConstructor = isBinary && original . isConstructor ( ) && enclosingType != null ; TypeBinding [ ] parameters = original . parameters ; int length = parameters == null ? <NUM_LIT:0> : parameters . length ; int declaringIndex = isInnerBinaryTypeConstructor ? <NUM_LIT:1> : <NUM_LIT:0> ; String [ ] parameterSignatures = new String [ declaringIndex + length ] ; if ( isInnerBinaryTypeConstructor ) parameterSignatures [ <NUM_LIT:0> ] = new String ( enclosingType . genericTypeSignature ( ) ) . replace ( '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { char [ ] signature = parameters [ i ] . genericTypeSignature ( ) ; if ( isBinary ) { signature = CharOperation . replaceOnCopy ( signature , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ; } else { signature = toUnresolvedTypeSignature ( signature ) ; } parameterSignatures [ declaringIndex + i ] = new String ( signature ) ; } IMethod result = declaringType . getMethod ( selector , parameterSignatures ) ; if ( isBinary ) return ( JavaElement ) result ; if ( result . exists ( ) ) return ( JavaElement ) result ; IMethod [ ] methods = null ; try { methods = declaringType . getMethods ( ) ; } catch ( JavaModelException e ) { return null ; } IMethod [ ] candidates = Member . findMethods ( result , methods ) ; if ( candidates == null || candidates . length == <NUM_LIT:0> ) return null ; return ( JavaElement ) candidates [ <NUM_LIT:0> ] ; } } public static JavaElement getUnresolvedJavaElement ( TypeBinding typeBinding , WorkingCopyOwner workingCopyOwner , BindingsToNodesMap bindingsToNodes ) { if ( typeBinding == null ) return null ; switch ( typeBinding . kind ( ) ) { case Binding . ARRAY_TYPE : typeBinding = ( ( org . eclipse . jdt . internal . compiler . lookup . ArrayBinding ) typeBinding ) . leafComponentType ( ) ; return getUnresolvedJavaElement ( typeBinding , workingCopyOwner , bindingsToNodes ) ; case Binding . BASE_TYPE : case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : return null ; default : if ( typeBinding . isCapture ( ) ) return null ; } ReferenceBinding referenceBinding ; if ( typeBinding . isParameterizedType ( ) || typeBinding . isRawType ( ) ) referenceBinding = ( ReferenceBinding ) typeBinding . erasure ( ) ; else referenceBinding = ( ReferenceBinding ) typeBinding ; char [ ] fileName = referenceBinding . getFileName ( ) ; if ( referenceBinding . isLocalType ( ) || referenceBinding . isAnonymousType ( ) ) { if ( org . eclipse . jdt . internal . compiler . util . Util . isClassFileName ( fileName ) ) { int jarSeparator = CharOperation . indexOf ( IDependent . JAR_FILE_ENTRY_SEPARATOR , fileName ) ; int pkgEnd = CharOperation . lastIndexOf ( '<CHAR_LIT:/>' , fileName ) ; if ( pkgEnd == - <NUM_LIT:1> ) pkgEnd = CharOperation . lastIndexOf ( File . separatorChar , fileName ) ; if ( jarSeparator != - <NUM_LIT:1> && pkgEnd < jarSeparator ) pkgEnd = jarSeparator ; if ( pkgEnd == - <NUM_LIT:1> ) return null ; IPackageFragment pkg = getPackageFragment ( fileName , pkgEnd , jarSeparator ) ; char [ ] constantPoolName = referenceBinding . constantPoolName ( ) ; if ( constantPoolName == null ) { ClassFile classFile = ( ClassFile ) getClassFile ( fileName ) ; return classFile == null ? null : ( JavaElement ) classFile . getType ( ) ; } pkgEnd = CharOperation . lastIndexOf ( '<CHAR_LIT:/>' , constantPoolName ) ; char [ ] classFileName = CharOperation . subarray ( constantPoolName , pkgEnd + <NUM_LIT:1> , constantPoolName . length ) ; ClassFile classFile = ( ClassFile ) pkg . getClassFile ( new String ( classFileName ) + SuffixConstants . SUFFIX_STRING_class ) ; return ( JavaElement ) classFile . getType ( ) ; } ICompilationUnit cu = getCompilationUnit ( fileName , workingCopyOwner ) ; if ( cu == null ) return null ; try { int sourceStart = ( ( org . eclipse . jdt . internal . compiler . lookup . LocalTypeBinding ) referenceBinding ) . sourceStart ; return ( JavaElement ) cu . getElementAt ( sourceStart ) ; } catch ( JavaModelException e ) { return null ; } } else if ( referenceBinding . isTypeVariable ( ) ) { final String typeVariableName = new String ( referenceBinding . sourceName ( ) ) ; org . eclipse . jdt . internal . compiler . lookup . Binding declaringElement = ( ( org . eclipse . jdt . internal . compiler . lookup . TypeVariableBinding ) referenceBinding ) . declaringElement ; if ( declaringElement instanceof MethodBinding ) { IMethod declaringMethod = ( IMethod ) getUnresolvedJavaElement ( ( MethodBinding ) declaringElement , workingCopyOwner , bindingsToNodes ) ; return ( JavaElement ) declaringMethod . getTypeParameter ( typeVariableName ) ; } else { IType declaringType = ( IType ) getUnresolvedJavaElement ( ( TypeBinding ) declaringElement , workingCopyOwner , bindingsToNodes ) ; return ( JavaElement ) declaringType . getTypeParameter ( typeVariableName ) ; } } else { if ( fileName == null ) return null ; TypeBinding declaringTypeBinding = typeBinding . enclosingType ( ) ; if ( declaringTypeBinding == null ) { if ( org . eclipse . jdt . internal . compiler . util . Util . isClassFileName ( fileName ) ) { ClassFile classFile = ( ClassFile ) getClassFile ( fileName ) ; if ( classFile == null ) return null ; return ( JavaElement ) classFile . getType ( ) ; } ICompilationUnit cu = getCompilationUnit ( fileName , workingCopyOwner ) ; if ( cu == null ) return null ; return ( JavaElement ) cu . getType ( new String ( referenceBinding . sourceName ( ) ) ) ; } else { IType declaringType = ( IType ) getUnresolvedJavaElement ( declaringTypeBinding , workingCopyOwner , bindingsToNodes ) ; if ( declaringType == null ) return null ; return ( JavaElement ) declaringType . getType ( new String ( referenceBinding . sourceName ( ) ) ) ; } } } public static int indexOfEnclosingPath ( IPath checkedPath , IPath [ ] paths , int pathCount ) { int bestMatch = - <NUM_LIT:1> , bestLength = - <NUM_LIT:1> ; for ( int i = <NUM_LIT:0> ; i < pathCount ; i ++ ) { if ( paths [ i ] . equals ( checkedPath ) ) continue ; if ( paths [ i ] . isPrefixOf ( checkedPath ) ) { int currentLength = paths [ i ] . segmentCount ( ) ; if ( currentLength > bestLength ) { bestLength = currentLength ; bestMatch = i ; } } } return bestMatch ; } public static int indexOfJavaLikeExtension ( String fileName ) { int fileNameLength = fileName . length ( ) ; char [ ] [ ] javaLikeExtensions = getJavaLikeExtensions ( ) ; extensions : for ( int i = <NUM_LIT:0> , length = javaLikeExtensions . length ; i < length ; i ++ ) { char [ ] extension = javaLikeExtensions [ i ] ; int extensionLength = extension . length ; int extensionStart = fileNameLength - extensionLength ; int dotIndex = extensionStart - <NUM_LIT:1> ; if ( dotIndex < <NUM_LIT:0> ) continue ; if ( fileName . charAt ( dotIndex ) != '<CHAR_LIT:.>' ) continue ; for ( int j = <NUM_LIT:0> ; j < extensionLength ; j ++ ) { if ( fileName . charAt ( extensionStart + j ) != extension [ j ] ) continue extensions ; } return dotIndex ; } return - <NUM_LIT:1> ; } public static int indexOfMatchingPath ( IPath checkedPath , IPath [ ] paths , int pathCount ) { for ( int i = <NUM_LIT:0> ; i < pathCount ; i ++ ) { if ( paths [ i ] . equals ( checkedPath ) ) return i ; } return - <NUM_LIT:1> ; } public static int indexOfNestedPath ( IPath checkedPath , IPath [ ] paths , int pathCount ) { for ( int i = <NUM_LIT:0> ; i < pathCount ; i ++ ) { if ( checkedPath . equals ( paths [ i ] ) ) continue ; if ( checkedPath . isPrefixOf ( paths [ i ] ) ) return i ; } return - <NUM_LIT:1> ; } protected static boolean isAttributeSupported ( int attribute ) { return ( EFS . getLocalFileSystem ( ) . attributes ( ) & attribute ) != <NUM_LIT:0> ; } public static boolean isReadOnly ( IResource resource ) { if ( isReadOnlySupported ( ) ) { ResourceAttributes resourceAttributes = resource . getResourceAttributes ( ) ; if ( resourceAttributes == null ) return false ; return resourceAttributes . isReadOnly ( ) ; } return false ; } public static boolean isReadOnlySupported ( ) { return isAttributeSupported ( EFS . ATTRIBUTE_READ_ONLY ) ; } public static final boolean isExcluded ( IJavaElement element ) { int elementType = element . getElementType ( ) ; switch ( elementType ) { case IJavaElement . JAVA_MODEL : case IJavaElement . JAVA_PROJECT : case IJavaElement . PACKAGE_FRAGMENT_ROOT : return false ; case IJavaElement . PACKAGE_FRAGMENT : PackageFragmentRoot root = ( PackageFragmentRoot ) element . getAncestor ( IJavaElement . PACKAGE_FRAGMENT_ROOT ) ; IResource resource = ( ( PackageFragment ) element ) . resource ( ) ; return resource != null && isExcluded ( resource , root . fullInclusionPatternChars ( ) , root . fullExclusionPatternChars ( ) ) ; case IJavaElement . COMPILATION_UNIT : root = ( PackageFragmentRoot ) element . getAncestor ( IJavaElement . PACKAGE_FRAGMENT_ROOT ) ; resource = element . getResource ( ) ; if ( resource == null ) return false ; if ( isExcluded ( resource , root . fullInclusionPatternChars ( ) , root . fullExclusionPatternChars ( ) ) ) return true ; return isExcluded ( element . getParent ( ) ) ; default : IJavaElement cu = element . getAncestor ( IJavaElement . COMPILATION_UNIT ) ; return cu != null && isExcluded ( cu ) ; } } public final static boolean isExcluded ( IPath resourcePath , char [ ] [ ] inclusionPatterns , char [ ] [ ] exclusionPatterns , boolean isFolderPath ) { if ( inclusionPatterns == null && exclusionPatterns == null ) return false ; return org . eclipse . jdt . internal . compiler . util . Util . isExcluded ( resourcePath . toString ( ) . toCharArray ( ) , inclusionPatterns , exclusionPatterns , isFolderPath ) ; } public final static boolean isExcluded ( IResource resource , char [ ] [ ] inclusionPatterns , char [ ] [ ] exclusionPatterns ) { IPath path = resource . getFullPath ( ) ; int resourceType = resource . getType ( ) ; return isExcluded ( path , inclusionPatterns , exclusionPatterns , resourceType == IResource . FOLDER || resourceType == IResource . PROJECT ) ; } public static boolean isValidClassFileName ( String name , String sourceLevel , String complianceLevel ) { return JavaConventions . validateClassFileName ( name , sourceLevel , complianceLevel ) . getSeverity ( ) != IStatus . ERROR ; } public static boolean isValidCompilationUnitName ( String name , String sourceLevel , String complianceLevel ) { return JavaConventions . validateCompilationUnitName ( name , sourceLevel , complianceLevel ) . getSeverity ( ) != IStatus . ERROR ; } public static boolean isValidFolderNameForPackage ( String folderName , String sourceLevel , String complianceLevel ) { return JavaConventions . validateIdentifier ( folderName , sourceLevel , complianceLevel ) . getSeverity ( ) != IStatus . ERROR ; } public static boolean isValidMethodSignature ( String sig ) { int len = sig . length ( ) ; if ( len == <NUM_LIT:0> ) return false ; int i = <NUM_LIT:0> ; char c = sig . charAt ( i ++ ) ; if ( c != '<CHAR_LIT:(>' ) return false ; if ( i >= len ) return false ; while ( sig . charAt ( i ) != '<CHAR_LIT:)>' ) { i = checkTypeSignature ( sig , i , len , false ) ; if ( i == - <NUM_LIT:1> ) return false ; if ( i >= len ) return false ; } ++ i ; i = checkTypeSignature ( sig , i , len , true ) ; return i == len ; } public static boolean isValidTypeSignature ( String sig , boolean allowVoid ) { int len = sig . length ( ) ; return checkTypeSignature ( sig , <NUM_LIT:0> , len , allowVoid ) == len ; } public static String localTypeName ( String binaryTypeName , int lastDollar , int end ) { if ( lastDollar > <NUM_LIT:0> && binaryTypeName . charAt ( lastDollar - <NUM_LIT:1> ) == '<CHAR_LIT>' ) return binaryTypeName ; int nameStart = lastDollar + <NUM_LIT:1> ; while ( nameStart < end && Character . isDigit ( binaryTypeName . charAt ( nameStart ) ) ) nameStart ++ ; return binaryTypeName . substring ( nameStart , end ) ; } public static void log ( Throwable e , String message ) { Throwable nestedException ; if ( e instanceof JavaModelException && ( nestedException = ( ( JavaModelException ) e ) . getException ( ) ) != null ) { e = nestedException ; } log ( new Status ( IStatus . ERROR , JavaCore . PLUGIN_ID , IStatus . ERROR , message , e ) ) ; } public static void logRepeatedMessage ( String key , Exception e ) { if ( key == null ) { throw new IllegalArgumentException ( "<STR_LIT>" ) ; } if ( fgRepeatedMessages . contains ( key ) ) { return ; } fgRepeatedMessages . add ( key ) ; log ( e ) ; } public static void logRepeatedMessage ( String key , int statusErrorID , String message ) { if ( key == null ) { throw new IllegalArgumentException ( "<STR_LIT>" ) ; } if ( fgRepeatedMessages . contains ( key ) ) { return ; } fgRepeatedMessages . add ( key ) ; log ( statusErrorID , message ) ; } public static void log ( int statusErrorID , String message ) { log ( new Status ( statusErrorID , JavaCore . PLUGIN_ID , message ) ) ; } public static void log ( IStatus status ) { JavaCore . getPlugin ( ) . getLog ( ) . log ( status ) ; } public static void log ( Throwable e ) { log ( new Status ( IStatus . ERROR , JavaCore . PLUGIN_ID , Messages . code_assist_internal_error , e ) ) ; } public static ClassFileReader newClassFileReader ( IResource resource ) throws CoreException , ClassFormatException , IOException { InputStream in = null ; try { in = ( ( IFile ) resource ) . getContents ( true ) ; return ClassFileReader . read ( in , resource . getFullPath ( ) . toString ( ) ) ; } finally { if ( in != null ) in . close ( ) ; } } public static char [ ] normalizeCRs ( char [ ] text , char [ ] buffer ) { CharArrayBuffer result = new CharArrayBuffer ( ) ; int lineStart = <NUM_LIT:0> ; int length = text . length ; if ( length == <NUM_LIT:0> ) return text ; String lineSeparator = getLineSeparator ( text , buffer ) ; char nextChar = text [ <NUM_LIT:0> ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { char currentChar = nextChar ; nextChar = i < length - <NUM_LIT:1> ? text [ i + <NUM_LIT:1> ] : '<CHAR_LIT:U+0020>' ; switch ( currentChar ) { case '<STR_LIT:\n>' : int lineLength = i - lineStart ; char [ ] line = new char [ lineLength ] ; System . arraycopy ( text , lineStart , line , <NUM_LIT:0> , lineLength ) ; result . append ( line ) ; result . append ( lineSeparator ) ; lineStart = i + <NUM_LIT:1> ; break ; case '<STR_LIT>' : lineLength = i - lineStart ; if ( lineLength >= <NUM_LIT:0> ) { line = new char [ lineLength ] ; System . arraycopy ( text , lineStart , line , <NUM_LIT:0> , lineLength ) ; result . append ( line ) ; result . append ( lineSeparator ) ; if ( nextChar == '<STR_LIT:\n>' ) { nextChar = '<CHAR_LIT:U+0020>' ; lineStart = i + <NUM_LIT:2> ; } else { lineStart = i + <NUM_LIT:1> ; } } else { lineStart = i + <NUM_LIT:1> ; } break ; } } char [ ] lastLine ; if ( lineStart > <NUM_LIT:0> ) { int lastLineLength = length - lineStart ; if ( lastLineLength > <NUM_LIT:0> ) { lastLine = new char [ lastLineLength ] ; System . arraycopy ( text , lineStart , lastLine , <NUM_LIT:0> , lastLineLength ) ; result . append ( lastLine ) ; } return result . getContents ( ) ; } return text ; } public static String normalizeCRs ( String text , String buffer ) { return new String ( normalizeCRs ( text . toCharArray ( ) , buffer . toCharArray ( ) ) ) ; } public static String packageName ( IPath pkgPath , String sourceLevel , String complianceLevel ) { StringBuffer pkgName = new StringBuffer ( IPackageFragment . DEFAULT_PACKAGE_NAME ) ; for ( int j = <NUM_LIT:0> , max = pkgPath . segmentCount ( ) ; j < max ; j ++ ) { String segment = pkgPath . segment ( j ) ; if ( ! isValidFolderNameForPackage ( segment , sourceLevel , complianceLevel ) ) { return null ; } pkgName . append ( segment ) ; if ( j < pkgPath . segmentCount ( ) - <NUM_LIT:1> ) { pkgName . append ( "<STR_LIT:.>" ) ; } } return pkgName . toString ( ) ; } public static int prefixLength ( char [ ] s1 , char [ ] s2 ) { int len = <NUM_LIT:0> ; int max = Math . min ( s1 . length , s2 . length ) ; for ( int i = <NUM_LIT:0> ; i < max && s1 [ i ] == s2 [ i ] ; ++ i ) ++ len ; return len ; } public static int prefixLength ( String s1 , String s2 ) { int len = <NUM_LIT:0> ; int max = Math . min ( s1 . length ( ) , s2 . length ( ) ) ; for ( int i = <NUM_LIT:0> ; i < max && s1 . charAt ( i ) == s2 . charAt ( i ) ; ++ i ) ++ len ; return len ; } private static void quickSort ( char [ ] [ ] list , int left , int right ) { int original_left = left ; int original_right = right ; char [ ] mid = list [ left + ( right - left ) / <NUM_LIT:2> ] ; do { while ( compare ( list [ left ] , mid ) < <NUM_LIT:0> ) { left ++ ; } while ( compare ( mid , list [ right ] ) < <NUM_LIT:0> ) { right -- ; } if ( left <= right ) { char [ ] tmp = list [ left ] ; list [ left ] = list [ right ] ; list [ right ] = tmp ; left ++ ; right -- ; } } while ( left <= right ) ; if ( original_left < right ) { quickSort ( list , original_left , right ) ; } if ( left < original_right ) { quickSort ( list , left , original_right ) ; } } private static void quickSort ( Comparable [ ] sortedCollection , int left , int right ) { int original_left = left ; int original_right = right ; Comparable mid = sortedCollection [ left + ( right - left ) / <NUM_LIT:2> ] ; do { while ( sortedCollection [ left ] . compareTo ( mid ) < <NUM_LIT:0> ) { left ++ ; } while ( mid . compareTo ( sortedCollection [ right ] ) < <NUM_LIT:0> ) { right -- ; } if ( left <= right ) { Comparable 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 static void quickSort ( int [ ] list , int left , int right ) { int original_left = left ; int original_right = right ; int mid = list [ left + ( right - left ) / <NUM_LIT:2> ] ; do { while ( list [ left ] < mid ) { left ++ ; } while ( mid < list [ right ] ) { right -- ; } if ( left <= right ) { int tmp = list [ left ] ; list [ left ] = list [ right ] ; list [ right ] = tmp ; left ++ ; right -- ; } } while ( left <= right ) ; if ( original_left < right ) { quickSort ( list , original_left , right ) ; } if ( left < original_right ) { quickSort ( list , left , original_right ) ; } } private static void quickSort ( Object [ ] sortedCollection , int left , int right , Comparer comparer ) { int original_left = left ; int original_right = right ; Object mid = sortedCollection [ left + ( right - left ) / <NUM_LIT:2> ] ; do { while ( comparer . compare ( sortedCollection [ left ] , mid ) < <NUM_LIT:0> ) { left ++ ; } while ( comparer . compare ( mid , sortedCollection [ right ] ) < <NUM_LIT:0> ) { right -- ; } if ( left <= right ) { Object tmp = sortedCollection [ left ] ; sortedCollection [ left ] = sortedCollection [ right ] ; sortedCollection [ right ] = tmp ; left ++ ; right -- ; } } while ( left <= right ) ; if ( original_left < right ) { quickSort ( sortedCollection , original_left , right , comparer ) ; } if ( left < original_right ) { quickSort ( sortedCollection , left , original_right , comparer ) ; } } private static void quickSort ( String [ ] sortedCollection , int left , int right ) { int original_left = left ; int original_right = right ; String mid = sortedCollection [ left + ( right - left ) / <NUM_LIT:2> ] ; do { while ( sortedCollection [ left ] . compareTo ( mid ) < <NUM_LIT:0> ) { left ++ ; } while ( mid . compareTo ( sortedCollection [ right ] ) < <NUM_LIT:0> ) { right -- ; } if ( left <= right ) { String 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 ) ; } } public static String relativePath ( IPath fullPath , int skipSegmentCount ) { boolean hasTrailingSeparator = fullPath . hasTrailingSeparator ( ) ; String [ ] segments = fullPath . segments ( ) ; int length = <NUM_LIT:0> ; int max = segments . length ; if ( max > skipSegmentCount ) { for ( int i1 = skipSegmentCount ; i1 < max ; i1 ++ ) { length += segments [ i1 ] . length ( ) ; } length += max - skipSegmentCount - <NUM_LIT:1> ; } if ( hasTrailingSeparator ) length ++ ; char [ ] result = new char [ length ] ; int offset = <NUM_LIT:0> ; int len = segments . length - <NUM_LIT:1> ; if ( len >= skipSegmentCount ) { for ( int i = skipSegmentCount ; i < len ; i ++ ) { int size = segments [ i ] . length ( ) ; segments [ i ] . getChars ( <NUM_LIT:0> , size , result , offset ) ; offset += size ; result [ offset ++ ] = '<CHAR_LIT:/>' ; } int size = segments [ len ] . length ( ) ; segments [ len ] . getChars ( <NUM_LIT:0> , size , result , offset ) ; offset += size ; } if ( hasTrailingSeparator ) result [ offset ++ ] = '<CHAR_LIT:/>' ; return new String ( result ) ; } public static void resetJavaLikeExtensions ( ) { JAVA_LIKE_EXTENSIONS = null ; } public static int scanTypeSignature ( char [ ] string , int start ) { return org . eclipse . jdt . internal . compiler . util . Util . scanTypeSignature ( string , start ) ; } public static final String [ ] splitOn ( char divider , String string , int start , int end ) { int length = string == null ? <NUM_LIT:0> : string . length ( ) ; if ( length == <NUM_LIT:0> || start > end ) return CharOperation . NO_STRINGS ; int wordCount = <NUM_LIT:1> ; for ( int i = start ; i < end ; i ++ ) if ( string . charAt ( i ) == divider ) wordCount ++ ; String [ ] split = new String [ wordCount ] ; int last = start , currentWord = <NUM_LIT:0> ; for ( int i = start ; i < end ; i ++ ) { if ( string . charAt ( i ) == divider ) { split [ currentWord ++ ] = string . substring ( last , i ) ; last = i + <NUM_LIT:1> ; } } split [ currentWord ] = string . substring ( last , end ) ; return split ; } public static void setReadOnly ( IResource resource , boolean readOnly ) { if ( isReadOnlySupported ( ) ) { ResourceAttributes resourceAttributes = resource . getResourceAttributes ( ) ; if ( resourceAttributes == null ) return ; resourceAttributes . setReadOnly ( readOnly ) ; try { resource . setResourceAttributes ( resourceAttributes ) ; } catch ( CoreException e ) { } } } public static void sort ( char [ ] [ ] list ) { if ( list . length > <NUM_LIT:1> ) quickSort ( list , <NUM_LIT:0> , list . length - <NUM_LIT:1> ) ; } public static void sort ( Comparable [ ] objects ) { if ( objects . length > <NUM_LIT:1> ) quickSort ( objects , <NUM_LIT:0> , objects . length - <NUM_LIT:1> ) ; } public static void sort ( int [ ] list ) { if ( list . length > <NUM_LIT:1> ) quickSort ( list , <NUM_LIT:0> , list . length - <NUM_LIT:1> ) ; } public static void sort ( Object [ ] objects , Comparer comparer ) { if ( objects . length > <NUM_LIT:1> ) quickSort ( objects , <NUM_LIT:0> , objects . length - <NUM_LIT:1> , comparer ) ; } public static void sort ( String [ ] strings ) { if ( strings . length > <NUM_LIT:1> ) quickSort ( strings , <NUM_LIT:0> , strings . length - <NUM_LIT:1> ) ; } public static Comparable [ ] sortCopy ( Comparable [ ] objects ) { int len = objects . length ; Comparable [ ] copy = new Comparable [ len ] ; System . arraycopy ( objects , <NUM_LIT:0> , copy , <NUM_LIT:0> , len ) ; sort ( copy ) ; return copy ; } public static IJavaElement [ ] sortCopy ( IJavaElement [ ] elements ) { int len = elements . length ; IJavaElement [ ] copy = new IJavaElement [ len ] ; System . arraycopy ( elements , <NUM_LIT:0> , copy , <NUM_LIT:0> , len ) ; sort ( copy , new Comparer ( ) { public int compare ( Object a , Object b ) { return ( ( JavaElement ) a ) . toStringWithAncestors ( ) . compareTo ( ( ( JavaElement ) b ) . toStringWithAncestors ( ) ) ; } } ) ; return copy ; } public static Object [ ] sortCopy ( Object [ ] objects , Comparer comparer ) { int len = objects . length ; Object [ ] copy = new Object [ len ] ; System . arraycopy ( objects , <NUM_LIT:0> , copy , <NUM_LIT:0> , len ) ; sort ( copy , comparer ) ; return copy ; } public static String [ ] sortCopy ( String [ ] objects ) { int len = objects . length ; String [ ] copy = new String [ len ] ; System . arraycopy ( objects , <NUM_LIT:0> , copy , <NUM_LIT:0> , len ) ; sort ( copy ) ; return copy ; } public static boolean startsWithIgnoreCase ( String [ ] compoundName , String [ ] prefix , boolean partialMatch ) { int prefixLength = prefix . length ; int nameLength = compoundName . length ; if ( prefixLength > nameLength ) return false ; for ( int i = <NUM_LIT:0> ; i < prefixLength - <NUM_LIT:1> ; i ++ ) { if ( ! compoundName [ i ] . equalsIgnoreCase ( prefix [ i ] ) ) return false ; } return ( partialMatch || prefixLength == nameLength ) && compoundName [ prefixLength - <NUM_LIT:1> ] . toLowerCase ( ) . startsWith ( prefix [ prefixLength - <NUM_LIT:1> ] . toLowerCase ( ) ) ; } public static char [ ] [ ] toCharArrays ( String [ ] a ) { int len = a . length ; if ( len == <NUM_LIT:0> ) return CharOperation . NO_CHAR_CHAR ; char [ ] [ ] result = new char [ len ] [ ] ; for ( int i = <NUM_LIT:0> ; i < len ; ++ i ) { result [ i ] = a [ i ] . toCharArray ( ) ; } return result ; } public static char [ ] [ ] toCompoundChars ( String s ) { int len = s . length ( ) ; if ( len == <NUM_LIT:0> ) { return CharOperation . NO_CHAR_CHAR ; } int segCount = <NUM_LIT:1> ; for ( int off = s . indexOf ( '<CHAR_LIT:.>' ) ; off != - <NUM_LIT:1> ; off = s . indexOf ( '<CHAR_LIT:.>' , off + <NUM_LIT:1> ) ) { ++ segCount ; } char [ ] [ ] segs = new char [ segCount ] [ ] ; int start = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < segCount ; ++ i ) { int dot = s . indexOf ( '<CHAR_LIT:.>' , start ) ; int end = ( dot == - <NUM_LIT:1> ? s . length ( ) : dot ) ; segs [ i ] = new char [ end - start ] ; s . getChars ( start , end , segs [ i ] , <NUM_LIT:0> ) ; start = end + <NUM_LIT:1> ; } return segs ; } public static File toLocalFile ( URI uri , IProgressMonitor monitor ) throws CoreException { IFileStore fileStore = EFS . getStore ( uri ) ; File localFile = fileStore . toLocalFile ( EFS . NONE , monitor ) ; if ( localFile == null ) localFile = fileStore . toLocalFile ( EFS . CACHE , monitor ) ; return localFile ; } public static String toString ( char [ ] [ ] c ) { StringBuffer sb = new StringBuffer ( ) ; for ( int i = <NUM_LIT:0> , max = c . length ; i < max ; ++ i ) { if ( i != <NUM_LIT:0> ) sb . append ( '<CHAR_LIT:.>' ) ; sb . append ( c [ i ] ) ; } return sb . toString ( ) ; } public static String toString ( char [ ] [ ] c , char [ ] d ) { if ( c == null ) return new String ( d ) ; StringBuffer sb = new StringBuffer ( ) ; for ( int i = <NUM_LIT:0> , max = c . length ; i < max ; ++ i ) { sb . append ( c [ i ] ) ; sb . append ( '<CHAR_LIT:.>' ) ; } sb . append ( d ) ; return sb . toString ( ) ; } public static String [ ] toStrings ( char [ ] [ ] a ) { int len = a . length ; String [ ] result = new String [ len ] ; for ( int i = <NUM_LIT:0> ; i < len ; ++ i ) { result [ i ] = new String ( a [ i ] ) ; } return result ; } private static char [ ] toUnresolvedTypeSignature ( char [ ] signature ) { int length = signature . length ; if ( length <= <NUM_LIT:1> ) return signature ; StringBuffer buffer = new StringBuffer ( length ) ; toUnresolvedTypeSignature ( signature , <NUM_LIT:0> , length , buffer ) ; int bufferLength = buffer . length ( ) ; char [ ] result = new char [ bufferLength ] ; buffer . getChars ( <NUM_LIT:0> , bufferLength , result , <NUM_LIT:0> ) ; return result ; } private static int toUnresolvedTypeSignature ( char [ ] signature , int start , int length , StringBuffer buffer ) { if ( signature [ start ] == Signature . C_RESOLVED ) buffer . append ( Signature . C_UNRESOLVED ) ; else buffer . append ( signature [ start ] ) ; for ( int i = start + <NUM_LIT:1> ; i < length ; i ++ ) { char c = signature [ i ] ; switch ( c ) { case '<CHAR_LIT:/>' : case Signature . C_DOLLAR : buffer . append ( Signature . C_DOT ) ; break ; case Signature . C_GENERIC_START : buffer . append ( Signature . C_GENERIC_START ) ; i = toUnresolvedTypeSignature ( signature , i + <NUM_LIT:1> , length , buffer ) ; break ; case Signature . C_GENERIC_END : buffer . append ( Signature . C_GENERIC_END ) ; return i ; default : buffer . append ( c ) ; break ; } } return length ; } private static void appendArrayTypeSignature ( char [ ] string , int start , StringBuffer buffer , boolean compact ) { int length = string . length ; if ( start >= length - <NUM_LIT:1> ) { throw new IllegalArgumentException ( ) ; } char c = string [ start ] ; if ( c != Signature . C_ARRAY ) { throw new IllegalArgumentException ( ) ; } int index = start ; c = string [ ++ index ] ; while ( c == Signature . C_ARRAY ) { if ( index >= length - <NUM_LIT:1> ) { throw new IllegalArgumentException ( ) ; } c = string [ ++ index ] ; } appendTypeSignature ( string , index , buffer , compact ) ; for ( int i = <NUM_LIT:0> , dims = index - start ; i < dims ; i ++ ) { buffer . append ( '<CHAR_LIT:[>' ) . append ( '<CHAR_LIT:]>' ) ; } } private static void appendClassTypeSignature ( char [ ] string , int start , StringBuffer buffer , boolean compact ) { char c = string [ start ] ; if ( c != Signature . C_RESOLVED ) { return ; } int p = start + <NUM_LIT:1> ; int checkpoint = buffer . length ( ) ; while ( true ) { c = string [ p ] ; switch ( c ) { case Signature . C_SEMICOLON : return ; case Signature . C_DOT : case '<CHAR_LIT:/>' : if ( compact ) { buffer . setLength ( checkpoint ) ; } else { buffer . append ( '<CHAR_LIT:.>' ) ; } break ; case Signature . C_DOLLAR : buffer . append ( '<CHAR_LIT:.>' ) ; break ; default : buffer . append ( c ) ; } p ++ ; } } static void appendTypeSignature ( char [ ] string , int start , StringBuffer buffer , boolean compact ) { char c = string [ start ] ; switch ( c ) { case Signature . C_ARRAY : appendArrayTypeSignature ( string , start , buffer , compact ) ; break ; case Signature . C_RESOLVED : appendClassTypeSignature ( string , start , buffer , compact ) ; break ; case Signature . C_TYPE_VARIABLE : int e = org . eclipse . jdt . internal . compiler . util . Util . scanTypeVariableSignature ( string , start ) ; buffer . append ( string , start + <NUM_LIT:1> , e - start - <NUM_LIT:1> ) ; break ; case Signature . C_BOOLEAN : buffer . append ( BOOLEAN ) ; break ; case Signature . C_BYTE : buffer . append ( BYTE ) ; break ; case Signature . C_CHAR : buffer . append ( CHAR ) ; break ; case Signature . C_DOUBLE : buffer . append ( DOUBLE ) ; break ; case Signature . C_FLOAT : buffer . append ( FLOAT ) ; break ; case Signature . C_INT : buffer . append ( INT ) ; break ; case Signature . C_LONG : buffer . append ( LONG ) ; break ; case Signature . C_SHORT : buffer . append ( SHORT ) ; break ; case Signature . C_VOID : buffer . append ( VOID ) ; break ; } } public static String toString ( char [ ] declaringClass , char [ ] methodName , char [ ] methodSignature , boolean includeReturnType , boolean compact ) { final boolean isConstructor = CharOperation . equals ( methodName , INIT ) ; int firstParen = CharOperation . indexOf ( Signature . C_PARAM_START , methodSignature ) ; if ( firstParen == - <NUM_LIT:1> ) { return "<STR_LIT>" ; } StringBuffer buffer = new StringBuffer ( methodSignature . length + <NUM_LIT:10> ) ; if ( declaringClass != null && declaringClass . length > <NUM_LIT:0> ) { char [ ] declaringClassSignature = null ; if ( declaringClass [ <NUM_LIT:0> ] == Signature . C_ARRAY ) { CharOperation . replace ( declaringClass , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ; declaringClassSignature = Signature . toCharArray ( declaringClass ) ; } else { CharOperation . replace ( declaringClass , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ; declaringClassSignature = declaringClass ; } int lastIndexOfSlash = CharOperation . lastIndexOf ( '<CHAR_LIT:.>' , declaringClassSignature ) ; if ( compact && lastIndexOfSlash != - <NUM_LIT:1> ) { buffer . append ( declaringClassSignature , lastIndexOfSlash + <NUM_LIT:1> , declaringClassSignature . length - lastIndexOfSlash - <NUM_LIT:1> ) ; } else { buffer . append ( declaringClassSignature ) ; } if ( ! isConstructor ) { buffer . append ( '<CHAR_LIT:.>' ) ; } } if ( ! isConstructor && methodName != null ) { buffer . append ( methodName ) ; } buffer . append ( '<CHAR_LIT:(>' ) ; char [ ] [ ] pts = Signature . getParameterTypes ( methodSignature ) ; for ( int i = <NUM_LIT:0> , max = pts . length ; i < max ; i ++ ) { appendTypeSignature ( pts [ i ] , <NUM_LIT:0> , buffer , compact ) ; if ( i != pts . length - <NUM_LIT:1> ) { buffer . append ( '<CHAR_LIT:U+002C>' ) ; buffer . append ( '<CHAR_LIT:U+0020>' ) ; } } buffer . append ( '<CHAR_LIT:)>' ) ; if ( ! isConstructor ) { buffer . append ( "<STR_LIT:U+0020:U+0020>" ) ; if ( includeReturnType ) { char [ ] rts = Signature . getReturnType ( methodSignature ) ; appendTypeSignature ( rts , <NUM_LIT:0> , buffer , compact ) ; } } return String . valueOf ( buffer ) ; } public static String [ ] typeParameterSignatures ( AbstractMethodDeclaration method ) { Argument [ ] args = method . arguments ; if ( args != null ) { int length = args . length ; String [ ] signatures = new String [ length ] ; for ( int i = <NUM_LIT:0> ; i < args . length ; i ++ ) { Argument arg = args [ i ] ; signatures [ i ] = typeSignature ( arg . type ) ; } return signatures ; } return CharOperation . NO_STRINGS ; } public static String typeSignature ( TypeReference type ) { String signature = null ; if ( ( type . bits & org . eclipse . jdt . internal . compiler . ast . ASTNode . IsUnionType ) != <NUM_LIT:0> ) { UnionTypeReference unionTypeReference = ( UnionTypeReference ) type ; TypeReference [ ] typeReferences = unionTypeReference . typeReferences ; int length = typeReferences . length ; String [ ] typeSignatures = new String [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { char [ ] [ ] compoundName = typeReferences [ i ] . getParameterizedTypeName ( ) ; char [ ] typeName = CharOperation . concatWith ( compoundName , '<CHAR_LIT:.>' ) ; typeSignatures [ i ] = Signature . createTypeSignature ( typeName , false ) ; } signature = Signature . createIntersectionTypeSignature ( typeSignatures ) ; } else { char [ ] [ ] compoundName = type . getParameterizedTypeName ( ) ; char [ ] typeName = CharOperation . concatWith ( compoundName , '<CHAR_LIT:.>' ) ; signature = Signature . createTypeSignature ( typeName , false ) ; } return signature ; } public static void validateMethodSignature ( String sig ) { Assert . isTrue ( isValidMethodSignature ( sig ) ) ; } public static void validateTypeSignature ( String sig , boolean allowVoid ) { Assert . isTrue ( isValidTypeSignature ( sig , allowVoid ) ) ; } public static void verbose ( String log ) { verbose ( log , System . out ) ; } public static synchronized void verbose ( String log , PrintStream printStream ) { int start = <NUM_LIT:0> ; do { int end = log . indexOf ( '<STR_LIT:\n>' , start ) ; printStream . print ( Thread . currentThread ( ) ) ; printStream . print ( "<STR_LIT:U+0020>" ) ; printStream . print ( log . substring ( start , end == - <NUM_LIT:1> ? log . length ( ) : end + <NUM_LIT:1> ) ) ; start = end + <NUM_LIT:1> ; } while ( start != <NUM_LIT:0> ) ; printStream . println ( ) ; } public final static boolean isJavaLikeFileName ( String name ) { if ( name == null ) return false ; return indexOfJavaLikeExtension ( name ) != - <NUM_LIT:1> ; } public final static boolean isJavaLikeFileName ( char [ ] fileName ) { if ( fileName == null ) return false ; int fileNameLength = fileName . length ; char [ ] [ ] javaLikeExtensions = getJavaLikeExtensions ( ) ; extensions : for ( int i = <NUM_LIT:0> , length = javaLikeExtensions . length ; i < length ; i ++ ) { char [ ] extension = javaLikeExtensions [ i ] ; int extensionLength = extension . length ; int extensionStart = fileNameLength - extensionLength ; if ( extensionStart - <NUM_LIT:1> < <NUM_LIT:0> ) continue ; if ( fileName [ extensionStart - <NUM_LIT:1> ] != '<CHAR_LIT:.>' ) continue ; for ( int j = <NUM_LIT:0> ; j < extensionLength ; j ++ ) { if ( fileName [ extensionStart + j ] != extension [ j ] ) continue extensions ; } return true ; } return false ; } public final static char [ ] [ ] [ ] getAllTypeArguments ( char [ ] [ ] typeSignatures ) { if ( typeSignatures == null ) return null ; int length = typeSignatures . length ; char [ ] [ ] [ ] typeArguments = new char [ length ] [ ] [ ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { typeArguments [ i ] = Signature . getTypeArguments ( typeSignatures [ i ] ) ; } return typeArguments ; } public static IAnnotation getAnnotation ( JavaElement parent , IBinaryAnnotation binaryAnnotation , String memberValuePairName ) { char [ ] typeName = org . eclipse . jdt . core . Signature . toCharArray ( CharOperation . replaceOnCopy ( binaryAnnotation . getTypeName ( ) , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ) ; return new Annotation ( parent , new String ( typeName ) , memberValuePairName ) ; } public static Object getAnnotationMemberValue ( JavaElement parent , MemberValuePair memberValuePair , Object binaryValue ) { if ( binaryValue instanceof Constant ) { return getAnnotationMemberValue ( memberValuePair , ( Constant ) binaryValue ) ; } else if ( binaryValue instanceof IBinaryAnnotation ) { memberValuePair . valueKind = IMemberValuePair . K_ANNOTATION ; return getAnnotation ( parent , ( IBinaryAnnotation ) binaryValue , memberValuePair . getMemberName ( ) ) ; } else if ( binaryValue instanceof ClassSignature ) { memberValuePair . valueKind = IMemberValuePair . K_CLASS ; char [ ] className = Signature . toCharArray ( CharOperation . replaceOnCopy ( ( ( ClassSignature ) binaryValue ) . getTypeName ( ) , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ) ; return new String ( className ) ; } else if ( binaryValue instanceof EnumConstantSignature ) { memberValuePair . valueKind = IMemberValuePair . K_QUALIFIED_NAME ; EnumConstantSignature enumConstant = ( EnumConstantSignature ) binaryValue ; char [ ] enumName = Signature . toCharArray ( CharOperation . replaceOnCopy ( enumConstant . getTypeName ( ) , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ) ; char [ ] qualifiedName = CharOperation . concat ( enumName , enumConstant . getEnumConstantName ( ) , '<CHAR_LIT:.>' ) ; return new String ( qualifiedName ) ; } else if ( binaryValue instanceof Object [ ] ) { memberValuePair . valueKind = - <NUM_LIT:1> ; Object [ ] binaryValues = ( Object [ ] ) binaryValue ; int length = binaryValues . length ; Object [ ] values = new Object [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { int previousValueKind = memberValuePair . valueKind ; Object value = getAnnotationMemberValue ( parent , memberValuePair , binaryValues [ i ] ) ; if ( previousValueKind != - <NUM_LIT:1> && memberValuePair . valueKind != previousValueKind ) { memberValuePair . valueKind = IMemberValuePair . K_UNKNOWN ; } if ( value instanceof Annotation ) { Annotation annotation = ( Annotation ) value ; for ( int j = <NUM_LIT:0> ; j < i ; j ++ ) { if ( annotation . equals ( values [ j ] ) ) { annotation . occurrenceCount ++ ; } } } values [ i ] = value ; } if ( memberValuePair . valueKind == - <NUM_LIT:1> ) memberValuePair . valueKind = IMemberValuePair . K_UNKNOWN ; return values ; } else { memberValuePair . valueKind = IMemberValuePair . K_UNKNOWN ; return null ; } } public static Object getAnnotationMemberValue ( MemberValuePair memberValuePair , Constant constant ) { if ( constant == null ) { memberValuePair . valueKind = IMemberValuePair . K_UNKNOWN ; return null ; } switch ( constant . typeID ( ) ) { case TypeIds . T_int : memberValuePair . valueKind = IMemberValuePair . K_INT ; return new Integer ( constant . intValue ( ) ) ; case TypeIds . T_byte : memberValuePair . valueKind = IMemberValuePair . K_BYTE ; return new Byte ( constant . byteValue ( ) ) ; case TypeIds . T_short : memberValuePair . valueKind = IMemberValuePair . K_SHORT ; return new Short ( constant . shortValue ( ) ) ; case TypeIds . T_char : memberValuePair . valueKind = IMemberValuePair . K_CHAR ; return new Character ( constant . charValue ( ) ) ; case TypeIds . T_float : memberValuePair . valueKind = IMemberValuePair . K_FLOAT ; return new Float ( constant . floatValue ( ) ) ; case TypeIds . T_double : memberValuePair . valueKind = IMemberValuePair . K_DOUBLE ; return new Double ( constant . doubleValue ( ) ) ; case TypeIds . T_boolean : memberValuePair . valueKind = IMemberValuePair . K_BOOLEAN ; return Boolean . valueOf ( constant . booleanValue ( ) ) ; case TypeIds . T_long : memberValuePair . valueKind = IMemberValuePair . K_LONG ; return new Long ( constant . longValue ( ) ) ; case TypeIds . T_JavaLangString : memberValuePair . valueKind = IMemberValuePair . K_STRING ; return constant . stringValue ( ) ; default : memberValuePair . valueKind = IMemberValuePair . K_UNKNOWN ; return null ; } } public static Object getNegativeAnnotationMemberValue ( MemberValuePair memberValuePair , Constant constant ) { if ( constant == null ) { memberValuePair . valueKind = IMemberValuePair . K_UNKNOWN ; return null ; } switch ( constant . typeID ( ) ) { case TypeIds . T_int : memberValuePair . valueKind = IMemberValuePair . K_INT ; return new Integer ( constant . intValue ( ) * - <NUM_LIT:1> ) ; case TypeIds . T_float : memberValuePair . valueKind = IMemberValuePair . K_FLOAT ; return new Float ( constant . floatValue ( ) * - <NUM_LIT:1.0f> ) ; case TypeIds . T_double : memberValuePair . valueKind = IMemberValuePair . K_DOUBLE ; return new Double ( constant . doubleValue ( ) * - <NUM_LIT:1.0> ) ; case TypeIds . T_long : memberValuePair . valueKind = IMemberValuePair . K_LONG ; return new Long ( constant . longValue ( ) * - <NUM_LIT:1L> ) ; default : memberValuePair . valueKind = IMemberValuePair . K_UNKNOWN ; return null ; } } public final static char [ ] [ ] splitTypeLevelsSignature ( String typeSignature ) { char [ ] source = Signature . removeCapture ( typeSignature . toCharArray ( ) ) ; CharOperation . replace ( source , '<CHAR_LIT>' , '<CHAR_LIT:.>' ) ; char [ ] [ ] signatures = new char [ <NUM_LIT:10> ] [ ] ; int signaturesCount = <NUM_LIT:0> ; int paramOpening = <NUM_LIT:0> ; for ( int idx = <NUM_LIT:0> , ln = source . length ; idx < ln ; idx ++ ) { switch ( source [ idx ] ) { case '<CHAR_LIT:>>' : paramOpening -- ; if ( paramOpening == <NUM_LIT:0> ) { if ( signaturesCount == signatures . length ) { System . arraycopy ( signatures , <NUM_LIT:0> , signatures = new char [ signaturesCount + <NUM_LIT:10> ] [ ] , <NUM_LIT:0> , signaturesCount ) ; } } break ; case '<CHAR_LIT>' : paramOpening ++ ; break ; case '<CHAR_LIT:.>' : if ( paramOpening == <NUM_LIT:0> ) { if ( signaturesCount == signatures . length ) { System . arraycopy ( signatures , <NUM_LIT:0> , signatures = new char [ signaturesCount + <NUM_LIT:10> ] [ ] , <NUM_LIT:0> , signaturesCount ) ; } signatures [ signaturesCount ] = new char [ idx + <NUM_LIT:1> ] ; System . arraycopy ( source , <NUM_LIT:0> , signatures [ signaturesCount ] , <NUM_LIT:0> , idx ) ; signatures [ signaturesCount ] [ idx ] = Signature . C_SEMICOLON ; signaturesCount ++ ; } break ; case '<CHAR_LIT:/>' : source [ idx ] = '<CHAR_LIT:.>' ; break ; } } char [ ] [ ] typeSignatures = new char [ signaturesCount + <NUM_LIT:1> ] [ ] ; typeSignatures [ <NUM_LIT:0> ] = source ; for ( int i = <NUM_LIT:1> , j = signaturesCount - <NUM_LIT:1> ; i <= signaturesCount ; i ++ , j -- ) { typeSignatures [ i ] = signatures [ j ] ; } return typeSignatures ; } public static String toAnchor ( int startingIndex , char [ ] methodSignature , String methodName , boolean isVarArgs ) { try { return new String ( toAnchor ( startingIndex , methodSignature , methodName . toCharArray ( ) , isVarArgs ) ) ; } catch ( IllegalArgumentException e ) { return null ; } } public static char [ ] toAnchor ( int startingIndex , char [ ] methodSignature , char [ ] methodName , boolean isVargArgs ) { int firstParen = CharOperation . indexOf ( Signature . C_PARAM_START , methodSignature ) ; if ( firstParen == - <NUM_LIT:1> ) { throw new IllegalArgumentException ( ) ; } StringBuffer buffer = new StringBuffer ( methodSignature . length + <NUM_LIT:10> ) ; if ( methodName != null ) { buffer . append ( methodName ) ; } buffer . append ( '<CHAR_LIT:(>' ) ; char [ ] [ ] pts = Signature . getParameterTypes ( methodSignature ) ; for ( int i = startingIndex , max = pts . length ; i < max ; i ++ ) { if ( i == max - <NUM_LIT:1> ) { appendTypeSignatureForAnchor ( pts [ i ] , <NUM_LIT:0> , buffer , isVargArgs ) ; } else { appendTypeSignatureForAnchor ( pts [ i ] , <NUM_LIT:0> , buffer , false ) ; } if ( i != pts . length - <NUM_LIT:1> ) { buffer . append ( '<CHAR_LIT:U+002C>' ) ; buffer . append ( '<CHAR_LIT:U+0020>' ) ; } } buffer . append ( '<CHAR_LIT:)>' ) ; char [ ] result = new char [ buffer . length ( ) ] ; buffer . getChars ( <NUM_LIT:0> , buffer . length ( ) , result , <NUM_LIT:0> ) ; return result ; } private static int appendTypeSignatureForAnchor ( char [ ] string , int start , StringBuffer buffer , boolean isVarArgs ) { if ( start >= string . length ) { throw new IllegalArgumentException ( ) ; } char c = string [ start ] ; if ( isVarArgs ) { switch ( c ) { case Signature . C_ARRAY : return appendArrayTypeSignatureForAnchor ( string , start , buffer , true ) ; case Signature . C_RESOLVED : case Signature . C_TYPE_VARIABLE : case Signature . C_BOOLEAN : case Signature . C_BYTE : case Signature . C_CHAR : case Signature . C_DOUBLE : case Signature . C_FLOAT : case Signature . C_INT : case Signature . C_LONG : case Signature . C_SHORT : case Signature . C_VOID : case Signature . C_STAR : case Signature . C_EXTENDS : case Signature . C_SUPER : case Signature . C_CAPTURE : default : throw new IllegalArgumentException ( ) ; } } else { switch ( c ) { case Signature . C_ARRAY : return appendArrayTypeSignatureForAnchor ( string , start , buffer , false ) ; case Signature . C_RESOLVED : return appendClassTypeSignatureForAnchor ( string , start , buffer ) ; case Signature . C_TYPE_VARIABLE : int e = org . eclipse . jdt . internal . compiler . util . Util . scanTypeVariableSignature ( string , start ) ; buffer . append ( string , start + <NUM_LIT:1> , e - start - <NUM_LIT:1> ) ; return e ; case Signature . C_BOOLEAN : buffer . append ( BOOLEAN ) ; return start ; case Signature . C_BYTE : buffer . append ( BYTE ) ; return start ; case Signature . C_CHAR : buffer . append ( CHAR ) ; return start ; case Signature . C_DOUBLE : buffer . append ( DOUBLE ) ; return start ; case Signature . C_FLOAT : buffer . append ( FLOAT ) ; return start ; case Signature . C_INT : buffer . append ( INT ) ; return start ; case Signature . C_LONG : buffer . append ( LONG ) ; return start ; case Signature . C_SHORT : buffer . append ( SHORT ) ; return start ; case Signature . C_VOID : buffer . append ( VOID ) ; return start ; case Signature . C_CAPTURE : return appendCaptureTypeSignatureForAnchor ( string , start , buffer ) ; case Signature . C_STAR : case Signature . C_EXTENDS : case Signature . C_SUPER : return appendTypeArgumentSignatureForAnchor ( string , start , buffer ) ; default : throw new IllegalArgumentException ( ) ; } } } private static int appendTypeArgumentSignatureForAnchor ( char [ ] string , int start , StringBuffer buffer ) { if ( start >= string . length ) { throw new IllegalArgumentException ( ) ; } char c = string [ start ] ; switch ( c ) { case Signature . C_STAR : return start ; case Signature . C_EXTENDS : return appendTypeSignatureForAnchor ( string , start + <NUM_LIT:1> , buffer , false ) ; case Signature . C_SUPER : return appendTypeSignatureForAnchor ( string , start + <NUM_LIT:1> , buffer , false ) ; default : return appendTypeSignatureForAnchor ( string , start , buffer , false ) ; } } private static int appendCaptureTypeSignatureForAnchor ( char [ ] string , int start , StringBuffer buffer ) { if ( start >= string . length - <NUM_LIT:1> ) { throw new IllegalArgumentException ( ) ; } char c = string [ start ] ; if ( c != Signature . C_CAPTURE ) { throw new IllegalArgumentException ( ) ; } return appendTypeArgumentSignatureForAnchor ( string , start + <NUM_LIT:1> , buffer ) ; } private static int appendArrayTypeSignatureForAnchor ( char [ ] string , int start , StringBuffer buffer , boolean isVarArgs ) { int length = string . length ; if ( start >= length - <NUM_LIT:1> ) { throw new IllegalArgumentException ( ) ; } char c = string [ start ] ; if ( c != Signature . C_ARRAY ) { throw new IllegalArgumentException ( ) ; } int index = start ; c = string [ ++ index ] ; while ( c == Signature . C_ARRAY ) { if ( index >= length - <NUM_LIT:1> ) { throw new IllegalArgumentException ( ) ; } c = string [ ++ index ] ; } int e = appendTypeSignatureForAnchor ( string , index , buffer , false ) ; for ( int i = <NUM_LIT:1> , dims = index - start ; i < dims ; i ++ ) { buffer . append ( '<CHAR_LIT:[>' ) . append ( '<CHAR_LIT:]>' ) ; } if ( isVarArgs ) { buffer . append ( '<CHAR_LIT:.>' ) . append ( '<CHAR_LIT:.>' ) . append ( '<CHAR_LIT:.>' ) ; } else { buffer . append ( '<CHAR_LIT:[>' ) . append ( '<CHAR_LIT:]>' ) ; } return e ; } private static int appendClassTypeSignatureForAnchor ( char [ ] string , int start , StringBuffer buffer ) { if ( start >= string . length - <NUM_LIT:2> ) { throw new IllegalArgumentException ( ) ; } char c = string [ start ] ; if ( c != Signature . C_RESOLVED && c != Signature . C_UNRESOLVED ) { throw new IllegalArgumentException ( ) ; } int p = start + <NUM_LIT:1> ; while ( true ) { if ( p >= string . length ) { throw new IllegalArgumentException ( ) ; } c = string [ p ] ; switch ( c ) { case Signature . C_SEMICOLON : return p ; case Signature . C_GENERIC_START : int e = scanGenericEnd ( string , p + <NUM_LIT:1> ) ; p = e ; break ; case Signature . C_DOT : buffer . append ( '<CHAR_LIT:.>' ) ; break ; case '<CHAR_LIT:/>' : buffer . append ( '<CHAR_LIT:/>' ) ; break ; case Signature . C_DOLLAR : buffer . append ( '<CHAR_LIT:.>' ) ; break ; default : buffer . append ( c ) ; } p ++ ; } } private static int scanGenericEnd ( char [ ] string , int start ) { if ( string [ start ] == Signature . C_GENERIC_END ) { return start ; } int length = string . length ; int balance = <NUM_LIT:1> ; start ++ ; while ( start <= length ) { switch ( string [ start ] ) { case Signature . C_GENERIC_END : balance -- ; if ( balance == <NUM_LIT:0> ) { return start ; } break ; case Signature . C_GENERIC_START : balance ++ ; break ; } start ++ ; } return start ; } public static void fixTaskTags ( Map defaultOptionsMap ) { Object taskTagsValue = defaultOptionsMap . get ( JavaCore . COMPILER_TASK_TAGS ) ; char [ ] [ ] taskTags = null ; if ( taskTagsValue instanceof String ) { taskTags = CharOperation . splitAndTrimOn ( '<CHAR_LIT:U+002C>' , ( ( String ) taskTagsValue ) . toCharArray ( ) ) ; } Object taskPrioritiesValue = defaultOptionsMap . get ( JavaCore . COMPILER_TASK_PRIORITIES ) ; char [ ] [ ] taskPriorities = null ; if ( taskPrioritiesValue instanceof String ) { taskPriorities = CharOperation . splitAndTrimOn ( '<CHAR_LIT:U+002C>' , ( ( String ) taskPrioritiesValue ) . toCharArray ( ) ) ; } if ( taskPriorities == null ) { if ( taskTags != null ) { Util . logRepeatedMessage ( TASK_PRIORITIES_PROBLEM , IStatus . ERROR , "<STR_LIT>" ) ; defaultOptionsMap . remove ( JavaCore . COMPILER_TASK_TAGS ) ; } return ; } else if ( taskTags == null ) { Util . logRepeatedMessage ( TASK_PRIORITIES_PROBLEM , IStatus . ERROR , "<STR_LIT>" ) ; defaultOptionsMap . remove ( JavaCore . COMPILER_TASK_PRIORITIES ) ; return ; } int taskTagsLength = taskTags . length ; int taskPrioritiesLength = taskPriorities . length ; if ( taskTagsLength != taskPrioritiesLength ) { Util . logRepeatedMessage ( TASK_PRIORITIES_PROBLEM , IStatus . ERROR , "<STR_LIT>" ) ; if ( taskTagsLength > taskPrioritiesLength ) { System . arraycopy ( taskTags , <NUM_LIT:0> , ( taskTags = new char [ taskPrioritiesLength ] [ ] ) , <NUM_LIT:0> , taskPrioritiesLength ) ; defaultOptionsMap . put ( JavaCore . COMPILER_TASK_TAGS , new String ( CharOperation . concatWith ( taskTags , '<CHAR_LIT:U+002C>' ) ) ) ; } else { System . arraycopy ( taskPriorities , <NUM_LIT:0> , ( taskPriorities = new char [ taskTagsLength ] [ ] ) , <NUM_LIT:0> , taskTagsLength ) ; defaultOptionsMap . put ( JavaCore . COMPILER_TASK_PRIORITIES , new String ( CharOperation . concatWith ( taskPriorities , '<CHAR_LIT:U+002C>' ) ) ) ; } } } public static IMethod findMethod ( IType type , char [ ] selector , String [ ] paramTypeSignatures , boolean isConstructor ) throws JavaModelException { IMethod method = null ; int startingIndex = <NUM_LIT:0> ; String [ ] args ; IType enclosingType = type . getDeclaringType ( ) ; if ( enclosingType != null && isConstructor && ! Flags . isStatic ( type . getFlags ( ) ) ) { args = new String [ paramTypeSignatures . length + <NUM_LIT:1> ] ; startingIndex = <NUM_LIT:1> ; args [ <NUM_LIT:0> ] = Signature . createTypeSignature ( enclosingType . getFullyQualifiedName ( ) , true ) ; } else { args = new String [ paramTypeSignatures . length ] ; } int length = args . length ; for ( int i = startingIndex ; i < length ; i ++ ) { args [ i ] = new String ( paramTypeSignatures [ i - startingIndex ] ) ; } method = type . getMethod ( new String ( selector ) , args ) ; IMethod [ ] methods = type . findMethods ( method ) ; if ( methods != null && methods . length > <NUM_LIT:0> ) { method = methods [ <NUM_LIT:0> ] ; } return method ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . util . IConstantPoolEntry ; public class ConstantPoolEntry implements IConstantPoolEntry { private int kind ; private int classInfoNameIndex ; private int classIndex ; private int nameAndTypeIndex ; private int stringIndex ; private char [ ] stringValue ; private int integerValue ; private float floatValue ; private double doubleValue ; private long longValue ; private int nameAndTypeDescriptorIndex ; private int nameAndTypeNameIndex ; private char [ ] className ; private char [ ] fieldName ; private char [ ] methodName ; private char [ ] fieldDescriptor ; private char [ ] methodDescriptor ; private char [ ] utf8Value ; private int utf8Length ; private char [ ] classInfoName ; public ConstantPoolEntry ( ) { this . classInfoNameIndex = - <NUM_LIT:1> ; this . classIndex = - <NUM_LIT:1> ; this . nameAndTypeIndex = - <NUM_LIT:1> ; this . stringIndex = - <NUM_LIT:1> ; this . stringValue = null ; this . integerValue = - <NUM_LIT:1> ; this . floatValue = - <NUM_LIT:0.0f> ; this . doubleValue = - <NUM_LIT:0> - <NUM_LIT:0> ; this . longValue = - <NUM_LIT:1> ; this . nameAndTypeDescriptorIndex = - <NUM_LIT:1> ; this . nameAndTypeNameIndex = - <NUM_LIT:1> ; this . className = null ; this . fieldName = null ; this . methodName = null ; this . fieldDescriptor = null ; this . methodDescriptor = null ; this . utf8Value = null ; this . utf8Length = - <NUM_LIT:1> ; this . classInfoName = null ; } public int getKind ( ) { return this . kind ; } public void setKind ( int kind ) { this . kind = kind ; } public int getClassInfoNameIndex ( ) { return this . classInfoNameIndex ; } public int getClassIndex ( ) { return this . classIndex ; } public int getNameAndTypeIndex ( ) { return this . nameAndTypeIndex ; } public int getStringIndex ( ) { return this . stringIndex ; } public String getStringValue ( ) { return new String ( this . stringValue ) ; } public int getIntegerValue ( ) { return this . integerValue ; } public float getFloatValue ( ) { return this . floatValue ; } public double getDoubleValue ( ) { return this . doubleValue ; } public long getLongValue ( ) { return this . longValue ; } public int getNameAndTypeInfoDescriptorIndex ( ) { return this . nameAndTypeDescriptorIndex ; } public int getNameAndTypeInfoNameIndex ( ) { return this . nameAndTypeNameIndex ; } public char [ ] getClassName ( ) { return this . className ; } public char [ ] getFieldName ( ) { return this . fieldName ; } public char [ ] getMethodName ( ) { return this . methodName ; } public char [ ] getFieldDescriptor ( ) { return this . fieldDescriptor ; } public char [ ] getMethodDescriptor ( ) { return this . methodDescriptor ; } public char [ ] getUtf8Value ( ) { return this . utf8Value ; } public char [ ] getClassInfoName ( ) { return this . classInfoName ; } public void setClassInfoNameIndex ( int classInfoNameIndex ) { this . classInfoNameIndex = classInfoNameIndex ; } public void setClassIndex ( int classIndex ) { this . classIndex = classIndex ; } public void setNameAndTypeIndex ( int nameAndTypeIndex ) { this . nameAndTypeIndex = nameAndTypeIndex ; } public void setStringIndex ( int stringIndex ) { this . stringIndex = stringIndex ; } public void setStringValue ( char [ ] stringValue ) { this . stringValue = stringValue ; } public void setIntegerValue ( int integerValue ) { this . integerValue = integerValue ; } public void setFloatValue ( float floatValue ) { this . floatValue = floatValue ; } public void setDoubleValue ( double doubleValue ) { this . doubleValue = doubleValue ; } public void setLongValue ( long longValue ) { this . longValue = longValue ; } public int getNameAndTypeDescriptorIndex ( ) { return this . nameAndTypeDescriptorIndex ; } public void setNameAndTypeDescriptorIndex ( int nameAndTypeDescriptorIndex ) { this . nameAndTypeDescriptorIndex = nameAndTypeDescriptorIndex ; } public int getNameAndTypeNameIndex ( ) { return this . nameAndTypeNameIndex ; } public void setNameAndTypeNameIndex ( int nameAndTypeNameIndex ) { this . nameAndTypeNameIndex = nameAndTypeNameIndex ; } public void setClassName ( char [ ] className ) { this . className = className ; } public void setFieldName ( char [ ] fieldName ) { this . fieldName = fieldName ; } public void setMethodName ( char [ ] methodName ) { this . methodName = methodName ; } public void setFieldDescriptor ( char [ ] fieldDescriptor ) { this . fieldDescriptor = fieldDescriptor ; } public void setMethodDescriptor ( char [ ] methodDescriptor ) { this . methodDescriptor = methodDescriptor ; } public void setUtf8Value ( char [ ] utf8Value ) { this . utf8Value = utf8Value ; } public void setClassInfoName ( char [ ] classInfoName ) { this . classInfoName = classInfoName ; } public int getUtf8Length ( ) { return this . utf8Length ; } public void setUtf8Length ( int utf8Length ) { this . utf8Length = utf8Length ; } public void reset ( ) { this . kind = <NUM_LIT:0> ; this . classInfoNameIndex = <NUM_LIT:0> ; this . classIndex = <NUM_LIT:0> ; this . nameAndTypeIndex = <NUM_LIT:0> ; this . stringIndex = <NUM_LIT:0> ; this . stringValue = null ; this . integerValue = <NUM_LIT:0> ; this . floatValue = <NUM_LIT:0.0f> ; this . doubleValue = <NUM_LIT:0.0> ; this . longValue = <NUM_LIT> ; this . nameAndTypeDescriptorIndex = <NUM_LIT:0> ; this . nameAndTypeNameIndex = <NUM_LIT:0> ; this . className = null ; this . fieldName = null ; this . methodName = null ; this . fieldDescriptor = null ; this . methodDescriptor = null ; this . utf8Value = null ; this . utf8Length = <NUM_LIT:0> ; this . classInfoName = null ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . util . ClassFormatException ; import org . eclipse . jdt . core . util . IConstantPool ; import org . eclipse . jdt . core . util . IConstantPoolConstant ; import org . eclipse . jdt . core . util . IConstantPoolEntry ; import org . eclipse . jdt . core . util . ILocalVariableTableEntry ; public class LocalVariableTableEntry extends ClassFileStruct implements ILocalVariableTableEntry { private int startPC ; private int length ; private int nameIndex ; private int descriptorIndex ; private char [ ] name ; private char [ ] descriptor ; private int index ; public LocalVariableTableEntry ( byte [ ] classFileBytes , IConstantPool constantPool , int offset ) throws ClassFormatException { this . startPC = u2At ( classFileBytes , <NUM_LIT:0> , offset ) ; this . length = u2At ( classFileBytes , <NUM_LIT:2> , offset ) ; this . nameIndex = u2At ( classFileBytes , <NUM_LIT:4> , offset ) ; this . descriptorIndex = u2At ( classFileBytes , <NUM_LIT:6> , offset ) ; this . index = u2At ( classFileBytes , <NUM_LIT:8> , offset ) ; IConstantPoolEntry constantPoolEntry = constantPool . decodeEntry ( this . nameIndex ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Utf8 ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } this . name = constantPoolEntry . getUtf8Value ( ) ; constantPoolEntry = constantPool . decodeEntry ( this . descriptorIndex ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Utf8 ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } this . descriptor = constantPoolEntry . getUtf8Value ( ) ; } public int getStartPC ( ) { return this . startPC ; } public int getLength ( ) { return this . length ; } public int getNameIndex ( ) { return this . nameIndex ; } public int getDescriptorIndex ( ) { return this . descriptorIndex ; } public int getIndex ( ) { return this . index ; } public char [ ] getName ( ) { return this . name ; } public char [ ] getDescriptor ( ) { return this . descriptor ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . util . ClassFormatException ; import org . eclipse . jdt . core . util . IAnnotation ; import org . eclipse . jdt . core . util . IConstantPool ; import org . eclipse . jdt . core . util . IParameterAnnotation ; public class ParameterAnnotation extends ClassFileStruct implements IParameterAnnotation { private static final IAnnotation [ ] NO_ENTRIES = new IAnnotation [ <NUM_LIT:0> ] ; private int annotationsNumber ; private IAnnotation [ ] annotations ; private int readOffset ; public ParameterAnnotation ( byte [ ] classFileBytes , IConstantPool constantPool , int offset ) throws ClassFormatException { final int length = u2At ( classFileBytes , <NUM_LIT:0> , offset ) ; this . readOffset = <NUM_LIT:2> ; this . annotationsNumber = length ; if ( length != <NUM_LIT:0> ) { this . annotations = new IAnnotation [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { Annotation annotation = new Annotation ( classFileBytes , constantPool , offset + this . readOffset ) ; this . annotations [ i ] = annotation ; this . readOffset += annotation . sizeInBytes ( ) ; } } else { this . annotations = NO_ENTRIES ; } } int sizeInBytes ( ) { return this . readOffset ; } public IAnnotation [ ] getAnnotations ( ) { return this . annotations ; } public int getAnnotationsNumber ( ) { return this . annotationsNumber ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . util . ClassFormatException ; import org . eclipse . jdt . core . util . IConstantPool ; import org . eclipse . jdt . core . util . IParameterAnnotation ; import org . eclipse . jdt . core . util . IRuntimeInvisibleParameterAnnotationsAttribute ; public class RuntimeInvisibleParameterAnnotationsAttribute extends ClassFileAttribute implements IRuntimeInvisibleParameterAnnotationsAttribute { private static final IParameterAnnotation [ ] NO_ENTRIES = new IParameterAnnotation [ <NUM_LIT:0> ] ; private IParameterAnnotation [ ] parameterAnnotations ; private int parametersNumber ; public RuntimeInvisibleParameterAnnotationsAttribute ( byte [ ] classFileBytes , IConstantPool constantPool , int offset ) throws ClassFormatException { super ( classFileBytes , constantPool , offset ) ; final int length = u1At ( classFileBytes , <NUM_LIT:6> , offset ) ; this . parametersNumber = length ; if ( length != <NUM_LIT:0> ) { int readOffset = <NUM_LIT:7> ; this . parameterAnnotations = new IParameterAnnotation [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { ParameterAnnotation parameterAnnotation = new ParameterAnnotation ( classFileBytes , constantPool , offset + readOffset ) ; this . parameterAnnotations [ i ] = parameterAnnotation ; readOffset += parameterAnnotation . sizeInBytes ( ) ; } } else { this . parameterAnnotations = NO_ENTRIES ; } } public IParameterAnnotation [ ] getParameterAnnotations ( ) { return this . parameterAnnotations ; } public int getParametersNumber ( ) { return this . parametersNumber ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import java . util . ArrayList ; import org . eclipse . jdt . core . IAnnotatable ; import org . eclipse . jdt . core . ICompilationUnit ; import org . eclipse . jdt . core . IJavaElement ; import org . eclipse . jdt . core . IMethod ; import org . eclipse . jdt . core . IOpenable ; import org . eclipse . jdt . core . IPackageFragment ; import org . eclipse . jdt . core . IType ; import org . eclipse . jdt . core . ITypeRoot ; import org . eclipse . jdt . core . JavaModelException ; import org . eclipse . jdt . core . Signature ; import org . eclipse . jdt . core . WorkingCopyOwner ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . util . SuffixConstants ; import org . eclipse . jdt . internal . core . * ; public class JavaElementFinder extends BindingKeyParser { private JavaProject project ; private WorkingCopyOwner owner ; public IJavaElement element ; public JavaModelException exception ; private ArrayList types = new ArrayList ( ) ; public JavaElementFinder ( String key , JavaProject project , WorkingCopyOwner owner ) { super ( key ) ; this . project = project ; this . owner = owner ; } private JavaElementFinder ( BindingKeyParser parser , JavaProject project , WorkingCopyOwner owner ) { super ( parser ) ; this . project = project ; this . owner = owner ; } public void consumeAnnotation ( ) { if ( ! ( this . element instanceof IAnnotatable ) ) return ; int size = this . types . size ( ) ; if ( size == <NUM_LIT:0> ) return ; IJavaElement annotationType = ( ( JavaElementFinder ) this . types . get ( size - <NUM_LIT:1> ) ) . element ; this . element = ( ( IAnnotatable ) this . element ) . getAnnotation ( annotationType . getElementName ( ) ) ; } public void consumeField ( char [ ] fieldName ) { if ( ! ( this . element instanceof IType ) ) return ; this . element = ( ( IType ) this . element ) . getField ( new String ( fieldName ) ) ; } public void consumeFullyQualifiedName ( char [ ] fullyQualifiedName ) { try { this . element = this . project . findType ( new String ( CharOperation . replaceOnCopy ( fullyQualifiedName , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ) , this . owner ) ; } catch ( JavaModelException e ) { this . exception = e ; } } public void consumeLocalType ( char [ ] uniqueKey ) { if ( this . element == null ) return ; if ( this . element instanceof BinaryType ) { int lastSlash = CharOperation . lastIndexOf ( '<CHAR_LIT:/>' , uniqueKey ) ; int end = CharOperation . indexOf ( '<CHAR_LIT:;>' , uniqueKey , lastSlash + <NUM_LIT:1> ) ; char [ ] localName = CharOperation . subarray ( uniqueKey , lastSlash + <NUM_LIT:1> , end ) ; IPackageFragment pkg = ( IPackageFragment ) this . element . getAncestor ( IJavaElement . PACKAGE_FRAGMENT ) ; this . element = pkg . getClassFile ( new String ( localName ) + SuffixConstants . SUFFIX_STRING_class ) ; } else { int firstDollar = CharOperation . indexOf ( '<CHAR_LIT>' , uniqueKey ) ; int end = CharOperation . indexOf ( '<CHAR_LIT>' , uniqueKey , firstDollar + <NUM_LIT:1> ) ; if ( end == - <NUM_LIT:1> ) end = CharOperation . indexOf ( '<CHAR_LIT:;>' , uniqueKey , firstDollar + <NUM_LIT:1> ) ; char [ ] sourceStart = CharOperation . subarray ( uniqueKey , firstDollar + <NUM_LIT:1> , end ) ; int position = Integer . parseInt ( new String ( sourceStart ) ) ; try { this . element = ( ( ITypeRoot ) this . element . getOpenable ( ) ) . getElementAt ( position ) ; } catch ( JavaModelException e ) { this . exception = e ; } } } public void consumeMemberType ( char [ ] simpleTypeName ) { if ( ! ( this . element instanceof IType ) ) return ; this . element = ( ( IType ) this . element ) . getType ( new String ( simpleTypeName ) ) ; } public void consumeMethod ( char [ ] selector , char [ ] signature ) { if ( ! ( this . element instanceof IType ) ) return ; String [ ] parameterTypes = Signature . getParameterTypes ( new String ( signature ) ) ; IType type = ( IType ) this . element ; IMethod method = type . getMethod ( new String ( selector ) , parameterTypes ) ; IMethod [ ] methods = type . findMethods ( method ) ; if ( methods . length > <NUM_LIT:0> ) this . element = methods [ <NUM_LIT:0> ] ; } public void consumePackage ( char [ ] pkgName ) { pkgName = CharOperation . replaceOnCopy ( pkgName , '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ; try { this . element = this . project . findPackageFragment ( new String ( pkgName ) ) ; } catch ( JavaModelException e ) { this . exception = e ; } } public void consumeParser ( BindingKeyParser parser ) { this . types . add ( parser ) ; } public void consumeSecondaryType ( char [ ] simpleTypeName ) { if ( this . element == null ) return ; IOpenable openable = this . element . getOpenable ( ) ; if ( ! ( openable instanceof ICompilationUnit ) ) return ; this . element = ( ( ICompilationUnit ) openable ) . getType ( new String ( simpleTypeName ) ) ; } public void consumeTypeVariable ( char [ ] position , char [ ] typeVariableName ) { if ( this . element == null ) return ; switch ( this . element . getElementType ( ) ) { case IJavaElement . TYPE : this . element = ( ( IType ) this . element ) . getTypeParameter ( new String ( typeVariableName ) ) ; break ; case IJavaElement . METHOD : this . element = ( ( IMethod ) this . element ) . getTypeParameter ( new String ( typeVariableName ) ) ; break ; } } public BindingKeyParser newParser ( ) { return new JavaElementFinder ( this , this . project , this . owner ) ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . util . ClassFormatException ; import org . eclipse . jdt . core . util . IClassFileAttribute ; import org . eclipse . jdt . core . util . IConstantPool ; import org . eclipse . jdt . core . util . IConstantPoolConstant ; import org . eclipse . jdt . core . util . IConstantPoolEntry ; public class ClassFileAttribute extends ClassFileStruct implements IClassFileAttribute { public static final IClassFileAttribute [ ] NO_ATTRIBUTES = new IClassFileAttribute [ <NUM_LIT:0> ] ; private long attributeLength ; private int attributeNameIndex ; private char [ ] attributeName ; public ClassFileAttribute ( byte [ ] classFileBytes , IConstantPool constantPool , int offset ) throws ClassFormatException { this . attributeNameIndex = u2At ( classFileBytes , <NUM_LIT:0> , offset ) ; this . attributeLength = u4At ( classFileBytes , <NUM_LIT:2> , offset ) ; IConstantPoolEntry constantPoolEntry = constantPool . decodeEntry ( this . attributeNameIndex ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Utf8 ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } this . attributeName = constantPoolEntry . getUtf8Value ( ) ; } public int getAttributeNameIndex ( ) { return this . attributeNameIndex ; } public char [ ] getAttributeName ( ) { return this . attributeName ; } public long getAttributeLength ( ) { return this . attributeLength ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . util . ClassFormatException ; import org . eclipse . jdt . core . util . IConstantPool ; import org . eclipse . jdt . core . util . IInnerClassesAttribute ; import org . eclipse . jdt . core . util . IInnerClassesAttributeEntry ; public class InnerClassesAttribute extends ClassFileAttribute implements IInnerClassesAttribute { private static final IInnerClassesAttributeEntry [ ] NO_ENTRIES = new IInnerClassesAttributeEntry [ <NUM_LIT:0> ] ; private int numberOfClasses ; private IInnerClassesAttributeEntry [ ] entries ; public InnerClassesAttribute ( byte [ ] classFileBytes , IConstantPool constantPool , int offset ) throws ClassFormatException { super ( classFileBytes , constantPool , offset ) ; this . numberOfClasses = u2At ( classFileBytes , <NUM_LIT:6> , offset ) ; final int length = this . numberOfClasses ; if ( length != <NUM_LIT:0> ) { int readOffset = <NUM_LIT:8> ; this . entries = new IInnerClassesAttributeEntry [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { this . entries [ i ] = new InnerClassesAttributeEntry ( classFileBytes , constantPool , offset + readOffset ) ; readOffset += <NUM_LIT:8> ; } } else { this . entries = NO_ENTRIES ; } } public IInnerClassesAttributeEntry [ ] getInnerClassAttributesEntries ( ) { return this . entries ; } public int getNumberOfClasses ( ) { return this . numberOfClasses ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . compiler . CharOperation ; public final class SimpleWordSet { public char [ ] [ ] words ; public int elementSize ; public int threshold ; public SimpleWordSet ( int size ) { this . elementSize = <NUM_LIT:0> ; this . threshold = size ; int extraRoom = ( int ) ( size * <NUM_LIT> ) ; if ( this . threshold == extraRoom ) extraRoom ++ ; this . words = new char [ extraRoom ] [ ] ; } public char [ ] add ( char [ ] word ) { int length = this . words . length ; int index = CharOperation . hashCode ( word ) % length ; char [ ] current ; while ( ( current = this . words [ index ] ) != null ) { if ( CharOperation . equals ( current , word ) ) return current ; if ( ++ index == length ) index = <NUM_LIT:0> ; } this . words [ index ] = word ; if ( ++ this . elementSize > this . threshold ) rehash ( ) ; return word ; } public boolean includes ( char [ ] word ) { int length = this . words . length ; int index = CharOperation . hashCode ( word ) % length ; char [ ] current ; while ( ( current = this . words [ index ] ) != null ) { if ( CharOperation . equals ( current , word ) ) return true ; if ( ++ index == length ) index = <NUM_LIT:0> ; } return false ; } private void rehash ( ) { SimpleWordSet newSet = new SimpleWordSet ( this . elementSize * <NUM_LIT:2> ) ; char [ ] current ; for ( int i = this . words . length ; -- i >= <NUM_LIT:0> ; ) if ( ( current = this . words [ i ] ) != null ) newSet . add ( current ) ; this . words = newSet . words ; this . elementSize = newSet . elementSize ; this . threshold = newSet . threshold ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import java . util . Locale ; import java . util . Map ; import org . eclipse . jdt . core . compiler . CategorizedProblem ; import org . eclipse . jdt . internal . compiler . CompilationResult ; import org . eclipse . jdt . internal . compiler . DefaultErrorHandlingPolicies ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . CompilationUnitDeclaration ; import org . eclipse . jdt . internal . compiler . ast . ConstructorDeclaration ; import org . eclipse . jdt . internal . compiler . ast . Expression ; import org . eclipse . jdt . internal . compiler . batch . CompilationUnit ; import org . eclipse . jdt . internal . compiler . env . ICompilationUnit ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . problem . DefaultProblemFactory ; import org . eclipse . jdt . internal . compiler . problem . ProblemReporter ; public class CodeSnippetParsingUtil { public RecordedParsingInformation recordedParsingInformation ; public boolean ignoreMethodBodies ; public CodeSnippetParsingUtil ( boolean ignoreMethodBodies ) { this . ignoreMethodBodies = ignoreMethodBodies ; } public CodeSnippetParsingUtil ( ) { this ( false ) ; } private RecordedParsingInformation getRecordedParsingInformation ( CompilationResult compilationResult , int [ ] [ ] commentPositions ) { int problemsCount = compilationResult . problemCount ; CategorizedProblem [ ] problems = null ; if ( problemsCount != <NUM_LIT:0> ) { final CategorizedProblem [ ] compilationResultProblems = compilationResult . problems ; if ( compilationResultProblems . length == problemsCount ) { problems = compilationResultProblems ; } else { System . arraycopy ( compilationResultProblems , <NUM_LIT:0> , ( problems = new CategorizedProblem [ problemsCount ] ) , <NUM_LIT:0> , problemsCount ) ; } } return new RecordedParsingInformation ( problems , compilationResult . getLineSeparatorPositions ( ) , commentPositions ) ; } public ASTNode [ ] parseClassBodyDeclarations ( char [ ] source , Map settings , boolean recordParsingInformation ) { return parseClassBodyDeclarations ( source , <NUM_LIT:0> , source . length , settings , recordParsingInformation , false ) ; } public ASTNode [ ] parseClassBodyDeclarations ( char [ ] source , int offset , int length , Map settings , boolean recordParsingInformation , boolean enabledStatementRecovery ) { if ( source == null ) { throw new IllegalArgumentException ( ) ; } CompilerOptions compilerOptions = new CompilerOptions ( settings ) ; compilerOptions . ignoreMethodBodies = this . ignoreMethodBodies ; final ProblemReporter problemReporter = new ProblemReporter ( DefaultErrorHandlingPolicies . proceedWithAllProblems ( ) , compilerOptions , new DefaultProblemFactory ( Locale . getDefault ( ) ) ) ; CommentRecorderParser parser = new CommentRecorderParser ( problemReporter , false ) ; parser . setMethodsFullRecovery ( false ) ; parser . setStatementsRecovery ( enabledStatementRecovery ) ; ICompilationUnit sourceUnit = new CompilationUnit ( source , "<STR_LIT>" , compilerOptions . defaultEncoding ) ; CompilationResult compilationResult = new CompilationResult ( sourceUnit , <NUM_LIT:0> , <NUM_LIT:0> , compilerOptions . maxProblemsPerUnit ) ; final CompilationUnitDeclaration compilationUnitDeclaration = new CompilationUnitDeclaration ( problemReporter , compilationResult , source . length ) ; ASTNode [ ] result = parser . parseClassBodyDeclarations ( source , offset , length , compilationUnitDeclaration ) ; if ( recordParsingInformation ) { this . recordedParsingInformation = getRecordedParsingInformation ( compilationResult , compilationUnitDeclaration . comments ) ; } return result ; } public CompilationUnitDeclaration parseCompilationUnit ( char [ ] source , Map settings , boolean recordParsingInformation ) { if ( source == null ) { throw new IllegalArgumentException ( ) ; } CompilerOptions compilerOptions = new CompilerOptions ( settings ) ; compilerOptions . ignoreMethodBodies = this . ignoreMethodBodies ; CommentRecorderParser parser = new CommentRecorderParser ( new ProblemReporter ( DefaultErrorHandlingPolicies . proceedWithAllProblems ( ) , compilerOptions , new DefaultProblemFactory ( Locale . getDefault ( ) ) ) , false ) ; ICompilationUnit sourceUnit = new CompilationUnit ( source , "<STR_LIT>" , compilerOptions . defaultEncoding ) ; final CompilationResult compilationResult = new CompilationResult ( sourceUnit , <NUM_LIT:0> , <NUM_LIT:0> , compilerOptions . maxProblemsPerUnit ) ; CompilationUnitDeclaration compilationUnitDeclaration = parser . dietParse ( sourceUnit , compilationResult ) ; if ( recordParsingInformation ) { this . recordedParsingInformation = getRecordedParsingInformation ( compilationResult , compilationUnitDeclaration . comments ) ; } if ( compilationUnitDeclaration . ignoreMethodBodies ) { compilationUnitDeclaration . ignoreFurtherInvestigation = true ; return compilationUnitDeclaration ; } parser . scanner . setSource ( compilationResult ) ; org . eclipse . jdt . internal . compiler . ast . TypeDeclaration [ ] types = compilationUnitDeclaration . types ; if ( types != null ) { for ( int i = <NUM_LIT:0> , length = types . length ; i < length ; i ++ ) { types [ i ] . parseMethods ( parser , compilationUnitDeclaration ) ; } } if ( recordParsingInformation ) { this . recordedParsingInformation . updateRecordedParsingInformation ( compilationResult ) ; } return compilationUnitDeclaration ; } public Expression parseExpression ( char [ ] source , Map settings , boolean recordParsingInformation ) { return parseExpression ( source , <NUM_LIT:0> , source . length , settings , recordParsingInformation ) ; } public Expression parseExpression ( char [ ] source , int offset , int length , Map settings , boolean recordParsingInformation ) { if ( source == null ) { throw new IllegalArgumentException ( ) ; } CompilerOptions compilerOptions = new CompilerOptions ( settings ) ; final ProblemReporter problemReporter = new ProblemReporter ( DefaultErrorHandlingPolicies . proceedWithAllProblems ( ) , compilerOptions , new DefaultProblemFactory ( Locale . getDefault ( ) ) ) ; CommentRecorderParser parser = new CommentRecorderParser ( problemReporter , false ) ; ICompilationUnit sourceUnit = new CompilationUnit ( source , "<STR_LIT>" , compilerOptions . defaultEncoding ) ; CompilationResult compilationResult = new CompilationResult ( sourceUnit , <NUM_LIT:0> , <NUM_LIT:0> , compilerOptions . maxProblemsPerUnit ) ; CompilationUnitDeclaration unit = new CompilationUnitDeclaration ( problemReporter , compilationResult , source . length ) ; Expression result = parser . parseExpression ( source , offset , length , unit ) ; if ( recordParsingInformation ) { this . recordedParsingInformation = getRecordedParsingInformation ( compilationResult , unit . comments ) ; } return result ; } public ConstructorDeclaration parseStatements ( char [ ] source , Map settings , boolean recordParsingInformation , boolean enabledStatementRecovery ) { return parseStatements ( source , <NUM_LIT:0> , source . length , settings , recordParsingInformation , enabledStatementRecovery ) ; } public ConstructorDeclaration parseStatements ( char [ ] source , int offset , int length , Map settings , boolean recordParsingInformation , boolean enabledStatementRecovery ) { if ( source == null ) { throw new IllegalArgumentException ( ) ; } CompilerOptions compilerOptions = new CompilerOptions ( settings ) ; final ProblemReporter problemReporter = new ProblemReporter ( DefaultErrorHandlingPolicies . proceedWithAllProblems ( ) , compilerOptions , new DefaultProblemFactory ( Locale . getDefault ( ) ) ) ; CommentRecorderParser parser = new CommentRecorderParser ( problemReporter , false ) ; parser . setMethodsFullRecovery ( false ) ; parser . setStatementsRecovery ( enabledStatementRecovery ) ; ICompilationUnit sourceUnit = new CompilationUnit ( source , "<STR_LIT>" , compilerOptions . defaultEncoding ) ; final CompilationResult compilationResult = new CompilationResult ( sourceUnit , <NUM_LIT:0> , <NUM_LIT:0> , compilerOptions . maxProblemsPerUnit ) ; CompilationUnitDeclaration compilationUnitDeclaration = new CompilationUnitDeclaration ( problemReporter , compilationResult , length ) ; ConstructorDeclaration constructorDeclaration = new ConstructorDeclaration ( compilationResult ) ; constructorDeclaration . sourceEnd = - <NUM_LIT:1> ; constructorDeclaration . declarationSourceEnd = offset + length - <NUM_LIT:1> ; constructorDeclaration . bodyStart = offset ; constructorDeclaration . bodyEnd = offset + length - <NUM_LIT:1> ; parser . scanner . setSource ( compilationResult ) ; parser . scanner . resetTo ( offset , offset + length ) ; parser . parse ( constructorDeclaration , compilationUnitDeclaration , true ) ; if ( recordParsingInformation ) { this . recordedParsingInformation = getRecordedParsingInformation ( compilationResult , compilationUnitDeclaration . comments ) ; } return constructorDeclaration ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; public abstract class ReferenceInfoAdapter { 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 acceptMethodReference ( char [ ] methodName , int argCount , int sourcePosition ) { } 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 ) { } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . util . ClassFormatException ; import org . eclipse . jdt . core . util . IConstantPool ; import org . eclipse . jdt . core . util . IConstantPoolConstant ; import org . eclipse . jdt . core . util . IConstantPoolEntry ; import org . eclipse . jdt . core . util . ISourceAttribute ; public class SourceFileAttribute extends ClassFileAttribute implements ISourceAttribute { private int sourceFileIndex ; private char [ ] sourceFileName ; public SourceFileAttribute ( byte [ ] classFileBytes , IConstantPool constantPool , int offset ) throws ClassFormatException { super ( classFileBytes , constantPool , offset ) ; this . sourceFileIndex = u2At ( classFileBytes , <NUM_LIT:6> , offset ) ; IConstantPoolEntry constantPoolEntry = constantPool . decodeEntry ( this . sourceFileIndex ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Utf8 ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } this . sourceFileName = constantPoolEntry . getUtf8Value ( ) ; } public int getSourceFileIndex ( ) { return this . sourceFileIndex ; } public char [ ] getSourceFileName ( ) { return this . sourceFileName ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import java . text . NumberFormat ; import java . util . Enumeration ; import java . util . Hashtable ; public class LRUCache implements Cloneable { protected static class LRUCacheEntry { public Object key ; public Object value ; public int timestamp ; public int space ; public LRUCacheEntry previous ; public LRUCacheEntry next ; public LRUCacheEntry ( Object key , Object value , int space ) { this . key = key ; this . value = value ; this . space = space ; } public String toString ( ) { return "<STR_LIT>" + this . key + "<STR_LIT>" + this . value + "<STR_LIT:]>" ; } } public class Stats { private int [ ] counters = new int [ <NUM_LIT:20> ] ; private long [ ] timestamps = new long [ <NUM_LIT:20> ] ; private int counterIndex = - <NUM_LIT:1> ; private void add ( int counter ) { for ( int i = <NUM_LIT:0> ; i <= this . counterIndex ; i ++ ) { if ( this . counters [ i ] == counter ) return ; } int length = this . counters . length ; if ( ++ this . counterIndex == length ) { int newLength = this . counters . length * <NUM_LIT:2> ; System . arraycopy ( this . counters , <NUM_LIT:0> , this . counters = new int [ newLength ] , <NUM_LIT:0> , length ) ; System . arraycopy ( this . timestamps , <NUM_LIT:0> , this . timestamps = new long [ newLength ] , <NUM_LIT:0> , length ) ; } this . counters [ this . counterIndex ] = counter ; this . timestamps [ this . counterIndex ] = System . currentTimeMillis ( ) ; } private String getAverageAge ( long totalTime , int numberOfElements , long currentTime ) { if ( numberOfElements == <NUM_LIT:0> ) return "<STR_LIT>" ; long time = totalTime / numberOfElements ; long age = currentTime - time ; long ageInSeconds = age / <NUM_LIT:1000> ; int seconds = <NUM_LIT:0> ; int minutes = <NUM_LIT:0> ; int hours = <NUM_LIT:0> ; int days = <NUM_LIT:0> ; if ( ageInSeconds > <NUM_LIT> ) { long ageInMin = ageInSeconds / <NUM_LIT> ; seconds = ( int ) ( ageInSeconds - ( <NUM_LIT> * ageInMin ) ) ; if ( ageInMin > <NUM_LIT> ) { long ageInHours = ageInMin / <NUM_LIT> ; minutes = ( int ) ( ageInMin - ( <NUM_LIT> * ageInHours ) ) ; if ( ageInHours > <NUM_LIT:24> ) { long ageInDays = ageInHours / <NUM_LIT:24> ; hours = ( int ) ( ageInHours - ( <NUM_LIT:24> * ageInDays ) ) ; days = ( int ) ageInDays ; } else { hours = ( int ) ageInHours ; } } else { minutes = ( int ) ageInMin ; } } else { seconds = ( int ) ageInSeconds ; } StringBuffer buffer = new StringBuffer ( ) ; if ( days > <NUM_LIT:0> ) { buffer . append ( days ) ; buffer . append ( "<STR_LIT>" ) ; } if ( hours > <NUM_LIT:0> ) { buffer . append ( hours ) ; buffer . append ( "<STR_LIT>" ) ; } if ( minutes > <NUM_LIT:0> ) { buffer . append ( minutes ) ; buffer . append ( "<STR_LIT>" ) ; } buffer . append ( seconds ) ; buffer . append ( "<STR_LIT>" ) ; return buffer . toString ( ) ; } private long getTimestamps ( int counter ) { for ( int i = <NUM_LIT:0> ; i <= this . counterIndex ; i ++ ) { if ( this . counters [ i ] >= counter ) return this . timestamps [ i ] ; } return - <NUM_LIT:1> ; } public synchronized String printStats ( ) { int numberOfElements = LRUCache . this . currentSpace ; if ( numberOfElements == <NUM_LIT:0> ) { return "<STR_LIT>" ; } StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( "<STR_LIT>" ) ; buffer . append ( numberOfElements ) ; final int numberOfGroups = <NUM_LIT:5> ; int numberOfElementsPerGroup = numberOfElements / numberOfGroups ; buffer . append ( "<STR_LIT>" ) ; buffer . append ( numberOfGroups ) ; buffer . append ( "<STR_LIT>" ) ; buffer . append ( numberOfElementsPerGroup ) ; buffer . append ( "<STR_LIT>" ) ; buffer . append ( "<STR_LIT>" ) ; int groupNumber = <NUM_LIT:1> ; int elementCounter = <NUM_LIT:0> ; LRUCacheEntry entry = LRUCache . this . entryQueueTail ; long currentTime = System . currentTimeMillis ( ) ; long accumulatedTime = <NUM_LIT:0> ; while ( entry != null ) { long timeStamps = getTimestamps ( entry . timestamp ) ; if ( timeStamps > <NUM_LIT:0> ) { accumulatedTime += timeStamps ; elementCounter ++ ; } if ( elementCounter >= numberOfElementsPerGroup && ( groupNumber < numberOfGroups ) ) { buffer . append ( "<STR_LIT>" ) ; buffer . append ( groupNumber ) ; if ( groupNumber == <NUM_LIT:1> ) { buffer . append ( "<STR_LIT>" ) ; } else { buffer . append ( "<STR_LIT>" ) ; } groupNumber ++ ; buffer . append ( getAverageAge ( accumulatedTime , elementCounter , currentTime ) ) ; elementCounter = <NUM_LIT:0> ; accumulatedTime = <NUM_LIT:0> ; } entry = entry . previous ; } buffer . append ( "<STR_LIT>" ) ; buffer . append ( numberOfGroups ) ; buffer . append ( "<STR_LIT>" ) ; buffer . append ( getAverageAge ( accumulatedTime , elementCounter , currentTime ) ) ; return buffer . toString ( ) ; } private void removeCountersOlderThan ( int counter ) { for ( int i = <NUM_LIT:0> ; i <= this . counterIndex ; i ++ ) { if ( this . counters [ i ] >= counter ) { if ( i > <NUM_LIT:0> ) { int length = this . counterIndex - i + <NUM_LIT:1> ; System . arraycopy ( this . counters , i , this . counters , <NUM_LIT:0> , length ) ; System . arraycopy ( this . timestamps , i , this . timestamps , <NUM_LIT:0> , length ) ; this . counterIndex = length ; } return ; } } } public Object getOldestElement ( ) { return LRUCache . this . getOldestElement ( ) ; } public long getOldestTimestamps ( ) { return getTimestamps ( getOldestTimestampCounter ( ) ) ; } public synchronized void snapshot ( ) { removeCountersOlderThan ( getOldestTimestampCounter ( ) ) ; add ( getNewestTimestampCounter ( ) ) ; } } protected int currentSpace ; protected int spaceLimit ; protected int timestampCounter ; protected Hashtable entryTable ; protected LRUCacheEntry entryQueue ; protected LRUCacheEntry entryQueueTail ; protected static final int DEFAULT_SPACELIMIT = <NUM_LIT:100> ; public LRUCache ( ) { this ( DEFAULT_SPACELIMIT ) ; } public LRUCache ( int size ) { this . timestampCounter = this . currentSpace = <NUM_LIT:0> ; this . entryQueue = this . entryQueueTail = null ; this . entryTable = new Hashtable ( size ) ; this . spaceLimit = size ; } public Object clone ( ) { LRUCache newCache = newInstance ( this . spaceLimit ) ; LRUCacheEntry qEntry ; qEntry = this . entryQueueTail ; while ( qEntry != null ) { newCache . privateAdd ( qEntry . key , qEntry . value , qEntry . space ) ; qEntry = qEntry . previous ; } return newCache ; } public double fillingRatio ( ) { return ( this . currentSpace ) * <NUM_LIT> / this . spaceLimit ; } public void flush ( ) { this . currentSpace = <NUM_LIT:0> ; LRUCacheEntry entry = this . entryQueueTail ; this . entryTable = new Hashtable ( ) ; this . entryQueue = this . entryQueueTail = null ; while ( entry != null ) { entry = entry . previous ; } } public void flush ( Object key ) { LRUCacheEntry entry ; entry = ( LRUCacheEntry ) this . entryTable . get ( key ) ; if ( entry == null ) return ; privateRemoveEntry ( entry , false ) ; } public Object getKey ( Object key ) { LRUCacheEntry entry = ( LRUCacheEntry ) this . entryTable . get ( key ) ; if ( entry == null ) { return key ; } return entry . key ; } public Object get ( Object key ) { LRUCacheEntry entry = ( LRUCacheEntry ) this . entryTable . get ( key ) ; if ( entry == null ) { return null ; } updateTimestamp ( entry ) ; return entry . value ; } public int getCurrentSpace ( ) { return this . currentSpace ; } public int getNewestTimestampCounter ( ) { return this . entryQueue == null ? <NUM_LIT:0> : this . entryQueue . timestamp ; } public int getOldestTimestampCounter ( ) { return this . entryQueueTail == null ? <NUM_LIT:0> : this . entryQueueTail . timestamp ; } public Object getOldestElement ( ) { return this . entryQueueTail == null ? null : this . entryQueueTail . key ; } public int getSpaceLimit ( ) { return this . spaceLimit ; } public Enumeration keys ( ) { return this . entryTable . keys ( ) ; } public ICacheEnumeration keysAndValues ( ) { return new ICacheEnumeration ( ) { Enumeration values = LRUCache . this . entryTable . elements ( ) ; LRUCacheEntry entry ; public boolean hasMoreElements ( ) { return this . values . hasMoreElements ( ) ; } public Object nextElement ( ) { this . entry = ( LRUCacheEntry ) this . values . nextElement ( ) ; return this . entry . key ; } public Object getValue ( ) { if ( this . entry == null ) { throw new java . util . NoSuchElementException ( ) ; } return this . entry . value ; } } ; } protected boolean makeSpace ( int space ) { int limit ; limit = getSpaceLimit ( ) ; if ( this . currentSpace + space <= limit ) { return true ; } if ( space > limit ) { return false ; } while ( this . currentSpace + space > limit && this . entryQueueTail != null ) { privateRemoveEntry ( this . entryQueueTail , false ) ; } return true ; } protected LRUCache newInstance ( int size ) { return new LRUCache ( size ) ; } public Object peek ( Object key ) { LRUCacheEntry entry = ( LRUCacheEntry ) this . entryTable . get ( key ) ; if ( entry == null ) { return null ; } return entry . value ; } protected void privateAdd ( Object key , Object value , int space ) { LRUCacheEntry entry ; entry = new LRUCacheEntry ( key , value , space ) ; privateAddEntry ( entry , false ) ; } protected void privateAddEntry ( LRUCacheEntry entry , boolean shuffle ) { if ( ! shuffle ) { this . entryTable . put ( entry . key , entry ) ; this . currentSpace += entry . space ; } entry . timestamp = this . timestampCounter ++ ; entry . next = this . entryQueue ; entry . previous = null ; if ( this . entryQueue == null ) { this . entryQueueTail = entry ; } else { this . entryQueue . previous = entry ; } this . entryQueue = entry ; } protected void privateRemoveEntry ( LRUCacheEntry entry , boolean shuffle ) { LRUCacheEntry previous , next ; previous = entry . previous ; next = entry . next ; if ( ! shuffle ) { this . entryTable . remove ( entry . key ) ; this . currentSpace -= entry . space ; } 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 ) { int newSpace , oldSpace , newTotal ; LRUCacheEntry entry ; newSpace = spaceFor ( value ) ; entry = ( LRUCacheEntry ) this . entryTable . get ( key ) ; if ( entry != null ) { oldSpace = entry . space ; newTotal = getCurrentSpace ( ) - oldSpace + newSpace ; if ( newTotal <= getSpaceLimit ( ) ) { updateTimestamp ( entry ) ; entry . value = value ; entry . space = newSpace ; this . currentSpace = newTotal ; return value ; } else { privateRemoveEntry ( entry , false ) ; } } if ( makeSpace ( newSpace ) ) { privateAdd ( key , value , newSpace ) ; } return value ; } public Object removeKey ( Object key ) { LRUCacheEntry entry = ( LRUCacheEntry ) this . entryTable . get ( key ) ; if ( entry == null ) { return null ; } Object value = entry . value ; privateRemoveEntry ( entry , false ) ; return value ; } public void setSpaceLimit ( int limit ) { if ( limit < this . spaceLimit ) { makeSpace ( this . spaceLimit - limit ) ; } this . spaceLimit = limit ; } protected int spaceFor ( Object value ) { if ( value instanceof ILRUCacheable ) { return ( ( ILRUCacheable ) value ) . getCacheFootprint ( ) ; } else { return <NUM_LIT:1> ; } } public String toString ( ) { return toStringFillingRation ( "<STR_LIT>" ) + toStringContents ( ) ; } protected String toStringContents ( ) { StringBuffer result = new StringBuffer ( ) ; int length = this . entryTable . size ( ) ; Object [ ] unsortedKeys = new Object [ length ] ; String [ ] unsortedToStrings = new String [ length ] ; Enumeration e = keys ( ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { Object key = e . nextElement ( ) ; unsortedKeys [ i ] = key ; unsortedToStrings [ i ] = ( key instanceof org . eclipse . jdt . internal . core . JavaElement ) ? ( ( org . eclipse . jdt . internal . core . JavaElement ) key ) . getElementName ( ) : key . toString ( ) ; } ToStringSorter sorter = new ToStringSorter ( ) ; sorter . sort ( unsortedKeys , unsortedToStrings ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { String toString = sorter . sortedStrings [ i ] ; Object value = get ( sorter . sortedObjects [ i ] ) ; result . append ( toString ) ; result . append ( "<STR_LIT>" ) ; result . append ( value ) ; result . append ( "<STR_LIT:n>" ) ; } return result . toString ( ) ; } public String toStringFillingRation ( String cacheName ) { StringBuffer buffer = new StringBuffer ( cacheName ) ; buffer . append ( '<CHAR_LIT:[>' ) ; buffer . append ( getSpaceLimit ( ) ) ; buffer . append ( "<STR_LIT>" ) ; buffer . append ( NumberFormat . getInstance ( ) . format ( fillingRatio ( ) ) ) ; buffer . append ( "<STR_LIT>" ) ; return buffer . toString ( ) ; } protected void updateTimestamp ( LRUCacheEntry entry ) { entry . timestamp = this . timestampCounter ++ ; if ( this . entryQueue != entry ) { privateRemoveEntry ( entry , true ) ; privateAddEntry ( entry , true ) ; } return ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . util . ClassFormatException ; import org . eclipse . jdt . core . util . IAnnotation ; import org . eclipse . jdt . core . util . IAnnotationComponentValue ; import org . eclipse . jdt . core . util . IConstantPool ; import org . eclipse . jdt . core . util . IConstantPoolConstant ; import org . eclipse . jdt . core . util . IConstantPoolEntry ; public class AnnotationComponentValue extends ClassFileStruct implements IAnnotationComponentValue { private static final IAnnotationComponentValue [ ] NO_VALUES = new AnnotationComponentValue [ <NUM_LIT:0> ] ; private IAnnotationComponentValue [ ] annotationComponentValues ; private IAnnotation annotationValue ; private IConstantPoolEntry classInfo ; private int classFileInfoIndex ; private IConstantPoolEntry constantValue ; private int constantValueIndex ; private int enumConstantTypeNameIndex ; private int enumConstantNameIndex ; private char [ ] enumConstantTypeName ; private char [ ] enumConstantName ; private int readOffset ; private int tag ; private int valuesNumber ; public AnnotationComponentValue ( byte [ ] classFileBytes , IConstantPool constantPool , int offset ) throws ClassFormatException { this . classFileInfoIndex = - <NUM_LIT:1> ; this . constantValueIndex = - <NUM_LIT:1> ; this . enumConstantTypeNameIndex = - <NUM_LIT:1> ; this . enumConstantNameIndex = - <NUM_LIT:1> ; final int t = u1At ( classFileBytes , <NUM_LIT:0> , offset ) ; this . tag = t ; this . readOffset = <NUM_LIT:1> ; switch ( t ) { case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT:Z>' : case '<CHAR_LIT>' : final int constantIndex = u2At ( classFileBytes , this . readOffset , offset ) ; this . constantValueIndex = constantIndex ; if ( constantIndex != <NUM_LIT:0> ) { IConstantPoolEntry constantPoolEntry = constantPool . decodeEntry ( constantIndex ) ; switch ( constantPoolEntry . getKind ( ) ) { case IConstantPoolConstant . CONSTANT_Long : case IConstantPoolConstant . CONSTANT_Float : case IConstantPoolConstant . CONSTANT_Double : case IConstantPoolConstant . CONSTANT_Integer : case IConstantPoolConstant . CONSTANT_Utf8 : break ; default : throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } this . constantValue = constantPoolEntry ; } this . readOffset += <NUM_LIT:2> ; break ; case '<CHAR_LIT:e>' : int index = u2At ( classFileBytes , this . readOffset , offset ) ; this . enumConstantTypeNameIndex = index ; if ( index != <NUM_LIT:0> ) { IConstantPoolEntry constantPoolEntry = constantPool . decodeEntry ( index ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Utf8 ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } this . enumConstantTypeName = constantPoolEntry . getUtf8Value ( ) ; } this . readOffset += <NUM_LIT:2> ; index = u2At ( classFileBytes , this . readOffset , offset ) ; this . enumConstantNameIndex = index ; if ( index != <NUM_LIT:0> ) { IConstantPoolEntry constantPoolEntry = constantPool . decodeEntry ( index ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Utf8 ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } this . enumConstantName = constantPoolEntry . getUtf8Value ( ) ; } this . readOffset += <NUM_LIT:2> ; break ; case '<CHAR_LIT:c>' : final int classFileIndex = u2At ( classFileBytes , this . readOffset , offset ) ; this . classFileInfoIndex = classFileIndex ; if ( classFileIndex != <NUM_LIT:0> ) { IConstantPoolEntry constantPoolEntry = constantPool . decodeEntry ( classFileIndex ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Utf8 ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } this . classInfo = constantPoolEntry ; } this . readOffset += <NUM_LIT:2> ; break ; case '<CHAR_LIT>' : Annotation annotation = new Annotation ( classFileBytes , constantPool , this . readOffset + offset ) ; this . annotationValue = annotation ; this . readOffset += annotation . sizeInBytes ( ) ; break ; case '<CHAR_LIT:[>' : final int numberOfValues = u2At ( classFileBytes , this . readOffset , offset ) ; this . valuesNumber = numberOfValues ; this . readOffset += <NUM_LIT:2> ; if ( numberOfValues != <NUM_LIT:0> ) { this . annotationComponentValues = new IAnnotationComponentValue [ numberOfValues ] ; for ( int i = <NUM_LIT:0> ; i < numberOfValues ; i ++ ) { AnnotationComponentValue value = new AnnotationComponentValue ( classFileBytes , constantPool , offset + this . readOffset ) ; this . annotationComponentValues [ i ] = value ; this . readOffset += value . sizeInBytes ( ) ; } } else { this . annotationComponentValues = NO_VALUES ; } break ; } } public IAnnotationComponentValue [ ] getAnnotationComponentValues ( ) { return this . annotationComponentValues ; } public IAnnotation getAnnotationValue ( ) { return this . annotationValue ; } public IConstantPoolEntry getClassInfo ( ) { return this . classInfo ; } public int getClassInfoIndex ( ) { return this . classFileInfoIndex ; } public IConstantPoolEntry getConstantValue ( ) { return this . constantValue ; } public int getConstantValueIndex ( ) { return this . constantValueIndex ; } public char [ ] getEnumConstantName ( ) { return this . enumConstantName ; } public int getEnumConstantNameIndex ( ) { return this . enumConstantNameIndex ; } public char [ ] getEnumConstantTypeName ( ) { return this . enumConstantTypeName ; } public int getEnumConstantTypeNameIndex ( ) { return this . enumConstantTypeNameIndex ; } public int getTag ( ) { return this . tag ; } public int getValuesNumber ( ) { return this . valuesNumber ; } int sizeInBytes ( ) { return this . readOffset ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . util . ClassFormatException ; import org . eclipse . jdt . core . util . IAnnotationComponentValue ; import org . eclipse . jdt . core . util . IAnnotationDefaultAttribute ; import org . eclipse . jdt . core . util . IConstantPool ; public class AnnotationDefaultAttribute extends ClassFileAttribute implements IAnnotationDefaultAttribute { private IAnnotationComponentValue memberValue ; public AnnotationDefaultAttribute ( byte [ ] classFileBytes , IConstantPool constantPool , int offset ) throws ClassFormatException { super ( classFileBytes , constantPool , offset ) ; this . memberValue = new AnnotationComponentValue ( classFileBytes , constantPool , offset + <NUM_LIT:6> ) ; } public IAnnotationComponentValue getMemberValue ( ) { return this . memberValue ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . util . ClassFormatException ; import org . eclipse . jdt . core . util . IConstantPool ; import org . eclipse . jdt . core . util . IConstantPoolConstant ; import org . eclipse . jdt . core . util . IConstantPoolEntry ; import org . eclipse . jdt . core . util . IExceptionTableEntry ; public class ExceptionTableEntry extends ClassFileStruct implements IExceptionTableEntry { private int startPC ; private int endPC ; private int handlerPC ; private int catchTypeIndex ; private char [ ] catchType ; ExceptionTableEntry ( byte [ ] classFileBytes , IConstantPool constantPool , int offset ) throws ClassFormatException { this . startPC = u2At ( classFileBytes , <NUM_LIT:0> , offset ) ; this . endPC = u2At ( classFileBytes , <NUM_LIT:2> , offset ) ; this . handlerPC = u2At ( classFileBytes , <NUM_LIT:4> , offset ) ; this . catchTypeIndex = u2At ( classFileBytes , <NUM_LIT:6> , offset ) ; if ( this . catchTypeIndex != <NUM_LIT:0> ) { IConstantPoolEntry constantPoolEntry = constantPool . decodeEntry ( this . catchTypeIndex ) ; if ( constantPoolEntry . getKind ( ) != IConstantPoolConstant . CONSTANT_Class ) { throw new ClassFormatException ( ClassFormatException . INVALID_CONSTANT_POOL_ENTRY ) ; } this . catchType = constantPoolEntry . getClassInfoName ( ) ; } } public int getStartPC ( ) { return this . startPC ; } public int getEndPC ( ) { return this . endPC ; } public int getHandlerPC ( ) { return this . handlerPC ; } public int getCatchTypeIndex ( ) { return this . catchTypeIndex ; } public char [ ] getCatchType ( ) { return this . catchType ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . util . ClassFormatException ; import org . eclipse . jdt . core . util . IConstantPool ; import org . eclipse . jdt . core . util . ILocalVariableTypeTableAttribute ; import org . eclipse . jdt . core . util . ILocalVariableTypeTableEntry ; public class LocalVariableTypeAttribute extends ClassFileAttribute implements ILocalVariableTypeTableAttribute { private static final ILocalVariableTypeTableEntry [ ] NO_ENTRIES = new ILocalVariableTypeTableEntry [ <NUM_LIT:0> ] ; private int localVariableTypeTableLength ; private ILocalVariableTypeTableEntry [ ] localVariableTypeTableEntries ; public LocalVariableTypeAttribute ( byte [ ] classFileBytes , IConstantPool constantPool , int offset ) throws ClassFormatException { super ( classFileBytes , constantPool , offset ) ; final int length = u2At ( classFileBytes , <NUM_LIT:6> , offset ) ; this . localVariableTypeTableLength = length ; if ( length != <NUM_LIT:0> ) { int readOffset = <NUM_LIT:8> ; this . localVariableTypeTableEntries = new ILocalVariableTypeTableEntry [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { this . localVariableTypeTableEntries [ i ] = new LocalVariableTypeTableEntry ( classFileBytes , constantPool , offset + readOffset ) ; readOffset += <NUM_LIT:10> ; } } else { this . localVariableTypeTableEntries = NO_ENTRIES ; } } public ILocalVariableTypeTableEntry [ ] getLocalVariableTypeTable ( ) { return this . localVariableTypeTableEntries ; } public int getLocalVariableTypeTableLength ( ) { return this . localVariableTypeTableLength ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; import org . eclipse . jdt . core . util . ClassFormatException ; import org . eclipse . jdt . core . util . IConstantPool ; import org . eclipse . jdt . core . util . IConstantPoolEntry ; import org . eclipse . jdt . core . util . IConstantValueAttribute ; public class ConstantValueAttribute extends ClassFileAttribute implements IConstantValueAttribute { private int constantValueIndex ; private IConstantPoolEntry constantPoolEntry ; ConstantValueAttribute ( byte [ ] classFileBytes , IConstantPool constantPool , int offset ) throws ClassFormatException { super ( classFileBytes , constantPool , offset ) ; this . constantValueIndex = u2At ( classFileBytes , <NUM_LIT:6> , offset ) ; this . constantPoolEntry = constantPool . decodeEntry ( this . constantValueIndex ) ; } public IConstantPoolEntry getConstantValue ( ) { return this . constantPoolEntry ; } public int getConstantValueIndex ( ) { return this . constantValueIndex ; } } </s>
<s> package org . eclipse . jdt . internal . core . util ; public class KeyKind extends BindingKeyParser { public static final int F_TYPE = <NUM_LIT> ; public static final int F_METHOD = <NUM_LIT> ; public static final int F_FIELD = <NUM_LIT> ; public static final int F_TYPE_PARAMETER = <NUM_LIT> ; public static final int F_LOCAL_VAR = <NUM_LIT> ; public static final int F_MEMBER = <NUM_LIT> ; public static final int F_LOCAL = <NUM_LIT> ; public static final int F_PARAMETERIZED_TYPE = <NUM_LIT> ; public static final int F_RAW_TYPE = <NUM_LIT> ; public static final int F_WILDCARD_TYPE = <NUM_LIT> ; public static final int F_PARAMETERIZED_METHOD = <NUM_LIT> ; public static final int F_CAPTURE = <NUM_LIT> ; public static final int F_CONSTRUCTOR = <NUM_LIT> ; public int flags = <NUM_LIT:0> ; private KeyKind innerKeyKind ; public KeyKind ( BindingKeyParser parser ) { super ( parser ) ; } public KeyKind ( String key ) { super ( key ) ; } public void consumeBaseType ( char [ ] baseTypeSig ) { this . flags |= F_TYPE ; } public void consumeCapture ( int position ) { this . flags |= F_CAPTURE ; } public void consumeField ( char [ ] fieldName ) { this . flags |= F_FIELD ; } public void consumeLocalType ( char [ ] uniqueKey ) { this . flags |= F_LOCAL ; } public void consumeLocalVar ( char [ ] varName , int occurrenceCount ) { this . flags |= F_LOCAL_VAR ; } public void consumeMemberType ( char [ ] simpleTypeName ) { this . flags |= F_MEMBER ; } public void consumeMethod ( char [ ] selector , char [ ] signature ) { this . flags |= F_METHOD ; if ( selector . length == <NUM_LIT:0> ) this . flags |= F_CONSTRUCTOR ; } public void consumeParameterizedGenericMethod ( ) { this . flags |= F_PARAMETERIZED_METHOD ; } public void consumeParameterizedType ( char [ ] simpleTypeName , boolean isRaw ) { this . flags |= isRaw ? F_RAW_TYPE : F_PARAMETERIZED_TYPE ; } public void consumeParser ( BindingKeyParser parser ) { this . innerKeyKind = ( KeyKind ) parser ; } public void consumeRawType ( ) { this . flags |= F_RAW_TYPE ; } public void consumeTopLevelType ( ) { this . flags |= F_TYPE ; } public void consumeTypeParameter ( char [ ] typeParameterName ) { this . flags |= F_TYPE_PARAMETER ; } public void consumeTypeWithCapture ( ) { this . flags = this . innerKeyKind . flags ; } public void consumeWildCard ( int kind ) { this . flags |= F_WILDCARD_TYPE ; } public BindingKeyParser newParser ( ) { return new KeyKind ( this ) ; } } </s>
<s> package org . eclipse . jdt . internal . core ; import org . eclipse . jdt . core . IType ; public final class TypeVector { static int INITIAL_SIZE = <NUM_LIT:10> ; public int size ; int maxSize ; IType [ ] elements ; public final static IType [ ] NoElements = new IType [ <NUM_LIT:0> ] ; public TypeVector ( ) { this . maxSize = INITIAL_SIZE ; this . size = <NUM_LIT:0> ; this . elements = new IType [ this . maxSize ] ; } public TypeVector ( IType [ ] types ) { this . size = types . length ; this . maxSize = this . size + <NUM_LIT:1> ; this . elements = new IType [ this . maxSize ] ; System . arraycopy ( types , <NUM_LIT:0> , this . elements , <NUM_LIT:0> , this . size ) ; } public TypeVector ( IType type ) { this . maxSize = INITIAL_SIZE ; this . size = <NUM_LIT:1> ; this . elements = new IType [ this . maxSize ] ; this . elements [ <NUM_LIT:0> ] = type ; } public void add ( IType newElement ) { if ( this . size == this . maxSize ) System . arraycopy ( this . elements , <NUM_LIT:0> , ( this . elements = new IType [ this . maxSize *= <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . size ) ; this . elements [ this . size ++ ] = newElement ; } public void addAll ( IType [ ] newElements ) { if ( this . size + newElements . length >= this . maxSize ) { this . maxSize = this . size + newElements . length ; System . arraycopy ( this . elements , <NUM_LIT:0> , ( this . elements = new IType [ this . maxSize ] ) , <NUM_LIT:0> , this . size ) ; } System . arraycopy ( newElements , <NUM_LIT:0> , this . elements , this . size , newElements . length ) ; this . size += newElements . length ; } public boolean contains ( IType element ) { for ( int i = this . size ; -- i >= <NUM_LIT:0> ; ) if ( element . equals ( this . elements [ i ] ) ) return true ; return false ; } public TypeVector copy ( ) { TypeVector clone = new TypeVector ( ) ; int length = this . elements . length ; System . arraycopy ( this . elements , <NUM_LIT:0> , clone . elements = new IType [ length ] , <NUM_LIT:0> , length ) ; clone . size = this . size ; clone . maxSize = this . maxSize ; return clone ; } public IType elementAt ( int index ) { return this . elements [ index ] ; } public IType [ ] elements ( ) { if ( this . size == <NUM_LIT:0> ) return NoElements ; if ( this . size < this . maxSize ) { this . maxSize = this . size ; System . arraycopy ( this . elements , <NUM_LIT:0> , ( this . elements = new IType [ this . maxSize ] ) , <NUM_LIT:0> , this . size ) ; } return this . elements ; } public IType find ( IType element ) { for ( int i = this . size ; -- i >= <NUM_LIT:0> ; ) if ( element == this . elements [ i ] ) return this . elements [ i ] ; return null ; } public IType remove ( IType element ) { for ( int i = this . size ; -- i >= <NUM_LIT:0> ; ) if ( element == this . elements [ i ] ) { System . arraycopy ( this . elements , i + <NUM_LIT:1> , this . elements , i , -- this . size - i ) ; this . elements [ this . size ] = null ; return element ; } return null ; } public void removeAll ( ) { for ( int i = this . size ; -- i >= <NUM_LIT:0> ; ) this . elements [ i ] = null ; this . size = <NUM_LIT:0> ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( "<STR_LIT:[>" ) ; for ( int i = <NUM_LIT:0> ; i < this . size ; i ++ ) { buffer . append ( "<STR_LIT:n>" ) ; buffer . append ( this . elements [ i ] ) ; } buffer . append ( "<STR_LIT>" ) ; return buffer . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . core ; import org . eclipse . jdt . core . IJavaElement ; public class SourceConstructorWithChildrenInfo extends SourceConstructorInfo { protected IJavaElement [ ] children ; public SourceConstructorWithChildrenInfo ( IJavaElement [ ] children ) { this . children = children ; } public IJavaElement [ ] getChildren ( ) { return this . children ; } } </s>
<s> package org . eclipse . jdt . internal . core ; import org . codehaus . jdt . groovy . integration . LanguageSupportFactory ; import org . eclipse . core . resources . IContainer ; import org . eclipse . core . resources . IResource ; import org . eclipse . core . runtime . CoreException ; import org . eclipse . core . runtime . IPath ; import org . eclipse . jdt . core . IClasspathEntry ; import org . eclipse . jdt . core . IJarEntryResource ; 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 . internal . core . util . Util ; class PackageFragmentRootInfo extends OpenableElementInfo { protected SourceMapper sourceMapper = null ; protected int rootKind = IPackageFragmentRoot . K_SOURCE ; protected Object [ ] nonJavaResources ; public PackageFragmentRootInfo ( ) { this . nonJavaResources = null ; } static Object [ ] computeFolderNonJavaResources ( IPackageFragmentRoot root , IContainer folder , char [ ] [ ] inclusionPatterns , char [ ] [ ] exclusionPatterns ) throws JavaModelException { IResource [ ] nonJavaResources = new IResource [ <NUM_LIT:5> ] ; int nonJavaResourcesCounter = <NUM_LIT:0> ; JavaProject project = ( JavaProject ) root . getJavaProject ( ) ; try { boolean isInterestingPackageRoot = LanguageSupportFactory . isInterestingProject ( project . getProject ( ) ) && root . getRawClasspathEntry ( ) . getEntryKind ( ) != IClasspathEntry . CPE_SOURCE ; IClasspathEntry [ ] classpath = project . getResolvedClasspath ( ) ; IResource [ ] members = folder . members ( ) ; int length = members . length ; if ( length > <NUM_LIT:0> ) { String sourceLevel = project . getOption ( JavaCore . COMPILER_SOURCE , true ) ; String complianceLevel = project . getOption ( JavaCore . COMPILER_COMPLIANCE , true ) ; nextResource : for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { IResource member = members [ i ] ; switch ( member . getType ( ) ) { case IResource . FILE : String fileName = member . getName ( ) ; if ( ( Util . isValidCompilationUnitName ( fileName , sourceLevel , complianceLevel ) && ! Util . isExcluded ( member , inclusionPatterns , exclusionPatterns ) ) && ! ( isInterestingPackageRoot && LanguageSupportFactory . isInterestingSourceFile ( fileName ) ) ) continue nextResource ; if ( Util . isValidClassFileName ( fileName , sourceLevel , complianceLevel ) ) continue nextResource ; if ( isClasspathEntry ( member . getFullPath ( ) , classpath ) ) continue nextResource ; break ; case IResource . FOLDER : if ( Util . isValidFolderNameForPackage ( member . getName ( ) , sourceLevel , complianceLevel ) && ( ! Util . isExcluded ( member , inclusionPatterns , exclusionPatterns ) || isClasspathEntry ( member . getFullPath ( ) , classpath ) ) ) continue nextResource ; break ; } if ( nonJavaResources . length == nonJavaResourcesCounter ) { System . arraycopy ( nonJavaResources , <NUM_LIT:0> , ( nonJavaResources = new IResource [ nonJavaResourcesCounter * <NUM_LIT:2> ] ) , <NUM_LIT:0> , nonJavaResourcesCounter ) ; } nonJavaResources [ nonJavaResourcesCounter ++ ] = member ; } } if ( ExternalFoldersManager . isInternalPathForExternalFolder ( folder . getFullPath ( ) ) ) { IJarEntryResource [ ] jarEntryResources = new IJarEntryResource [ nonJavaResourcesCounter ] ; for ( int i = <NUM_LIT:0> ; i < nonJavaResourcesCounter ; i ++ ) { jarEntryResources [ i ] = new NonJavaResource ( root , nonJavaResources [ i ] ) ; } return jarEntryResources ; } else if ( nonJavaResources . length != nonJavaResourcesCounter ) { System . arraycopy ( nonJavaResources , <NUM_LIT:0> , ( nonJavaResources = new IResource [ nonJavaResourcesCounter ] ) , <NUM_LIT:0> , nonJavaResourcesCounter ) ; } return nonJavaResources ; } catch ( CoreException e ) { throw new JavaModelException ( e ) ; } } private Object [ ] computeNonJavaResources ( IResource underlyingResource , PackageFragmentRoot handle ) { Object [ ] resources = NO_NON_JAVA_RESOURCES ; try { if ( underlyingResource . getType ( ) == IResource . FOLDER || underlyingResource . getType ( ) == IResource . PROJECT ) { resources = computeFolderNonJavaResources ( handle , ( IContainer ) underlyingResource , handle . fullInclusionPatternChars ( ) , handle . fullExclusionPatternChars ( ) ) ; } } catch ( JavaModelException e ) { } return resources ; } synchronized Object [ ] getNonJavaResources ( IJavaProject project , IResource underlyingResource , PackageFragmentRoot handle ) { Object [ ] resources = this . nonJavaResources ; if ( resources == null ) { resources = computeNonJavaResources ( underlyingResource , handle ) ; this . nonJavaResources = resources ; } return resources ; } public int getRootKind ( ) { return this . rootKind ; } protected SourceMapper getSourceMapper ( ) { return this . sourceMapper ; } private static boolean isClasspathEntry ( IPath path , IClasspathEntry [ ] resolvedClasspath ) { for ( int i = <NUM_LIT:0> , length = resolvedClasspath . length ; i < length ; i ++ ) { IClasspathEntry entry = resolvedClasspath [ i ] ; if ( entry . getPath ( ) . equals ( path ) ) { return true ; } } return false ; } void setNonJavaResources ( Object [ ] resources ) { this . nonJavaResources = resources ; } protected void setRootKind ( int newRootKind ) { this . rootKind = newRootKind ; } protected void setSourceMapper ( SourceMapper mapper ) { this . sourceMapper = mapper ; } } </s>
<s> package org . eclipse . jdt . internal . core ; import org . eclipse . core . resources . IResourceStatus ; import org . eclipse . core . resources . IWorkspaceRunnable ; import org . eclipse . core . runtime . CoreException ; import org . eclipse . jdt . core . IJavaModelStatus ; import org . eclipse . jdt . core . JavaModelException ; public class BatchOperation extends JavaModelOperation { protected IWorkspaceRunnable runnable ; public BatchOperation ( IWorkspaceRunnable runnable ) { this . runnable = runnable ; } protected boolean canModifyRoots ( ) { return true ; } protected void executeOperation ( ) throws JavaModelException { try { this . runnable . run ( this . progressMonitor ) ; } catch ( CoreException ce ) { if ( ce instanceof JavaModelException ) { throw ( JavaModelException ) ce ; } else { if ( ce . getStatus ( ) . getCode ( ) == IResourceStatus . OPERATION_FAILED ) { Throwable e = ce . getStatus ( ) . getException ( ) ; if ( e instanceof JavaModelException ) { throw ( JavaModelException ) e ; } } throw new JavaModelException ( ce ) ; } } } protected IJavaModelStatus verify ( ) { return JavaModelStatus . VERIFIED_OK ; } } </s>
<s> package org . eclipse . jdt . internal . core ; import java . io . File ; import java . io . FileOutputStream ; import java . io . IOException ; import java . util . ArrayList ; import java . util . Collection ; import java . util . Collections ; import java . util . HashMap ; import java . util . HashSet ; import java . util . Iterator ; import java . util . Map ; import java . util . Set ; import java . util . Vector ; import org . eclipse . core . resources . IFolder ; import org . eclipse . core . resources . IProject ; import org . eclipse . core . resources . IProjectDescription ; import org . eclipse . core . resources . IResource ; import org . eclipse . core . resources . IResourceStatus ; import org . eclipse . core . resources . ResourcesPlugin ; 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 . Status ; import org . eclipse . core . runtime . jobs . Job ; import org . eclipse . jdt . core . IClasspathEntry ; 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 ExternalFoldersManager { private static final String EXTERNAL_PROJECT_NAME = "<STR_LIT>" ; private static final String LINKED_FOLDER_NAME = "<STR_LIT>" ; private Map folders ; private Set pendingFolders ; private int counter = <NUM_LIT:0> ; private static ExternalFoldersManager MANAGER = new ExternalFoldersManager ( ) ; private ExternalFoldersManager ( ) { } public static ExternalFoldersManager getExternalFoldersManager ( ) { return MANAGER ; } public static HashSet getExternalFolders ( IClasspathEntry [ ] classpath ) { if ( classpath == null ) return null ; HashSet folders = null ; for ( int i = <NUM_LIT:0> ; i < classpath . length ; i ++ ) { IClasspathEntry entry = classpath [ i ] ; if ( entry . getEntryKind ( ) == IClasspathEntry . CPE_LIBRARY ) { IPath entryPath = entry . getPath ( ) ; if ( isExternalFolderPath ( entryPath ) ) { if ( folders == null ) folders = new HashSet ( ) ; folders . add ( entryPath ) ; } IPath attachmentPath = entry . getSourceAttachmentPath ( ) ; if ( isExternalFolderPath ( attachmentPath ) ) { if ( folders == null ) folders = new HashSet ( ) ; folders . add ( attachmentPath ) ; } } } return folders ; } public static boolean isExternalFolderPath ( IPath externalPath ) { if ( externalPath == null ) return false ; String firstSegment = externalPath . segment ( <NUM_LIT:0> ) ; if ( firstSegment != null && ResourcesPlugin . getWorkspace ( ) . getRoot ( ) . getProject ( firstSegment ) . exists ( ) ) return false ; File externalFolder = externalPath . toFile ( ) ; if ( externalFolder . isFile ( ) ) return false ; if ( externalPath . getFileExtension ( ) != null && ! externalFolder . exists ( ) ) return false ; return true ; } public static boolean isInternalPathForExternalFolder ( IPath resourcePath ) { return EXTERNAL_PROJECT_NAME . equals ( resourcePath . segment ( <NUM_LIT:0> ) ) ; } public IFolder addFolder ( IPath externalFolderPath , boolean scheduleForCreation ) { return addFolder ( externalFolderPath , getExternalFoldersProject ( ) , scheduleForCreation ) ; } private IFolder addFolder ( IPath externalFolderPath , IProject externalFoldersProject , boolean scheduleForCreation ) { Map knownFolders = getFolders ( ) ; Object existing = knownFolders . get ( externalFolderPath ) ; if ( existing != null ) { return ( IFolder ) existing ; } IFolder result ; do { result = externalFoldersProject . getFolder ( LINKED_FOLDER_NAME + this . counter ++ ) ; } while ( result . exists ( ) ) ; if ( scheduleForCreation ) { if ( this . pendingFolders == null ) this . pendingFolders = new HashSet ( ) ; this . pendingFolders . add ( externalFolderPath ) ; } knownFolders . put ( externalFolderPath , result ) ; return result ; } public boolean removePendingFolder ( Object externalPath ) { if ( this . pendingFolders == null ) return false ; return this . pendingFolders . remove ( externalPath ) ; } public IFolder createLinkFolder ( IPath externalFolderPath , boolean refreshIfExistAlready , IProgressMonitor monitor ) throws CoreException { IProject externalFoldersProject = createExternalFoldersProject ( monitor ) ; return createLinkFolder ( externalFolderPath , refreshIfExistAlready , externalFoldersProject , monitor ) ; } private IFolder createLinkFolder ( IPath externalFolderPath , boolean refreshIfExistAlready , IProject externalFoldersProject , IProgressMonitor monitor ) throws CoreException { IFolder result = addFolder ( externalFolderPath , externalFoldersProject , false ) ; if ( ! result . exists ( ) ) result . createLink ( externalFolderPath , IResource . ALLOW_MISSING_LOCAL , monitor ) ; else if ( refreshIfExistAlready ) result . refreshLocal ( IResource . DEPTH_INFINITE , monitor ) ; return result ; } public void createPendingFolders ( IProgressMonitor monitor ) throws JavaModelException { if ( this . pendingFolders == null || this . pendingFolders . isEmpty ( ) ) return ; IProject externalFoldersProject = null ; try { externalFoldersProject = createExternalFoldersProject ( monitor ) ; } catch ( CoreException e ) { throw new JavaModelException ( e ) ; } Iterator iterator = this . pendingFolders . iterator ( ) ; while ( iterator . hasNext ( ) ) { Object folderPath = iterator . next ( ) ; try { createLinkFolder ( ( IPath ) folderPath , false , externalFoldersProject , monitor ) ; } catch ( CoreException e ) { Util . log ( e , "<STR_LIT>" + folderPath ) ; } } this . pendingFolders . clear ( ) ; } public void cleanUp ( IProgressMonitor monitor ) throws CoreException { ArrayList toDelete = getFoldersToCleanUp ( monitor ) ; if ( toDelete == null ) return ; for ( Iterator iterator = toDelete . iterator ( ) ; iterator . hasNext ( ) ; ) { Map . Entry entry = ( Map . Entry ) iterator . next ( ) ; IFolder folder = ( IFolder ) entry . getValue ( ) ; folder . delete ( true , monitor ) ; IPath key = ( IPath ) entry . getKey ( ) ; this . folders . remove ( key ) ; } IProject project = getExternalFoldersProject ( ) ; if ( project . isAccessible ( ) && project . members ( ) . length == <NUM_LIT:1> ) project . delete ( true , monitor ) ; } private ArrayList getFoldersToCleanUp ( IProgressMonitor monitor ) throws CoreException { DeltaProcessingState state = JavaModelManager . getDeltaState ( ) ; HashMap roots = state . roots ; HashMap sourceAttachments = state . sourceAttachments ; if ( roots == null && sourceAttachments == null ) return null ; Map knownFolders = getFolders ( ) ; ArrayList result = null ; synchronized ( knownFolders ) { Iterator iterator = knownFolders . entrySet ( ) . iterator ( ) ; while ( iterator . hasNext ( ) ) { Map . Entry entry = ( Map . Entry ) iterator . next ( ) ; IPath path = ( IPath ) entry . getKey ( ) ; if ( ( roots != null && ! roots . containsKey ( path ) ) && ( sourceAttachments != null && ! sourceAttachments . containsKey ( path ) ) ) { if ( entry . getValue ( ) != null ) { if ( result == null ) result = new ArrayList ( ) ; result . add ( entry ) ; } } } } return result ; } public IProject getExternalFoldersProject ( ) { return ResourcesPlugin . getWorkspace ( ) . getRoot ( ) . getProject ( EXTERNAL_PROJECT_NAME ) ; } public IProject createExternalFoldersProject ( IProgressMonitor monitor ) throws CoreException { IProject project = getExternalFoldersProject ( ) ; if ( ! project . isAccessible ( ) ) { if ( ! project . exists ( ) ) { createExternalFoldersProject ( project , monitor ) ; } openExternalFoldersProject ( project , monitor ) ; } return project ; } private void openExternalFoldersProject ( IProject project , IProgressMonitor monitor ) throws CoreException { try { project . open ( monitor ) ; } catch ( CoreException e1 ) { if ( e1 . getStatus ( ) . getCode ( ) == IResourceStatus . FAILED_READ_METADATA ) { project . delete ( false , true , monitor ) ; createExternalFoldersProject ( project , monitor ) ; } else { IPath stateLocation = JavaCore . getPlugin ( ) . getStateLocation ( ) ; IPath projectPath = stateLocation . append ( EXTERNAL_PROJECT_NAME ) ; projectPath . toFile ( ) . mkdirs ( ) ; try { FileOutputStream output = new FileOutputStream ( projectPath . append ( "<STR_LIT>" ) . toOSString ( ) ) ; try { output . write ( ( "<STR_LIT>" + "<STR_LIT>" + "<STR_LIT>" + EXTERNAL_PROJECT_NAME + "<STR_LIT>" + "<STR_LIT>" + "<STR_LIT>" + "<STR_LIT>" + "<STR_LIT>" + "<STR_LIT>" + "<STR_LIT>" + "<STR_LIT>" + "<STR_LIT>" ) . getBytes ( ) ) ; } finally { output . close ( ) ; } } catch ( IOException e ) { project . delete ( false , true , monitor ) ; createExternalFoldersProject ( project , monitor ) ; } } project . open ( monitor ) ; } } private void createExternalFoldersProject ( IProject project , IProgressMonitor monitor ) throws CoreException { IProjectDescription desc = project . getWorkspace ( ) . newProjectDescription ( project . getName ( ) ) ; IPath stateLocation = JavaCore . getPlugin ( ) . getStateLocation ( ) ; desc . setLocation ( stateLocation . append ( EXTERNAL_PROJECT_NAME ) ) ; project . create ( desc , IResource . HIDDEN , monitor ) ; } public IFolder getFolder ( IPath externalFolderPath ) { return ( IFolder ) getFolders ( ) . get ( externalFolderPath ) ; } private Map getFolders ( ) { if ( this . folders == null ) { Map tempFolders = new HashMap ( ) ; IProject project = getExternalFoldersProject ( ) ; try { if ( ! project . isAccessible ( ) ) { if ( project . exists ( ) ) { openExternalFoldersProject ( project , null ) ; } else { return this . folders = Collections . synchronizedMap ( tempFolders ) ; } } IResource [ ] members = project . members ( ) ; for ( int i = <NUM_LIT:0> , length = members . length ; i < length ; i ++ ) { IResource member = members [ i ] ; if ( member . getType ( ) == IResource . FOLDER && member . isLinked ( ) && member . getName ( ) . startsWith ( LINKED_FOLDER_NAME ) ) { IPath externalFolderPath = member . getLocation ( ) ; tempFolders . put ( externalFolderPath , member ) ; } } } catch ( CoreException e ) { Util . log ( e , "<STR_LIT>" ) ; } this . folders = Collections . synchronizedMap ( tempFolders ) ; } return this . folders ; } private void runRefreshJob ( Collection paths ) { Job [ ] jobs = Job . getJobManager ( ) . find ( ResourcesPlugin . FAMILY_MANUAL_REFRESH ) ; RefreshJob refreshJob = null ; if ( jobs != null ) { for ( int index = <NUM_LIT:0> ; index < jobs . length ; index ++ ) { if ( jobs [ index ] instanceof RefreshJob ) { refreshJob = ( RefreshJob ) jobs [ index ] ; refreshJob . addFoldersToRefresh ( paths ) ; if ( refreshJob . getState ( ) == Job . NONE ) { refreshJob . schedule ( ) ; } break ; } } } if ( refreshJob == null ) { refreshJob = new RefreshJob ( new Vector ( paths ) ) ; refreshJob . schedule ( ) ; } } public void refreshReferences ( final IProject [ ] sourceProjects , IProgressMonitor monitor ) { IProject externalProject = getExternalFoldersProject ( ) ; try { HashSet externalFolders = null ; for ( int index = <NUM_LIT:0> ; index < sourceProjects . length ; index ++ ) { if ( sourceProjects [ index ] . equals ( externalProject ) ) continue ; if ( ! JavaProject . hasJavaNature ( sourceProjects [ index ] ) ) continue ; HashSet foldersInProject = getExternalFolders ( ( ( JavaProject ) JavaCore . create ( sourceProjects [ index ] ) ) . getResolvedClasspath ( ) ) ; if ( foldersInProject == null || foldersInProject . size ( ) == <NUM_LIT:0> ) continue ; if ( externalFolders == null ) externalFolders = new HashSet ( ) ; externalFolders . addAll ( foldersInProject ) ; } if ( externalFolders == null ) return ; runRefreshJob ( externalFolders ) ; } catch ( CoreException e ) { Util . log ( e , "<STR_LIT>" ) ; } return ; } public void refreshReferences ( IProject source , IProgressMonitor monitor ) { IProject externalProject = getExternalFoldersProject ( ) ; if ( source . equals ( externalProject ) ) return ; if ( ! JavaProject . hasJavaNature ( source ) ) return ; try { HashSet externalFolders = getExternalFolders ( ( ( JavaProject ) JavaCore . create ( source ) ) . getResolvedClasspath ( ) ) ; if ( externalFolders == null ) return ; runRefreshJob ( externalFolders ) ; } catch ( CoreException e ) { Util . log ( e , "<STR_LIT>" ) ; } return ; } public IFolder removeFolder ( IPath externalFolderPath ) { return ( IFolder ) getFolders ( ) . remove ( externalFolderPath ) ; } class RefreshJob extends Job { Vector externalFolders = null ; RefreshJob ( Vector externalFolders ) { super ( Messages . refreshing_external_folders ) ; this . externalFolders = externalFolders ; } public boolean belongsTo ( Object family ) { return family == ResourcesPlugin . FAMILY_MANUAL_REFRESH ; } public void addFoldersToRefresh ( Collection paths ) { if ( ! paths . isEmpty ( ) && this . externalFolders == null ) { this . externalFolders = new Vector ( ) ; } Iterator it = paths . iterator ( ) ; while ( it . hasNext ( ) ) { Object path = it . next ( ) ; if ( ! this . externalFolders . contains ( path ) ) { this . externalFolders . add ( path ) ; } } } protected IStatus run ( IProgressMonitor pm ) { try { if ( this . externalFolders == null ) return Status . OK_STATUS ; IPath externalPath = null ; for ( int index = <NUM_LIT:0> ; index < this . externalFolders . size ( ) ; index ++ ) { if ( ( externalPath = ( IPath ) this . externalFolders . get ( index ) ) != null ) { IFolder folder = getFolder ( externalPath ) ; if ( folder != null ) folder . refreshLocal ( IResource . DEPTH_INFINITE , pm ) ; } this . externalFolders . setElementAt ( null , index ) ; } } catch ( CoreException e ) { return e . getStatus ( ) ; } return Status . OK_STATUS ; } } } </s>
<s> package org . eclipse . jdt . internal . core ; import java . util . HashMap ; import org . eclipse . jdt . core . dom . CompilationUnit ; public class ASTHolderCUInfo extends CompilationUnitElementInfo { int astLevel ; boolean resolveBindings ; int reconcileFlags ; HashMap problems = null ; CompilationUnit ast ; } </s>
<s> package org . eclipse . jdt . internal . core ; import org . eclipse . jdt . core . IAnnotation ; import org . eclipse . jdt . core . ISourceRange ; import org . eclipse . jdt . core . SourceRange ; public class AnnotatableInfo extends MemberElementInfo { protected IAnnotation [ ] annotations = Annotation . NO_ANNOTATIONS ; protected int nameStart = - <NUM_LIT:1> ; protected int nameEnd = - <NUM_LIT:1> ; public int getNameSourceEnd ( ) { return this . nameEnd ; } public int getNameSourceStart ( ) { return this . nameStart ; } protected void setNameSourceEnd ( int end ) { this . nameEnd = end ; } protected void setNameSourceStart ( int start ) { this . nameStart = start ; } protected ISourceRange getNameRange ( ) { return new SourceRange ( this . nameStart , this . nameEnd - this . nameStart + <NUM_LIT:1> ) ; } } </s>
<s> package org . eclipse . jdt . internal . core ; import java . util . ArrayList ; import org . eclipse . core . runtime . IProgressMonitor ; import org . eclipse . jdt . core . IAnnotation ; import org . eclipse . jdt . core . IJavaElement ; import org . eclipse . jdt . core . IJavaModelStatusConstants ; import org . eclipse . jdt . core . ISourceRange ; import org . eclipse . jdt . core . JavaModelException ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . env . IBinaryAnnotation ; import org . eclipse . jdt . internal . compiler . lookup . TagBits ; import org . eclipse . jdt . internal . compiler . lookup . TypeConstants ; import org . eclipse . jdt . internal . core . util . Util ; public abstract class BinaryMember extends NamedMember { protected BinaryMember ( JavaElement parent , String name ) { super ( parent , name ) ; } public void copy ( IJavaElement container , IJavaElement sibling , String rename , boolean force , IProgressMonitor monitor ) throws JavaModelException { throw new JavaModelException ( new JavaModelStatus ( IJavaModelStatusConstants . READ_ONLY , this ) ) ; } protected IAnnotation [ ] getAnnotations ( IBinaryAnnotation [ ] binaryAnnotations , long tagBits ) { IAnnotation [ ] standardAnnotations = getStandardAnnotations ( tagBits ) ; if ( binaryAnnotations == null ) return standardAnnotations ; int length = binaryAnnotations . length ; int standardLength = standardAnnotations . length ; int fullLength = length + standardLength ; if ( fullLength == <NUM_LIT:0> ) { return Annotation . NO_ANNOTATIONS ; } IAnnotation [ ] annotations = new IAnnotation [ fullLength ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { annotations [ i ] = Util . getAnnotation ( this , binaryAnnotations [ i ] , null ) ; } System . arraycopy ( standardAnnotations , <NUM_LIT:0> , annotations , length , standardLength ) ; return annotations ; } private IAnnotation getAnnotation ( char [ ] [ ] annotationName ) { return new Annotation ( this , new String ( CharOperation . concatWith ( annotationName , '<CHAR_LIT:.>' ) ) ) ; } protected IAnnotation [ ] getStandardAnnotations ( long tagBits ) { if ( ( tagBits & TagBits . AllStandardAnnotationsMask ) == <NUM_LIT:0> ) return Annotation . NO_ANNOTATIONS ; ArrayList annotations = new ArrayList ( ) ; if ( ( tagBits & TagBits . AnnotationTargetMASK ) != <NUM_LIT:0> ) { annotations . add ( getAnnotation ( TypeConstants . JAVA_LANG_ANNOTATION_TARGET ) ) ; } if ( ( tagBits & TagBits . AnnotationRetentionMASK ) != <NUM_LIT:0> ) { annotations . add ( getAnnotation ( TypeConstants . JAVA_LANG_ANNOTATION_RETENTION ) ) ; } if ( ( tagBits & TagBits . AnnotationDeprecated ) != <NUM_LIT:0> ) { annotations . add ( getAnnotation ( TypeConstants . JAVA_LANG_DEPRECATED ) ) ; } if ( ( tagBits & TagBits . AnnotationDocumented ) != <NUM_LIT:0> ) { annotations . add ( getAnnotation ( TypeConstants . JAVA_LANG_ANNOTATION_DOCUMENTED ) ) ; } if ( ( tagBits & TagBits . AnnotationInherited ) != <NUM_LIT:0> ) { annotations . add ( getAnnotation ( TypeConstants . JAVA_LANG_ANNOTATION_INHERITED ) ) ; } if ( ( tagBits & TagBits . AnnotationPolymorphicSignature ) != <NUM_LIT:0> ) { annotations . add ( getAnnotation ( TypeConstants . JAVA_LANG_INVOKE_METHODHANDLE_$_POLYMORPHICSIGNATURE ) ) ; } if ( ( tagBits & TagBits . AnnotationSafeVarargs ) != <NUM_LIT:0> ) { annotations . add ( getAnnotation ( TypeConstants . JAVA_LANG_SAFEVARARGS ) ) ; } return ( IAnnotation [ ] ) annotations . toArray ( new IAnnotation [ annotations . size ( ) ] ) ; } public String [ ] getCategories ( ) throws JavaModelException { SourceMapper mapper = getSourceMapper ( ) ; if ( mapper != null ) { ( ( ClassFile ) getClassFile ( ) ) . getBuffer ( ) ; if ( mapper . categories != null ) { String [ ] categories = ( String [ ] ) mapper . categories . get ( this ) ; if ( categories != null ) return categories ; } } return CharOperation . NO_STRINGS ; } public String getKey ( ) { try { return getKey ( false ) ; } catch ( JavaModelException e ) { return null ; } } public abstract String getKey ( boolean forceOpen ) throws JavaModelException ; public ISourceRange getNameRange ( ) throws JavaModelException { SourceMapper mapper = getSourceMapper ( ) ; if ( mapper != null ) { ( ( ClassFile ) getClassFile ( ) ) . getBuffer ( ) ; return mapper . getNameRange ( this ) ; } else { return SourceMapper . UNKNOWN_RANGE ; } } public ISourceRange getSourceRange ( ) throws JavaModelException { SourceMapper mapper = getSourceMapper ( ) ; if ( mapper != null ) { ( ( ClassFile ) getClassFile ( ) ) . getBuffer ( ) ; return mapper . getSourceRange ( this ) ; } else { return SourceMapper . UNKNOWN_RANGE ; } } public boolean isBinary ( ) { return true ; } public boolean isStructureKnown ( ) throws JavaModelException { return ( ( IJavaElement ) getOpenableParent ( ) ) . isStructureKnown ( ) ; } public void move ( IJavaElement container , IJavaElement sibling , String rename , boolean force , IProgressMonitor monitor ) throws JavaModelException { throw new JavaModelException ( new JavaModelStatus ( IJavaModelStatusConstants . READ_ONLY , this ) ) ; } public void rename ( String newName , boolean force , IProgressMonitor monitor ) throws JavaModelException { throw new JavaModelException ( new JavaModelStatus ( IJavaModelStatusConstants . READ_ONLY , this ) ) ; } public void setContents ( String contents , IProgressMonitor monitor ) throws JavaModelException { throw new JavaModelException ( new JavaModelStatus ( IJavaModelStatusConstants . READ_ONLY , this ) ) ; } } </s>
<s> package org . eclipse . jdt . internal . core ; import java . io . File ; import java . util . * ; import org . eclipse . core . resources . * ; import org . eclipse . core . runtime . IPath ; import org . eclipse . core . runtime . IProgressMonitor ; import org . eclipse . jdt . core . IClasspathEntry ; import org . eclipse . jdt . core . ICompilationUnit ; import org . eclipse . jdt . core . IJavaElement ; import org . eclipse . jdt . core . IJavaProject ; import org . eclipse . jdt . core . IPackageFragment ; import org . eclipse . jdt . core . IPackageFragmentRoot ; import org . eclipse . jdt . core . IType ; import org . eclipse . jdt . core . JavaCore ; import org . eclipse . jdt . core . JavaModelException ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; import org . eclipse . jdt . internal . compiler . env . AccessRestriction ; import org . eclipse . jdt . internal . compiler . env . AccessRuleSet ; import org . eclipse . jdt . internal . compiler . env . IBinaryType ; import org . eclipse . jdt . internal . compiler . lookup . TypeConstants ; import org . eclipse . jdt . internal . compiler . parser . ScannerHelper ; import org . eclipse . jdt . internal . compiler . util . HashtableOfObjectToInt ; import org . eclipse . jdt . internal . compiler . util . SuffixConstants ; import org . eclipse . jdt . internal . core . util . HashtableOfArrayToObject ; import org . eclipse . jdt . internal . core . util . Messages ; import org . eclipse . jdt . internal . core . util . Util ; public class NameLookup implements SuffixConstants { public static class Answer { public IType type ; AccessRestriction restriction ; Answer ( IType type , AccessRestriction restriction ) { this . type = type ; this . restriction = restriction ; } public boolean ignoreIfBetter ( ) { return this . restriction != null && this . restriction . ignoreIfBetter ( ) ; } public boolean isBetter ( Answer otherAnswer ) { if ( otherAnswer == null ) return true ; if ( this . restriction == null ) return true ; return otherAnswer . restriction != null && this . restriction . getProblemId ( ) < otherAnswer . restriction . getProblemId ( ) ; } } public static final int ACCEPT_CLASSES = ASTNode . Bit2 ; public static final int ACCEPT_INTERFACES = ASTNode . Bit3 ; public static final int ACCEPT_ENUMS = ASTNode . Bit4 ; public static final int ACCEPT_ANNOTATIONS = ASTNode . Bit5 ; public static final int ACCEPT_ALL = ACCEPT_CLASSES | ACCEPT_INTERFACES | ACCEPT_ENUMS | ACCEPT_ANNOTATIONS ; public static boolean VERBOSE = false ; private static final IType [ ] NO_TYPES = { } ; protected IPackageFragmentRoot [ ] packageFragmentRoots ; protected HashtableOfArrayToObject packageFragments ; protected Map rootToResolvedEntries ; protected HashMap typesInWorkingCopies ; public long timeSpentInSeekTypesInSourcePackage = <NUM_LIT:0> ; public long timeSpentInSeekTypesInBinaryPackage = <NUM_LIT:0> ; public NameLookup ( IPackageFragmentRoot [ ] packageFragmentRoots , HashtableOfArrayToObject packageFragments , ICompilationUnit [ ] workingCopies , Map rootToResolvedEntries ) { long start = - <NUM_LIT:1> ; if ( VERBOSE ) { Util . verbose ( "<STR_LIT>" ) ; Util . verbose ( "<STR_LIT>" + ( packageFragmentRoots == null ? <NUM_LIT:0> : packageFragmentRoots . length ) ) ; Util . verbose ( "<STR_LIT>" + ( packageFragments == null ? <NUM_LIT:0> : packageFragments . size ( ) ) ) ; Util . verbose ( "<STR_LIT>" + ( workingCopies == null ? <NUM_LIT:0> : workingCopies . length ) ) ; start = System . currentTimeMillis ( ) ; } this . packageFragmentRoots = packageFragmentRoots ; if ( workingCopies == null ) { this . packageFragments = packageFragments ; } else { try { this . packageFragments = ( HashtableOfArrayToObject ) packageFragments . clone ( ) ; } catch ( CloneNotSupportedException e1 ) { } this . typesInWorkingCopies = new HashMap ( ) ; HashtableOfObjectToInt rootPositions = new HashtableOfObjectToInt ( ) ; for ( int i = <NUM_LIT:0> , length = packageFragmentRoots . length ; i < length ; i ++ ) { rootPositions . put ( packageFragmentRoots [ i ] , i ) ; } for ( int i = <NUM_LIT:0> , length = workingCopies . length ; i < length ; i ++ ) { ICompilationUnit workingCopy = workingCopies [ i ] ; PackageFragment pkg = ( PackageFragment ) workingCopy . getParent ( ) ; IPackageFragmentRoot root = ( IPackageFragmentRoot ) pkg . getParent ( ) ; int rootPosition = rootPositions . get ( root ) ; if ( rootPosition == - <NUM_LIT:1> ) continue ; HashMap typeMap = ( HashMap ) this . typesInWorkingCopies . get ( pkg ) ; if ( typeMap == null ) { typeMap = new HashMap ( ) ; this . typesInWorkingCopies . put ( pkg , typeMap ) ; } try { IType [ ] types = workingCopy . getTypes ( ) ; int typeLength = types . length ; if ( typeLength == <NUM_LIT:0> ) { String typeName = Util . getNameWithoutJavaLikeExtension ( workingCopy . getElementName ( ) ) ; typeMap . put ( typeName , NO_TYPES ) ; } else { for ( int j = <NUM_LIT:0> ; j < typeLength ; j ++ ) { IType type = types [ j ] ; String typeName = type . getElementName ( ) ; Object existing = typeMap . get ( typeName ) ; if ( existing == null ) { typeMap . put ( typeName , type ) ; } else if ( existing instanceof IType ) { typeMap . put ( typeName , new IType [ ] { ( IType ) existing , type } ) ; } else { IType [ ] existingTypes = ( IType [ ] ) existing ; int existingTypeLength = existingTypes . length ; System . arraycopy ( existingTypes , <NUM_LIT:0> , existingTypes = new IType [ existingTypeLength + <NUM_LIT:1> ] , <NUM_LIT:0> , existingTypeLength ) ; existingTypes [ existingTypeLength ] = type ; typeMap . put ( typeName , existingTypes ) ; } } } } catch ( JavaModelException e ) { } String [ ] pkgName = pkg . names ; Object existing = this . packageFragments . get ( pkgName ) ; if ( existing == null || existing == JavaProjectElementInfo . NO_ROOTS ) { this . packageFragments . put ( pkgName , root ) ; JavaProjectElementInfo . addSuperPackageNames ( pkgName , this . packageFragments ) ; } else { if ( existing instanceof PackageFragmentRoot ) { int exisitingPosition = rootPositions . get ( existing ) ; if ( rootPosition != exisitingPosition ) { this . packageFragments . put ( pkgName , exisitingPosition < rootPosition ? new IPackageFragmentRoot [ ] { ( PackageFragmentRoot ) existing , root } : new IPackageFragmentRoot [ ] { root , ( PackageFragmentRoot ) existing } ) ; } } else { IPackageFragmentRoot [ ] roots = ( IPackageFragmentRoot [ ] ) existing ; int rootLength = roots . length ; int insertionIndex = <NUM_LIT:0> ; for ( int j = <NUM_LIT:0> ; j < rootLength ; j ++ ) { int existingPosition = rootPositions . get ( roots [ j ] ) ; if ( rootPosition > existingPosition ) { insertionIndex = j ; } else if ( rootPosition == existingPosition ) { insertionIndex = - <NUM_LIT:1> ; break ; } else if ( rootPosition < existingPosition ) { break ; } } if ( insertionIndex != - <NUM_LIT:1> ) { IPackageFragmentRoot [ ] newRoots = new IPackageFragmentRoot [ rootLength + <NUM_LIT:1> ] ; System . arraycopy ( roots , <NUM_LIT:0> , newRoots , <NUM_LIT:0> , insertionIndex ) ; newRoots [ insertionIndex ] = root ; System . arraycopy ( roots , insertionIndex , newRoots , insertionIndex + <NUM_LIT:1> , rootLength - insertionIndex ) ; this . packageFragments . put ( pkgName , newRoots ) ; } } } } } this . rootToResolvedEntries = rootToResolvedEntries ; if ( VERBOSE ) { Util . verbose ( "<STR_LIT>" + ( System . currentTimeMillis ( ) - start ) + "<STR_LIT>" ) ; } } protected boolean acceptType ( IType type , int acceptFlags , boolean isSourceType ) { if ( acceptFlags == <NUM_LIT:0> || acceptFlags == ACCEPT_ALL ) return true ; try { int kind = isSourceType ? TypeDeclaration . kind ( ( ( SourceTypeElementInfo ) ( ( SourceType ) type ) . getElementInfo ( ) ) . getModifiers ( ) ) : TypeDeclaration . kind ( ( ( IBinaryType ) ( ( BinaryType ) type ) . getElementInfo ( ) ) . getModifiers ( ) ) ; switch ( kind ) { case TypeDeclaration . CLASS_DECL : return ( acceptFlags & ACCEPT_CLASSES ) != <NUM_LIT:0> ; case TypeDeclaration . INTERFACE_DECL : return ( acceptFlags & ACCEPT_INTERFACES ) != <NUM_LIT:0> ; case TypeDeclaration . ENUM_DECL : return ( acceptFlags & ACCEPT_ENUMS ) != <NUM_LIT:0> ; default : return ( acceptFlags & ACCEPT_ANNOTATIONS ) != <NUM_LIT:0> ; } } catch ( JavaModelException npe ) { return false ; } } private void findAllTypes ( String prefix , boolean partialMatch , int acceptFlags , IJavaElementRequestor requestor ) { int count = this . packageFragmentRoots . length ; for ( int i = <NUM_LIT:0> ; i < count ; i ++ ) { if ( requestor . isCanceled ( ) ) return ; IPackageFragmentRoot root = this . packageFragmentRoots [ i ] ; IJavaElement [ ] packages = null ; try { packages = root . getChildren ( ) ; } catch ( JavaModelException npe ) { continue ; } if ( packages != null ) { for ( int j = <NUM_LIT:0> , packageCount = packages . length ; j < packageCount ; j ++ ) { if ( requestor . isCanceled ( ) ) return ; seekTypes ( prefix , ( IPackageFragment ) packages [ j ] , partialMatch , acceptFlags , requestor ) ; } } } } public ICompilationUnit findCompilationUnit ( String qualifiedTypeName ) { String [ ] pkgName = CharOperation . NO_STRINGS ; String cuName = qualifiedTypeName ; int index = qualifiedTypeName . lastIndexOf ( '<CHAR_LIT:.>' ) ; if ( index != - <NUM_LIT:1> ) { pkgName = Util . splitOn ( '<CHAR_LIT:.>' , qualifiedTypeName , <NUM_LIT:0> , index ) ; cuName = qualifiedTypeName . substring ( index + <NUM_LIT:1> ) ; } index = cuName . indexOf ( '<CHAR_LIT>' ) ; if ( index != - <NUM_LIT:1> ) { cuName = cuName . substring ( <NUM_LIT:0> , index ) ; } int pkgIndex = this . packageFragments . getIndex ( pkgName ) ; if ( pkgIndex != - <NUM_LIT:1> ) { Object value = this . packageFragments . valueTable [ pkgIndex ] ; pkgName = ( String [ ] ) this . packageFragments . keyTable [ pkgIndex ] ; if ( value instanceof PackageFragmentRoot ) { return findCompilationUnit ( pkgName , cuName , ( PackageFragmentRoot ) value ) ; } else { IPackageFragmentRoot [ ] roots = ( IPackageFragmentRoot [ ] ) value ; for ( int i = <NUM_LIT:0> ; i < roots . length ; i ++ ) { PackageFragmentRoot root = ( PackageFragmentRoot ) roots [ i ] ; ICompilationUnit cu = findCompilationUnit ( pkgName , cuName , root ) ; if ( cu != null ) return cu ; } } } return null ; } private ICompilationUnit findCompilationUnit ( String [ ] pkgName , String cuName , PackageFragmentRoot root ) { if ( ! root . isArchive ( ) ) { IPackageFragment pkg = root . getPackageFragment ( pkgName ) ; try { ICompilationUnit [ ] cus = pkg . getCompilationUnits ( ) ; for ( int j = <NUM_LIT:0> , length = cus . length ; j < length ; j ++ ) { ICompilationUnit cu = cus [ j ] ; if ( Util . equalsIgnoreJavaLikeExtension ( cu . getElementName ( ) , cuName ) ) return cu ; } } catch ( JavaModelException e ) { } } return null ; } public IPackageFragment findPackageFragment ( IPath path ) { if ( ! path . isAbsolute ( ) ) { throw new IllegalArgumentException ( Messages . path_mustBeAbsolute ) ; } IResource possibleFragment = ResourcesPlugin . getWorkspace ( ) . getRoot ( ) . findMember ( path ) ; if ( possibleFragment == null ) { for ( int i = <NUM_LIT:0> ; i < this . packageFragmentRoots . length ; i ++ ) { IPackageFragmentRoot root = this . packageFragmentRoots [ i ] ; if ( ! root . isExternal ( ) ) { continue ; } IPath rootPath = root . getPath ( ) ; if ( rootPath . isPrefixOf ( path ) ) { String name = path . toOSString ( ) ; name = name . substring ( rootPath . toOSString ( ) . length ( ) + <NUM_LIT:1> , name . length ( ) ) ; name = name . replace ( File . separatorChar , '<CHAR_LIT:.>' ) ; IJavaElement [ ] list = null ; try { list = root . getChildren ( ) ; } catch ( JavaModelException npe ) { continue ; } int elementCount = list . length ; for ( int j = <NUM_LIT:0> ; j < elementCount ; j ++ ) { IPackageFragment packageFragment = ( IPackageFragment ) list [ j ] ; if ( nameMatches ( name , packageFragment , false ) ) { return packageFragment ; } } } } } else { IJavaElement fromFactory = JavaCore . create ( possibleFragment ) ; if ( fromFactory == null ) { return null ; } switch ( fromFactory . getElementType ( ) ) { case IJavaElement . PACKAGE_FRAGMENT : return ( IPackageFragment ) fromFactory ; case IJavaElement . JAVA_PROJECT : JavaProject project = ( JavaProject ) fromFactory ; try { IClasspathEntry entry = project . getClasspathEntryFor ( path ) ; if ( entry != null ) { IPackageFragmentRoot root = project . getPackageFragmentRoot ( project . getResource ( ) ) ; Object defaultPkgRoot = this . packageFragments . get ( CharOperation . NO_STRINGS ) ; if ( defaultPkgRoot == null ) { return null ; } if ( defaultPkgRoot instanceof PackageFragmentRoot && defaultPkgRoot . equals ( root ) ) return ( ( PackageFragmentRoot ) root ) . getPackageFragment ( CharOperation . NO_STRINGS ) ; else { IPackageFragmentRoot [ ] roots = ( IPackageFragmentRoot [ ] ) defaultPkgRoot ; for ( int i = <NUM_LIT:0> ; i < roots . length ; i ++ ) { if ( roots [ i ] . equals ( root ) ) { return ( ( PackageFragmentRoot ) root ) . getPackageFragment ( CharOperation . NO_STRINGS ) ; } } } } } catch ( JavaModelException e ) { return null ; } return null ; case IJavaElement . PACKAGE_FRAGMENT_ROOT : return ( ( PackageFragmentRoot ) fromFactory ) . getPackageFragment ( CharOperation . NO_STRINGS ) ; } } return null ; } public IPackageFragment [ ] findPackageFragments ( String name , boolean partialMatch ) { return findPackageFragments ( name , partialMatch , false ) ; } public IPackageFragment [ ] findPackageFragments ( String name , boolean partialMatch , boolean patternMatch ) { boolean isStarPattern = name . equals ( "<STR_LIT:*>" ) ; boolean hasPatternChars = isStarPattern || ( patternMatch && ( name . indexOf ( '<CHAR_LIT>' ) >= <NUM_LIT:0> || name . indexOf ( '<CHAR_LIT>' ) >= <NUM_LIT:0> ) ) ; if ( partialMatch || hasPatternChars ) { String [ ] splittedName = Util . splitOn ( '<CHAR_LIT:.>' , name , <NUM_LIT:0> , name . length ( ) ) ; IPackageFragment [ ] oneFragment = null ; ArrayList pkgs = null ; char [ ] lowercaseName = hasPatternChars && ! isStarPattern ? name . toLowerCase ( ) . toCharArray ( ) : null ; Object [ ] [ ] keys = this . packageFragments . keyTable ; for ( int i = <NUM_LIT:0> , length = keys . length ; i < length ; i ++ ) { String [ ] pkgName = ( String [ ] ) keys [ i ] ; if ( pkgName != null ) { boolean match = isStarPattern || ( hasPatternChars ? CharOperation . match ( lowercaseName , Util . concatCompoundNameToCharArray ( pkgName ) , false ) : Util . startsWithIgnoreCase ( pkgName , splittedName , partialMatch ) ) ; if ( match ) { Object value = this . packageFragments . valueTable [ i ] ; if ( value instanceof PackageFragmentRoot ) { IPackageFragment pkg = ( ( PackageFragmentRoot ) value ) . getPackageFragment ( pkgName ) ; if ( oneFragment == null ) { oneFragment = new IPackageFragment [ ] { pkg } ; } else { if ( pkgs == null ) { pkgs = new ArrayList ( ) ; pkgs . add ( oneFragment [ <NUM_LIT:0> ] ) ; } pkgs . add ( pkg ) ; } } else { IPackageFragmentRoot [ ] roots = ( IPackageFragmentRoot [ ] ) value ; for ( int j = <NUM_LIT:0> , length2 = roots . length ; j < length2 ; j ++ ) { PackageFragmentRoot root = ( PackageFragmentRoot ) roots [ j ] ; IPackageFragment pkg = root . getPackageFragment ( pkgName ) ; if ( oneFragment == null ) { oneFragment = new IPackageFragment [ ] { pkg } ; } else { if ( pkgs == null ) { pkgs = new ArrayList ( ) ; pkgs . add ( oneFragment [ <NUM_LIT:0> ] ) ; } pkgs . add ( pkg ) ; } } } } } } if ( pkgs == null ) return oneFragment ; int resultLength = pkgs . size ( ) ; IPackageFragment [ ] result = new IPackageFragment [ resultLength ] ; pkgs . toArray ( result ) ; return result ; } else { String [ ] splittedName = Util . splitOn ( '<CHAR_LIT:.>' , name , <NUM_LIT:0> , name . length ( ) ) ; int pkgIndex = this . packageFragments . getIndex ( splittedName ) ; if ( pkgIndex == - <NUM_LIT:1> ) return null ; Object value = this . packageFragments . valueTable [ pkgIndex ] ; String [ ] pkgName = ( String [ ] ) this . packageFragments . keyTable [ pkgIndex ] ; if ( value instanceof PackageFragmentRoot ) { return new IPackageFragment [ ] { ( ( PackageFragmentRoot ) value ) . getPackageFragment ( pkgName ) } ; } else { IPackageFragmentRoot [ ] roots = ( IPackageFragmentRoot [ ] ) value ; IPackageFragment [ ] result = new IPackageFragment [ roots . length ] ; for ( int i = <NUM_LIT:0> ; i < roots . length ; i ++ ) { result [ i ] = ( ( PackageFragmentRoot ) roots [ i ] ) . getPackageFragment ( pkgName ) ; } return result ; } } } private IType findSecondaryType ( String packageName , String typeName , IJavaProject project , boolean waitForIndexes , IProgressMonitor monitor ) { JavaModelManager manager = JavaModelManager . getJavaModelManager ( ) ; try { IJavaProject javaProject = project ; Map secondaryTypePaths = manager . secondaryTypes ( javaProject , waitForIndexes , monitor ) ; if ( secondaryTypePaths . size ( ) > <NUM_LIT:0> ) { Map types = ( Map ) secondaryTypePaths . get ( packageName == null ? "<STR_LIT>" : packageName ) ; if ( types != null && types . size ( ) > <NUM_LIT:0> ) { IType type = ( IType ) types . get ( typeName ) ; if ( type != null ) { if ( JavaModelManager . VERBOSE ) { Util . verbose ( "<STR_LIT>" ) ; Util . verbose ( "<STR_LIT>" + packageName ) ; Util . verbose ( "<STR_LIT>" + typeName ) ; Util . verbose ( "<STR_LIT>" + project . getElementName ( ) ) ; Util . verbose ( "<STR_LIT>" + type . getElementName ( ) ) ; } return type ; } } } } catch ( JavaModelException jme ) { } return null ; } public Answer findType ( String typeName , String packageName , boolean partialMatch , int acceptFlags , boolean checkRestrictions ) { return findType ( typeName , packageName , partialMatch , acceptFlags , true , false , checkRestrictions , null ) ; } public Answer findType ( String typeName , String packageName , boolean partialMatch , int acceptFlags , boolean considerSecondaryTypes , boolean waitForIndexes , boolean checkRestrictions , IProgressMonitor monitor ) { if ( packageName == null || packageName . length ( ) == <NUM_LIT:0> ) { packageName = IPackageFragment . DEFAULT_PACKAGE_NAME ; } else if ( typeName . length ( ) > <NUM_LIT:0> && ScannerHelper . isLowerCase ( typeName . charAt ( <NUM_LIT:0> ) ) ) { if ( findPackageFragments ( packageName + "<STR_LIT:.>" + typeName , false ) != null ) return null ; } JavaElementRequestor elementRequestor = new JavaElementRequestor ( ) ; seekPackageFragments ( packageName , false , elementRequestor ) ; IPackageFragment [ ] packages = elementRequestor . getPackageFragments ( ) ; IType type = null ; int length = packages . length ; HashSet projects = null ; IJavaProject javaProject = null ; Answer suggestedAnswer = null ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { type = findType ( typeName , packages [ i ] , partialMatch , acceptFlags ) ; if ( type != null ) { AccessRestriction accessRestriction = null ; if ( checkRestrictions ) { accessRestriction = getViolatedRestriction ( typeName , packageName , type , accessRestriction ) ; } Answer answer = new Answer ( type , accessRestriction ) ; if ( ! answer . ignoreIfBetter ( ) ) { if ( answer . isBetter ( suggestedAnswer ) ) return answer ; } else if ( answer . isBetter ( suggestedAnswer ) ) suggestedAnswer = answer ; } else if ( suggestedAnswer == null && considerSecondaryTypes ) { if ( javaProject == null ) { javaProject = packages [ i ] . getJavaProject ( ) ; } else if ( projects == null ) { if ( ! javaProject . equals ( packages [ i ] . getJavaProject ( ) ) ) { projects = new HashSet ( <NUM_LIT:3> ) ; projects . add ( javaProject ) ; projects . add ( packages [ i ] . getJavaProject ( ) ) ; } } else { projects . add ( packages [ i ] . getJavaProject ( ) ) ; } } } if ( suggestedAnswer != null ) return suggestedAnswer ; if ( considerSecondaryTypes && javaProject != null ) { if ( projects == null ) { type = findSecondaryType ( packageName , typeName , javaProject , waitForIndexes , monitor ) ; } else { Iterator allProjects = projects . iterator ( ) ; while ( type == null && allProjects . hasNext ( ) ) { type = findSecondaryType ( packageName , typeName , ( IJavaProject ) allProjects . next ( ) , waitForIndexes , monitor ) ; } } } return type == null ? null : new Answer ( type , null ) ; } private AccessRestriction getViolatedRestriction ( String typeName , String packageName , IType type , AccessRestriction accessRestriction ) { PackageFragmentRoot root = ( PackageFragmentRoot ) type . getAncestor ( IJavaElement . PACKAGE_FRAGMENT_ROOT ) ; ClasspathEntry entry = ( ClasspathEntry ) this . rootToResolvedEntries . get ( root ) ; if ( entry != null ) { AccessRuleSet accessRuleSet = entry . getAccessRuleSet ( ) ; if ( accessRuleSet != null ) { char [ ] [ ] packageChars = CharOperation . splitOn ( '<CHAR_LIT:.>' , packageName . toCharArray ( ) ) ; char [ ] typeChars = typeName . toCharArray ( ) ; accessRestriction = accessRuleSet . getViolatedRestriction ( CharOperation . concatWith ( packageChars , typeChars , '<CHAR_LIT:/>' ) ) ; } } return accessRestriction ; } public IType findType ( String name , IPackageFragment pkg , boolean partialMatch , int acceptFlags , boolean considerSecondaryTypes ) { IType type = findType ( name , pkg , partialMatch , acceptFlags ) ; if ( type == null && considerSecondaryTypes ) { type = findSecondaryType ( pkg . getElementName ( ) , name , pkg . getJavaProject ( ) , false , null ) ; } return type ; } public IType findType ( String name , IPackageFragment pkg , boolean partialMatch , int acceptFlags ) { if ( pkg == null ) return null ; SingleTypeRequestor typeRequestor = new SingleTypeRequestor ( ) ; seekTypes ( name , pkg , partialMatch , acceptFlags , typeRequestor ) ; return typeRequestor . getType ( ) ; } public IType findType ( String name , boolean partialMatch , int acceptFlags ) { NameLookup . Answer answer = findType ( name , partialMatch , acceptFlags , false ) ; return answer == null ? null : answer . type ; } public Answer findType ( String name , boolean partialMatch , int acceptFlags , boolean checkRestrictions ) { return findType ( name , partialMatch , acceptFlags , true , true , checkRestrictions , null ) ; } public Answer findType ( String name , boolean partialMatch , int acceptFlags , boolean considerSecondaryTypes , boolean waitForIndexes , boolean checkRestrictions , IProgressMonitor monitor ) { int index = name . lastIndexOf ( '<CHAR_LIT:.>' ) ; String className = null , packageName = null ; if ( index == - <NUM_LIT:1> ) { packageName = IPackageFragment . DEFAULT_PACKAGE_NAME ; className = name ; } else { packageName = name . substring ( <NUM_LIT:0> , index ) ; className = name . substring ( index + <NUM_LIT:1> ) ; } return findType ( className , packageName , partialMatch , acceptFlags , considerSecondaryTypes , waitForIndexes , checkRestrictions , monitor ) ; } private IType getMemberType ( IType type , String name , int dot ) { while ( dot != - <NUM_LIT:1> ) { int start = dot + <NUM_LIT:1> ; dot = name . indexOf ( '<CHAR_LIT:.>' , start ) ; String typeName = name . substring ( start , dot == - <NUM_LIT:1> ? name . length ( ) : dot ) ; type = type . getType ( typeName ) ; } return type ; } public boolean isPackage ( String [ ] pkgName ) { return this . packageFragments . get ( pkgName ) != null ; } protected boolean nameMatches ( String searchName , IJavaElement element , boolean partialMatch ) { if ( partialMatch ) { return element . getElementName ( ) . toLowerCase ( ) . startsWith ( searchName ) ; } else { return element . getElementName ( ) . equals ( searchName ) ; } } protected boolean nameMatches ( String searchName , ICompilationUnit cu , boolean partialMatch ) { if ( partialMatch ) { return cu . getElementName ( ) . toLowerCase ( ) . startsWith ( searchName ) ; } else { return Util . equalsIgnoreJavaLikeExtension ( cu . getElementName ( ) , searchName ) ; } } public void seekPackageFragments ( String name , boolean partialMatch , IJavaElementRequestor requestor ) { if ( partialMatch ) { String [ ] splittedName = Util . splitOn ( '<CHAR_LIT:.>' , name , <NUM_LIT:0> , name . length ( ) ) ; Object [ ] [ ] keys = this . packageFragments . keyTable ; for ( int i = <NUM_LIT:0> , length = keys . length ; i < length ; i ++ ) { if ( requestor . isCanceled ( ) ) return ; String [ ] pkgName = ( String [ ] ) keys [ i ] ; if ( pkgName != null && Util . startsWithIgnoreCase ( pkgName , splittedName , partialMatch ) ) { Object value = this . packageFragments . valueTable [ i ] ; if ( value instanceof PackageFragmentRoot ) { PackageFragmentRoot root = ( PackageFragmentRoot ) value ; requestor . acceptPackageFragment ( root . getPackageFragment ( pkgName ) ) ; } else { IPackageFragmentRoot [ ] roots = ( IPackageFragmentRoot [ ] ) value ; for ( int j = <NUM_LIT:0> , length2 = roots . length ; j < length2 ; j ++ ) { if ( requestor . isCanceled ( ) ) return ; PackageFragmentRoot root = ( PackageFragmentRoot ) roots [ j ] ; requestor . acceptPackageFragment ( root . getPackageFragment ( pkgName ) ) ; } } } } } else { String [ ] splittedName = Util . splitOn ( '<CHAR_LIT:.>' , name , <NUM_LIT:0> , name . length ( ) ) ; int pkgIndex = this . packageFragments . getIndex ( splittedName ) ; if ( pkgIndex != - <NUM_LIT:1> ) { Object value = this . packageFragments . valueTable [ pkgIndex ] ; String [ ] pkgName = ( String [ ] ) this . packageFragments . keyTable [ pkgIndex ] ; if ( value instanceof PackageFragmentRoot ) { requestor . acceptPackageFragment ( ( ( PackageFragmentRoot ) value ) . getPackageFragment ( pkgName ) ) ; } else { IPackageFragmentRoot [ ] roots = ( IPackageFragmentRoot [ ] ) value ; if ( roots != null ) { for ( int i = <NUM_LIT:0> , length = roots . length ; i < length ; i ++ ) { if ( requestor . isCanceled ( ) ) return ; PackageFragmentRoot root = ( PackageFragmentRoot ) roots [ i ] ; requestor . acceptPackageFragment ( root . getPackageFragment ( pkgName ) ) ; } } } } } } public void seekTypes ( String name , IPackageFragment pkg , boolean partialMatch , int acceptFlags , IJavaElementRequestor requestor ) { String matchName = partialMatch ? name . toLowerCase ( ) : name ; if ( pkg == null ) { findAllTypes ( matchName , partialMatch , acceptFlags , requestor ) ; return ; } PackageFragmentRoot root = ( PackageFragmentRoot ) pkg . getParent ( ) ; try { int firstDot = - <NUM_LIT:1> ; String topLevelTypeName = null ; int packageFlavor = root . internalKind ( ) ; if ( this . typesInWorkingCopies != null || packageFlavor == IPackageFragmentRoot . K_SOURCE ) { firstDot = matchName . indexOf ( '<CHAR_LIT:.>' ) ; if ( ! partialMatch ) topLevelTypeName = firstDot == - <NUM_LIT:1> ? matchName : matchName . substring ( <NUM_LIT:0> , firstDot ) ; } if ( this . typesInWorkingCopies != null ) { if ( seekTypesInWorkingCopies ( matchName , pkg , firstDot , partialMatch , topLevelTypeName , acceptFlags , requestor ) ) return ; } switch ( packageFlavor ) { case IPackageFragmentRoot . K_BINARY : matchName = matchName . replace ( '<CHAR_LIT:.>' , '<CHAR_LIT>' ) ; seekTypesInBinaryPackage ( matchName , pkg , partialMatch , acceptFlags , requestor ) ; break ; case IPackageFragmentRoot . K_SOURCE : seekTypesInSourcePackage ( matchName , pkg , firstDot , partialMatch , topLevelTypeName , acceptFlags , requestor ) ; if ( matchName . indexOf ( '<CHAR_LIT>' ) != - <NUM_LIT:1> ) { matchName = matchName . replace ( '<CHAR_LIT>' , '<CHAR_LIT:.>' ) ; firstDot = matchName . indexOf ( '<CHAR_LIT:.>' ) ; if ( ! partialMatch ) topLevelTypeName = firstDot == - <NUM_LIT:1> ? matchName : matchName . substring ( <NUM_LIT:0> , firstDot ) ; seekTypesInSourcePackage ( matchName , pkg , firstDot , partialMatch , topLevelTypeName , acceptFlags , requestor ) ; } break ; default : return ; } } catch ( JavaModelException e ) { return ; } } protected void seekTypesInBinaryPackage ( String name , IPackageFragment pkg , boolean partialMatch , int acceptFlags , IJavaElementRequestor requestor ) { long start = - <NUM_LIT:1> ; if ( VERBOSE ) start = System . currentTimeMillis ( ) ; try { if ( ! partialMatch ) { if ( requestor . isCanceled ( ) ) return ; ClassFile classFile = new ClassFile ( ( PackageFragment ) pkg , name ) ; if ( classFile . existsUsingJarTypeCache ( ) ) { IType type = classFile . getType ( ) ; if ( acceptType ( type , acceptFlags , false ) ) { requestor . acceptType ( type ) ; } } } else { IJavaElement [ ] classFiles = null ; try { classFiles = pkg . getChildren ( ) ; } catch ( JavaModelException npe ) { return ; } int length = classFiles . length ; String unqualifiedName = name ; int index = name . lastIndexOf ( '<CHAR_LIT>' ) ; if ( index != - <NUM_LIT:1> ) { unqualifiedName = Util . localTypeName ( name , index , name . length ( ) ) ; } int matchLength = name . length ( ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( requestor . isCanceled ( ) ) return ; IJavaElement classFile = classFiles [ i ] ; String elementName = classFile . getElementName ( ) ; if ( elementName . regionMatches ( true , <NUM_LIT:0> , name , <NUM_LIT:0> , matchLength ) ) { IType type = ( ( ClassFile ) classFile ) . getType ( ) ; String typeName = type . getElementName ( ) ; if ( typeName . length ( ) > <NUM_LIT:0> && ! Character . isDigit ( typeName . charAt ( <NUM_LIT:0> ) ) ) { if ( nameMatches ( unqualifiedName , type , true ) && acceptType ( type , acceptFlags , false ) ) requestor . acceptType ( type ) ; } } } } } finally { if ( VERBOSE ) this . timeSpentInSeekTypesInBinaryPackage += System . currentTimeMillis ( ) - start ; } } protected void seekTypesInSourcePackage ( String name , IPackageFragment pkg , int firstDot , boolean partialMatch , String topLevelTypeName , int acceptFlags , IJavaElementRequestor requestor ) { long start = - <NUM_LIT:1> ; if ( VERBOSE ) start = System . currentTimeMillis ( ) ; try { if ( ! partialMatch ) { try { IJavaElement [ ] compilationUnits = pkg . getChildren ( ) ; for ( int i = <NUM_LIT:0> , length = compilationUnits . length ; i < length ; i ++ ) { if ( requestor . isCanceled ( ) ) return ; IJavaElement cu = compilationUnits [ i ] ; String cuName = cu . getElementName ( ) ; int lastDot = cuName . lastIndexOf ( '<CHAR_LIT:.>' ) ; if ( lastDot != topLevelTypeName . length ( ) || ! topLevelTypeName . regionMatches ( <NUM_LIT:0> , cuName , <NUM_LIT:0> , lastDot ) ) continue ; IType type = ( ( ICompilationUnit ) cu ) . getType ( topLevelTypeName ) ; type = getMemberType ( type , name , firstDot ) ; if ( acceptType ( type , acceptFlags , true ) ) { requestor . acceptType ( type ) ; break ; } } } catch ( JavaModelException e ) { } } else { try { String cuPrefix = firstDot == - <NUM_LIT:1> ? name : name . substring ( <NUM_LIT:0> , firstDot ) ; IJavaElement [ ] compilationUnits = pkg . getChildren ( ) ; for ( int i = <NUM_LIT:0> , length = compilationUnits . length ; i < length ; i ++ ) { if ( requestor . isCanceled ( ) ) return ; IJavaElement cu = compilationUnits [ i ] ; if ( ! cu . getElementName ( ) . toLowerCase ( ) . startsWith ( cuPrefix ) ) continue ; try { IType [ ] types = ( ( ICompilationUnit ) cu ) . getTypes ( ) ; for ( int j = <NUM_LIT:0> , typeLength = types . length ; j < typeLength ; j ++ ) seekTypesInTopLevelType ( name , firstDot , types [ j ] , requestor , acceptFlags ) ; } catch ( JavaModelException e ) { } } } catch ( JavaModelException e ) { } } } finally { if ( VERBOSE ) this . timeSpentInSeekTypesInSourcePackage += System . currentTimeMillis ( ) - start ; } } protected boolean seekTypesInType ( String prefix , int firstDot , IType type , IJavaElementRequestor requestor , int acceptFlags ) { IType [ ] types = null ; try { types = type . getTypes ( ) ; } catch ( JavaModelException npe ) { return false ; } int length = types . length ; if ( length == <NUM_LIT:0> ) return false ; String memberPrefix = prefix ; boolean isMemberTypePrefix = false ; if ( firstDot != - <NUM_LIT:1> ) { memberPrefix = prefix . substring ( <NUM_LIT:0> , firstDot ) ; isMemberTypePrefix = true ; } for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( requestor . isCanceled ( ) ) return false ; IType memberType = types [ i ] ; if ( memberType . getElementName ( ) . toLowerCase ( ) . startsWith ( memberPrefix ) ) if ( isMemberTypePrefix ) { String subPrefix = prefix . substring ( firstDot + <NUM_LIT:1> , prefix . length ( ) ) ; return seekTypesInType ( subPrefix , subPrefix . indexOf ( '<CHAR_LIT:.>' ) , memberType , requestor , acceptFlags ) ; } else { if ( acceptType ( memberType , acceptFlags , true ) ) { requestor . acceptMemberType ( memberType ) ; return true ; } } } return false ; } protected boolean seekTypesInTopLevelType ( String prefix , int firstDot , IType topLevelType , IJavaElementRequestor requestor , int acceptFlags ) { if ( ! topLevelType . getElementName ( ) . toLowerCase ( ) . startsWith ( prefix ) ) return false ; if ( firstDot == - <NUM_LIT:1> ) { if ( acceptType ( topLevelType , acceptFlags , true ) ) { requestor . acceptType ( topLevelType ) ; return true ; } } else { return seekTypesInType ( prefix , firstDot , topLevelType , requestor , acceptFlags ) ; } return false ; } protected boolean seekTypesInWorkingCopies ( String name , IPackageFragment pkg , int firstDot , boolean partialMatch , String topLevelTypeName , int acceptFlags , IJavaElementRequestor requestor ) { if ( ! partialMatch ) { HashMap typeMap = ( HashMap ) ( this . typesInWorkingCopies == null ? null : this . typesInWorkingCopies . get ( pkg ) ) ; if ( typeMap != null ) { Object object = typeMap . get ( topLevelTypeName ) ; if ( object instanceof IType ) { IType type = getMemberType ( ( IType ) object , name , firstDot ) ; if ( acceptType ( type , acceptFlags , true ) ) { requestor . acceptType ( type ) ; return true ; } } else if ( object instanceof IType [ ] ) { if ( object == NO_TYPES ) { String packageInfoName = String . valueOf ( TypeConstants . PACKAGE_INFO_NAME ) ; if ( packageInfoName . equals ( name ) ) requestor . acceptType ( pkg . getCompilationUnit ( packageInfoName . concat ( SUFFIX_STRING_java ) ) . getType ( name ) ) ; return true ; } IType [ ] topLevelTypes = ( IType [ ] ) object ; for ( int i = <NUM_LIT:0> , length = topLevelTypes . length ; i < length ; i ++ ) { if ( requestor . isCanceled ( ) ) return false ; IType type = getMemberType ( topLevelTypes [ i ] , name , firstDot ) ; if ( acceptType ( type , acceptFlags , true ) ) { requestor . acceptType ( type ) ; return true ; } } } } } else { HashMap typeMap = ( HashMap ) ( this . typesInWorkingCopies == null ? null : this . typesInWorkingCopies . get ( pkg ) ) ; if ( typeMap != null ) { Iterator iterator = typeMap . values ( ) . iterator ( ) ; while ( iterator . hasNext ( ) ) { if ( requestor . isCanceled ( ) ) return false ; Object object = iterator . next ( ) ; if ( object instanceof IType ) { seekTypesInTopLevelType ( name , firstDot , ( IType ) object , requestor , acceptFlags ) ; } else if ( object instanceof IType [ ] ) { IType [ ] topLevelTypes = ( IType [ ] ) object ; for ( int i = <NUM_LIT:0> , length = topLevelTypes . length ; i < length ; i ++ ) seekTypesInTopLevelType ( name , firstDot , topLevelTypes [ i ] , requestor , acceptFlags ) ; } } } } return false ; } } </s>
<s> package org . eclipse . jdt . internal . core ; import java . io . InputStream ; import java . util . ArrayList ; import java . util . HashMap ; import org . eclipse . core . resources . * ; import org . eclipse . core . runtime . * ; import org . eclipse . core . runtime . jobs . ISchedulingRule ; import org . eclipse . jdt . core . * ; import org . eclipse . jdt . internal . core . util . Messages ; import org . eclipse . jface . text . BadLocationException ; import org . eclipse . jface . text . IDocument ; import org . eclipse . text . edits . TextEdit ; public abstract class JavaModelOperation implements IWorkspaceRunnable , IProgressMonitor { protected interface IPostAction { String getID ( ) ; void run ( ) throws JavaModelException ; } protected static final int APPEND = <NUM_LIT:1> ; protected static final int REMOVEALL_APPEND = <NUM_LIT:2> ; protected static final int KEEP_EXISTING = <NUM_LIT:3> ; protected static boolean POST_ACTION_VERBOSE ; protected IPostAction [ ] actions ; protected int actionsStart = <NUM_LIT:0> ; protected int actionsEnd = - <NUM_LIT:1> ; protected HashMap attributes ; public static final String HAS_MODIFIED_RESOURCE_ATTR = "<STR_LIT>" ; public static final String TRUE = JavaModelManager . TRUE ; protected IJavaElement [ ] elementsToProcess ; protected IJavaElement [ ] parentElements ; protected static final IJavaElement [ ] NO_ELEMENTS = new IJavaElement [ ] { } ; protected IJavaElement [ ] resultElements = NO_ELEMENTS ; public IProgressMonitor progressMonitor = null ; protected boolean isNested = false ; protected boolean force = false ; protected static final ThreadLocal OPERATION_STACKS = new ThreadLocal ( ) ; protected JavaModelOperation ( ) { } protected JavaModelOperation ( IJavaElement [ ] elements ) { this . elementsToProcess = elements ; } protected JavaModelOperation ( IJavaElement [ ] elementsToProcess , IJavaElement [ ] parentElements ) { this . elementsToProcess = elementsToProcess ; this . parentElements = parentElements ; } protected JavaModelOperation ( IJavaElement [ ] elementsToProcess , IJavaElement [ ] parentElements , boolean force ) { this . elementsToProcess = elementsToProcess ; this . parentElements = parentElements ; this . force = force ; } protected JavaModelOperation ( IJavaElement [ ] elements , boolean force ) { this . elementsToProcess = elements ; this . force = force ; } protected JavaModelOperation ( IJavaElement element ) { this . elementsToProcess = new IJavaElement [ ] { element } ; } protected void addAction ( IPostAction action ) { int length = this . actions . length ; if ( length == ++ this . actionsEnd ) { System . arraycopy ( this . actions , <NUM_LIT:0> , this . actions = new IPostAction [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; } this . actions [ this . actionsEnd ] = action ; } protected void addDelta ( IJavaElementDelta delta ) { JavaModelManager . getJavaModelManager ( ) . getDeltaProcessor ( ) . registerJavaModelDelta ( delta ) ; } protected void addReconcileDelta ( ICompilationUnit workingCopy , IJavaElementDelta delta ) { HashMap reconcileDeltas = JavaModelManager . getJavaModelManager ( ) . getDeltaProcessor ( ) . reconcileDeltas ; JavaElementDelta previousDelta = ( JavaElementDelta ) reconcileDeltas . get ( workingCopy ) ; if ( previousDelta != null ) { IJavaElementDelta [ ] children = delta . getAffectedChildren ( ) ; for ( int i = <NUM_LIT:0> , length = children . length ; i < length ; i ++ ) { JavaElementDelta child = ( JavaElementDelta ) children [ i ] ; previousDelta . insertDeltaTree ( child . getElement ( ) , child ) ; } if ( ( delta . getFlags ( ) & IJavaElementDelta . F_AST_AFFECTED ) != <NUM_LIT:0> ) { previousDelta . changedAST ( delta . getCompilationUnitAST ( ) ) ; } } else { reconcileDeltas . put ( workingCopy , delta ) ; } } protected void removeReconcileDelta ( ICompilationUnit workingCopy ) { JavaModelManager . getJavaModelManager ( ) . getDeltaProcessor ( ) . reconcileDeltas . remove ( workingCopy ) ; } protected void applyTextEdit ( ICompilationUnit cu , TextEdit edits ) throws JavaModelException { try { edits . apply ( getDocument ( cu ) ) ; } catch ( BadLocationException e ) { throw new JavaModelException ( e , IJavaModelStatusConstants . INVALID_CONTENTS ) ; } } public void beginTask ( String name , int totalWork ) { if ( this . progressMonitor != null ) { this . progressMonitor . beginTask ( name , totalWork ) ; } } protected boolean canModifyRoots ( ) { return false ; } protected void checkCanceled ( ) { if ( isCanceled ( ) ) { throw new OperationCanceledException ( Messages . operation_cancelled ) ; } } protected IJavaModelStatus commonVerify ( ) { if ( this . elementsToProcess == null || this . elementsToProcess . length == <NUM_LIT:0> ) { return new JavaModelStatus ( IJavaModelStatusConstants . NO_ELEMENTS_TO_PROCESS ) ; } for ( int i = <NUM_LIT:0> ; i < this . elementsToProcess . length ; i ++ ) { if ( this . elementsToProcess [ i ] == null ) { return new JavaModelStatus ( IJavaModelStatusConstants . NO_ELEMENTS_TO_PROCESS ) ; } } return JavaModelStatus . VERIFIED_OK ; } protected void copyResources ( IResource [ ] resources , IPath container ) throws JavaModelException { IProgressMonitor subProgressMonitor = getSubProgressMonitor ( resources . length ) ; IWorkspaceRoot root = ResourcesPlugin . getWorkspace ( ) . getRoot ( ) ; try { for ( int i = <NUM_LIT:0> , length = resources . length ; i < length ; i ++ ) { IResource resource = resources [ i ] ; IPath destination = container . append ( resource . getName ( ) ) ; if ( root . findMember ( destination ) == null ) { resource . copy ( destination , false , subProgressMonitor ) ; } } setAttribute ( HAS_MODIFIED_RESOURCE_ATTR , TRUE ) ; } catch ( CoreException e ) { throw new JavaModelException ( e ) ; } } protected void createFile ( IContainer folder , String name , InputStream contents , boolean forceFlag ) throws JavaModelException { IFile file = folder . getFile ( new Path ( name ) ) ; try { file . create ( contents , forceFlag ? IResource . FORCE | IResource . KEEP_HISTORY : IResource . KEEP_HISTORY , getSubProgressMonitor ( <NUM_LIT:1> ) ) ; setAttribute ( HAS_MODIFIED_RESOURCE_ATTR , TRUE ) ; } catch ( CoreException e ) { throw new JavaModelException ( e ) ; } } protected void createFolder ( IContainer parentFolder , String name , boolean forceFlag ) throws JavaModelException { IFolder folder = parentFolder . getFolder ( new Path ( name ) ) ; try { folder . create ( forceFlag ? IResource . FORCE | IResource . KEEP_HISTORY : IResource . KEEP_HISTORY , true , getSubProgressMonitor ( <NUM_LIT:1> ) ) ; setAttribute ( HAS_MODIFIED_RESOURCE_ATTR , TRUE ) ; } catch ( CoreException e ) { throw new JavaModelException ( e ) ; } } protected void deleteEmptyPackageFragment ( IPackageFragment fragment , boolean forceFlag , IResource rootResource ) throws JavaModelException { IContainer resource = ( IContainer ) ( ( JavaElement ) fragment ) . resource ( ) ; try { resource . delete ( forceFlag ? IResource . FORCE | IResource . KEEP_HISTORY : IResource . KEEP_HISTORY , getSubProgressMonitor ( <NUM_LIT:1> ) ) ; setAttribute ( HAS_MODIFIED_RESOURCE_ATTR , TRUE ) ; while ( resource instanceof IFolder ) { resource = resource . getParent ( ) ; if ( ! resource . equals ( rootResource ) && resource . members ( ) . length == <NUM_LIT:0> ) { resource . delete ( forceFlag ? IResource . FORCE | IResource . KEEP_HISTORY : IResource . KEEP_HISTORY , getSubProgressMonitor ( <NUM_LIT:1> ) ) ; setAttribute ( HAS_MODIFIED_RESOURCE_ATTR , TRUE ) ; } } } catch ( CoreException e ) { throw new JavaModelException ( e ) ; } } protected void deleteResource ( IResource resource , int flags ) throws JavaModelException { try { resource . delete ( flags , getSubProgressMonitor ( <NUM_LIT:1> ) ) ; setAttribute ( HAS_MODIFIED_RESOURCE_ATTR , TRUE ) ; } catch ( CoreException e ) { throw new JavaModelException ( e ) ; } } protected void deleteResources ( IResource [ ] resources , boolean forceFlag ) throws JavaModelException { if ( resources == null || resources . length == <NUM_LIT:0> ) return ; IProgressMonitor subProgressMonitor = getSubProgressMonitor ( resources . length ) ; IWorkspace workspace = resources [ <NUM_LIT:0> ] . getWorkspace ( ) ; try { workspace . delete ( resources , forceFlag ? IResource . FORCE | IResource . KEEP_HISTORY : IResource . KEEP_HISTORY , subProgressMonitor ) ; setAttribute ( HAS_MODIFIED_RESOURCE_ATTR , TRUE ) ; } catch ( CoreException e ) { throw new JavaModelException ( e ) ; } } public void done ( ) { if ( this . progressMonitor != null ) { this . progressMonitor . done ( ) ; } } protected boolean equalsOneOf ( IPath path , IPath [ ] otherPaths ) { for ( int i = <NUM_LIT:0> , length = otherPaths . length ; i < length ; i ++ ) { if ( path . equals ( otherPaths [ i ] ) ) { return true ; } } return false ; } public void executeNestedOperation ( JavaModelOperation operation , int subWorkAmount ) throws JavaModelException { IJavaModelStatus status = operation . verify ( ) ; if ( ! status . isOK ( ) ) { throw new JavaModelException ( status ) ; } IProgressMonitor subProgressMonitor = getSubProgressMonitor ( subWorkAmount ) ; try { operation . setNested ( true ) ; operation . run ( subProgressMonitor ) ; } catch ( CoreException ce ) { if ( ce instanceof JavaModelException ) { throw ( JavaModelException ) ce ; } else { if ( ce . getStatus ( ) . getCode ( ) == IResourceStatus . OPERATION_FAILED ) { Throwable e = ce . getStatus ( ) . getException ( ) ; if ( e instanceof JavaModelException ) { throw ( JavaModelException ) e ; } } throw new JavaModelException ( ce ) ; } } } protected abstract void executeOperation ( ) throws JavaModelException ; protected static Object getAttribute ( Object key ) { ArrayList stack = getCurrentOperationStack ( ) ; if ( stack . size ( ) == <NUM_LIT:0> ) return null ; JavaModelOperation topLevelOp = ( JavaModelOperation ) stack . get ( <NUM_LIT:0> ) ; if ( topLevelOp . attributes == null ) { return null ; } else { return topLevelOp . attributes . get ( key ) ; } } protected ICompilationUnit getCompilationUnitFor ( IJavaElement element ) { return ( ( JavaElement ) element ) . getCompilationUnit ( ) ; } protected static ArrayList getCurrentOperationStack ( ) { ArrayList stack = ( ArrayList ) OPERATION_STACKS . get ( ) ; if ( stack == null ) { stack = new ArrayList ( ) ; OPERATION_STACKS . set ( stack ) ; } return stack ; } protected IDocument getDocument ( ICompilationUnit cu ) throws JavaModelException { IBuffer buffer = cu . getBuffer ( ) ; if ( buffer instanceof IDocument ) return ( IDocument ) buffer ; return new DocumentAdapter ( buffer ) ; } protected IJavaElement getElementToProcess ( ) { if ( this . elementsToProcess == null || this . elementsToProcess . length == <NUM_LIT:0> ) { return null ; } return this . elementsToProcess [ <NUM_LIT:0> ] ; } public IJavaModel getJavaModel ( ) { return JavaModelManager . getJavaModelManager ( ) . getJavaModel ( ) ; } protected IPath [ ] getNestedFolders ( IPackageFragmentRoot root ) throws JavaModelException { IPath rootPath = root . getPath ( ) ; IClasspathEntry [ ] classpath = root . getJavaProject ( ) . getRawClasspath ( ) ; int length = classpath . length ; IPath [ ] result = new IPath [ length ] ; int index = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { IPath path = classpath [ i ] . getPath ( ) ; if ( rootPath . isPrefixOf ( path ) && ! rootPath . equals ( path ) ) { result [ index ++ ] = path ; } } if ( index < length ) { System . arraycopy ( result , <NUM_LIT:0> , result = new IPath [ index ] , <NUM_LIT:0> , index ) ; } return result ; } protected IJavaElement getParentElement ( ) { if ( this . parentElements == null || this . parentElements . length == <NUM_LIT:0> ) { return null ; } return this . parentElements [ <NUM_LIT:0> ] ; } protected IJavaElement [ ] getParentElements ( ) { return this . parentElements ; } public IJavaElement [ ] getResultElements ( ) { return this . resultElements ; } protected ISchedulingRule getSchedulingRule ( ) { return ResourcesPlugin . getWorkspace ( ) . getRoot ( ) ; } protected IProgressMonitor getSubProgressMonitor ( int workAmount ) { IProgressMonitor sub = null ; if ( this . progressMonitor != null ) { sub = new SubProgressMonitor ( this . progressMonitor , workAmount , SubProgressMonitor . PREPEND_MAIN_LABEL_TO_SUBTASK ) ; } return sub ; } public boolean hasModifiedResource ( ) { return ! isReadOnly ( ) && getAttribute ( HAS_MODIFIED_RESOURCE_ATTR ) == TRUE ; } public void internalWorked ( double work ) { if ( this . progressMonitor != null ) { this . progressMonitor . internalWorked ( work ) ; } } public boolean isCanceled ( ) { if ( this . progressMonitor != null ) { return this . progressMonitor . isCanceled ( ) ; } return false ; } public boolean isReadOnly ( ) { return false ; } protected boolean isTopLevelOperation ( ) { ArrayList stack ; return ( stack = getCurrentOperationStack ( ) ) . size ( ) > <NUM_LIT:0> && stack . get ( <NUM_LIT:0> ) == this ; } protected int firstActionWithID ( String id , int start ) { for ( int i = start ; i <= this . actionsEnd ; i ++ ) { if ( this . actions [ i ] . getID ( ) . equals ( id ) ) { return i ; } } return - <NUM_LIT:1> ; } protected void moveResources ( IResource [ ] resources , IPath container ) throws JavaModelException { IProgressMonitor subProgressMonitor = null ; if ( this . progressMonitor != null ) { subProgressMonitor = new SubProgressMonitor ( this . progressMonitor , resources . length , SubProgressMonitor . PREPEND_MAIN_LABEL_TO_SUBTASK ) ; } IWorkspaceRoot root = ResourcesPlugin . getWorkspace ( ) . getRoot ( ) ; try { for ( int i = <NUM_LIT:0> , length = resources . length ; i < length ; i ++ ) { IResource resource = resources [ i ] ; IPath destination = container . append ( resource . getName ( ) ) ; if ( root . findMember ( destination ) == null ) { resource . move ( destination , false , subProgressMonitor ) ; } } setAttribute ( HAS_MODIFIED_RESOURCE_ATTR , TRUE ) ; } catch ( CoreException e ) { throw new JavaModelException ( e ) ; } } public JavaElementDelta newJavaElementDelta ( ) { return new JavaElementDelta ( getJavaModel ( ) ) ; } protected JavaModelOperation popOperation ( ) { ArrayList stack = getCurrentOperationStack ( ) ; int size = stack . size ( ) ; if ( size > <NUM_LIT:0> ) { if ( size == <NUM_LIT:1> ) { OPERATION_STACKS . set ( null ) ; } return ( JavaModelOperation ) stack . remove ( size - <NUM_LIT:1> ) ; } else { return null ; } } protected void postAction ( IPostAction action , int insertionMode ) { if ( POST_ACTION_VERBOSE ) { System . out . print ( "<STR_LIT:(>" + Thread . currentThread ( ) + "<STR_LIT>" + action . getID ( ) ) ; switch ( insertionMode ) { case REMOVEALL_APPEND : System . out . println ( "<STR_LIT>" ) ; break ; case KEEP_EXISTING : System . out . println ( "<STR_LIT>" ) ; break ; case APPEND : System . out . println ( "<STR_LIT>" ) ; break ; } } JavaModelOperation topLevelOp = ( JavaModelOperation ) getCurrentOperationStack ( ) . get ( <NUM_LIT:0> ) ; IPostAction [ ] postActions = topLevelOp . actions ; if ( postActions == null ) { topLevelOp . actions = postActions = new IPostAction [ <NUM_LIT:1> ] ; postActions [ <NUM_LIT:0> ] = action ; topLevelOp . actionsEnd = <NUM_LIT:0> ; } else { String id = action . getID ( ) ; switch ( insertionMode ) { case REMOVEALL_APPEND : int index = this . actionsStart - <NUM_LIT:1> ; while ( ( index = topLevelOp . firstActionWithID ( id , index + <NUM_LIT:1> ) ) >= <NUM_LIT:0> ) { System . arraycopy ( postActions , index + <NUM_LIT:1> , postActions , index , topLevelOp . actionsEnd - index ) ; postActions [ topLevelOp . actionsEnd -- ] = null ; } topLevelOp . addAction ( action ) ; break ; case KEEP_EXISTING : if ( topLevelOp . firstActionWithID ( id , <NUM_LIT:0> ) < <NUM_LIT:0> ) { topLevelOp . addAction ( action ) ; } break ; case APPEND : topLevelOp . addAction ( action ) ; break ; } } } protected boolean prefixesOneOf ( IPath path , IPath [ ] otherPaths ) { for ( int i = <NUM_LIT:0> , length = otherPaths . length ; i < length ; i ++ ) { if ( path . isPrefixOf ( otherPaths [ i ] ) ) { return true ; } } return false ; } protected void pushOperation ( JavaModelOperation operation ) { getCurrentOperationStack ( ) . add ( operation ) ; } protected void removeAllPostAction ( String actionID ) { if ( POST_ACTION_VERBOSE ) { System . out . println ( "<STR_LIT:(>" + Thread . currentThread ( ) + "<STR_LIT>" + actionID ) ; } JavaModelOperation topLevelOp = ( JavaModelOperation ) getCurrentOperationStack ( ) . get ( <NUM_LIT:0> ) ; IPostAction [ ] postActions = topLevelOp . actions ; if ( postActions == null ) return ; int index = this . actionsStart - <NUM_LIT:1> ; while ( ( index = topLevelOp . firstActionWithID ( actionID , index + <NUM_LIT:1> ) ) >= <NUM_LIT:0> ) { System . arraycopy ( postActions , index + <NUM_LIT:1> , postActions , index , topLevelOp . actionsEnd - index ) ; postActions [ topLevelOp . actionsEnd -- ] = null ; } } public void run ( IProgressMonitor monitor ) throws CoreException { JavaModelManager manager = JavaModelManager . getJavaModelManager ( ) ; DeltaProcessor deltaProcessor = manager . getDeltaProcessor ( ) ; int previousDeltaCount = deltaProcessor . javaModelDeltas . size ( ) ; try { this . progressMonitor = monitor ; pushOperation ( this ) ; try { if ( canModifyRoots ( ) ) { JavaModelManager . getDeltaState ( ) . initializeRoots ( false ) ; } executeOperation ( ) ; } finally { if ( isTopLevelOperation ( ) ) { runPostActions ( ) ; } } } finally { try { deltaProcessor = manager . getDeltaProcessor ( ) ; for ( int i = previousDeltaCount , size = deltaProcessor . javaModelDeltas . size ( ) ; i < size ; i ++ ) { deltaProcessor . updateJavaModel ( ( IJavaElementDelta ) deltaProcessor . javaModelDeltas . get ( i ) ) ; } for ( int i = <NUM_LIT:0> , length = this . resultElements . length ; i < length ; i ++ ) { IJavaElement element = this . resultElements [ i ] ; Openable openable = ( Openable ) element . getOpenable ( ) ; if ( ! ( openable instanceof CompilationUnit ) || ! ( ( CompilationUnit ) openable ) . isWorkingCopy ( ) ) { ( ( JavaElement ) openable . getParent ( ) ) . close ( ) ; } switch ( element . getElementType ( ) ) { case IJavaElement . PACKAGE_FRAGMENT_ROOT : case IJavaElement . PACKAGE_FRAGMENT : deltaProcessor . projectCachesToReset . add ( element . getJavaProject ( ) ) ; break ; } } deltaProcessor . resetProjectCaches ( ) ; if ( isTopLevelOperation ( ) ) { if ( ( deltaProcessor . javaModelDeltas . size ( ) > previousDeltaCount || ! deltaProcessor . reconcileDeltas . isEmpty ( ) ) && ! hasModifiedResource ( ) ) { deltaProcessor . fire ( null , DeltaProcessor . DEFAULT_CHANGE_EVENT ) ; } } } finally { popOperation ( ) ; } } } public void runOperation ( IProgressMonitor monitor ) throws JavaModelException { IJavaModelStatus status = verify ( ) ; if ( ! status . isOK ( ) ) { throw new JavaModelException ( status ) ; } try { if ( isReadOnly ( ) ) { run ( monitor ) ; } else { ResourcesPlugin . getWorkspace ( ) . run ( this , getSchedulingRule ( ) , IWorkspace . AVOID_UPDATE , monitor ) ; } } catch ( CoreException ce ) { if ( ce instanceof JavaModelException ) { throw ( JavaModelException ) ce ; } else { if ( ce . getStatus ( ) . getCode ( ) == IResourceStatus . OPERATION_FAILED ) { Throwable e = ce . getStatus ( ) . getException ( ) ; if ( e instanceof JavaModelException ) { throw ( JavaModelException ) e ; } } throw new JavaModelException ( ce ) ; } } } protected void runPostActions ( ) throws JavaModelException { while ( this . actionsStart <= this . actionsEnd ) { IPostAction postAction = this . actions [ this . actionsStart ++ ] ; if ( POST_ACTION_VERBOSE ) { System . out . println ( "<STR_LIT:(>" + Thread . currentThread ( ) + "<STR_LIT>" + postAction . getID ( ) ) ; } postAction . run ( ) ; } } protected static void setAttribute ( Object key , Object attribute ) { ArrayList operationStack = getCurrentOperationStack ( ) ; if ( operationStack . size ( ) == <NUM_LIT:0> ) return ; JavaModelOperation topLevelOp = ( JavaModelOperation ) operationStack . get ( <NUM_LIT:0> ) ; if ( topLevelOp . attributes == null ) { topLevelOp . attributes = new HashMap ( ) ; } topLevelOp . attributes . put ( key , attribute ) ; } public void setCanceled ( boolean b ) { if ( this . progressMonitor != null ) { this . progressMonitor . setCanceled ( b ) ; } } protected void setNested ( boolean nested ) { this . isNested = nested ; } public void setTaskName ( String name ) { if ( this . progressMonitor != null ) { this . progressMonitor . setTaskName ( name ) ; } } public void subTask ( String name ) { if ( this . progressMonitor != null ) { this . progressMonitor . subTask ( name ) ; } } protected IJavaModelStatus verify ( ) { return commonVerify ( ) ; } public void worked ( int work ) { if ( this . progressMonitor != null ) { this . progressMonitor . worked ( work ) ; checkCanceled ( ) ; } } } </s>
<s> package org . eclipse . jdt . internal . core ; import org . eclipse . core . runtime . IProgressMonitor ; import org . eclipse . jdt . core . Flags ; import org . eclipse . jdt . core . IAnnotation ; import org . eclipse . jdt . core . IField ; import org . eclipse . jdt . core . JavaModelException ; import org . eclipse . jdt . core . Signature ; import org . eclipse . jdt . internal . compiler . env . IBinaryAnnotation ; import org . eclipse . jdt . internal . compiler . env . IBinaryField ; import org . eclipse . jdt . internal . compiler . lookup . Binding ; class BinaryField extends BinaryMember implements IField { protected BinaryField ( JavaElement parent , String name ) { super ( parent , name ) ; } public boolean equals ( Object o ) { if ( ! ( o instanceof BinaryField ) ) return false ; return super . equals ( o ) ; } public IAnnotation [ ] getAnnotations ( ) throws JavaModelException { IBinaryField info = ( IBinaryField ) getElementInfo ( ) ; IBinaryAnnotation [ ] binaryAnnotations = info . getAnnotations ( ) ; return getAnnotations ( binaryAnnotations , info . getTagBits ( ) ) ; } public Object getConstant ( ) throws JavaModelException { IBinaryField info = ( IBinaryField ) getElementInfo ( ) ; return convertConstant ( info . getConstant ( ) ) ; } public int getFlags ( ) throws JavaModelException { IBinaryField info = ( IBinaryField ) getElementInfo ( ) ; return info . getModifiers ( ) ; } public int getElementType ( ) { return FIELD ; } protected char getHandleMementoDelimiter ( ) { return JavaElement . JEM_FIELD ; } public String getKey ( boolean forceOpen ) throws JavaModelException { return getKey ( this , forceOpen ) ; } public String getTypeSignature ( ) throws JavaModelException { IBinaryField info = ( IBinaryField ) getElementInfo ( ) ; char [ ] genericSignature = info . getGenericSignature ( ) ; if ( genericSignature != null ) { return new String ( ClassFile . translatedName ( genericSignature ) ) ; } return new String ( ClassFile . translatedName ( info . getTypeName ( ) ) ) ; } public boolean isEnumConstant ( ) throws JavaModelException { return Flags . isEnum ( getFlags ( ) ) ; } public boolean isResolved ( ) { return false ; } public JavaElement resolved ( Binding binding ) { SourceRefElement resolvedHandle = new ResolvedBinaryField ( 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 ) { toStringName ( buffer ) ; buffer . append ( "<STR_LIT>" ) ; } else if ( info == NO_INFO ) { toStringName ( buffer ) ; } else { try { buffer . append ( Signature . toString ( getTypeSignature ( ) ) ) ; buffer . append ( "<STR_LIT:U+0020>" ) ; toStringName ( buffer ) ; } catch ( JavaModelException e ) { buffer . append ( "<STR_LIT>" + getElementName ( ) ) ; } } } public String getAttachedJavadoc ( IProgressMonitor monitor ) throws JavaModelException { JavadocContents javadocContents = ( ( BinaryType ) this . getDeclaringType ( ) ) . getJavadocContents ( monitor ) ; if ( javadocContents == null ) return null ; return javadocContents . getFieldDoc ( this ) ; } } </s>
<s> package org . eclipse . jdt . internal . core ; import java . util . ArrayList ; import org . eclipse . core . resources . IResourceDelta ; import org . eclipse . jdt . core . IJavaElement ; import org . eclipse . jdt . core . IJavaElementDelta ; import org . eclipse . jdt . core . dom . CompilationUnit ; public class JavaElementDelta extends SimpleDelta implements IJavaElementDelta { IJavaElementDelta [ ] affectedChildren = EMPTY_DELTA ; CompilationUnit ast = null ; IJavaElement changedElement ; IResourceDelta [ ] resourceDeltas = null ; int resourceDeltasCounter ; IJavaElement movedFromHandle = null ; IJavaElement movedToHandle = null ; IJavaElementDelta [ ] annotationDeltas = EMPTY_DELTA ; static IJavaElementDelta [ ] EMPTY_DELTA = new IJavaElementDelta [ ] { } ; public JavaElementDelta ( IJavaElement element ) { this . changedElement = element ; } protected void addAffectedChild ( JavaElementDelta child ) { switch ( this . kind ) { case ADDED : case REMOVED : return ; case CHANGED : this . changeFlags |= F_CHILDREN ; break ; default : this . kind = CHANGED ; this . changeFlags |= F_CHILDREN ; } if ( this . changedElement . getElementType ( ) >= IJavaElement . COMPILATION_UNIT ) { fineGrained ( ) ; } if ( this . affectedChildren == null || this . affectedChildren . length == <NUM_LIT:0> ) { this . affectedChildren = new IJavaElementDelta [ ] { child } ; return ; } JavaElementDelta existingChild = null ; int existingChildIndex = - <NUM_LIT:1> ; for ( int i = <NUM_LIT:0> ; i < this . affectedChildren . length ; i ++ ) { if ( equalsAndSameParent ( this . affectedChildren [ i ] . getElement ( ) , child . getElement ( ) ) ) { existingChild = ( JavaElementDelta ) this . affectedChildren [ i ] ; existingChildIndex = i ; break ; } } if ( existingChild == null ) { this . affectedChildren = growAndAddToArray ( this . affectedChildren , child ) ; } else { switch ( existingChild . getKind ( ) ) { case ADDED : switch ( child . getKind ( ) ) { case ADDED : case CHANGED : return ; case REMOVED : this . affectedChildren = removeAndShrinkArray ( this . affectedChildren , existingChildIndex ) ; return ; } break ; case REMOVED : switch ( child . getKind ( ) ) { case ADDED : child . kind = CHANGED ; this . affectedChildren [ existingChildIndex ] = child ; return ; case CHANGED : case REMOVED : return ; } break ; case CHANGED : switch ( child . getKind ( ) ) { case ADDED : case REMOVED : this . affectedChildren [ existingChildIndex ] = child ; return ; case CHANGED : IJavaElementDelta [ ] children = child . getAffectedChildren ( ) ; for ( int i = <NUM_LIT:0> ; i < children . length ; i ++ ) { JavaElementDelta childsChild = ( JavaElementDelta ) children [ i ] ; existingChild . addAffectedChild ( childsChild ) ; } boolean childHadContentFlag = ( child . changeFlags & F_CONTENT ) != <NUM_LIT:0> ; boolean existingChildHadChildrenFlag = ( existingChild . changeFlags & F_CHILDREN ) != <NUM_LIT:0> ; existingChild . changeFlags |= child . changeFlags ; if ( childHadContentFlag && existingChildHadChildrenFlag ) { existingChild . changeFlags &= ~ F_CONTENT ; } IResourceDelta [ ] resDeltas = child . getResourceDeltas ( ) ; if ( resDeltas != null ) { existingChild . resourceDeltas = resDeltas ; existingChild . resourceDeltasCounter = child . resourceDeltasCounter ; } return ; } break ; default : int flags = existingChild . getFlags ( ) ; this . affectedChildren [ existingChildIndex ] = child ; child . changeFlags |= flags ; } } } public void added ( IJavaElement element ) { added ( element , <NUM_LIT:0> ) ; } public void added ( IJavaElement element , int flags ) { JavaElementDelta addedDelta = new JavaElementDelta ( element ) ; addedDelta . added ( ) ; addedDelta . changeFlags |= flags ; insertDeltaTree ( element , addedDelta ) ; } protected void addResourceDelta ( IResourceDelta child ) { switch ( this . kind ) { case ADDED : case REMOVED : return ; case CHANGED : this . changeFlags |= F_CONTENT ; break ; default : this . kind = CHANGED ; this . changeFlags |= F_CONTENT ; } if ( this . resourceDeltas == null ) { this . resourceDeltas = new IResourceDelta [ <NUM_LIT:5> ] ; this . resourceDeltas [ this . resourceDeltasCounter ++ ] = child ; return ; } if ( this . resourceDeltas . length == this . resourceDeltasCounter ) { System . arraycopy ( this . resourceDeltas , <NUM_LIT:0> , ( this . resourceDeltas = new IResourceDelta [ this . resourceDeltasCounter * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . resourceDeltasCounter ) ; } this . resourceDeltas [ this . resourceDeltasCounter ++ ] = child ; } public JavaElementDelta changed ( IJavaElement element , int changeFlag ) { JavaElementDelta changedDelta = new JavaElementDelta ( element ) ; changedDelta . changed ( changeFlag ) ; insertDeltaTree ( element , changedDelta ) ; return changedDelta ; } public void changedAST ( CompilationUnit changedAST ) { this . ast = changedAST ; changed ( F_AST_AFFECTED ) ; } public void contentChanged ( ) { this . changeFlags |= F_CONTENT ; } public void closed ( IJavaElement element ) { JavaElementDelta delta = new JavaElementDelta ( element ) ; delta . changed ( F_CLOSED ) ; insertDeltaTree ( element , delta ) ; } protected JavaElementDelta createDeltaTree ( IJavaElement element , JavaElementDelta delta ) { JavaElementDelta childDelta = delta ; ArrayList ancestors = getAncestors ( element ) ; if ( ancestors == null ) { if ( equalsAndSameParent ( delta . getElement ( ) , getElement ( ) ) ) { this . kind = delta . kind ; this . changeFlags = delta . changeFlags ; this . movedToHandle = delta . movedToHandle ; this . movedFromHandle = delta . movedFromHandle ; } } else { for ( int i = <NUM_LIT:0> , size = ancestors . size ( ) ; i < size ; i ++ ) { IJavaElement ancestor = ( IJavaElement ) ancestors . get ( i ) ; JavaElementDelta ancestorDelta = new JavaElementDelta ( ancestor ) ; ancestorDelta . addAffectedChild ( childDelta ) ; childDelta = ancestorDelta ; } } return childDelta ; } protected boolean equalsAndSameParent ( IJavaElement e1 , IJavaElement e2 ) { IJavaElement parent1 ; return e1 . equals ( e2 ) && ( ( parent1 = e1 . getParent ( ) ) != null ) && parent1 . equals ( e2 . getParent ( ) ) ; } protected JavaElementDelta find ( IJavaElement e ) { if ( equalsAndSameParent ( this . changedElement , e ) ) { return this ; } else { for ( int i = <NUM_LIT:0> ; i < this . affectedChildren . length ; i ++ ) { JavaElementDelta delta = ( ( JavaElementDelta ) this . affectedChildren [ i ] ) . find ( e ) ; if ( delta != null ) { return delta ; } } } return null ; } public void fineGrained ( ) { changed ( F_FINE_GRAINED ) ; } public IJavaElementDelta [ ] getAddedChildren ( ) { return getChildrenOfType ( ADDED ) ; } public IJavaElementDelta [ ] getAffectedChildren ( ) { return this . affectedChildren ; } private ArrayList getAncestors ( IJavaElement element ) { IJavaElement parent = element . getParent ( ) ; if ( parent == null ) { return null ; } ArrayList parents = new ArrayList ( ) ; while ( ! parent . equals ( this . changedElement ) ) { parents . add ( parent ) ; parent = parent . getParent ( ) ; if ( parent == null ) { return null ; } } parents . trimToSize ( ) ; return parents ; } public CompilationUnit getCompilationUnitAST ( ) { return this . ast ; } public IJavaElementDelta [ ] getAnnotationDeltas ( ) { return this . annotationDeltas ; } public IJavaElementDelta [ ] getChangedChildren ( ) { return getChildrenOfType ( CHANGED ) ; } protected IJavaElementDelta [ ] getChildrenOfType ( int type ) { int length = this . affectedChildren . length ; if ( length == <NUM_LIT:0> ) { return new IJavaElementDelta [ ] { } ; } ArrayList children = new ArrayList ( length ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( this . affectedChildren [ i ] . getKind ( ) == type ) { children . add ( this . affectedChildren [ i ] ) ; } } IJavaElementDelta [ ] childrenOfType = new IJavaElementDelta [ children . size ( ) ] ; children . toArray ( childrenOfType ) ; return childrenOfType ; } protected JavaElementDelta getDeltaFor ( IJavaElement element ) { if ( equalsAndSameParent ( getElement ( ) , element ) ) return this ; if ( this . affectedChildren . length == <NUM_LIT:0> ) return null ; int childrenCount = this . affectedChildren . length ; for ( int i = <NUM_LIT:0> ; i < childrenCount ; i ++ ) { JavaElementDelta delta = ( JavaElementDelta ) this . affectedChildren [ i ] ; if ( equalsAndSameParent ( delta . getElement ( ) , element ) ) { return delta ; } else { delta = delta . getDeltaFor ( element ) ; if ( delta != null ) return delta ; } } return null ; } public IJavaElement getElement ( ) { return this . changedElement ; } public IJavaElement getMovedFromElement ( ) { return this . movedFromHandle ; } public IJavaElement getMovedToElement ( ) { return this . movedToHandle ; } public IJavaElementDelta [ ] getRemovedChildren ( ) { return getChildrenOfType ( REMOVED ) ; } public IResourceDelta [ ] getResourceDeltas ( ) { if ( this . resourceDeltas == null ) return null ; if ( this . resourceDeltas . length != this . resourceDeltasCounter ) { System . arraycopy ( this . resourceDeltas , <NUM_LIT:0> , this . resourceDeltas = new IResourceDelta [ this . resourceDeltasCounter ] , <NUM_LIT:0> , this . resourceDeltasCounter ) ; } return this . resourceDeltas ; } protected IJavaElementDelta [ ] growAndAddToArray ( IJavaElementDelta [ ] array , IJavaElementDelta addition ) { IJavaElementDelta [ ] old = array ; array = new IJavaElementDelta [ old . length + <NUM_LIT:1> ] ; System . arraycopy ( old , <NUM_LIT:0> , array , <NUM_LIT:0> , old . length ) ; array [ old . length ] = addition ; return array ; } protected void insertDeltaTree ( IJavaElement element , JavaElementDelta delta ) { JavaElementDelta childDelta = createDeltaTree ( element , delta ) ; if ( ! equalsAndSameParent ( element , getElement ( ) ) ) { addAffectedChild ( childDelta ) ; } } public void movedFrom ( IJavaElement movedFromElement , IJavaElement movedToElement ) { JavaElementDelta removedDelta = new JavaElementDelta ( movedFromElement ) ; removedDelta . kind = REMOVED ; removedDelta . changeFlags |= F_MOVED_TO ; removedDelta . movedToHandle = movedToElement ; insertDeltaTree ( movedFromElement , removedDelta ) ; } public void movedTo ( IJavaElement movedToElement , IJavaElement movedFromElement ) { JavaElementDelta addedDelta = new JavaElementDelta ( movedToElement ) ; addedDelta . kind = ADDED ; addedDelta . changeFlags |= F_MOVED_FROM ; addedDelta . movedFromHandle = movedFromElement ; insertDeltaTree ( movedToElement , addedDelta ) ; } public void opened ( IJavaElement element ) { JavaElementDelta delta = new JavaElementDelta ( element ) ; delta . changed ( F_OPENED ) ; insertDeltaTree ( element , delta ) ; } protected void removeAffectedChild ( JavaElementDelta child ) { int index = - <NUM_LIT:1> ; if ( this . affectedChildren != null ) { for ( int i = <NUM_LIT:0> ; i < this . affectedChildren . length ; i ++ ) { if ( equalsAndSameParent ( this . affectedChildren [ i ] . getElement ( ) , child . getElement ( ) ) ) { index = i ; break ; } } } if ( index >= <NUM_LIT:0> ) { this . affectedChildren = removeAndShrinkArray ( this . affectedChildren , index ) ; } } protected IJavaElementDelta [ ] removeAndShrinkArray ( IJavaElementDelta [ ] old , int index ) { IJavaElementDelta [ ] array = new IJavaElementDelta [ old . length - <NUM_LIT:1> ] ; if ( index > <NUM_LIT:0> ) System . arraycopy ( old , <NUM_LIT:0> , array , <NUM_LIT:0> , index ) ; int rest = old . length - index - <NUM_LIT:1> ; if ( rest > <NUM_LIT:0> ) System . arraycopy ( old , index + <NUM_LIT:1> , array , index , rest ) ; return array ; } public void removed ( IJavaElement element ) { removed ( element , <NUM_LIT:0> ) ; } public void removed ( IJavaElement element , int flags ) { JavaElementDelta removedDelta = new JavaElementDelta ( element ) ; insertDeltaTree ( element , removedDelta ) ; JavaElementDelta actualDelta = getDeltaFor ( element ) ; if ( actualDelta != null ) { actualDelta . removed ( ) ; actualDelta . changeFlags |= flags ; actualDelta . affectedChildren = EMPTY_DELTA ; } } public void sourceAttached ( IJavaElement element ) { JavaElementDelta attachedDelta = new JavaElementDelta ( element ) ; attachedDelta . changed ( F_SOURCEATTACHED ) ; insertDeltaTree ( element , attachedDelta ) ; } public void sourceDetached ( IJavaElement element ) { JavaElementDelta detachedDelta = new JavaElementDelta ( element ) ; detachedDelta . changed ( F_SOURCEDETACHED ) ; insertDeltaTree ( element , detachedDelta ) ; } public String toDebugString ( int depth ) { StringBuffer buffer = new StringBuffer ( ) ; for ( int i = <NUM_LIT:0> ; i < depth ; i ++ ) { buffer . append ( '<STR_LIT:\t>' ) ; } buffer . append ( ( ( JavaElement ) getElement ( ) ) . toDebugString ( ) ) ; toDebugString ( buffer ) ; IJavaElementDelta [ ] children = getAffectedChildren ( ) ; if ( children != null ) { for ( int i = <NUM_LIT:0> ; i < children . length ; ++ i ) { buffer . append ( "<STR_LIT:n>" ) ; buffer . append ( ( ( JavaElementDelta ) children [ i ] ) . toDebugString ( depth + <NUM_LIT:1> ) ) ; } } for ( int i = <NUM_LIT:0> ; i < this . resourceDeltasCounter ; i ++ ) { buffer . append ( "<STR_LIT:n>" ) ; for ( int j = <NUM_LIT:0> ; j < depth + <NUM_LIT:1> ; j ++ ) { buffer . append ( '<STR_LIT:\t>' ) ; } IResourceDelta resourceDelta = this . resourceDeltas [ i ] ; buffer . append ( resourceDelta . toString ( ) ) ; buffer . append ( "<STR_LIT:[>" ) ; switch ( resourceDelta . getKind ( ) ) { case IResourceDelta . ADDED : buffer . append ( '<CHAR_LIT>' ) ; break ; case IResourceDelta . REMOVED : buffer . append ( '<CHAR_LIT:->' ) ; break ; case IResourceDelta . CHANGED : buffer . append ( '<CHAR_LIT>' ) ; break ; default : buffer . append ( '<CHAR_LIT>' ) ; break ; } buffer . append ( "<STR_LIT:]>" ) ; } IJavaElementDelta [ ] annotations = getAnnotationDeltas ( ) ; if ( annotations != null ) { for ( int i = <NUM_LIT:0> ; i < annotations . length ; ++ i ) { buffer . append ( "<STR_LIT:n>" ) ; buffer . append ( ( ( JavaElementDelta ) annotations [ i ] ) . toDebugString ( depth + <NUM_LIT:1> ) ) ; } } return buffer . toString ( ) ; } protected boolean toDebugString ( StringBuffer buffer , int flags ) { boolean prev = super . toDebugString ( buffer , flags ) ; if ( ( flags & IJavaElementDelta . F_CHILDREN ) != <NUM_LIT:0> ) { if ( prev ) buffer . append ( "<STR_LIT>" ) ; buffer . append ( "<STR_LIT>" ) ; prev = true ; } if ( ( flags & IJavaElementDelta . F_CONTENT ) != <NUM_LIT:0> ) { if ( prev ) buffer . append ( "<STR_LIT>" ) ; buffer . append ( "<STR_LIT>" ) ; prev = true ; } if ( ( flags & IJavaElementDelta . F_MOVED_FROM ) != <NUM_LIT:0> ) { if ( prev ) buffer . append ( "<STR_LIT>" ) ; buffer . append ( "<STR_LIT>" + ( ( JavaElement ) getMovedFromElement ( ) ) . toStringWithAncestors ( ) + "<STR_LIT:)>" ) ; prev = true ; } if ( ( flags & IJavaElementDelta . F_MOVED_TO ) != <NUM_LIT:0> ) { if ( prev ) buffer . append ( "<STR_LIT>" ) ; buffer . append ( "<STR_LIT>" + ( ( JavaElement ) getMovedToElement ( ) ) . toStringWithAncestors ( ) + "<STR_LIT:)>" ) ; prev = true ; } if ( ( flags & IJavaElementDelta . F_ADDED_TO_CLASSPATH ) != <NUM_LIT:0> ) { if ( prev ) buffer . append ( "<STR_LIT>" ) ; buffer . append ( "<STR_LIT>" ) ; prev = true ; } if ( ( flags & IJavaElementDelta . F_REMOVED_FROM_CLASSPATH ) != <NUM_LIT:0> ) { if ( prev ) buffer . append ( "<STR_LIT>" ) ; buffer . append ( "<STR_LIT>" ) ; prev = true ; } if ( ( flags & IJavaElementDelta . F_REORDER ) != <NUM_LIT:0> ) { if ( prev ) buffer . append ( "<STR_LIT>" ) ; buffer . append ( "<STR_LIT>" ) ; prev = true ; } if ( ( flags & IJavaElementDelta . F_ARCHIVE_CONTENT_CHANGED ) != <NUM_LIT:0> ) { if ( prev ) buffer . append ( "<STR_LIT>" ) ; buffer . append ( "<STR_LIT>" ) ; prev = true ; } if ( ( flags & IJavaElementDelta . F_SOURCEATTACHED ) != <NUM_LIT:0> ) { if ( prev ) buffer . append ( "<STR_LIT>" ) ; buffer . append ( "<STR_LIT>" ) ; prev = true ; } if ( ( flags & IJavaElementDelta . F_SOURCEDETACHED ) != <NUM_LIT:0> ) { if ( prev ) buffer . append ( "<STR_LIT>" ) ; buffer . append ( "<STR_LIT>" ) ; prev = true ; } if ( ( flags & IJavaElementDelta . F_FINE_GRAINED ) != <NUM_LIT:0> ) { if ( prev ) buffer . append ( "<STR_LIT>" ) ; buffer . append ( "<STR_LIT>" ) ; prev = true ; } if ( ( flags & IJavaElementDelta . F_PRIMARY_WORKING_COPY ) != <NUM_LIT:0> ) { if ( prev ) buffer . append ( "<STR_LIT>" ) ; buffer . append ( "<STR_LIT>" ) ; prev = true ; } if ( ( flags & IJavaElementDelta . F_CLASSPATH_CHANGED ) != <NUM_LIT:0> ) { if ( prev ) buffer . append ( "<STR_LIT>" ) ; buffer . append ( "<STR_LIT>" ) ; prev = true ; } if ( ( flags & IJavaElementDelta . F_RESOLVED_CLASSPATH_CHANGED ) != <NUM_LIT:0> ) { if ( prev ) buffer . append ( "<STR_LIT>" ) ; buffer . append ( "<STR_LIT>" ) ; prev = true ; } if ( ( flags & IJavaElementDelta . F_PRIMARY_RESOURCE ) != <NUM_LIT:0> ) { if ( prev ) buffer . append ( "<STR_LIT>" ) ; buffer . append ( "<STR_LIT>" ) ; prev = true ; } if ( ( flags & IJavaElementDelta . F_OPENED ) != <NUM_LIT:0> ) { if ( prev ) buffer . append ( "<STR_LIT>" ) ; buffer . append ( "<STR_LIT>" ) ; prev = true ; } if ( ( flags & IJavaElementDelta . F_CLOSED ) != <NUM_LIT:0> ) { if ( prev ) buffer . append ( "<STR_LIT>" ) ; buffer . append ( "<STR_LIT>" ) ; prev = true ; } if ( ( flags & IJavaElementDelta . F_AST_AFFECTED ) != <NUM_LIT:0> ) { if ( prev ) buffer . append ( "<STR_LIT>" ) ; buffer . append ( "<STR_LIT>" ) ; prev = true ; } if ( ( flags & IJavaElementDelta . F_CATEGORIES ) != <NUM_LIT:0> ) { if ( prev ) buffer . append ( "<STR_LIT>" ) ; buffer . append ( "<STR_LIT>" ) ; prev = true ; } if ( ( flags & IJavaElementDelta . F_ANNOTATIONS ) != <NUM_LIT:0> ) { if ( prev ) buffer . append ( "<STR_LIT>" ) ; buffer . append ( "<STR_LIT>" ) ; prev = true ; } return prev ; } public String toString ( ) { return toDebugString ( <NUM_LIT:0> ) ; } } </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 . IClasspathContainer ; import org . eclipse . jdt . core . IClasspathEntry ; import org . eclipse . jdt . core . JavaCore ; import org . eclipse . jdt . internal . core . util . Util ; public class UserLibraryClasspathContainer implements IClasspathContainer { private String name ; public UserLibraryClasspathContainer ( String name ) { this . name = name ; } public IClasspathEntry [ ] getClasspathEntries ( ) { UserLibrary library = getUserLibrary ( ) ; if ( library != null ) { return library . getEntries ( ) ; } return new IClasspathEntry [ <NUM_LIT:0> ] ; } public String getDescription ( ) { return this . name ; } public int getKind ( ) { UserLibrary library = getUserLibrary ( ) ; if ( library != null && library . isSystemLibrary ( ) ) { return K_SYSTEM ; } return K_APPLICATION ; } public IPath getPath ( ) { return new Path ( JavaCore . USER_LIBRARY_CONTAINER_ID ) . append ( this . name ) ; } private UserLibrary getUserLibrary ( ) { UserLibrary userLibrary = JavaModelManager . getUserLibraryManager ( ) . getUserLibrary ( this . name ) ; if ( userLibrary == null && ( JavaModelManager . CP_RESOLVE_VERBOSE || JavaModelManager . CP_RESOLVE_VERBOSE_FAILURE ) ) { verbose_no_user_library_found ( this . name ) ; } return userLibrary ; } private void verbose_no_user_library_found ( String userLibraryName ) { Util . verbose ( "<STR_LIT>" + "<STR_LIT>" + userLibraryName ) ; } } </s>
<s> package org . eclipse . jdt . internal . core ; import java . util . HashMap ; import java . util . Map ; import org . codehaus . jdt . groovy . integration . LanguageSupportFactory ; import org . eclipse . core . runtime . IProgressMonitor ; import org . eclipse . core . runtime . OperationCanceledException ; import org . eclipse . jdt . core . ICompilationUnit ; import org . eclipse . jdt . core . IJavaModelMarker ; 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 . core . WorkingCopyOwner ; import org . eclipse . jdt . core . compiler . CategorizedProblem ; import org . eclipse . jdt . core . util . CompilerUtils ; import org . eclipse . jdt . internal . compiler . CompilationResult ; import org . eclipse . jdt . internal . compiler . Compiler ; import org . eclipse . jdt . internal . compiler . DefaultErrorHandlingPolicies ; import org . eclipse . jdt . internal . compiler . ICompilerRequestor ; import org . eclipse . jdt . internal . compiler . IErrorHandlingPolicy ; import org . eclipse . jdt . internal . compiler . IProblemFactory ; import org . eclipse . jdt . internal . compiler . SourceElementParser ; import org . eclipse . jdt . internal . compiler . ast . CompilationUnitDeclaration ; import org . eclipse . jdt . internal . compiler . env . AccessRestriction ; import org . eclipse . jdt . internal . compiler . env . INameEnvironment ; import org . eclipse . jdt . internal . compiler . env . ISourceType ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . lookup . PackageBinding ; import org . eclipse . jdt . internal . compiler . parser . SourceTypeConverter ; import org . eclipse . jdt . internal . compiler . problem . AbortCompilation ; import org . eclipse . jdt . internal . core . util . Util ; public class CompilationUnitProblemFinder extends Compiler { protected CompilationUnitProblemFinder ( INameEnvironment environment , IErrorHandlingPolicy policy , CompilerOptions compilerOptions , ICompilerRequestor requestor , IProblemFactory problemFactory ) { super ( environment , policy , compilerOptions , requestor , problemFactory ) ; } public void accept ( ISourceType [ ] sourceTypes , PackageBinding packageBinding , AccessRestriction accessRestriction ) { while ( sourceTypes [ <NUM_LIT:0> ] . getEnclosingType ( ) != null ) { sourceTypes [ <NUM_LIT:0> ] = sourceTypes [ <NUM_LIT:0> ] . getEnclosingType ( ) ; } CompilationResult result = new CompilationResult ( sourceTypes [ <NUM_LIT:0> ] . getFileName ( ) , <NUM_LIT:1> , <NUM_LIT:1> , this . options . maxProblemsPerUnit ) ; final long savedComplianceLevel = this . options . complianceLevel ; final long savedSourceLevel = this . options . sourceLevel ; try { IJavaProject project = ( ( SourceTypeElementInfo ) sourceTypes [ <NUM_LIT:0> ] ) . getHandle ( ) . getJavaProject ( ) ; this . options . complianceLevel = CompilerOptions . versionToJdkLevel ( project . getOption ( JavaCore . COMPILER_COMPLIANCE , true ) ) ; this . options . sourceLevel = CompilerOptions . versionToJdkLevel ( project . getOption ( JavaCore . COMPILER_SOURCE , true ) ) ; CompilationUnitDeclaration unit = SourceTypeConverter . buildCompilationUnit ( sourceTypes , SourceTypeConverter . FIELD_AND_METHOD | SourceTypeConverter . MEMBER_TYPE | SourceTypeConverter . FIELD_INITIALIZATION , this . lookupEnvironment . problemReporter , result ) ; if ( unit != null ) { this . lookupEnvironment . buildTypeBindings ( unit , accessRestriction ) ; this . lookupEnvironment . completeTypeBindings ( unit ) ; } } finally { this . options . complianceLevel = savedComplianceLevel ; this . options . sourceLevel = savedSourceLevel ; } } protected static CompilerOptions getCompilerOptions ( Map settings , boolean creatingAST , boolean statementsRecovery ) { CompilerOptions compilerOptions = new CompilerOptions ( settings ) ; compilerOptions . performMethodsFullRecovery = statementsRecovery ; compilerOptions . performStatementsRecovery = statementsRecovery ; compilerOptions . parseLiteralExpressionsAsConstants = ! creatingAST ; compilerOptions . storeAnnotations = creatingAST ; return compilerOptions ; } protected static IErrorHandlingPolicy getHandlingPolicy ( ) { return DefaultErrorHandlingPolicies . proceedWithAllProblems ( ) ; } protected static ICompilerRequestor getRequestor ( ) { return new ICompilerRequestor ( ) { public void acceptResult ( CompilationResult compilationResult ) { } } ; } public static CompilationUnitDeclaration process ( CompilationUnit unitElement , SourceElementParser parser , WorkingCopyOwner workingCopyOwner , HashMap problems , boolean creatingAST , int reconcileFlags , IProgressMonitor monitor ) throws JavaModelException { JavaProject project = ( JavaProject ) unitElement . getJavaProject ( ) ; CancelableNameEnvironment environment = null ; CancelableProblemFactory problemFactory = null ; CompilationUnitProblemFinder problemFinder = null ; CompilationUnitDeclaration unit = null ; try { environment = new CancelableNameEnvironment ( project , workingCopyOwner , monitor ) ; problemFactory = new CancelableProblemFactory ( monitor ) ; CompilerOptions compilerOptions = getCompilerOptions ( project . getOptions ( true ) , creatingAST , ( ( reconcileFlags & ICompilationUnit . ENABLE_STATEMENTS_RECOVERY ) != <NUM_LIT:0> ) ) ; boolean ignoreMethodBodies = ( reconcileFlags & ICompilationUnit . IGNORE_METHOD_BODIES ) != <NUM_LIT:0> ; compilerOptions . ignoreMethodBodies = ignoreMethodBodies ; CompilerUtils . configureOptionsBasedOnNature ( compilerOptions , project ) ; problemFinder = new CompilationUnitProblemFinder ( environment , getHandlingPolicy ( ) , compilerOptions , getRequestor ( ) , problemFactory ) ; boolean analyzeAndGenerateCode = true ; if ( ignoreMethodBodies ) { analyzeAndGenerateCode = false ; } try { if ( parser != null ) { problemFinder . parser = parser ; unit = parser . parseCompilationUnit ( unitElement , true , monitor ) ; problemFinder . resolve ( unit , unitElement , true , analyzeAndGenerateCode , analyzeAndGenerateCode ) ; } else { unit = problemFinder . resolve ( unitElement , true , analyzeAndGenerateCode , analyzeAndGenerateCode ) ; } } catch ( AbortCompilation e ) { problemFinder . handleInternalException ( e , unit ) ; } if ( unit != null ) { CompilationResult unitResult = unit . compilationResult ; CategorizedProblem [ ] unitProblems = unitResult . getProblems ( ) ; int length = unitProblems == null ? <NUM_LIT:0> : unitProblems . length ; if ( length > <NUM_LIT:0> ) { CategorizedProblem [ ] categorizedProblems = new CategorizedProblem [ length ] ; System . arraycopy ( unitProblems , <NUM_LIT:0> , categorizedProblems , <NUM_LIT:0> , length ) ; problems . put ( IJavaModelMarker . JAVA_MODEL_PROBLEM_MARKER , categorizedProblems ) ; } unitProblems = unitResult . getTasks ( ) ; length = unitProblems == null ? <NUM_LIT:0> : unitProblems . length ; if ( length > <NUM_LIT:0> ) { CategorizedProblem [ ] categorizedProblems = new CategorizedProblem [ length ] ; System . arraycopy ( unitProblems , <NUM_LIT:0> , categorizedProblems , <NUM_LIT:0> , length ) ; problems . put ( IJavaModelMarker . TASK_MARKER , categorizedProblems ) ; } 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>" ) ; } } } catch ( OperationCanceledException e ) { throw e ; } catch ( RuntimeException e ) { String lineDelimiter = unitElement . findRecommendedLineSeparator ( ) ; StringBuffer message = new StringBuffer ( "<STR_LIT>" ) ; message . append ( lineDelimiter ) ; message . append ( "<STR_LIT>" ) ; message . append ( lineDelimiter ) ; message . append ( unitElement . getSource ( ) ) ; message . append ( lineDelimiter ) ; message . append ( "<STR_LIT>" ) ; Util . log ( e , message . toString ( ) ) ; throw new JavaModelException ( e , IJavaModelStatusConstants . COMPILER_FAILURE ) ; } finally { if ( environment != null ) environment . setMonitor ( null ) ; if ( problemFactory != null ) problemFactory . monitor = null ; if ( problemFinder != null && ! creatingAST ) problemFinder . lookupEnvironment . reset ( ) ; } return unit ; } public static CompilationUnitDeclaration process ( CompilationUnit unitElement , WorkingCopyOwner workingCopyOwner , HashMap problems , boolean creatingAST , int reconcileFlags , IProgressMonitor monitor ) throws JavaModelException { return process ( unitElement , null , workingCopyOwner , problems , creatingAST , reconcileFlags , monitor ) ; } public void initializeParser ( ) { this . parser = LanguageSupportFactory . getParser ( this , this . lookupEnvironment == null ? null : this . lookupEnvironment . globalOptions , this . problemReporter , this . options . parseLiteralExpressionsAsConstants , <NUM_LIT:3> ) ; } } </s>
<s> package org . eclipse . jdt . internal . core ; import java . util . Enumeration ; public class LRUCacheEnumerator implements Enumeration { protected LRUEnumeratorElement elementQueue ; public static class LRUEnumeratorElement { public Object value ; public LRUEnumeratorElement next ; public LRUEnumeratorElement ( Object value ) { this . value = value ; } } public LRUCacheEnumerator ( LRUEnumeratorElement firstElement ) { this . elementQueue = firstElement ; } public boolean hasMoreElements ( ) { return this . elementQueue != null ; } public Object nextElement ( ) { Object temp = this . elementQueue . value ; this . elementQueue = this . elementQueue . next ; return temp ; } } </s>
<s> package org . eclipse . jdt . internal . core ; import org . eclipse . jdt . internal . core . util . HashtableOfArrayToObject ; class JarPackageFragmentRootInfo extends PackageFragmentRootInfo { HashtableOfArrayToObject rawPackageInfo ; } </s>
<s> package org . eclipse . jdt . internal . core ; 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 . Messages ; public class RenameResourceElementsOperation extends MoveResourceElementsOperation { public RenameResourceElementsOperation ( IJavaElement [ ] elements , IJavaElement [ ] destinations , String [ ] newNames , boolean force ) { super ( elements , destinations , force ) ; setRenamings ( newNames ) ; } protected String getMainTaskName ( ) { return Messages . operation_renameResourceProgress ; } protected boolean isRename ( ) { return true ; } protected void verify ( IJavaElement element ) throws JavaModelException { super . verify ( element ) ; int elementType = element . getElementType ( ) ; if ( ! ( elementType == IJavaElement . COMPILATION_UNIT || elementType == IJavaElement . PACKAGE_FRAGMENT ) ) { error ( IJavaModelStatusConstants . INVALID_ELEMENT_TYPES , element ) ; } if ( elementType == IJavaElement . COMPILATION_UNIT ) { CompilationUnit cu = ( CompilationUnit ) element ; if ( cu . isWorkingCopy ( ) && ! cu . isPrimary ( ) ) { error ( IJavaModelStatusConstants . INVALID_ELEMENT_TYPES , element ) ; } } verifyRenaming ( element ) ; } } </s>
<s> package org . eclipse . jdt . internal . core ; import org . eclipse . jdt . core . * ; import org . eclipse . jdt . internal . core . util . MementoTokenizer ; public class ImportContainer extends SourceRefElement implements IImportContainer { protected ImportContainer ( CompilationUnit parent ) { super ( parent ) ; } public boolean equals ( Object o ) { if ( ! ( o instanceof ImportContainer ) ) return false ; return super . equals ( o ) ; } public int getElementType ( ) { return IMPORT_CONTAINER ; } public IJavaElement getHandleFromMemento ( String token , MementoTokenizer memento , WorkingCopyOwner workingCopyOwner ) { switch ( token . charAt ( <NUM_LIT:0> ) ) { case JEM_COUNT : return getHandleUpdatingCountFromMemento ( memento , workingCopyOwner ) ; case JEM_IMPORTDECLARATION : if ( memento . hasMoreTokens ( ) ) { String importName = memento . nextToken ( ) ; JavaElement importDecl = ( JavaElement ) getImport ( importName ) ; return importDecl . getHandleFromMemento ( memento , workingCopyOwner ) ; } else { return this ; } } return null ; } protected char getHandleMementoDelimiter ( ) { return JavaElement . JEM_IMPORTDECLARATION ; } public IImportDeclaration getImport ( String importName ) { int index = importName . indexOf ( "<STR_LIT>" ) ; boolean isOnDemand = index != - <NUM_LIT:1> ; if ( isOnDemand ) importName = new String ( importName . substring ( <NUM_LIT:0> , index ) ) ; return getImport ( importName , isOnDemand ) ; } protected IImportDeclaration getImport ( String importName , boolean isOnDemand ) { return new ImportDeclaration ( this , importName , isOnDemand ) ; } public IJavaElement getPrimaryElement ( boolean checkOwner ) { CompilationUnit cu = ( CompilationUnit ) this . parent ; if ( checkOwner && cu . isPrimary ( ) ) return this ; return cu . getImportContainer ( ) ; } public ISourceRange getSourceRange ( ) throws JavaModelException { IJavaElement [ ] imports = getChildren ( ) ; ISourceRange firstRange = ( ( ISourceReference ) imports [ <NUM_LIT:0> ] ) . getSourceRange ( ) ; ISourceRange lastRange = ( ( ISourceReference ) imports [ imports . length - <NUM_LIT:1> ] ) . getSourceRange ( ) ; SourceRange range = new SourceRange ( firstRange . getOffset ( ) , lastRange . getOffset ( ) + lastRange . getLength ( ) - firstRange . getOffset ( ) ) ; return range ; } public String readableName ( ) { return null ; } protected void toString ( int tab , StringBuffer buffer ) { Object info = JavaModelManager . getJavaModelManager ( ) . peekAtInfo ( this ) ; if ( info == null || ! ( info instanceof JavaElementInfo ) ) return ; IJavaElement [ ] children = ( ( JavaElementInfo ) info ) . getChildren ( ) ; for ( int i = <NUM_LIT:0> ; i < children . length ; i ++ ) { if ( i > <NUM_LIT:0> ) buffer . append ( "<STR_LIT:n>" ) ; ( ( JavaElement ) children [ i ] ) . toString ( tab , buffer ) ; } } protected void toStringInfo ( int tab , StringBuffer buffer , Object info , boolean showResolvedInfo ) { buffer . append ( tabString ( tab ) ) ; buffer . append ( "<STR_LIT>" ) ; if ( info == null ) { buffer . append ( "<STR_LIT>" ) ; } } public ISourceRange getNameRange ( ) { return null ; } } </s>
<s> package org . eclipse . jdt . internal . core . builder ; import org . eclipse . jdt . internal . compiler . problem . DefaultProblemFactory ; import org . eclipse . jdt . internal . compiler . util . SimpleLookupTable ; import java . util . * ; public class ProblemFactory extends DefaultProblemFactory { static SimpleLookupTable factories = new SimpleLookupTable ( <NUM_LIT:5> ) ; private ProblemFactory ( Locale locale ) { super ( locale ) ; } public static ProblemFactory getProblemFactory ( Locale locale ) { ProblemFactory factory = ( ProblemFactory ) factories . get ( locale ) ; if ( factory == null ) factories . put ( locale , factory = new ProblemFactory ( locale ) ) ; return factory ; } } </s>
<s> package org . eclipse . jdt . internal . core . builder ; import org . eclipse . core . resources . * ; import org . eclipse . core . runtime . * ; import org . eclipse . jdt . core . * ; import org . eclipse . jdt . core . compiler . * ; import org . eclipse . jdt . internal . compiler . util . SimpleLookupTable ; import org . eclipse . jdt . internal . core . * ; import org . eclipse . jdt . internal . core . util . Messages ; import org . eclipse . jdt . internal . core . util . Util ; import java . io . * ; import java . util . * ; public class JavaBuilder extends IncrementalProjectBuilder { IProject currentProject ; JavaProject javaProject ; IWorkspaceRoot workspaceRoot ; CompilationParticipant [ ] participants ; NameEnvironment nameEnvironment ; SimpleLookupTable binaryLocationsPerProject ; public State lastState ; BuildNotifier notifier ; char [ ] [ ] extraResourceFileFilters ; String [ ] extraResourceFolderFilters ; public static final String SOURCE_ID = "<STR_LIT>" ; public static boolean DEBUG = false ; public static boolean SHOW_STATS = false ; static ArrayList builtProjects = null ; public static IMarker [ ] getProblemsFor ( IResource resource ) { try { if ( resource != null && resource . exists ( ) ) { IMarker [ ] markers = resource . findMarkers ( IJavaModelMarker . JAVA_MODEL_PROBLEM_MARKER , false , IResource . DEPTH_INFINITE ) ; Set markerTypes = JavaModelManager . getJavaModelManager ( ) . compilationParticipants . managedMarkerTypes ( ) ; if ( markerTypes . isEmpty ( ) ) return markers ; ArrayList markerList = new ArrayList ( <NUM_LIT:5> ) ; for ( int i = <NUM_LIT:0> , length = markers . length ; i < length ; i ++ ) { markerList . add ( markers [ i ] ) ; } Iterator iterator = markerTypes . iterator ( ) ; while ( iterator . hasNext ( ) ) { markers = resource . findMarkers ( ( String ) iterator . next ( ) , false , IResource . DEPTH_INFINITE ) ; for ( int i = <NUM_LIT:0> , length = markers . length ; i < length ; i ++ ) { markerList . add ( markers [ i ] ) ; } } IMarker [ ] result ; markerList . toArray ( result = new IMarker [ markerList . size ( ) ] ) ; return result ; } } catch ( CoreException e ) { } return new IMarker [ <NUM_LIT:0> ] ; } public static IMarker [ ] getTasksFor ( IResource resource ) { try { if ( resource != null && resource . exists ( ) ) return resource . findMarkers ( IJavaModelMarker . TASK_MARKER , false , IResource . DEPTH_INFINITE ) ; } catch ( CoreException e ) { } return new IMarker [ <NUM_LIT:0> ] ; } public static void buildStarting ( ) { } public static void buildFinished ( ) { BuildNotifier . resetProblemCounters ( ) ; } public static void removeProblemsFor ( IResource resource ) { try { if ( resource != null && resource . exists ( ) ) { resource . deleteMarkers ( IJavaModelMarker . JAVA_MODEL_PROBLEM_MARKER , false , IResource . DEPTH_INFINITE ) ; Set markerTypes = JavaModelManager . getJavaModelManager ( ) . compilationParticipants . managedMarkerTypes ( ) ; if ( markerTypes . size ( ) == <NUM_LIT:0> ) return ; Iterator iterator = markerTypes . iterator ( ) ; while ( iterator . hasNext ( ) ) resource . deleteMarkers ( ( String ) iterator . next ( ) , false , IResource . DEPTH_INFINITE ) ; } } catch ( CoreException e ) { } } public static void removeTasksFor ( IResource resource ) { try { if ( resource != null && resource . exists ( ) ) resource . deleteMarkers ( IJavaModelMarker . TASK_MARKER , false , IResource . DEPTH_INFINITE ) ; } catch ( CoreException e ) { } } public static void removeProblemsAndTasksFor ( IResource resource ) { try { if ( resource != null && resource . exists ( ) ) { resource . deleteMarkers ( IJavaModelMarker . JAVA_MODEL_PROBLEM_MARKER , false , IResource . DEPTH_INFINITE ) ; resource . deleteMarkers ( IJavaModelMarker . TASK_MARKER , false , IResource . DEPTH_INFINITE ) ; Set markerTypes = JavaModelManager . getJavaModelManager ( ) . compilationParticipants . managedMarkerTypes ( ) ; if ( markerTypes . size ( ) == <NUM_LIT:0> ) return ; Iterator iterator = markerTypes . iterator ( ) ; while ( iterator . hasNext ( ) ) resource . deleteMarkers ( ( String ) iterator . next ( ) , false , IResource . DEPTH_INFINITE ) ; } } catch ( CoreException e ) { } } public static State readState ( IProject project , DataInputStream in ) throws IOException { return State . read ( project , in ) ; } public static void writeState ( Object state , DataOutputStream out ) throws IOException { ( ( State ) state ) . write ( out ) ; } protected IProject [ ] build ( int kind , Map ignored , IProgressMonitor monitor ) throws CoreException { this . currentProject = getProject ( ) ; if ( this . currentProject == null || ! this . currentProject . isAccessible ( ) ) return new IProject [ <NUM_LIT:0> ] ; if ( DEBUG ) System . out . println ( "<STR_LIT>" + this . currentProject . getName ( ) + "<STR_LIT>" + new Date ( System . currentTimeMillis ( ) ) ) ; this . notifier = new BuildNotifier ( monitor , this . currentProject ) ; this . notifier . begin ( ) ; boolean ok = false ; try { this . notifier . checkCancel ( ) ; kind = initializeBuilder ( kind , true ) ; if ( isWorthBuilding ( ) ) { if ( kind == FULL_BUILD ) { if ( DEBUG ) System . out . println ( "<STR_LIT>" ) ; buildAll ( ) ; } else { if ( ( this . lastState = getLastState ( this . currentProject ) ) == null ) { if ( DEBUG ) System . out . println ( "<STR_LIT>" ) ; buildAll ( ) ; } else if ( hasClasspathChanged ( ) ) { if ( DEBUG ) System . out . println ( "<STR_LIT>" ) ; buildAll ( ) ; } else if ( this . nameEnvironment . sourceLocations . length > <NUM_LIT:0> ) { SimpleLookupTable deltas = findDeltas ( ) ; if ( deltas == null ) { if ( DEBUG ) System . out . println ( "<STR_LIT>" ) ; buildAll ( ) ; } else if ( deltas . elementSize > <NUM_LIT:0> ) { buildDeltas ( deltas ) ; } else if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; } } else { if ( hasStructuralDelta ( ) ) { if ( DEBUG ) System . out . println ( "<STR_LIT>" ) ; buildAll ( ) ; } else { if ( DEBUG ) System . out . println ( "<STR_LIT>" ) ; this . lastState . tagAsNoopBuild ( ) ; } } } ok = true ; } } catch ( CoreException e ) { Util . log ( e , "<STR_LIT>" + this . currentProject . getName ( ) ) ; createInconsistentBuildMarker ( e ) ; } catch ( ImageBuilderInternalException e ) { Util . log ( e . getThrowable ( ) , "<STR_LIT>" + this . currentProject . getName ( ) ) ; createInconsistentBuildMarker ( e . coreException ) ; } catch ( MissingSourceFileException e ) { if ( DEBUG ) System . out . println ( Messages . bind ( Messages . build_missingSourceFile , e . missingSourceFile ) ) ; removeProblemsAndTasksFor ( this . currentProject ) ; IMarker marker = this . currentProject . createMarker ( IJavaModelMarker . JAVA_MODEL_PROBLEM_MARKER ) ; marker . setAttributes ( new String [ ] { IMarker . MESSAGE , IMarker . SEVERITY , IMarker . SOURCE_ID } , new Object [ ] { Messages . bind ( Messages . build_missingSourceFile , e . missingSourceFile ) , new Integer ( IMarker . SEVERITY_ERROR ) , JavaBuilder . SOURCE_ID } ) ; } finally { for ( int i = <NUM_LIT:0> , l = this . participants == null ? <NUM_LIT:0> : this . participants . length ; i < l ; i ++ ) this . participants [ i ] . buildFinished ( this . javaProject ) ; if ( ! ok ) clearLastState ( ) ; this . notifier . done ( ) ; cleanup ( ) ; } IProject [ ] requiredProjects = getRequiredProjects ( true ) ; if ( DEBUG ) System . out . println ( "<STR_LIT>" + this . currentProject . getName ( ) + "<STR_LIT>" + new Date ( System . currentTimeMillis ( ) ) ) ; return requiredProjects ; } private void buildAll ( ) { this . notifier . checkCancel ( ) ; this . notifier . subTask ( Messages . bind ( Messages . build_preparingBuild , this . currentProject . getName ( ) ) ) ; if ( DEBUG && this . lastState != null ) System . out . println ( "<STR_LIT>" + this . lastState ) ; clearLastState ( ) ; BatchImageBuilder imageBuilder = new BatchImageBuilder ( this , true ) ; imageBuilder . build ( ) ; recordNewState ( imageBuilder . newState ) ; } private void buildDeltas ( SimpleLookupTable deltas ) { this . notifier . checkCancel ( ) ; this . notifier . subTask ( Messages . bind ( Messages . build_preparingBuild , this . currentProject . getName ( ) ) ) ; if ( DEBUG && this . lastState != null ) System . out . println ( "<STR_LIT>" + this . lastState ) ; clearLastState ( ) ; IncrementalImageBuilder imageBuilder = new IncrementalImageBuilder ( this ) ; if ( imageBuilder . build ( deltas ) ) { recordNewState ( imageBuilder . newState ) ; } else { if ( DEBUG ) System . out . println ( "<STR_LIT>" ) ; buildAll ( ) ; } } protected void clean ( IProgressMonitor monitor ) throws CoreException { this . currentProject = getProject ( ) ; if ( this . currentProject == null || ! this . currentProject . isAccessible ( ) ) return ; if ( DEBUG ) System . out . println ( "<STR_LIT>" + this . currentProject . getName ( ) + "<STR_LIT>" + new Date ( System . currentTimeMillis ( ) ) ) ; this . notifier = new BuildNotifier ( monitor , this . currentProject ) ; this . notifier . begin ( ) ; try { this . notifier . checkCancel ( ) ; initializeBuilder ( CLEAN_BUILD , true ) ; if ( DEBUG ) System . out . println ( "<STR_LIT>" + this . lastState ) ; clearLastState ( ) ; removeProblemsAndTasksFor ( this . currentProject ) ; new BatchImageBuilder ( this , false ) . cleanOutputFolders ( false ) ; } catch ( CoreException e ) { Util . log ( e , "<STR_LIT>" + this . currentProject . getName ( ) ) ; createInconsistentBuildMarker ( e ) ; } finally { this . notifier . done ( ) ; cleanup ( ) ; } if ( DEBUG ) System . out . println ( "<STR_LIT>" + this . currentProject . getName ( ) + "<STR_LIT>" + new Date ( System . currentTimeMillis ( ) ) ) ; } private void createInconsistentBuildMarker ( CoreException coreException ) throws CoreException { String message = null ; IStatus status = coreException . getStatus ( ) ; if ( status . isMultiStatus ( ) ) { IStatus [ ] children = status . getChildren ( ) ; if ( children != null && children . length > <NUM_LIT:0> ) message = children [ <NUM_LIT:0> ] . getMessage ( ) ; } if ( message == null ) message = coreException . getMessage ( ) ; IMarker marker = this . currentProject . createMarker ( IJavaModelMarker . JAVA_MODEL_PROBLEM_MARKER ) ; marker . setAttributes ( new String [ ] { IMarker . MESSAGE , IMarker . SEVERITY , IJavaModelMarker . CATEGORY_ID , IMarker . SOURCE_ID } , new Object [ ] { Messages . bind ( Messages . build_inconsistentProject , message ) , new Integer ( IMarker . SEVERITY_ERROR ) , new Integer ( CategorizedProblem . CAT_BUILDPATH ) , JavaBuilder . SOURCE_ID } ) ; } private void cleanup ( ) { this . participants = null ; this . nameEnvironment = null ; this . binaryLocationsPerProject = null ; this . lastState = null ; this . notifier = null ; this . extraResourceFileFilters = null ; this . extraResourceFolderFilters = null ; } private void clearLastState ( ) { JavaModelManager . getJavaModelManager ( ) . setLastBuiltState ( this . currentProject , null ) ; } boolean filterExtraResource ( IResource resource ) { if ( this . extraResourceFileFilters != null ) { char [ ] name = resource . getName ( ) . toCharArray ( ) ; for ( int i = <NUM_LIT:0> , l = this . extraResourceFileFilters . length ; i < l ; i ++ ) if ( CharOperation . match ( this . extraResourceFileFilters [ i ] , name , true ) ) return true ; } if ( this . extraResourceFolderFilters != null ) { IPath path = resource . getProjectRelativePath ( ) ; String pathName = path . toString ( ) ; int count = path . segmentCount ( ) ; if ( resource . getType ( ) == IResource . FILE ) count -- ; for ( int i = <NUM_LIT:0> , l = this . extraResourceFolderFilters . length ; i < l ; i ++ ) if ( pathName . indexOf ( this . extraResourceFolderFilters [ i ] ) != - <NUM_LIT:1> ) for ( int j = <NUM_LIT:0> ; j < count ; j ++ ) if ( this . extraResourceFolderFilters [ i ] . equals ( path . segment ( j ) ) ) return true ; } return false ; } private SimpleLookupTable findDeltas ( ) { this . notifier . subTask ( Messages . bind ( Messages . build_readingDelta , this . currentProject . getName ( ) ) ) ; IResourceDelta delta = getDelta ( this . currentProject ) ; SimpleLookupTable deltas = new SimpleLookupTable ( <NUM_LIT:3> ) ; if ( delta != null ) { if ( delta . getKind ( ) != IResourceDelta . NO_CHANGE ) { if ( DEBUG ) System . out . println ( "<STR_LIT>" + this . currentProject . getName ( ) ) ; deltas . put ( this . currentProject , delta ) ; } } else { if ( DEBUG ) System . out . println ( "<STR_LIT>" + this . currentProject . getName ( ) ) ; this . notifier . subTask ( "<STR_LIT>" ) ; return null ; } Object [ ] keyTable = this . binaryLocationsPerProject . keyTable ; Object [ ] valueTable = this . binaryLocationsPerProject . valueTable ; nextProject : for ( int i = <NUM_LIT:0> , l = keyTable . length ; i < l ; i ++ ) { IProject p = ( IProject ) keyTable [ i ] ; if ( p != null && p != this . currentProject ) { State s = getLastState ( p ) ; if ( ! this . lastState . wasStructurallyChanged ( p , s ) ) { if ( s . wasNoopBuild ( ) ) continue nextProject ; ClasspathLocation [ ] classFoldersAndJars = ( ClasspathLocation [ ] ) valueTable [ i ] ; boolean canSkip = true ; for ( int j = <NUM_LIT:0> , m = classFoldersAndJars . length ; j < m ; j ++ ) { if ( classFoldersAndJars [ j ] . isOutputFolder ( ) ) classFoldersAndJars [ j ] = null ; else canSkip = false ; } if ( canSkip ) continue nextProject ; } this . notifier . subTask ( Messages . bind ( Messages . build_readingDelta , p . getName ( ) ) ) ; delta = getDelta ( p ) ; if ( delta != null ) { if ( delta . getKind ( ) != IResourceDelta . NO_CHANGE ) { if ( DEBUG ) System . out . println ( "<STR_LIT>" + p . getName ( ) ) ; deltas . put ( p , delta ) ; } } else { if ( DEBUG ) System . out . println ( "<STR_LIT>" + p . getName ( ) ) ; this . notifier . subTask ( "<STR_LIT>" ) ; return null ; } } } this . notifier . subTask ( "<STR_LIT>" ) ; return deltas ; } public State getLastState ( IProject project ) { return ( State ) JavaModelManager . getJavaModelManager ( ) . getLastBuiltState ( project , this . notifier . monitor ) ; } private IProject [ ] getRequiredProjects ( boolean includeBinaryPrerequisites ) { if ( this . javaProject == null || this . workspaceRoot == null ) return new IProject [ <NUM_LIT:0> ] ; ArrayList projects = new ArrayList ( ) ; ExternalFoldersManager externalFoldersManager = JavaModelManager . getExternalManager ( ) ; try { IClasspathEntry [ ] entries = this . javaProject . getExpandedClasspath ( ) ; for ( int i = <NUM_LIT:0> , l = entries . length ; i < l ; i ++ ) { IClasspathEntry entry = entries [ i ] ; IPath path = entry . getPath ( ) ; IProject p = null ; switch ( entry . getEntryKind ( ) ) { case IClasspathEntry . CPE_PROJECT : p = this . workspaceRoot . getProject ( path . lastSegment ( ) ) ; if ( ( ( ClasspathEntry ) entry ) . isOptional ( ) && ! JavaProject . hasJavaNature ( p ) ) p = null ; break ; case IClasspathEntry . CPE_LIBRARY : if ( includeBinaryPrerequisites && path . segmentCount ( ) > <NUM_LIT:0> ) { IResource resource = this . workspaceRoot . findMember ( path . segment ( <NUM_LIT:0> ) ) ; if ( resource instanceof IProject ) { p = ( IProject ) resource ; } else { resource = externalFoldersManager . getFolder ( path ) ; if ( resource != null ) p = resource . getProject ( ) ; } } } if ( p != null && ! projects . contains ( p ) ) projects . add ( p ) ; } } catch ( JavaModelException e ) { return new IProject [ <NUM_LIT:0> ] ; } IProject [ ] result = new IProject [ projects . size ( ) ] ; projects . toArray ( result ) ; return result ; } boolean hasBuildpathErrors ( ) throws CoreException { IMarker [ ] markers = this . currentProject . findMarkers ( IJavaModelMarker . JAVA_MODEL_PROBLEM_MARKER , false , IResource . DEPTH_ZERO ) ; for ( int i = <NUM_LIT:0> , l = markers . length ; i < l ; i ++ ) if ( markers [ i ] . getAttribute ( IJavaModelMarker . CATEGORY_ID , - <NUM_LIT:1> ) == CategorizedProblem . CAT_BUILDPATH ) return true ; return false ; } private boolean hasClasspathChanged ( ) { ClasspathMultiDirectory [ ] newSourceLocations = this . nameEnvironment . sourceLocations ; ClasspathMultiDirectory [ ] oldSourceLocations = this . lastState . sourceLocations ; int newLength = newSourceLocations . length ; int oldLength = oldSourceLocations . length ; int n , o ; for ( n = o = <NUM_LIT:0> ; n < newLength && o < oldLength ; n ++ , o ++ ) { if ( newSourceLocations [ n ] . equals ( oldSourceLocations [ o ] ) ) continue ; try { if ( newSourceLocations [ n ] . sourceFolder . members ( ) . length == <NUM_LIT:0> ) { o -- ; continue ; } else if ( this . lastState . isSourceFolderEmpty ( oldSourceLocations [ o ] . sourceFolder ) ) { n -- ; continue ; } } catch ( CoreException ignore ) { } if ( DEBUG ) { System . out . println ( "<STR_LIT>" + newSourceLocations [ n ] + "<STR_LIT>" + oldSourceLocations [ o ] ) ; printLocations ( newSourceLocations , oldSourceLocations ) ; } return true ; } while ( n < newLength ) { try { if ( newSourceLocations [ n ] . sourceFolder . members ( ) . length == <NUM_LIT:0> ) { n ++ ; continue ; } } catch ( CoreException ignore ) { } if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; printLocations ( newSourceLocations , oldSourceLocations ) ; } return true ; } while ( o < oldLength ) { if ( this . lastState . isSourceFolderEmpty ( oldSourceLocations [ o ] . sourceFolder ) ) { o ++ ; continue ; } if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; printLocations ( newSourceLocations , oldSourceLocations ) ; } return true ; } ClasspathLocation [ ] newBinaryLocations = this . nameEnvironment . binaryLocations ; ClasspathLocation [ ] oldBinaryLocations = this . lastState . binaryLocations ; newLength = newBinaryLocations . length ; oldLength = oldBinaryLocations . length ; for ( n = o = <NUM_LIT:0> ; n < newLength && o < oldLength ; n ++ , o ++ ) { if ( newBinaryLocations [ n ] . equals ( oldBinaryLocations [ o ] ) ) continue ; if ( DEBUG ) { System . out . println ( "<STR_LIT>" + newBinaryLocations [ n ] + "<STR_LIT>" + oldBinaryLocations [ o ] ) ; printLocations ( newBinaryLocations , oldBinaryLocations ) ; } return true ; } if ( n < newLength || o < oldLength ) { if ( DEBUG ) { System . out . println ( "<STR_LIT>" ) ; printLocations ( newBinaryLocations , oldBinaryLocations ) ; } return true ; } return false ; } private boolean hasJavaBuilder ( IProject project ) throws CoreException { ICommand [ ] buildCommands = project . getDescription ( ) . getBuildSpec ( ) ; for ( int i = <NUM_LIT:0> , l = buildCommands . length ; i < l ; i ++ ) if ( buildCommands [ i ] . getBuilderName ( ) . equals ( JavaCore . BUILDER_ID ) ) return true ; return false ; } private boolean hasStructuralDelta ( ) { IResourceDelta delta = getDelta ( this . currentProject ) ; if ( delta != null && delta . getKind ( ) != IResourceDelta . NO_CHANGE ) { ClasspathLocation [ ] classFoldersAndJars = ( ClasspathLocation [ ] ) this . binaryLocationsPerProject . get ( this . currentProject ) ; if ( classFoldersAndJars != null ) { for ( int i = <NUM_LIT:0> , l = classFoldersAndJars . length ; i < l ; i ++ ) { ClasspathLocation classFolderOrJar = classFoldersAndJars [ i ] ; if ( classFolderOrJar != null ) { IPath p = classFolderOrJar . getProjectRelativePath ( ) ; if ( p != null ) { IResourceDelta binaryDelta = delta . findMember ( p ) ; if ( binaryDelta != null && binaryDelta . getKind ( ) != IResourceDelta . NO_CHANGE ) return true ; } } } } } return false ; } private int initializeBuilder ( int kind , boolean forBuild ) throws CoreException { this . javaProject = ( JavaProject ) JavaCore . create ( this . currentProject ) ; this . workspaceRoot = this . currentProject . getWorkspace ( ) . getRoot ( ) ; if ( forBuild ) { this . participants = JavaModelManager . getJavaModelManager ( ) . compilationParticipants . getCompilationParticipants ( this . javaProject ) ; if ( this . participants != null ) for ( int i = <NUM_LIT:0> , l = this . participants . length ; i < l ; i ++ ) if ( this . participants [ i ] . aboutToBuild ( this . javaProject ) == CompilationParticipant . NEEDS_FULL_BUILD ) kind = FULL_BUILD ; String projectName = this . currentProject . getName ( ) ; if ( builtProjects == null || builtProjects . contains ( projectName ) ) { JavaModel . flushExternalFileCache ( ) ; builtProjects = new ArrayList ( ) ; } builtProjects . add ( projectName ) ; } this . binaryLocationsPerProject = new SimpleLookupTable ( <NUM_LIT:3> ) ; this . nameEnvironment = new NameEnvironment ( this . workspaceRoot , this . javaProject , this . binaryLocationsPerProject , this . notifier ) ; if ( forBuild ) { String filterSequence = this . javaProject . getOption ( JavaCore . CORE_JAVA_BUILD_RESOURCE_COPY_FILTER , true ) ; char [ ] [ ] filters = filterSequence != null && filterSequence . length ( ) > <NUM_LIT:0> ? CharOperation . splitAndTrimOn ( '<CHAR_LIT:U+002C>' , filterSequence . toCharArray ( ) ) : null ; if ( filters == null ) { this . extraResourceFileFilters = null ; this . extraResourceFolderFilters = null ; } else { int fileCount = <NUM_LIT:0> , folderCount = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> , l = filters . length ; i < l ; i ++ ) { char [ ] f = filters [ i ] ; if ( f . length == <NUM_LIT:0> ) continue ; if ( f [ f . length - <NUM_LIT:1> ] == '<CHAR_LIT:/>' ) folderCount ++ ; else fileCount ++ ; } this . extraResourceFileFilters = new char [ fileCount ] [ ] ; this . extraResourceFolderFilters = new String [ folderCount ] ; for ( int i = <NUM_LIT:0> , l = filters . length ; i < l ; i ++ ) { char [ ] f = filters [ i ] ; if ( f . length == <NUM_LIT:0> ) continue ; if ( f [ f . length - <NUM_LIT:1> ] == '<CHAR_LIT:/>' ) this . extraResourceFolderFilters [ -- folderCount ] = new String ( f , <NUM_LIT:0> , f . length - <NUM_LIT:1> ) ; else this . extraResourceFileFilters [ -- fileCount ] = f ; } } } return kind ; } private boolean isClasspathBroken ( IClasspathEntry [ ] classpath , IProject p ) throws CoreException { IMarker [ ] markers = p . findMarkers ( IJavaModelMarker . BUILDPATH_PROBLEM_MARKER , false , IResource . DEPTH_ZERO ) ; for ( int i = <NUM_LIT:0> , l = markers . length ; i < l ; i ++ ) if ( markers [ i ] . getAttribute ( IMarker . SEVERITY , - <NUM_LIT:1> ) == IMarker . SEVERITY_ERROR ) return true ; return false ; } private boolean isWorthBuilding ( ) throws CoreException { boolean abortBuilds = JavaCore . ABORT . equals ( this . javaProject . getOption ( JavaCore . CORE_JAVA_BUILD_INVALID_CLASSPATH , true ) ) ; if ( ! abortBuilds ) return true ; if ( isClasspathBroken ( this . javaProject . getRawClasspath ( ) , this . currentProject ) ) { if ( DEBUG ) System . out . println ( "<STR_LIT>" ) ; removeProblemsAndTasksFor ( this . currentProject ) ; IMarker marker = this . currentProject . createMarker ( IJavaModelMarker . JAVA_MODEL_PROBLEM_MARKER ) ; marker . setAttributes ( new String [ ] { IMarker . MESSAGE , IMarker . SEVERITY , IJavaModelMarker . CATEGORY_ID , IMarker . SOURCE_ID } , new Object [ ] { Messages . build_abortDueToClasspathProblems , new Integer ( IMarker . SEVERITY_ERROR ) , new Integer ( CategorizedProblem . CAT_BUILDPATH ) , JavaBuilder . SOURCE_ID } ) ; return false ; } if ( JavaCore . WARNING . equals ( this . javaProject . getOption ( JavaCore . CORE_INCOMPLETE_CLASSPATH , true ) ) ) return true ; IProject [ ] requiredProjects = getRequiredProjects ( false ) ; for ( int i = <NUM_LIT:0> , l = requiredProjects . length ; i < l ; i ++ ) { IProject p = requiredProjects [ i ] ; if ( getLastState ( p ) == null ) { JavaProject prereq = ( JavaProject ) JavaCore . create ( p ) ; if ( prereq . hasCycleMarker ( ) && JavaCore . WARNING . equals ( this . javaProject . getOption ( JavaCore . CORE_CIRCULAR_CLASSPATH , true ) ) ) { if ( DEBUG ) System . out . println ( "<STR_LIT>" + p . getName ( ) + "<STR_LIT>" ) ; continue ; } if ( ! hasJavaBuilder ( p ) ) { if ( DEBUG ) System . out . println ( "<STR_LIT>" + p . getName ( ) + "<STR_LIT>" ) ; continue ; } if ( DEBUG ) System . out . println ( "<STR_LIT>" + p . getName ( ) + "<STR_LIT>" ) ; removeProblemsAndTasksFor ( this . currentProject ) ; IMarker marker = this . currentProject . createMarker ( IJavaModelMarker . JAVA_MODEL_PROBLEM_MARKER ) ; marker . setAttributes ( new String [ ] { IMarker . MESSAGE , IMarker . SEVERITY , IJavaModelMarker . CATEGORY_ID , IMarker . SOURCE_ID } , new Object [ ] { isClasspathBroken ( prereq . getRawClasspath ( ) , p ) ? Messages . bind ( Messages . build_prereqProjectHasClasspathProblems , p . getName ( ) ) : Messages . bind ( Messages . build_prereqProjectMustBeRebuilt , p . getName ( ) ) , new Integer ( IMarker . SEVERITY_ERROR ) , new Integer ( CategorizedProblem . CAT_BUILDPATH ) , JavaBuilder . SOURCE_ID } ) ; return false ; } } return true ; } void mustPropagateStructuralChanges ( ) { LinkedHashSet cycleParticipants = new LinkedHashSet ( <NUM_LIT:3> ) ; this . javaProject . updateCycleParticipants ( new ArrayList ( ) , cycleParticipants , this . workspaceRoot , new HashSet ( <NUM_LIT:3> ) , null ) ; IPath currentPath = this . javaProject . getPath ( ) ; Iterator i = cycleParticipants . iterator ( ) ; while ( i . hasNext ( ) ) { IPath participantPath = ( IPath ) i . next ( ) ; if ( participantPath != currentPath ) { IProject project = this . workspaceRoot . getProject ( participantPath . segment ( <NUM_LIT:0> ) ) ; if ( hasBeenBuilt ( project ) ) { if ( DEBUG ) System . out . println ( "<STR_LIT>" + project . getName ( ) + "<STR_LIT>" ) ; needRebuild ( ) ; return ; } } } } private void printLocations ( ClasspathLocation [ ] newLocations , ClasspathLocation [ ] oldLocations ) { System . out . println ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> , length = newLocations . length ; i < length ; i ++ ) System . out . println ( "<STR_LIT:U+0020U+0020U+0020U+0020>" + newLocations [ i ] . debugPathString ( ) ) ; System . out . println ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> , length = oldLocations . length ; i < length ; i ++ ) System . out . println ( "<STR_LIT:U+0020U+0020U+0020U+0020>" + oldLocations [ i ] . debugPathString ( ) ) ; } private void recordNewState ( State state ) { Object [ ] keyTable = this . binaryLocationsPerProject . keyTable ; for ( int i = <NUM_LIT:0> , l = keyTable . length ; i < l ; i ++ ) { IProject prereqProject = ( IProject ) keyTable [ i ] ; if ( prereqProject != null && prereqProject != this . currentProject ) state . recordStructuralDependency ( prereqProject , getLastState ( prereqProject ) ) ; } if ( DEBUG ) System . out . println ( "<STR_LIT>" + state ) ; JavaModelManager . getJavaModelManager ( ) . setLastBuiltState ( this . currentProject , state ) ; } public String toString ( ) { return this . currentProject == null ? "<STR_LIT>" : "<STR_LIT>" + this . currentProject . getName ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . core . builder ; import org . codehaus . jdt . groovy . integration . LanguageSupportFactory ; import org . eclipse . core . resources . * ; import org . eclipse . core . runtime . * ; import org . eclipse . jdt . core . JavaCore ; import org . eclipse . jdt . core . compiler . * ; import org . eclipse . jdt . internal . compiler . ClassFile ; import org . eclipse . jdt . internal . compiler . impl . CompilerStats ; import org . eclipse . jdt . internal . core . util . Messages ; import org . eclipse . jdt . internal . core . util . Util ; import java . util . * ; public class BatchImageBuilder extends AbstractImageBuilder { IncrementalImageBuilder incrementalBuilder ; ArrayList secondaryTypes ; StringSet typeLocatorsWithUndefinedTypes ; protected BatchImageBuilder ( JavaBuilder javaBuilder , boolean buildStarting ) { super ( javaBuilder , buildStarting , null ) ; this . nameEnvironment . isIncrementalBuild = false ; this . incrementalBuilder = null ; this . secondaryTypes = null ; this . typeLocatorsWithUndefinedTypes = null ; } public void build ( ) { if ( JavaBuilder . DEBUG ) System . out . println ( "<STR_LIT>" ) ; try { this . notifier . subTask ( Messages . bind ( Messages . build_cleaningOutput , this . javaBuilder . currentProject . getName ( ) ) ) ; JavaBuilder . removeProblemsAndTasksFor ( this . javaBuilder . currentProject ) ; cleanOutputFolders ( true ) ; this . notifier . updateProgressDelta ( <NUM_LIT> ) ; this . notifier . subTask ( Messages . build_analyzingSources ) ; ArrayList sourceFiles = new ArrayList ( <NUM_LIT> ) ; addAllSourceFiles ( sourceFiles ) ; this . notifier . updateProgressDelta ( <NUM_LIT> ) ; if ( sourceFiles . size ( ) > <NUM_LIT:0> ) { SourceFile [ ] allSourceFiles = new SourceFile [ sourceFiles . size ( ) ] ; sourceFiles . toArray ( allSourceFiles ) ; this . notifier . setProgressPerCompilationUnit ( <NUM_LIT> / allSourceFiles . length ) ; this . workQueue . addAll ( allSourceFiles ) ; compile ( allSourceFiles ) ; if ( this . typeLocatorsWithUndefinedTypes != null ) if ( this . secondaryTypes != null && ! this . secondaryTypes . isEmpty ( ) ) rebuildTypesAffectedBySecondaryTypes ( ) ; if ( this . incrementalBuilder != null ) this . incrementalBuilder . buildAfterBatchBuild ( ) ; } if ( this . javaBuilder . javaProject . hasCycleMarker ( ) ) this . javaBuilder . mustPropagateStructuralChanges ( ) ; } catch ( CoreException e ) { throw internalException ( e ) ; } finally { if ( JavaBuilder . SHOW_STATS ) printStats ( ) ; cleanUp ( ) ; } } protected void acceptSecondaryType ( ClassFile classFile ) { if ( this . secondaryTypes != null ) this . secondaryTypes . add ( classFile . fileName ( ) ) ; } protected void cleanOutputFolders ( boolean copyBack ) throws CoreException { boolean deleteAll = JavaCore . CLEAN . equals ( this . javaBuilder . javaProject . getOption ( JavaCore . CORE_JAVA_BUILD_CLEAN_OUTPUT_FOLDER , true ) ) ; if ( deleteAll ) { if ( this . javaBuilder . participants != null ) for ( int i = <NUM_LIT:0> , l = this . javaBuilder . participants . length ; i < l ; i ++ ) this . javaBuilder . participants [ i ] . cleanStarting ( this . javaBuilder . javaProject ) ; ArrayList visited = new ArrayList ( this . sourceLocations . length ) ; for ( int i = <NUM_LIT:0> , l = this . sourceLocations . length ; i < l ; i ++ ) { this . notifier . subTask ( Messages . bind ( Messages . build_cleaningOutput , this . javaBuilder . currentProject . getName ( ) ) ) ; ClasspathMultiDirectory sourceLocation = this . sourceLocations [ i ] ; if ( sourceLocation . hasIndependentOutputFolder ) { IContainer outputFolder = sourceLocation . binaryFolder ; if ( ! visited . contains ( outputFolder ) ) { visited . add ( outputFolder ) ; IResource [ ] members = outputFolder . members ( ) ; for ( int j = <NUM_LIT:0> , m = members . length ; j < m ; j ++ ) { IResource member = members [ j ] ; if ( ! member . isDerived ( ) ) { member . accept ( new IResourceVisitor ( ) { public boolean visit ( IResource resource ) throws CoreException { resource . setDerived ( true , null ) ; return resource . getType ( ) != IResource . FILE ; } } ) ; } member . delete ( IResource . FORCE , null ) ; } } this . notifier . checkCancel ( ) ; if ( copyBack ) copyExtraResourcesBack ( sourceLocation , true ) ; } else { boolean isOutputFolder = sourceLocation . sourceFolder . equals ( sourceLocation . binaryFolder ) ; final char [ ] [ ] exclusionPatterns = isOutputFolder ? sourceLocation . exclusionPatterns : null ; final char [ ] [ ] inclusionPatterns = isOutputFolder ? sourceLocation . inclusionPatterns : null ; sourceLocation . binaryFolder . accept ( new IResourceProxyVisitor ( ) { public boolean visit ( IResourceProxy proxy ) throws CoreException { if ( proxy . getType ( ) == IResource . FILE ) { if ( org . eclipse . jdt . internal . compiler . util . Util . isClassFileName ( proxy . getName ( ) ) ) { IResource resource = proxy . requestResource ( ) ; if ( exclusionPatterns != null || inclusionPatterns != null ) if ( Util . isExcluded ( resource . getFullPath ( ) , inclusionPatterns , exclusionPatterns , false ) ) return false ; if ( ! resource . isDerived ( ) ) resource . setDerived ( true , null ) ; resource . delete ( IResource . FORCE , null ) ; } return false ; } if ( exclusionPatterns != null && inclusionPatterns == null ) if ( Util . isExcluded ( proxy . requestFullPath ( ) , null , exclusionPatterns , true ) ) return false ; BatchImageBuilder . this . notifier . checkCancel ( ) ; return true ; } } , IResource . NONE ) ; this . notifier . checkCancel ( ) ; } this . notifier . checkCancel ( ) ; } } else if ( copyBack ) { for ( int i = <NUM_LIT:0> , l = this . sourceLocations . length ; i < l ; i ++ ) { ClasspathMultiDirectory sourceLocation = this . sourceLocations [ i ] ; if ( sourceLocation . hasIndependentOutputFolder ) copyExtraResourcesBack ( sourceLocation , false ) ; this . notifier . checkCancel ( ) ; } } LanguageSupportFactory . getEventHandler ( ) . handle ( this . javaBuilder . javaProject , "<STR_LIT>" ) ; } protected void cleanUp ( ) { this . incrementalBuilder = null ; this . secondaryTypes = null ; this . typeLocatorsWithUndefinedTypes = null ; super . cleanUp ( ) ; } protected void compile ( SourceFile [ ] units , SourceFile [ ] additionalUnits , boolean compilingFirstGroup ) { if ( additionalUnits != null && this . secondaryTypes == null ) this . secondaryTypes = new ArrayList ( <NUM_LIT:7> ) ; super . compile ( units , additionalUnits , compilingFirstGroup ) ; } protected void copyExtraResourcesBack ( ClasspathMultiDirectory sourceLocation , final boolean deletedAll ) throws CoreException { this . notifier . subTask ( Messages . build_copyingResources ) ; final int segmentCount = sourceLocation . sourceFolder . getFullPath ( ) . segmentCount ( ) ; final char [ ] [ ] exclusionPatterns = sourceLocation . exclusionPatterns ; final char [ ] [ ] inclusionPatterns = sourceLocation . inclusionPatterns ; final IContainer outputFolder = sourceLocation . binaryFolder ; final boolean isAlsoProject = sourceLocation . sourceFolder . equals ( this . javaBuilder . currentProject ) ; final boolean isInterestingProject = LanguageSupportFactory . isInterestingProject ( this . javaBuilder . getProject ( ) ) ; sourceLocation . sourceFolder . accept ( new IResourceProxyVisitor ( ) { public boolean visit ( IResourceProxy proxy ) throws CoreException { IResource resource = null ; switch ( proxy . getType ( ) ) { case IResource . FILE : if ( ( LanguageSupportFactory . isSourceFile ( proxy . getName ( ) , isInterestingProject ) && org . eclipse . jdt . internal . core . util . Util . isJavaLikeFileName ( proxy . getName ( ) ) ) || org . eclipse . jdt . internal . compiler . util . Util . isClassFileName ( proxy . getName ( ) ) ) return false ; resource = proxy . requestResource ( ) ; if ( BatchImageBuilder . this . javaBuilder . filterExtraResource ( resource ) ) return false ; if ( exclusionPatterns != null || inclusionPatterns != null ) if ( Util . isExcluded ( resource . getFullPath ( ) , inclusionPatterns , exclusionPatterns , false ) ) return false ; IPath partialPath = resource . getFullPath ( ) . removeFirstSegments ( segmentCount ) ; IResource copiedResource = outputFolder . getFile ( partialPath ) ; if ( copiedResource . exists ( ) ) { if ( deletedAll ) { IResource originalResource = findOriginalResource ( partialPath ) ; String id = originalResource . getFullPath ( ) . removeFirstSegments ( <NUM_LIT:1> ) . toString ( ) ; createProblemFor ( resource , null , Messages . bind ( Messages . build_duplicateResource , id ) , BatchImageBuilder . this . javaBuilder . javaProject . getOption ( JavaCore . CORE_JAVA_BUILD_DUPLICATE_RESOURCE , true ) ) ; return false ; } copiedResource . delete ( IResource . FORCE , null ) ; } createFolder ( partialPath . removeLastSegments ( <NUM_LIT:1> ) , outputFolder ) ; copyResource ( resource , copiedResource ) ; return false ; case IResource . FOLDER : resource = proxy . requestResource ( ) ; if ( BatchImageBuilder . this . javaBuilder . filterExtraResource ( resource ) ) return false ; if ( isAlsoProject && isExcludedFromProject ( resource . getFullPath ( ) ) ) return false ; if ( exclusionPatterns != null && inclusionPatterns == null ) if ( Util . isExcluded ( resource . getFullPath ( ) , null , exclusionPatterns , true ) ) return false ; } return true ; } } , IResource . NONE ) ; } protected IResource findOriginalResource ( IPath partialPath ) { for ( int i = <NUM_LIT:0> , l = this . sourceLocations . length ; i < l ; i ++ ) { ClasspathMultiDirectory sourceLocation = this . sourceLocations [ i ] ; if ( sourceLocation . hasIndependentOutputFolder ) { IResource originalResource = sourceLocation . sourceFolder . getFile ( partialPath ) ; if ( originalResource . exists ( ) ) return originalResource ; } } return null ; } private void printStats ( ) { if ( this . compiler == null ) return ; CompilerStats compilerStats = this . compiler . stats ; long time = compilerStats . elapsedTime ( ) ; long lineCount = compilerStats . lineCount ; double speed = ( ( int ) ( lineCount * <NUM_LIT> / time ) ) / <NUM_LIT> ; System . out . println ( "<STR_LIT>" + this . javaBuilder . javaProject . getElementName ( ) ) ; System . out . println ( "<STR_LIT>" + lineCount + "<STR_LIT>" + time + "<STR_LIT>" + speed + "<STR_LIT>" ) ; System . out . print ( "<STR_LIT>" + compilerStats . parseTime + "<STR_LIT>" + ( ( int ) ( compilerStats . parseTime * <NUM_LIT> / time ) ) / <NUM_LIT> + "<STR_LIT>" ) ; System . out . print ( "<STR_LIT>" + compilerStats . resolveTime + "<STR_LIT>" + ( ( int ) ( compilerStats . resolveTime * <NUM_LIT> / time ) ) / <NUM_LIT> + "<STR_LIT>" ) ; System . out . print ( "<STR_LIT>" + compilerStats . analyzeTime + "<STR_LIT>" + ( ( int ) ( compilerStats . analyzeTime * <NUM_LIT> / time ) ) / <NUM_LIT> + "<STR_LIT>" ) ; System . out . println ( "<STR_LIT>" + compilerStats . generateTime + "<STR_LIT>" + ( ( int ) ( compilerStats . generateTime * <NUM_LIT> / time ) ) / <NUM_LIT> + "<STR_LIT>" ) ; } protected void processAnnotationResults ( CompilationParticipantResult [ ] results ) { if ( this . incrementalBuilder == null ) this . incrementalBuilder = new IncrementalImageBuilder ( this ) ; this . incrementalBuilder . processAnnotationResults ( results ) ; } protected void rebuildTypesAffectedBySecondaryTypes ( ) { if ( this . incrementalBuilder == null ) this . incrementalBuilder = new IncrementalImageBuilder ( this ) ; int count = this . secondaryTypes . size ( ) ; StringSet qualifiedNames = new StringSet ( count * <NUM_LIT:2> ) ; StringSet simpleNames = new StringSet ( count ) ; StringSet rootNames = new StringSet ( <NUM_LIT:3> ) ; while ( -- count >= <NUM_LIT:0> ) { char [ ] secondaryTypeName = ( char [ ] ) this . secondaryTypes . get ( count ) ; IPath path = new Path ( null , new String ( secondaryTypeName ) ) ; this . incrementalBuilder . addDependentsOf ( path , false , qualifiedNames , simpleNames , rootNames ) ; } this . incrementalBuilder . addAffectedSourceFiles ( qualifiedNames , simpleNames , rootNames , this . typeLocatorsWithUndefinedTypes ) ; } protected void storeProblemsFor ( SourceFile sourceFile , CategorizedProblem [ ] problems ) throws CoreException { if ( sourceFile == null || problems == null || problems . length == <NUM_LIT:0> ) return ; for ( int i = problems . length ; -- i >= <NUM_LIT:0> ; ) { CategorizedProblem problem = problems [ i ] ; if ( problem != null && problem . getID ( ) == IProblem . UndefinedType ) { if ( this . typeLocatorsWithUndefinedTypes == null ) this . typeLocatorsWithUndefinedTypes = new StringSet ( <NUM_LIT:3> ) ; this . typeLocatorsWithUndefinedTypes . add ( sourceFile . typeLocator ( ) ) ; break ; } } super . storeProblemsFor ( sourceFile , problems ) ; } public String toString ( ) { return "<STR_LIT>" + this . newState ; } } </s>
<s> package org . eclipse . jdt . internal . core . builder ; public class AbortIncrementalBuildException extends RuntimeException { protected String qualifiedTypeName ; private static final long serialVersionUID = - <NUM_LIT> ; public AbortIncrementalBuildException ( String qualifiedTypeName ) { this . qualifiedTypeName = qualifiedTypeName ; } } </s>
<s> package org . eclipse . jdt . internal . core . builder ; public class AdditionalTypeCollection extends ReferenceCollection { char [ ] [ ] definedTypeNames ; protected AdditionalTypeCollection ( char [ ] [ ] definedTypeNames , char [ ] [ ] [ ] qualifiedReferences , char [ ] [ ] simpleNameReferences , char [ ] [ ] rootReferences ) { super ( qualifiedReferences , simpleNameReferences , rootReferences ) ; this . definedTypeNames = definedTypeNames ; } } </s>
<s> package org . eclipse . jdt . internal . core . builder ; import org . eclipse . core . resources . IFile ; import org . eclipse . core . runtime . IPath ; import org . eclipse . core . runtime . CoreException ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . env . ICompilationUnit ; import org . eclipse . jdt . internal . compiler . problem . AbortCompilation ; import org . eclipse . jdt . internal . core . util . Util ; public class SourceFile implements ICompilationUnit { public IFile resource ; ClasspathMultiDirectory sourceLocation ; String initialTypeName ; boolean updateClassFile ; public SourceFile ( IFile resource , ClasspathMultiDirectory sourceLocation ) { this . resource = resource ; this . sourceLocation = sourceLocation ; this . initialTypeName = extractTypeName ( ) ; this . updateClassFile = false ; } public SourceFile ( IFile resource , ClasspathMultiDirectory sourceLocation , boolean updateClassFile ) { this ( resource , sourceLocation ) ; this . updateClassFile = updateClassFile ; } public boolean equals ( Object o ) { if ( this == o ) return true ; if ( ! ( o instanceof SourceFile ) ) return false ; SourceFile f = ( SourceFile ) o ; return this . sourceLocation == f . sourceLocation && this . resource . getFullPath ( ) . equals ( f . resource . getFullPath ( ) ) ; } String extractTypeName ( ) { IPath fullPath = this . resource . getFullPath ( ) ; int resourceSegmentCount = fullPath . segmentCount ( ) ; int sourceFolderSegmentCount = this . sourceLocation . sourceFolder . getFullPath ( ) . segmentCount ( ) ; int charCount = ( resourceSegmentCount - sourceFolderSegmentCount - <NUM_LIT:1> ) ; resourceSegmentCount -- ; for ( int i = sourceFolderSegmentCount ; i < resourceSegmentCount ; i ++ ) charCount += fullPath . segment ( i ) . length ( ) ; String lastSegment = fullPath . segment ( resourceSegmentCount ) ; int extensionIndex = Util . indexOfJavaLikeExtension ( lastSegment ) ; charCount += extensionIndex ; char [ ] result = new char [ charCount ] ; int offset = <NUM_LIT:0> ; for ( int i = sourceFolderSegmentCount ; i < resourceSegmentCount ; i ++ ) { String segment = fullPath . segment ( i ) ; int size = segment . length ( ) ; segment . getChars ( <NUM_LIT:0> , size , result , offset ) ; offset += size ; result [ offset ++ ] = '<CHAR_LIT:/>' ; } lastSegment . getChars ( <NUM_LIT:0> , extensionIndex , result , offset ) ; return new String ( result ) ; } public char [ ] getContents ( ) { try { return Util . getResourceContentsAsCharArray ( this . resource ) ; } catch ( CoreException e ) { throw new AbortCompilation ( true , new MissingSourceFileException ( this . resource . getFullPath ( ) . toString ( ) ) ) ; } } public char [ ] getFileName ( ) { return this . resource . getFullPath ( ) . toString ( ) . toCharArray ( ) ; } public char [ ] getMainTypeName ( ) { char [ ] typeName = this . initialTypeName . toCharArray ( ) ; int lastIndex = CharOperation . lastIndexOf ( '<CHAR_LIT:/>' , typeName ) ; return CharOperation . subarray ( typeName , lastIndex + <NUM_LIT:1> , - <NUM_LIT:1> ) ; } public char [ ] [ ] getPackageName ( ) { char [ ] typeName = this . initialTypeName . toCharArray ( ) ; int lastIndex = CharOperation . lastIndexOf ( '<CHAR_LIT:/>' , typeName ) ; return CharOperation . splitOn ( '<CHAR_LIT:/>' , typeName , <NUM_LIT:0> , lastIndex ) ; } public int hashCode ( ) { return this . initialTypeName . hashCode ( ) ; } String typeLocator ( ) { return this . resource . getProjectRelativePath ( ) . toString ( ) ; } public String toString ( ) { return "<STR_LIT>" + this . resource . getFullPath ( ) + "<STR_LIT:]>" ; } public static final String LINK_TO_GRAILS_PLUGINS = "<STR_LIT>" ; public boolean isInLinkedSourceFolder ( ) { if ( this . sourceLocation != null && this . sourceLocation . sourceFolder != null ) { IPath fullPath = this . sourceLocation . sourceFolder . getFullPath ( ) ; if ( fullPath != null ) { return LINK_TO_GRAILS_PLUGINS . equals ( fullPath . segment ( <NUM_LIT:1> ) ) ; } } return false ; } } </s>
<s> package org . eclipse . jdt . internal . core . builder ; public class StringSet { public String [ ] values ; public int elementSize ; public int threshold ; public StringSet ( int size ) { this . elementSize = <NUM_LIT:0> ; this . threshold = size ; int extraRoom = ( int ) ( size * <NUM_LIT> ) ; if ( this . threshold == extraRoom ) extraRoom ++ ; this . values = new String [ extraRoom ] ; } public boolean add ( String value ) { int length = this . values . length ; int index = ( value . hashCode ( ) & <NUM_LIT> ) % length ; String current ; while ( ( current = this . values [ index ] ) != null ) { if ( value . equals ( current ) ) return false ; if ( ++ index == length ) index = <NUM_LIT:0> ; } this . values [ index ] = value ; if ( ++ this . elementSize > this . threshold ) rehash ( ) ; return true ; } public void clear ( ) { for ( int i = this . values . length ; -- i >= <NUM_LIT:0> ; ) this . values [ i ] = null ; this . elementSize = <NUM_LIT:0> ; } public boolean includes ( String value ) { int length = this . values . length ; int index = ( value . hashCode ( ) & <NUM_LIT> ) % length ; String current ; while ( ( current = this . values [ index ] ) != null ) { if ( value . equals ( current ) ) return true ; if ( ++ index == length ) index = <NUM_LIT:0> ; } return false ; } private void rehash ( ) { StringSet newSet = new StringSet ( this . elementSize * <NUM_LIT:2> ) ; String current ; for ( int i = this . values . length ; -- i >= <NUM_LIT:0> ; ) if ( ( current = this . values [ i ] ) != null ) newSet . add ( current ) ; this . values = newSet . values ; this . elementSize = newSet . elementSize ; this . threshold = newSet . threshold ; } public String toString ( ) { String s = "<STR_LIT>" ; String value ; for ( int i = <NUM_LIT:0> , l = this . values . length ; i < l ; i ++ ) if ( ( value = this . values [ i ] ) != null ) s += value + "<STR_LIT:n>" ; return s ; } } </s>
<s> package org . eclipse . jdt . internal . core . builder ; import org . eclipse . core . resources . IFile ; import org . eclipse . jdt . core . compiler . * ; public class CompilationParticipantResult extends BuildContext { protected SourceFile sourceFile ; protected boolean hasAnnotations ; protected IFile [ ] addedFiles ; protected IFile [ ] deletedFiles ; protected CategorizedProblem [ ] problems ; protected String [ ] dependencies ; protected CompilationParticipantResult ( SourceFile sourceFile ) { this . sourceFile = sourceFile ; this . hasAnnotations = false ; this . addedFiles = null ; this . deletedFiles = null ; this . problems = null ; this . dependencies = null ; } public char [ ] getContents ( ) { return this . sourceFile . getContents ( ) ; } public IFile getFile ( ) { return this . sourceFile . resource ; } public boolean hasAnnotations ( ) { return this . hasAnnotations ; } public void recordAddedGeneratedFiles ( IFile [ ] addedGeneratedFiles ) { int length2 = addedGeneratedFiles . length ; if ( length2 == <NUM_LIT:0> ) return ; int length1 = this . addedFiles == null ? <NUM_LIT:0> : this . addedFiles . length ; IFile [ ] merged = new IFile [ length1 + length2 ] ; if ( length1 > <NUM_LIT:0> ) System . arraycopy ( this . addedFiles , <NUM_LIT:0> , merged , <NUM_LIT:0> , length1 ) ; System . arraycopy ( addedGeneratedFiles , <NUM_LIT:0> , merged , length1 , length2 ) ; this . addedFiles = merged ; } public void recordDeletedGeneratedFiles ( IFile [ ] deletedGeneratedFiles ) { int length2 = deletedGeneratedFiles . length ; if ( length2 == <NUM_LIT:0> ) return ; int length1 = this . deletedFiles == null ? <NUM_LIT:0> : this . deletedFiles . length ; IFile [ ] merged = new IFile [ length1 + length2 ] ; if ( length1 > <NUM_LIT:0> ) System . arraycopy ( this . deletedFiles , <NUM_LIT:0> , merged , <NUM_LIT:0> , length1 ) ; System . arraycopy ( deletedGeneratedFiles , <NUM_LIT:0> , merged , length1 , length2 ) ; this . deletedFiles = merged ; } public void recordDependencies ( String [ ] typeNameDependencies ) { int length2 = typeNameDependencies . length ; if ( length2 == <NUM_LIT:0> ) return ; int length1 = this . dependencies == null ? <NUM_LIT:0> : this . dependencies . length ; String [ ] merged = new String [ length1 + length2 ] ; if ( length1 > <NUM_LIT:0> ) System . arraycopy ( this . dependencies , <NUM_LIT:0> , merged , <NUM_LIT:0> , length1 ) ; System . arraycopy ( typeNameDependencies , <NUM_LIT:0> , merged , length1 , length2 ) ; this . dependencies = merged ; } public void recordNewProblems ( CategorizedProblem [ ] newProblems ) { int length2 = newProblems . length ; if ( length2 == <NUM_LIT:0> ) return ; int length1 = this . problems == null ? <NUM_LIT:0> : this . problems . length ; CategorizedProblem [ ] merged = new CategorizedProblem [ length1 + length2 ] ; if ( length1 > <NUM_LIT:0> ) System . arraycopy ( this . problems , <NUM_LIT:0> , merged , <NUM_LIT:0> , length1 ) ; System . arraycopy ( newProblems , <NUM_LIT:0> , merged , length1 , length2 ) ; this . problems = merged ; } void reset ( boolean detectedAnnotations ) { this . hasAnnotations = detectedAnnotations ; this . addedFiles = null ; this . deletedFiles = null ; this . problems = null ; this . dependencies = null ; } public String toString ( ) { return this . sourceFile . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . core . builder ; import org . eclipse . core . resources . IFile ; import org . eclipse . jdt . internal . compiler . env . ICompilationUnit ; public interface ICompilationUnitLocator { public ICompilationUnit fromIFile ( IFile file ) ; } </s>
<s> package org . eclipse . jdt . internal . core . builder ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . lookup . TypeConstants ; public class ReferenceCollection { char [ ] [ ] [ ] qualifiedNameReferences ; char [ ] [ ] simpleNameReferences ; char [ ] [ ] rootReferences ; protected ReferenceCollection ( char [ ] [ ] [ ] qualifiedNameReferences , char [ ] [ ] simpleNameReferences , char [ ] [ ] rootReferences ) { this . qualifiedNameReferences = internQualifiedNames ( qualifiedNameReferences , false ) ; this . simpleNameReferences = internSimpleNames ( simpleNameReferences , true ) ; this . rootReferences = internSimpleNames ( rootReferences , false ) ; } public void addDependencies ( String [ ] typeNameDependencies ) { char [ ] [ ] [ ] qNames = new char [ typeNameDependencies . length ] [ ] [ ] ; for ( int i = typeNameDependencies . length ; -- i >= <NUM_LIT:0> ; ) qNames [ i ] = CharOperation . splitOn ( '<CHAR_LIT:.>' , typeNameDependencies [ i ] . toCharArray ( ) ) ; qNames = internQualifiedNames ( qNames , false ) ; next : for ( int i = qNames . length ; -- i >= <NUM_LIT:0> ; ) { char [ ] [ ] qualifiedTypeName = qNames [ i ] ; while ( ! includes ( qualifiedTypeName ) ) { if ( ! includes ( qualifiedTypeName [ qualifiedTypeName . length - <NUM_LIT:1> ] ) ) { int length = this . simpleNameReferences . length ; System . arraycopy ( this . simpleNameReferences , <NUM_LIT:0> , this . simpleNameReferences = new char [ length + <NUM_LIT:1> ] [ ] , <NUM_LIT:0> , length ) ; this . simpleNameReferences [ length ] = qualifiedTypeName [ qualifiedTypeName . length - <NUM_LIT:1> ] ; } if ( ! insideRoot ( qualifiedTypeName [ <NUM_LIT:0> ] ) ) { int length = this . rootReferences . length ; System . arraycopy ( this . rootReferences , <NUM_LIT:0> , this . rootReferences = new char [ length + <NUM_LIT:1> ] [ ] , <NUM_LIT:0> , length ) ; this . rootReferences [ length ] = qualifiedTypeName [ <NUM_LIT:0> ] ; } int length = this . qualifiedNameReferences . length ; System . arraycopy ( this . qualifiedNameReferences , <NUM_LIT:0> , this . qualifiedNameReferences = new char [ length + <NUM_LIT:1> ] [ ] [ ] , <NUM_LIT:0> , length ) ; this . qualifiedNameReferences [ length ] = qualifiedTypeName ; qualifiedTypeName = CharOperation . subarray ( qualifiedTypeName , <NUM_LIT:0> , qualifiedTypeName . length - <NUM_LIT:1> ) ; char [ ] [ ] [ ] temp = internQualifiedNames ( new char [ ] [ ] [ ] { qualifiedTypeName } , false ) ; if ( temp == EmptyQualifiedNames ) continue next ; qualifiedTypeName = temp [ <NUM_LIT:0> ] ; } } } public boolean includes ( char [ ] simpleName ) { for ( int i = <NUM_LIT:0> , l = this . simpleNameReferences . length ; i < l ; i ++ ) if ( simpleName == this . simpleNameReferences [ i ] ) return true ; return false ; } public boolean includes ( char [ ] [ ] qualifiedName ) { for ( int i = <NUM_LIT:0> , l = this . qualifiedNameReferences . length ; i < l ; i ++ ) if ( qualifiedName == this . qualifiedNameReferences [ i ] ) return true ; return false ; } public boolean includes ( char [ ] [ ] [ ] qualifiedNames , char [ ] [ ] simpleNames ) { return includes ( qualifiedNames , simpleNames , null ) ; } public boolean includes ( char [ ] [ ] [ ] qualifiedNames , char [ ] [ ] simpleNames , char [ ] [ ] rootNames ) { if ( rootNames != null ) { boolean foundRoot = false ; for ( int i = <NUM_LIT:0> , l = rootNames . length ; ! foundRoot && i < l ; i ++ ) foundRoot = insideRoot ( rootNames [ i ] ) ; if ( ! foundRoot ) return false ; } if ( simpleNames == null || qualifiedNames == null ) { if ( simpleNames == null && qualifiedNames == null ) { if ( JavaBuilder . DEBUG ) System . out . println ( "<STR_LIT>" ) ; return true ; } else if ( qualifiedNames == null ) { for ( int i = <NUM_LIT:0> , l = simpleNames . length ; i < l ; i ++ ) { if ( includes ( simpleNames [ i ] ) ) { if ( JavaBuilder . DEBUG ) System . out . println ( "<STR_LIT>" + new String ( simpleNames [ i ] ) ) ; return true ; } } } else { for ( int i = <NUM_LIT:0> , l = qualifiedNames . length ; i < l ; i ++ ) { char [ ] [ ] qualifiedName = qualifiedNames [ i ] ; if ( qualifiedName . length == <NUM_LIT:1> ? includes ( qualifiedName [ <NUM_LIT:0> ] ) : includes ( qualifiedName ) ) { if ( JavaBuilder . DEBUG ) System . out . println ( "<STR_LIT>" + CharOperation . toString ( qualifiedName ) ) ; return true ; } } } return false ; } int sLength = simpleNames . length ; int qLength = qualifiedNames . length ; if ( sLength <= qLength ) { for ( int i = <NUM_LIT:0> ; i < sLength ; i ++ ) { if ( includes ( simpleNames [ i ] ) ) { for ( int j = <NUM_LIT:0> ; j < qLength ; j ++ ) { char [ ] [ ] qualifiedName = qualifiedNames [ j ] ; if ( qualifiedName . length == <NUM_LIT:1> ? includes ( qualifiedName [ <NUM_LIT:0> ] ) : includes ( qualifiedName ) ) { if ( JavaBuilder . DEBUG ) System . out . println ( "<STR_LIT>" + CharOperation . toString ( qualifiedName ) + "<STR_LIT:U+0020toU+0020>" + new String ( simpleNames [ i ] ) ) ; return true ; } } return false ; } } } else { for ( int i = <NUM_LIT:0> ; i < qLength ; i ++ ) { char [ ] [ ] qualifiedName = qualifiedNames [ i ] ; if ( qualifiedName . length == <NUM_LIT:1> ? includes ( qualifiedName [ <NUM_LIT:0> ] ) : includes ( qualifiedName ) ) { for ( int j = <NUM_LIT:0> ; j < sLength ; j ++ ) { if ( includes ( simpleNames [ j ] ) ) { if ( JavaBuilder . DEBUG ) System . out . println ( "<STR_LIT>" + CharOperation . toString ( qualifiedName ) + "<STR_LIT:U+0020toU+0020>" + new String ( simpleNames [ j ] ) ) ; return true ; } } return false ; } } } return false ; } public boolean insideRoot ( char [ ] rootName ) { for ( int i = <NUM_LIT:0> , l = this . rootReferences . length ; i < l ; i ++ ) if ( rootName == this . rootReferences [ i ] ) return true ; return false ; } static final char [ ] [ ] [ ] WellKnownQualifiedNames = new char [ ] [ ] [ ] { TypeConstants . JAVA_LANG_RUNTIMEEXCEPTION , TypeConstants . JAVA_LANG_THROWABLE , TypeConstants . JAVA_LANG_OBJECT , TypeConstants . JAVA_LANG , new char [ ] [ ] { TypeConstants . JAVA } , new char [ ] [ ] { new char [ ] { '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' } } , new char [ ] [ ] { new char [ ] { '<CHAR_LIT:c>' , '<CHAR_LIT>' , '<CHAR_LIT>' } } , CharOperation . NO_CHAR_CHAR } ; static final char [ ] [ ] WellKnownSimpleNames = new char [ ] [ ] { TypeConstants . JAVA_LANG_RUNTIMEEXCEPTION [ <NUM_LIT:2> ] , TypeConstants . JAVA_LANG_THROWABLE [ <NUM_LIT:2> ] , TypeConstants . JAVA_LANG_OBJECT [ <NUM_LIT:2> ] , TypeConstants . JAVA , TypeConstants . LANG , new char [ ] { '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' } , new char [ ] { '<CHAR_LIT:c>' , '<CHAR_LIT>' , '<CHAR_LIT>' } } ; static final char [ ] [ ] [ ] EmptyQualifiedNames = new char [ <NUM_LIT:0> ] [ ] [ ] ; static final char [ ] [ ] EmptySimpleNames = CharOperation . NO_CHAR_CHAR ; static final int MaxQualifiedNames = <NUM_LIT:7> ; static QualifiedNameSet [ ] InternedQualifiedNames = new QualifiedNameSet [ MaxQualifiedNames ] ; static final int MaxSimpleNames = <NUM_LIT:30> ; static NameSet [ ] InternedSimpleNames = new NameSet [ MaxSimpleNames ] ; static { for ( int i = <NUM_LIT:0> ; i < MaxQualifiedNames ; i ++ ) InternedQualifiedNames [ i ] = new QualifiedNameSet ( <NUM_LIT> ) ; for ( int i = <NUM_LIT:0> ; i < MaxSimpleNames ; i ++ ) InternedSimpleNames [ i ] = new NameSet ( <NUM_LIT> ) ; } public static char [ ] [ ] [ ] internQualifiedNames ( StringSet qualifiedStrings ) { if ( qualifiedStrings == null ) return EmptyQualifiedNames ; int length = qualifiedStrings . elementSize ; if ( length == <NUM_LIT:0> ) return EmptyQualifiedNames ; char [ ] [ ] [ ] result = new char [ length ] [ ] [ ] ; String [ ] strings = qualifiedStrings . values ; for ( int i = <NUM_LIT:0> , l = strings . length ; i < l ; i ++ ) if ( strings [ i ] != null ) result [ -- length ] = CharOperation . splitOn ( '<CHAR_LIT:/>' , strings [ i ] . toCharArray ( ) ) ; return internQualifiedNames ( result , false ) ; } public static char [ ] [ ] [ ] internQualifiedNames ( char [ ] [ ] [ ] qualifiedNames ) { return internQualifiedNames ( qualifiedNames , false ) ; } public static char [ ] [ ] [ ] internQualifiedNames ( char [ ] [ ] [ ] qualifiedNames , boolean keepWellKnown ) { if ( qualifiedNames == null ) return EmptyQualifiedNames ; int length = qualifiedNames . length ; if ( length == <NUM_LIT:0> ) return EmptyQualifiedNames ; char [ ] [ ] [ ] keepers = new char [ length ] [ ] [ ] ; int index = <NUM_LIT:0> ; next : for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { char [ ] [ ] qualifiedName = qualifiedNames [ i ] ; int qLength = qualifiedName . length ; for ( int j = <NUM_LIT:0> , m = WellKnownQualifiedNames . length ; j < m ; j ++ ) { char [ ] [ ] wellKnownName = WellKnownQualifiedNames [ j ] ; if ( qLength > wellKnownName . length ) break ; if ( CharOperation . equals ( qualifiedName , wellKnownName ) ) { if ( keepWellKnown ) { keepers [ index ++ ] = wellKnownName ; } continue next ; } } QualifiedNameSet internedNames = InternedQualifiedNames [ qLength <= MaxQualifiedNames ? qLength - <NUM_LIT:1> : <NUM_LIT:0> ] ; qualifiedName = internSimpleNames ( qualifiedName , false ) ; keepers [ index ++ ] = internedNames . add ( qualifiedName ) ; } if ( length > index ) { if ( index == <NUM_LIT:0> ) return EmptyQualifiedNames ; System . arraycopy ( keepers , <NUM_LIT:0> , keepers = new char [ index ] [ ] [ ] , <NUM_LIT:0> , index ) ; } return keepers ; } public static char [ ] [ ] internSimpleNames ( StringSet simpleStrings ) { return internSimpleNames ( simpleStrings , true ) ; } public static char [ ] [ ] internSimpleNames ( StringSet simpleStrings , boolean removeWellKnown ) { if ( simpleStrings == null ) return EmptySimpleNames ; int length = simpleStrings . elementSize ; if ( length == <NUM_LIT:0> ) return EmptySimpleNames ; char [ ] [ ] result = new char [ length ] [ ] ; String [ ] strings = simpleStrings . values ; for ( int i = <NUM_LIT:0> , l = strings . length ; i < l ; i ++ ) if ( strings [ i ] != null ) result [ -- length ] = strings [ i ] . toCharArray ( ) ; return internSimpleNames ( result , removeWellKnown ) ; } public static char [ ] [ ] internSimpleNames ( char [ ] [ ] simpleNames , boolean removeWellKnown ) { if ( simpleNames == null ) return EmptySimpleNames ; int length = simpleNames . length ; if ( length == <NUM_LIT:0> ) return EmptySimpleNames ; char [ ] [ ] keepers = new char [ length ] [ ] ; int index = <NUM_LIT:0> ; next : for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { char [ ] name = simpleNames [ i ] ; int sLength = name . length ; for ( int j = <NUM_LIT:0> , m = WellKnownSimpleNames . length ; j < m ; j ++ ) { char [ ] wellKnownName = WellKnownSimpleNames [ j ] ; if ( sLength > wellKnownName . length ) break ; if ( CharOperation . equals ( name , wellKnownName ) ) { if ( ! removeWellKnown ) keepers [ index ++ ] = WellKnownSimpleNames [ j ] ; continue next ; } } NameSet internedNames = InternedSimpleNames [ sLength < MaxSimpleNames ? sLength : <NUM_LIT:0> ] ; keepers [ index ++ ] = internedNames . add ( name ) ; } if ( length > index ) { if ( index == <NUM_LIT:0> ) return EmptySimpleNames ; System . arraycopy ( keepers , <NUM_LIT:0> , keepers = new char [ index ] [ ] , <NUM_LIT:0> , index ) ; } return keepers ; } } </s>
<s> package org . eclipse . jdt . internal . core . builder ; import org . eclipse . core . resources . IFile ; import org . eclipse . core . runtime . * ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileReader ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFormatException ; import org . eclipse . jdt . internal . compiler . env . AccessRuleSet ; import org . eclipse . jdt . internal . compiler . env . NameEnvironmentAnswer ; import org . eclipse . jdt . internal . compiler . util . SimpleLookupTable ; import org . eclipse . jdt . internal . compiler . util . SimpleSet ; import org . eclipse . jdt . internal . compiler . util . SuffixConstants ; import org . eclipse . jdt . internal . core . util . Util ; import java . io . * ; import java . util . * ; import java . util . zip . * ; public class ClasspathJar extends ClasspathLocation { static class PackageCacheEntry { long lastModified ; long fileSize ; SimpleSet packageSet ; PackageCacheEntry ( long lastModified , long fileSize , SimpleSet packageSet ) { this . lastModified = lastModified ; this . fileSize = fileSize ; this . packageSet = packageSet ; } } static SimpleLookupTable PackageCache = new SimpleLookupTable ( ) ; static SimpleSet findPackageSet ( ClasspathJar jar ) { String zipFileName = jar . zipFilename ; long lastModified = jar . lastModified ( ) ; long fileSize = new File ( zipFileName ) . length ( ) ; PackageCacheEntry cacheEntry = ( PackageCacheEntry ) PackageCache . get ( zipFileName ) ; if ( cacheEntry != null && cacheEntry . lastModified == lastModified && cacheEntry . fileSize == fileSize ) return cacheEntry . packageSet ; SimpleSet packageSet = new SimpleSet ( <NUM_LIT> ) ; packageSet . add ( "<STR_LIT>" ) ; nextEntry : for ( Enumeration e = jar . zipFile . entries ( ) ; e . hasMoreElements ( ) ; ) { String fileName = ( ( ZipEntry ) e . nextElement ( ) ) . getName ( ) ; int last = fileName . lastIndexOf ( '<CHAR_LIT:/>' ) ; while ( last > <NUM_LIT:0> ) { String packageName = fileName . substring ( <NUM_LIT:0> , last ) ; if ( packageSet . addIfNotIncluded ( packageName ) == null ) continue nextEntry ; last = packageName . lastIndexOf ( '<CHAR_LIT:/>' ) ; } } PackageCache . put ( zipFileName , new PackageCacheEntry ( lastModified , fileSize , packageSet ) ) ; return packageSet ; } String zipFilename ; IFile resource ; ZipFile zipFile ; long lastModified ; boolean closeZipFileAtEnd ; SimpleSet knownPackageNames ; AccessRuleSet accessRuleSet ; ClasspathJar ( IFile resource , AccessRuleSet accessRuleSet ) { this . resource = resource ; try { java . net . URI location = resource . getLocationURI ( ) ; if ( location == null ) { this . zipFilename = "<STR_LIT>" ; } else { File localFile = Util . toLocalFile ( location , null ) ; this . zipFilename = localFile . getPath ( ) ; } } catch ( CoreException e ) { } this . zipFile = null ; this . knownPackageNames = null ; this . accessRuleSet = accessRuleSet ; } ClasspathJar ( String zipFilename , long lastModified , AccessRuleSet accessRuleSet ) { this . zipFilename = zipFilename ; this . lastModified = lastModified ; this . zipFile = null ; this . knownPackageNames = null ; this . accessRuleSet = accessRuleSet ; } public ClasspathJar ( ZipFile zipFile , AccessRuleSet accessRuleSet ) { this . zipFilename = zipFile . getName ( ) ; this . zipFile = zipFile ; this . closeZipFileAtEnd = false ; this . knownPackageNames = null ; this . accessRuleSet = accessRuleSet ; } public void cleanup ( ) { if ( this . zipFile != null && this . closeZipFileAtEnd ) { try { this . zipFile . close ( ) ; } catch ( IOException e ) { } this . zipFile = null ; } this . knownPackageNames = null ; } public boolean equals ( Object o ) { if ( this == o ) return true ; if ( ! ( o instanceof ClasspathJar ) ) return false ; ClasspathJar jar = ( ClasspathJar ) o ; if ( this . accessRuleSet != jar . accessRuleSet ) if ( this . accessRuleSet == null || ! this . accessRuleSet . equals ( jar . accessRuleSet ) ) return false ; return this . zipFilename . equals ( jar . zipFilename ) && lastModified ( ) == jar . lastModified ( ) ; } public NameEnvironmentAnswer findClass ( String binaryFileName , String qualifiedPackageName , String qualifiedBinaryFileName ) { if ( ! isPackage ( qualifiedPackageName ) ) return null ; try { ClassFileReader reader = ClassFileReader . read ( this . zipFile , qualifiedBinaryFileName ) ; if ( reader != null ) { if ( this . accessRuleSet == null ) return new NameEnvironmentAnswer ( reader , null ) ; String fileNameWithoutExtension = qualifiedBinaryFileName . substring ( <NUM_LIT:0> , qualifiedBinaryFileName . length ( ) - SuffixConstants . SUFFIX_CLASS . length ) ; return new NameEnvironmentAnswer ( reader , this . accessRuleSet . getViolatedRestriction ( fileNameWithoutExtension . toCharArray ( ) ) ) ; } } catch ( IOException e ) { } catch ( ClassFormatException e ) { } return null ; } public IPath getProjectRelativePath ( ) { if ( this . resource == null ) return null ; return this . resource . getProjectRelativePath ( ) ; } public int hashCode ( ) { return this . zipFilename == null ? super . hashCode ( ) : this . zipFilename . hashCode ( ) ; } public boolean isPackage ( String qualifiedPackageName ) { if ( this . knownPackageNames != null ) return this . knownPackageNames . includes ( qualifiedPackageName ) ; try { if ( this . zipFile == null ) { if ( org . eclipse . jdt . internal . core . JavaModelManager . ZIP_ACCESS_VERBOSE ) { System . out . println ( "<STR_LIT:(>" + Thread . currentThread ( ) + "<STR_LIT>" + this . zipFilename ) ; } this . zipFile = new ZipFile ( this . zipFilename ) ; this . closeZipFileAtEnd = true ; } this . knownPackageNames = findPackageSet ( this ) ; } catch ( Exception e ) { this . knownPackageNames = new SimpleSet ( ) ; } return this . knownPackageNames . includes ( qualifiedPackageName ) ; } public long lastModified ( ) { if ( this . lastModified == <NUM_LIT:0> ) this . lastModified = new File ( this . zipFilename ) . lastModified ( ) ; return this . lastModified ; } public String toString ( ) { String start = "<STR_LIT>" + this . zipFilename ; if ( this . accessRuleSet == null ) return start ; return start + "<STR_LIT>" + this . accessRuleSet ; } public String debugPathString ( ) { long time = lastModified ( ) ; if ( time == <NUM_LIT:0> ) return this . zipFilename ; return this . zipFilename + '<CHAR_LIT:(>' + ( new Date ( time ) ) + "<STR_LIT:U+0020:U+0020>" + time + '<CHAR_LIT:)>' ; } } </s>
<s> package org . eclipse . jdt . internal . core . builder ; import org . eclipse . core . runtime . * ; public class ImageBuilderInternalException extends RuntimeException { private static final long serialVersionUID = <NUM_LIT> ; protected CoreException coreException ; public ImageBuilderInternalException ( CoreException e ) { this . coreException = e ; } public CoreException getThrowable ( ) { return this . coreException ; } public void printStackTrace ( ) { if ( this . coreException != null ) { System . err . println ( this ) ; System . err . println ( "<STR_LIT>" ) ; this . coreException . printStackTrace ( ) ; } else { super . printStackTrace ( ) ; } } } </s>
<s> package org . eclipse . jdt . internal . core . builder ; import org . eclipse . jdt . core . compiler . CharOperation ; public final class NameSet { public char [ ] [ ] names ; public int elementSize ; public int threshold ; public NameSet ( int size ) { this . elementSize = <NUM_LIT:0> ; this . threshold = size ; int extraRoom = ( int ) ( size * <NUM_LIT> ) ; if ( this . threshold == extraRoom ) extraRoom ++ ; this . names = new char [ extraRoom ] [ ] ; } public char [ ] add ( char [ ] name ) { int length = this . names . length ; int index = CharOperation . hashCode ( name ) % length ; char [ ] current ; while ( ( current = this . names [ index ] ) != null ) { if ( CharOperation . equals ( current , name ) ) return current ; if ( ++ index == length ) index = <NUM_LIT:0> ; } this . names [ index ] = name ; if ( ++ this . elementSize > this . threshold ) rehash ( ) ; return name ; } private void rehash ( ) { NameSet newSet = new NameSet ( this . elementSize * <NUM_LIT:2> ) ; char [ ] current ; for ( int i = this . names . length ; -- i >= <NUM_LIT:0> ; ) if ( ( current = this . names [ i ] ) != null ) newSet . add ( current ) ; this . names = newSet . names ; this . elementSize = newSet . elementSize ; this . threshold = newSet . threshold ; } public String toString ( ) { String s = "<STR_LIT>" ; char [ ] name ; for ( int i = <NUM_LIT:0> , l = this . names . length ; i < l ; i ++ ) if ( ( name = this . names [ i ] ) != null ) s += new String ( name ) + "<STR_LIT:n>" ; return s ; } } </s>
<s> package org . eclipse . jdt . internal . core . builder ; import org . eclipse . core . resources . * ; import org . eclipse . core . runtime . * ; import org . eclipse . jdt . internal . compiler . env . AccessRuleSet ; import org . eclipse . jdt . internal . compiler . env . NameEnvironmentAnswer ; public abstract class ClasspathLocation { static ClasspathLocation forSourceFolder ( IContainer sourceFolder , IContainer outputFolder , char [ ] [ ] inclusionPatterns , char [ ] [ ] exclusionPatterns ) { return new ClasspathMultiDirectory ( sourceFolder , outputFolder , inclusionPatterns , exclusionPatterns ) ; } public static ClasspathLocation forBinaryFolder ( IContainer binaryFolder , boolean isOutputFolder , AccessRuleSet accessRuleSet ) { return new ClasspathDirectory ( binaryFolder , isOutputFolder , accessRuleSet ) ; } static ClasspathLocation forLibrary ( String libraryPathname , long lastModified , AccessRuleSet accessRuleSet ) { return new ClasspathJar ( libraryPathname , lastModified , accessRuleSet ) ; } static ClasspathLocation forLibrary ( String libraryPathname , AccessRuleSet accessRuleSet ) { return forLibrary ( libraryPathname , <NUM_LIT:0> , accessRuleSet ) ; } static ClasspathLocation forLibrary ( IFile library , AccessRuleSet accessRuleSet ) { return new ClasspathJar ( library , accessRuleSet ) ; } public abstract NameEnvironmentAnswer findClass ( String binaryFileName , String qualifiedPackageName , String qualifiedBinaryFileName ) ; public abstract IPath getProjectRelativePath ( ) ; public boolean isOutputFolder ( ) { return false ; } public abstract boolean isPackage ( String qualifiedPackageName ) ; public void cleanup ( ) { } public void reset ( ) { } public abstract String debugPathString ( ) ; } </s>