text
stringlengths 30
1.67M
|
|---|
<s> package org . eclipse . jdt . internal . eval ; public class GlobalVariable { char [ ] typeName ; char [ ] name ; char [ ] initializer ; int declarationStart = - <NUM_LIT:1> , initializerStart = - <NUM_LIT:1> , initExpressionStart ; int initializerLineStart = - <NUM_LIT:1> ; public GlobalVariable ( char [ ] typeName , char [ ] name , char [ ] initializer ) { this . typeName = typeName ; this . name = name ; this . initializer = initializer ; } public char [ ] getInitializer ( ) { return this . initializer ; } public char [ ] getName ( ) { return this . name ; } public char [ ] getTypeName ( ) { return this . typeName ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( this . typeName ) ; buffer . append ( "<STR_LIT:U+0020>" ) ; buffer . append ( this . name ) ; if ( this . initializer != null ) { buffer . append ( "<STR_LIT>" ) ; buffer . append ( this . initializer ) ; } buffer . append ( "<STR_LIT:;>" ) ; return buffer . toString ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . eval ; public class InstallException extends Exception { private static final long serialVersionUID = - <NUM_LIT> ; public InstallException ( ) { super ( ) ; } public InstallException ( String s ) { super ( s ) ; } } </s>
|
<s> package org . eclipse . jdt . core . compiler . batch ; import java . io . PrintWriter ; import org . eclipse . jdt . core . compiler . CompilationProgress ; import org . eclipse . jdt . internal . compiler . batch . Main ; public final class BatchCompiler { public static boolean compile ( String commandLine , PrintWriter outWriter , PrintWriter errWriter , CompilationProgress progress ) { return compile ( Main . tokenize ( commandLine ) , outWriter , errWriter , progress ) ; } public static boolean compile ( String [ ] commandLineArguments , PrintWriter outWriter , PrintWriter errWriter , CompilationProgress progress ) { return Main . compile ( commandLineArguments , outWriter , errWriter , progress ) ; } private BatchCompiler ( ) { } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . batch ; import java . io . File ; import java . io . IOException ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . env . ICompilationUnit ; import org . eclipse . jdt . internal . compiler . problem . AbortCompilationUnit ; import org . eclipse . jdt . internal . compiler . util . Util ; public class CompilationUnit implements ICompilationUnit { public char [ ] contents ; public char [ ] fileName ; public char [ ] mainTypeName ; String encoding ; public String destinationPath ; public CompilationUnit ( char [ ] contents , String fileName , String encoding ) { this ( contents , fileName , encoding , null ) ; } public CompilationUnit ( char [ ] contents , String fileName , String encoding , String destinationPath ) { this . contents = contents ; char [ ] fileNameCharArray = fileName . toCharArray ( ) ; switch ( File . separatorChar ) { case '<CHAR_LIT:/>' : if ( CharOperation . indexOf ( '<STR_LIT:\\>' , fileNameCharArray ) != - <NUM_LIT:1> ) { CharOperation . replace ( fileNameCharArray , '<STR_LIT:\\>' , '<CHAR_LIT:/>' ) ; } break ; case '<STR_LIT:\\>' : if ( CharOperation . indexOf ( '<CHAR_LIT:/>' , fileNameCharArray ) != - <NUM_LIT:1> ) { CharOperation . replace ( fileNameCharArray , '<CHAR_LIT:/>' , '<STR_LIT:\\>' ) ; } } this . fileName = fileNameCharArray ; int start = CharOperation . lastIndexOf ( File . separatorChar , fileNameCharArray ) + <NUM_LIT:1> ; int end = CharOperation . lastIndexOf ( '<CHAR_LIT:.>' , fileNameCharArray ) ; if ( end == - <NUM_LIT:1> ) { end = fileNameCharArray . length ; } this . mainTypeName = CharOperation . subarray ( fileNameCharArray , start , end ) ; this . encoding = encoding ; this . destinationPath = destinationPath ; } public char [ ] getContents ( ) { if ( this . contents != null ) return this . contents ; try { return Util . getFileCharContent ( new File ( new String ( this . fileName ) ) , this . encoding ) ; } catch ( IOException e ) { this . contents = CharOperation . NO_CHAR ; throw new AbortCompilationUnit ( null , e , this . encoding ) ; } } public char [ ] getFileName ( ) { return this . fileName ; } public char [ ] getMainTypeName ( ) { return this . mainTypeName ; } public char [ ] [ ] getPackageName ( ) { return null ; } public String toString ( ) { return "<STR_LIT>" + new String ( this . fileName ) + "<STR_LIT:]>" ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . batch ; import java . io . File ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . env . AccessRestriction ; import org . eclipse . jdt . internal . compiler . env . AccessRuleSet ; import org . eclipse . jdt . internal . compiler . util . SuffixConstants ; public abstract class ClasspathLocation implements FileSystem . Classpath , SuffixConstants { public static final int SOURCE = <NUM_LIT:1> ; public static final int BINARY = <NUM_LIT:2> ; String path ; char [ ] normalizedPath ; public AccessRuleSet accessRuleSet ; public String destinationPath ; protected ClasspathLocation ( AccessRuleSet accessRuleSet , String destinationPath ) { this . accessRuleSet = accessRuleSet ; this . destinationPath = destinationPath ; } protected AccessRestriction fetchAccessRestriction ( String qualifiedBinaryFileName ) { if ( this . accessRuleSet == null ) return null ; char [ ] qualifiedTypeName = qualifiedBinaryFileName . substring ( <NUM_LIT:0> , qualifiedBinaryFileName . length ( ) - SUFFIX_CLASS . length ) . toCharArray ( ) ; if ( File . separatorChar == '<STR_LIT:\\>' ) { CharOperation . replace ( qualifiedTypeName , File . separatorChar , '<CHAR_LIT:/>' ) ; } return this . accessRuleSet . getViolatedRestriction ( qualifiedTypeName ) ; } public int getMode ( ) { return SOURCE | BINARY ; } public int hashCode ( ) { final int prime = <NUM_LIT:31> ; int result = <NUM_LIT:1> ; result = prime * result + this . getMode ( ) ; result = prime * result + ( ( this . path == null ) ? <NUM_LIT:0> : this . path . hashCode ( ) ) ; return result ; } public boolean equals ( Object obj ) { if ( this == obj ) return true ; if ( obj == null ) return false ; if ( getClass ( ) != obj . getClass ( ) ) return false ; ClasspathLocation other = ( ClasspathLocation ) obj ; String localPath = this . getPath ( ) ; String otherPath = other . getPath ( ) ; if ( localPath == null ) { if ( otherPath != null ) return false ; } else if ( ! localPath . equals ( otherPath ) ) return false ; if ( this . getMode ( ) != other . getMode ( ) ) return false ; return true ; } public String getPath ( ) { return this . path ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . batch ; import java . io . File ; import java . io . IOException ; import java . io . InputStream ; import java . util . ArrayList ; import java . util . Enumeration ; import java . util . Hashtable ; import java . util . Iterator ; import java . util . List ; import java . util . zip . ZipEntry ; import java . util . zip . ZipFile ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileReader ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFormatException ; import org . eclipse . jdt . internal . compiler . env . AccessRuleSet ; import org . eclipse . jdt . internal . compiler . env . NameEnvironmentAnswer ; import org . eclipse . jdt . internal . compiler . util . ManifestAnalyzer ; import org . eclipse . jdt . internal . compiler . util . Util ; public class ClasspathJar extends ClasspathLocation { protected File file ; protected ZipFile zipFile ; protected boolean closeZipFileAtEnd ; protected Hashtable packageCache ; public ClasspathJar ( File file , boolean closeZipFileAtEnd , AccessRuleSet accessRuleSet , String destinationPath ) { super ( accessRuleSet , destinationPath ) ; this . file = file ; this . closeZipFileAtEnd = closeZipFileAtEnd ; } public List fetchLinkedJars ( FileSystem . ClasspathSectionProblemReporter problemReporter ) { InputStream inputStream = null ; try { initialize ( ) ; ArrayList result = new ArrayList ( ) ; ZipEntry manifest = this . zipFile . getEntry ( "<STR_LIT>" ) ; if ( manifest != null ) { inputStream = this . zipFile . getInputStream ( manifest ) ; ManifestAnalyzer analyzer = new ManifestAnalyzer ( ) ; boolean success = analyzer . analyzeManifestContents ( inputStream ) ; List calledFileNames = analyzer . getCalledFileNames ( ) ; if ( problemReporter != null ) { if ( ! success || analyzer . getClasspathSectionsCount ( ) == <NUM_LIT:1> && calledFileNames == null ) { problemReporter . invalidClasspathSection ( getPath ( ) ) ; } else if ( analyzer . getClasspathSectionsCount ( ) > <NUM_LIT:1> ) { problemReporter . multipleClasspathSections ( getPath ( ) ) ; } } if ( calledFileNames != null ) { Iterator calledFilesIterator = calledFileNames . iterator ( ) ; String directoryPath = getPath ( ) ; int lastSeparator = directoryPath . lastIndexOf ( File . separatorChar ) ; directoryPath = directoryPath . substring ( <NUM_LIT:0> , lastSeparator + <NUM_LIT:1> ) ; while ( calledFilesIterator . hasNext ( ) ) { result . add ( new ClasspathJar ( new File ( directoryPath + ( String ) calledFilesIterator . next ( ) ) , this . closeZipFileAtEnd , this . accessRuleSet , this . destinationPath ) ) ; } } } return result ; } catch ( IOException e ) { return null ; } finally { if ( inputStream != null ) { try { inputStream . close ( ) ; } catch ( IOException e ) { } } } } public NameEnvironmentAnswer findClass ( char [ ] typeName , String qualifiedPackageName , String qualifiedBinaryFileName ) { return findClass ( typeName , qualifiedPackageName , qualifiedBinaryFileName , false ) ; } public NameEnvironmentAnswer findClass ( char [ ] typeName , String qualifiedPackageName , String qualifiedBinaryFileName , boolean asBinaryOnly ) { if ( ! isPackage ( qualifiedPackageName ) ) return null ; try { ClassFileReader reader = ClassFileReader . read ( this . zipFile , qualifiedBinaryFileName ) ; if ( reader != null ) return new NameEnvironmentAnswer ( reader , fetchAccessRestriction ( qualifiedBinaryFileName ) ) ; } catch ( ClassFormatException e ) { } catch ( IOException e ) { } return null ; } public char [ ] [ ] [ ] findTypeNames ( String qualifiedPackageName ) { if ( ! isPackage ( qualifiedPackageName ) ) return null ; ArrayList answers = new ArrayList ( ) ; nextEntry : for ( Enumeration e = this . zipFile . entries ( ) ; e . hasMoreElements ( ) ; ) { String fileName = ( ( ZipEntry ) e . nextElement ( ) ) . getName ( ) ; int last = fileName . lastIndexOf ( '<CHAR_LIT:/>' ) ; while ( last > <NUM_LIT:0> ) { String packageName = fileName . substring ( <NUM_LIT:0> , last ) ; if ( ! qualifiedPackageName . equals ( packageName ) ) continue nextEntry ; int indexOfDot = fileName . lastIndexOf ( '<CHAR_LIT:.>' ) ; if ( indexOfDot != - <NUM_LIT:1> ) { String typeName = fileName . substring ( last + <NUM_LIT:1> , indexOfDot ) ; char [ ] packageArray = packageName . toCharArray ( ) ; answers . add ( CharOperation . arrayConcat ( CharOperation . splitOn ( '<CHAR_LIT:/>' , packageArray ) , typeName . toCharArray ( ) ) ) ; } } } int size = answers . size ( ) ; if ( size != <NUM_LIT:0> ) { char [ ] [ ] [ ] result = new char [ size ] [ ] [ ] ; answers . toArray ( result ) ; return null ; } return null ; } public void initialize ( ) throws IOException { if ( this . zipFile == null ) { this . zipFile = new ZipFile ( this . file ) ; } } public boolean isPackage ( String qualifiedPackageName ) { if ( this . packageCache != null ) return this . packageCache . containsKey ( qualifiedPackageName ) ; this . packageCache = new Hashtable ( <NUM_LIT> ) ; this . packageCache . put ( Util . EMPTY_STRING , Util . EMPTY_STRING ) ; nextEntry : for ( Enumeration e = this . zipFile . entries ( ) ; e . hasMoreElements ( ) ; ) { String fileName = ( ( ZipEntry ) e . nextElement ( ) ) . getName ( ) ; int last = fileName . lastIndexOf ( '<CHAR_LIT:/>' ) ; while ( last > <NUM_LIT:0> ) { String packageName = fileName . substring ( <NUM_LIT:0> , last ) ; if ( this . packageCache . containsKey ( packageName ) ) continue nextEntry ; this . packageCache . put ( packageName , packageName ) ; last = packageName . lastIndexOf ( '<CHAR_LIT:/>' ) ; } } return this . packageCache . containsKey ( qualifiedPackageName ) ; } public void reset ( ) { if ( this . zipFile != null && this . closeZipFileAtEnd ) { try { this . zipFile . close ( ) ; } catch ( IOException e ) { } this . zipFile = null ; } this . packageCache = null ; } public String toString ( ) { return "<STR_LIT>" + this . file . getPath ( ) ; } public char [ ] normalizedPath ( ) { if ( this . normalizedPath == null ) { String path2 = this . getPath ( ) ; char [ ] rawName = path2 . toCharArray ( ) ; if ( File . separatorChar == '<STR_LIT:\\>' ) { CharOperation . replace ( rawName , '<STR_LIT:\\>' , '<CHAR_LIT:/>' ) ; } this . normalizedPath = CharOperation . subarray ( rawName , <NUM_LIT:0> , CharOperation . lastIndexOf ( '<CHAR_LIT:.>' , rawName ) ) ; } return this . normalizedPath ; } public String getPath ( ) { if ( this . path == null ) { try { this . path = this . file . getCanonicalPath ( ) ; } catch ( IOException e ) { this . path = this . file . getAbsolutePath ( ) ; } } return this . path ; } public int getMode ( ) { return BINARY ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . batch ; import java . io . File ; import java . util . ArrayList ; public class FileFinder { public static String [ ] find ( File f , String pattern ) { ArrayList files = new ArrayList ( ) ; find0 ( f , pattern , files ) ; String [ ] result = new String [ files . size ( ) ] ; files . toArray ( result ) ; return result ; } private static void find0 ( File f , String pattern , ArrayList collector ) { if ( f . isDirectory ( ) ) { String [ ] files = f . list ( ) ; if ( files == null ) return ; for ( int i = <NUM_LIT:0> , max = files . length ; i < max ; i ++ ) { File current = new File ( f , files [ i ] ) ; if ( current . isDirectory ( ) ) { find0 ( current , pattern , collector ) ; } else { if ( current . getName ( ) . toUpperCase ( ) . endsWith ( pattern ) ) { collector . add ( current . getAbsolutePath ( ) ) ; } } } } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . batch ; import java . io . File ; import java . io . IOException ; import java . util . ArrayList ; import java . util . HashSet ; import java . util . Iterator ; import java . util . List ; import java . util . Set ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . env . AccessRuleSet ; import org . eclipse . jdt . internal . compiler . env . INameEnvironment ; import org . eclipse . jdt . internal . compiler . env . NameEnvironmentAnswer ; import org . eclipse . jdt . internal . compiler . util . SuffixConstants ; import org . eclipse . jdt . internal . compiler . util . Util ; public class FileSystem implements INameEnvironment , SuffixConstants { public interface Classpath { char [ ] [ ] [ ] findTypeNames ( String qualifiedPackageName ) ; NameEnvironmentAnswer findClass ( char [ ] typeName , String qualifiedPackageName , String qualifiedBinaryFileName ) ; NameEnvironmentAnswer findClass ( char [ ] typeName , String qualifiedPackageName , String qualifiedBinaryFileName , boolean asBinaryOnly ) ; boolean isPackage ( String qualifiedPackageName ) ; List fetchLinkedJars ( ClasspathSectionProblemReporter problemReporter ) ; void reset ( ) ; char [ ] normalizedPath ( ) ; String getPath ( ) ; void initialize ( ) throws IOException ; } public interface ClasspathSectionProblemReporter { void invalidClasspathSection ( String jarFilePath ) ; void multipleClasspathSections ( String jarFilePath ) ; } public static class ClasspathNormalizer { public static ArrayList normalize ( ArrayList classpaths ) { ArrayList normalizedClasspath = new ArrayList ( ) ; HashSet cache = new HashSet ( ) ; for ( Iterator iterator = classpaths . iterator ( ) ; iterator . hasNext ( ) ; ) { FileSystem . Classpath classpath = ( FileSystem . Classpath ) iterator . next ( ) ; if ( ! cache . contains ( classpath ) ) { normalizedClasspath . add ( classpath ) ; cache . add ( classpath ) ; } } return normalizedClasspath ; } } Classpath [ ] classpaths ; Set knownFileNames ; public FileSystem ( String [ ] classpathNames , String [ ] initialFileNames , String encoding ) { final int classpathSize = classpathNames . length ; this . classpaths = new Classpath [ classpathSize ] ; int counter = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < classpathSize ; i ++ ) { Classpath classpath = getClasspath ( classpathNames [ i ] , encoding , null ) ; try { classpath . initialize ( ) ; this . classpaths [ counter ++ ] = classpath ; } catch ( IOException e ) { } } if ( counter != classpathSize ) { System . arraycopy ( this . classpaths , <NUM_LIT:0> , ( this . classpaths = new Classpath [ counter ] ) , <NUM_LIT:0> , counter ) ; } initializeKnownFileNames ( initialFileNames ) ; } protected FileSystem ( Classpath [ ] paths , String [ ] initialFileNames ) { final int length = paths . length ; int counter = <NUM_LIT:0> ; this . classpaths = new FileSystem . Classpath [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { final Classpath classpath = paths [ i ] ; try { classpath . initialize ( ) ; this . classpaths [ counter ++ ] = classpath ; } catch ( IOException exception ) { } } if ( counter != length ) { System . arraycopy ( this . classpaths , <NUM_LIT:0> , ( this . classpaths = new FileSystem . Classpath [ counter ] ) , <NUM_LIT:0> , counter ) ; } initializeKnownFileNames ( initialFileNames ) ; } public static Classpath getClasspath ( String classpathName , String encoding , AccessRuleSet accessRuleSet ) { return getClasspath ( classpathName , encoding , false , accessRuleSet , null ) ; } public static Classpath getClasspath ( String classpathName , String encoding , boolean isSourceOnly , AccessRuleSet accessRuleSet , String destinationPath ) { Classpath result = null ; File file = new File ( convertPathSeparators ( classpathName ) ) ; if ( file . isDirectory ( ) ) { if ( file . exists ( ) ) { result = new ClasspathDirectory ( file , encoding , isSourceOnly ? ClasspathLocation . SOURCE : ClasspathLocation . SOURCE | ClasspathLocation . BINARY , accessRuleSet , destinationPath == null || destinationPath == Main . NONE ? destinationPath : convertPathSeparators ( destinationPath ) ) ; } } else { if ( Util . isPotentialZipArchive ( classpathName ) ) { if ( isSourceOnly ) { result = new ClasspathSourceJar ( file , true , accessRuleSet , encoding , destinationPath == null || destinationPath == Main . NONE ? destinationPath : convertPathSeparators ( destinationPath ) ) ; } else if ( destinationPath == null ) { result = new ClasspathJar ( file , true , accessRuleSet , null ) ; } } } return result ; } private void initializeKnownFileNames ( String [ ] initialFileNames ) { if ( initialFileNames == null ) { this . knownFileNames = new HashSet ( <NUM_LIT:0> ) ; return ; } this . knownFileNames = new HashSet ( initialFileNames . length * <NUM_LIT:2> ) ; for ( int i = initialFileNames . length ; -- i >= <NUM_LIT:0> ; ) { File compilationUnitFile = new File ( initialFileNames [ i ] ) ; char [ ] fileName = null ; try { fileName = compilationUnitFile . getCanonicalPath ( ) . toCharArray ( ) ; } catch ( IOException e ) { continue ; } char [ ] matchingPathName = null ; final int lastIndexOf = CharOperation . lastIndexOf ( '<CHAR_LIT:.>' , fileName ) ; if ( lastIndexOf != - <NUM_LIT:1> ) { fileName = CharOperation . subarray ( fileName , <NUM_LIT:0> , lastIndexOf ) ; } CharOperation . replace ( fileName , '<STR_LIT:\\>' , '<CHAR_LIT:/>' ) ; boolean globalPathMatches = false ; for ( int j = <NUM_LIT:0> , max = this . classpaths . length ; j < max ; j ++ ) { char [ ] matchCandidate = this . classpaths [ j ] . normalizedPath ( ) ; boolean currentPathMatch = false ; if ( this . classpaths [ j ] instanceof ClasspathDirectory && CharOperation . prefixEquals ( matchCandidate , fileName ) ) { currentPathMatch = true ; if ( matchingPathName == null ) { matchingPathName = matchCandidate ; } else { if ( currentPathMatch ) { if ( matchCandidate . length > matchingPathName . length ) { matchingPathName = matchCandidate ; } } else { if ( ! globalPathMatches && matchCandidate . length < matchingPathName . length ) { matchingPathName = matchCandidate ; } } } if ( currentPathMatch ) { globalPathMatches = true ; } } } if ( matchingPathName == null ) { this . knownFileNames . add ( new String ( fileName ) ) ; } else { this . knownFileNames . add ( new String ( CharOperation . subarray ( fileName , matchingPathName . length , fileName . length ) ) ) ; } matchingPathName = null ; } } public void cleanup ( ) { for ( int i = <NUM_LIT:0> , max = this . classpaths . length ; i < max ; i ++ ) this . classpaths [ i ] . reset ( ) ; } private static String convertPathSeparators ( String path ) { return File . separatorChar == '<CHAR_LIT:/>' ? path . replace ( '<STR_LIT:\\>' , '<CHAR_LIT:/>' ) : path . replace ( '<CHAR_LIT:/>' , '<STR_LIT:\\>' ) ; } private NameEnvironmentAnswer findClass ( String qualifiedTypeName , char [ ] typeName , boolean asBinaryOnly ) { if ( this . knownFileNames . contains ( qualifiedTypeName ) ) return null ; String qualifiedBinaryFileName = qualifiedTypeName + SUFFIX_STRING_class ; String qualifiedPackageName = qualifiedTypeName . length ( ) == typeName . length ? Util . EMPTY_STRING : qualifiedBinaryFileName . substring ( <NUM_LIT:0> , qualifiedTypeName . length ( ) - typeName . length - <NUM_LIT:1> ) ; String qp2 = File . separatorChar == '<CHAR_LIT:/>' ? qualifiedPackageName : qualifiedPackageName . replace ( '<CHAR_LIT:/>' , File . separatorChar ) ; NameEnvironmentAnswer suggestedAnswer = null ; if ( qualifiedPackageName == qp2 ) { for ( int i = <NUM_LIT:0> , length = this . classpaths . length ; i < length ; i ++ ) { NameEnvironmentAnswer answer = this . classpaths [ i ] . findClass ( typeName , qualifiedPackageName , qualifiedBinaryFileName , asBinaryOnly ) ; if ( answer != null ) { if ( ! answer . ignoreIfBetter ( ) ) { if ( answer . isBetter ( suggestedAnswer ) ) return answer ; } else if ( answer . isBetter ( suggestedAnswer ) ) suggestedAnswer = answer ; } } } else { String qb2 = qualifiedBinaryFileName . replace ( '<CHAR_LIT:/>' , File . separatorChar ) ; for ( int i = <NUM_LIT:0> , length = this . classpaths . length ; i < length ; i ++ ) { Classpath p = this . classpaths [ i ] ; NameEnvironmentAnswer answer = ( p instanceof ClasspathJar ) ? p . findClass ( typeName , qualifiedPackageName , qualifiedBinaryFileName , asBinaryOnly ) : p . findClass ( typeName , qp2 , qb2 , asBinaryOnly ) ; if ( answer != null ) { if ( ! answer . ignoreIfBetter ( ) ) { if ( answer . isBetter ( suggestedAnswer ) ) return answer ; } else if ( answer . isBetter ( suggestedAnswer ) ) suggestedAnswer = answer ; } } } if ( suggestedAnswer != null ) return suggestedAnswer ; return null ; } public NameEnvironmentAnswer findType ( char [ ] [ ] compoundName ) { if ( compoundName != null ) return findClass ( new String ( CharOperation . concatWith ( compoundName , '<CHAR_LIT:/>' ) ) , compoundName [ compoundName . length - <NUM_LIT:1> ] , false ) ; return null ; } public char [ ] [ ] [ ] findTypeNames ( char [ ] [ ] packageName ) { char [ ] [ ] [ ] result = null ; if ( packageName != null ) { String qualifiedPackageName = new String ( CharOperation . concatWith ( packageName , '<CHAR_LIT:/>' ) ) ; String qualifiedPackageName2 = File . separatorChar == '<CHAR_LIT:/>' ? qualifiedPackageName : qualifiedPackageName . replace ( '<CHAR_LIT:/>' , File . separatorChar ) ; if ( qualifiedPackageName == qualifiedPackageName2 ) { for ( int i = <NUM_LIT:0> , length = this . classpaths . length ; i < length ; i ++ ) { char [ ] [ ] [ ] answers = this . classpaths [ i ] . findTypeNames ( qualifiedPackageName ) ; if ( answers != null ) { if ( result == null ) { result = answers ; } else { int resultLength = result . length ; int answersLength = answers . length ; System . arraycopy ( result , <NUM_LIT:0> , ( result = new char [ answersLength + resultLength ] [ ] [ ] ) , <NUM_LIT:0> , resultLength ) ; System . arraycopy ( answers , <NUM_LIT:0> , result , resultLength , answersLength ) ; } } } } else { for ( int i = <NUM_LIT:0> , length = this . classpaths . length ; i < length ; i ++ ) { Classpath p = this . classpaths [ i ] ; char [ ] [ ] [ ] answers = ( p instanceof ClasspathJar ) ? p . findTypeNames ( qualifiedPackageName ) : p . findTypeNames ( qualifiedPackageName2 ) ; if ( answers != null ) { if ( result == null ) { result = answers ; } else { int resultLength = result . length ; int answersLength = answers . length ; System . arraycopy ( result , <NUM_LIT:0> , ( result = new char [ answersLength + resultLength ] [ ] [ ] ) , <NUM_LIT:0> , resultLength ) ; System . arraycopy ( answers , <NUM_LIT:0> , result , resultLength , answersLength ) ; } } } } } return result ; } public NameEnvironmentAnswer findType ( char [ ] [ ] compoundName , boolean asBinaryOnly ) { if ( compoundName != null ) return findClass ( new String ( CharOperation . concatWith ( compoundName , '<CHAR_LIT:/>' ) ) , compoundName [ compoundName . length - <NUM_LIT:1> ] , asBinaryOnly ) ; return null ; } public NameEnvironmentAnswer findType ( char [ ] typeName , char [ ] [ ] packageName ) { if ( typeName != null ) return findClass ( new String ( CharOperation . concatWith ( packageName , typeName , '<CHAR_LIT:/>' ) ) , typeName , false ) ; return null ; } public boolean isPackage ( char [ ] [ ] compoundName , char [ ] packageName ) { String qualifiedPackageName = new String ( CharOperation . concatWith ( compoundName , packageName , '<CHAR_LIT:/>' ) ) ; String qp2 = File . separatorChar == '<CHAR_LIT:/>' ? qualifiedPackageName : qualifiedPackageName . replace ( '<CHAR_LIT:/>' , File . separatorChar ) ; if ( qualifiedPackageName == qp2 ) { for ( int i = <NUM_LIT:0> , length = this . classpaths . length ; i < length ; i ++ ) if ( this . classpaths [ i ] . isPackage ( qualifiedPackageName ) ) return true ; } else { for ( int i = <NUM_LIT:0> , length = this . classpaths . length ; i < length ; i ++ ) { Classpath p = this . classpaths [ i ] ; if ( ( p instanceof ClasspathJar ) ? p . isPackage ( qualifiedPackageName ) : p . isPackage ( qp2 ) ) return true ; } } return false ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . batch ; import java . io . File ; import java . io . InputStream ; import java . io . IOException ; import java . util . zip . ZipEntry ; import org . eclipse . jdt . internal . compiler . env . AccessRuleSet ; import org . eclipse . jdt . internal . compiler . env . NameEnvironmentAnswer ; import org . eclipse . jdt . internal . compiler . util . Util ; public class ClasspathSourceJar extends ClasspathJar { private String encoding ; public ClasspathSourceJar ( File file , boolean closeZipFileAtEnd , AccessRuleSet accessRuleSet , String encoding , String destinationPath ) { super ( file , closeZipFileAtEnd , accessRuleSet , destinationPath ) ; this . encoding = encoding ; } public NameEnvironmentAnswer findClass ( char [ ] typeName , String qualifiedPackageName , String qualifiedBinaryFileName , boolean asBinaryOnly ) { if ( ! isPackage ( qualifiedPackageName ) ) return null ; ZipEntry sourceEntry = this . zipFile . getEntry ( qualifiedBinaryFileName . substring ( <NUM_LIT:0> , qualifiedBinaryFileName . length ( ) - <NUM_LIT:6> ) + SUFFIX_STRING_java ) ; if ( sourceEntry != null ) { try { InputStream stream = null ; char [ ] contents = null ; try { stream = this . zipFile . getInputStream ( sourceEntry ) ; contents = Util . getInputStreamAsCharArray ( stream , - <NUM_LIT:1> , this . encoding ) ; } finally { if ( stream != null ) stream . close ( ) ; } return new NameEnvironmentAnswer ( new CompilationUnit ( contents , qualifiedBinaryFileName . substring ( <NUM_LIT:0> , qualifiedBinaryFileName . length ( ) - <NUM_LIT:6> ) + SUFFIX_STRING_java , this . encoding , this . destinationPath ) , fetchAccessRestriction ( qualifiedBinaryFileName ) ) ; } catch ( IOException e ) { } } return null ; } public NameEnvironmentAnswer findClass ( char [ ] typeName , String qualifiedPackageName , String qualifiedBinaryFileName ) { return findClass ( typeName , qualifiedPackageName , qualifiedBinaryFileName , false ) ; } public int getMode ( ) { return SOURCE ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . batch ; import java . io . BufferedInputStream ; import java . io . ByteArrayInputStream ; import java . io . File ; import java . io . FileInputStream ; import java . io . FileNotFoundException ; import java . io . FileOutputStream ; import java . io . FilenameFilter ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . LineNumberReader ; import java . io . OutputStreamWriter ; import java . io . PrintWriter ; import java . io . StringReader ; import java . io . StringWriter ; import java . io . UnsupportedEncodingException ; import java . lang . reflect . Field ; import java . text . DateFormat ; import java . text . MessageFormat ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Comparator ; import java . util . Date ; import java . util . HashMap ; import java . util . HashSet ; import java . util . Iterator ; import java . util . List ; import java . util . Locale ; import java . util . Map ; import java . util . MissingResourceException ; import java . util . Properties ; import java . util . ResourceBundle ; import java . util . Set ; import java . util . StringTokenizer ; import org . eclipse . jdt . core . compiler . CategorizedProblem ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . core . compiler . CompilationProgress ; import org . eclipse . jdt . core . compiler . IProblem ; import org . eclipse . jdt . core . compiler . batch . BatchCompiler ; import org . eclipse . jdt . internal . compiler . AbstractAnnotationProcessorManager ; import org . eclipse . jdt . internal . compiler . ClassFile ; import org . eclipse . jdt . internal . compiler . CompilationResult ; import org . eclipse . jdt . internal . compiler . Compiler ; 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 . batch . FileSystem . Classpath ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . env . AccessRestriction ; import org . eclipse . jdt . internal . compiler . env . AccessRule ; import org . eclipse . jdt . internal . compiler . env . AccessRuleSet ; import org . eclipse . jdt . internal . compiler . env . ICompilationUnit ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . impl . CompilerStats ; import org . eclipse . jdt . internal . compiler . lookup . LookupEnvironment ; import org . eclipse . jdt . internal . compiler . lookup . ReferenceBinding ; import org . eclipse . jdt . internal . compiler . problem . DefaultProblemFactory ; import org . eclipse . jdt . internal . compiler . problem . ProblemReporter ; import org . eclipse . jdt . internal . compiler . problem . ProblemSeverities ; import org . eclipse . jdt . internal . compiler . util . GenericXMLWriter ; import org . eclipse . jdt . internal . compiler . util . HashtableOfInt ; import org . eclipse . jdt . internal . compiler . util . HashtableOfObject ; import org . eclipse . jdt . internal . compiler . util . Messages ; import org . eclipse . jdt . internal . compiler . util . SuffixConstants ; import org . eclipse . jdt . internal . compiler . util . Util ; public class Main implements ProblemSeverities , SuffixConstants { public static class Logger { private PrintWriter err ; private PrintWriter log ; private Main main ; private PrintWriter out ; private HashMap parameters ; int tagBits ; private static final String CLASS = "<STR_LIT:class>" ; private static final String CLASS_FILE = "<STR_LIT>" ; private static final String CLASSPATH = "<STR_LIT>" ; private static final String CLASSPATH_FILE = "<STR_LIT>" ; private static final String CLASSPATH_FOLDER = "<STR_LIT>" ; private static final String CLASSPATH_ID = "<STR_LIT:id>" ; private static final String CLASSPATH_JAR = "<STR_LIT>" ; private static final String CLASSPATHS = "<STR_LIT>" ; private static final String COMMAND_LINE_ARGUMENT = "<STR_LIT>" ; private static final String COMMAND_LINE_ARGUMENTS = "<STR_LIT>" ; private static final String COMPILER = "<STR_LIT>" ; private static final String COMPILER_COPYRIGHT = "<STR_LIT>" ; private static final String COMPILER_NAME = "<STR_LIT:name>" ; private static final String COMPILER_VERSION = "<STR_LIT:version>" ; public static final int EMACS = <NUM_LIT:2> ; private static final String ERROR = "<STR_LIT>" ; private static final String ERROR_TAG = "<STR_LIT:error>" ; private static final String WARNING_TAG = "<STR_LIT>" ; private static final String EXCEPTION = "<STR_LIT>" ; private static final String EXTRA_PROBLEM_TAG = "<STR_LIT>" ; private static final String EXTRA_PROBLEMS = "<STR_LIT>" ; private static final HashtableOfInt FIELD_TABLE = new HashtableOfInt ( ) ; private static final String KEY = "<STR_LIT:key>" ; private static final String MESSAGE = "<STR_LIT:message>" ; private static final String NUMBER_OF_CLASSFILES = "<STR_LIT>" ; private static final String NUMBER_OF_ERRORS = "<STR_LIT>" ; private static final String NUMBER_OF_LINES = "<STR_LIT>" ; private static final String NUMBER_OF_PROBLEMS = "<STR_LIT>" ; private static final String NUMBER_OF_TASKS = "<STR_LIT>" ; private static final String NUMBER_OF_WARNINGS = "<STR_LIT>" ; private static final String OPTION = "<STR_LIT>" ; private static final String OPTIONS = "<STR_LIT>" ; private static final String OUTPUT = "<STR_LIT>" ; private static final String PACKAGE = "<STR_LIT>" ; private static final String PATH = "<STR_LIT:path>" ; private static final String PROBLEM_ARGUMENT = "<STR_LIT>" ; private static final String PROBLEM_ARGUMENT_VALUE = "<STR_LIT:value>" ; private static final String PROBLEM_ARGUMENTS = "<STR_LIT>" ; private static final String PROBLEM_CATEGORY_ID = "<STR_LIT>" ; private static final String ID = "<STR_LIT:id>" ; private static final String PROBLEM_ID = "<STR_LIT>" ; private static final String PROBLEM_LINE = "<STR_LIT>" ; private static final String PROBLEM_OPTION_KEY = "<STR_LIT>" ; private static final String PROBLEM_MESSAGE = "<STR_LIT:message>" ; private static final String PROBLEM_SEVERITY = "<STR_LIT>" ; private static final String PROBLEM_SOURCE_END = "<STR_LIT>" ; private static final String PROBLEM_SOURCE_START = "<STR_LIT>" ; private static final String PROBLEM_SUMMARY = "<STR_LIT>" ; private static final String PROBLEM_TAG = "<STR_LIT>" ; private static final String PROBLEMS = "<STR_LIT>" ; private static final String SOURCE = "<STR_LIT:source>" ; private static final String SOURCE_CONTEXT = "<STR_LIT>" ; private static final String SOURCE_END = "<STR_LIT>" ; private static final String SOURCE_START = "<STR_LIT>" ; private static final String SOURCES = "<STR_LIT>" ; private static final String STATS = "<STR_LIT>" ; private static final String TASK = "<STR_LIT>" ; private static final String TASKS = "<STR_LIT>" ; private static final String TIME = "<STR_LIT>" ; private static final String VALUE = "<STR_LIT:value>" ; private static final String WARNING = "<STR_LIT>" ; public static final int XML = <NUM_LIT:1> ; private static final String XML_DTD_DECLARATION = "<STR_LIT>" ; static { try { Class c = IProblem . class ; Field [ ] fields = c . getFields ( ) ; for ( int i = <NUM_LIT:0> , max = fields . length ; i < max ; i ++ ) { Field field = fields [ i ] ; if ( field . getType ( ) . equals ( Integer . TYPE ) ) { Integer value = ( Integer ) field . get ( null ) ; int key2 = value . intValue ( ) & IProblem . IgnoreCategoriesMask ; if ( key2 == <NUM_LIT:0> ) { key2 = Integer . MAX_VALUE ; } Logger . FIELD_TABLE . put ( key2 , field . getName ( ) ) ; } } } catch ( SecurityException e ) { e . printStackTrace ( ) ; } catch ( IllegalArgumentException e ) { e . printStackTrace ( ) ; } catch ( IllegalAccessException e ) { e . printStackTrace ( ) ; } } public Logger ( Main main , PrintWriter out , PrintWriter err ) { this . out = out ; this . err = err ; this . parameters = new HashMap ( ) ; this . main = main ; } public String buildFileName ( String outputPath , String relativeFileName ) { char fileSeparatorChar = File . separatorChar ; String fileSeparator = File . separator ; outputPath = outputPath . replace ( '<CHAR_LIT:/>' , fileSeparatorChar ) ; StringBuffer outDir = new StringBuffer ( outputPath ) ; if ( ! outputPath . endsWith ( fileSeparator ) ) { outDir . append ( fileSeparator ) ; } StringTokenizer tokenizer = new StringTokenizer ( relativeFileName , fileSeparator ) ; String token = tokenizer . nextToken ( ) ; while ( tokenizer . hasMoreTokens ( ) ) { outDir . append ( token ) . append ( fileSeparator ) ; token = tokenizer . nextToken ( ) ; } return outDir . append ( token ) . toString ( ) ; } public void close ( ) { if ( this . log != null ) { if ( ( this . tagBits & Logger . XML ) != <NUM_LIT:0> ) { endTag ( Logger . COMPILER ) ; flush ( ) ; } this . log . close ( ) ; } } public void compiling ( ) { printlnOut ( this . main . bind ( "<STR_LIT>" ) ) ; } private void endLoggingExtraProblems ( ) { endTag ( Logger . EXTRA_PROBLEMS ) ; } private void endLoggingProblems ( ) { endTag ( Logger . PROBLEMS ) ; } public void endLoggingSource ( ) { if ( ( this . tagBits & Logger . XML ) != <NUM_LIT:0> ) { endTag ( Logger . SOURCE ) ; } } public void endLoggingSources ( ) { if ( ( this . tagBits & Logger . XML ) != <NUM_LIT:0> ) { endTag ( Logger . SOURCES ) ; } } public void endLoggingTasks ( ) { if ( ( this . tagBits & Logger . XML ) != <NUM_LIT:0> ) { endTag ( Logger . TASKS ) ; } } private void endTag ( String name ) { if ( this . log != null ) { ( ( GenericXMLWriter ) this . log ) . endTag ( name , true , true ) ; } } private String errorReportSource ( CategorizedProblem problem , char [ ] unitSource , int bits ) { int startPosition = problem . getSourceStart ( ) ; int endPosition = problem . getSourceEnd ( ) ; if ( unitSource == null ) { if ( problem . getOriginatingFileName ( ) != null ) { try { unitSource = Util . getFileCharContent ( new File ( new String ( problem . getOriginatingFileName ( ) ) ) , null ) ; } catch ( IOException e ) { } } } int length ; if ( ( startPosition > endPosition ) || ( ( startPosition < <NUM_LIT:0> ) && ( endPosition < <NUM_LIT:0> ) ) || ( unitSource == null ) || ( length = unitSource . length ) == <NUM_LIT:0> ) return Messages . problem_noSourceInformation ; StringBuffer errorBuffer = new StringBuffer ( ) ; if ( ( bits & Main . Logger . EMACS ) == <NUM_LIT:0> ) { errorBuffer . append ( '<CHAR_LIT:U+0020>' ) . append ( Messages . bind ( Messages . problem_atLine , String . valueOf ( problem . getSourceLineNumber ( ) ) ) ) ; errorBuffer . append ( Util . LINE_SEPARATOR ) ; } errorBuffer . append ( '<STR_LIT:\t>' ) ; char c ; final char SPACE = '<CHAR_LIT:U+0020>' ; final char MARK = '<CHAR_LIT>' ; final char TAB = '<STR_LIT:\t>' ; int begin ; int end ; for ( begin = startPosition >= length ? length - <NUM_LIT:1> : startPosition ; begin > <NUM_LIT:0> ; begin -- ) { if ( ( c = unitSource [ begin - <NUM_LIT:1> ] ) == '<STR_LIT:\n>' || c == '<STR_LIT>' ) break ; } for ( end = endPosition >= length ? length - <NUM_LIT:1> : endPosition ; end + <NUM_LIT:1> < length ; end ++ ) { if ( ( c = unitSource [ end + <NUM_LIT:1> ] ) == '<STR_LIT>' || c == '<STR_LIT:\n>' ) break ; } while ( ( c = unitSource [ begin ] ) == '<CHAR_LIT:U+0020>' || c == '<STR_LIT:\t>' ) begin ++ ; errorBuffer . append ( unitSource , begin , end - begin + <NUM_LIT:1> ) ; errorBuffer . append ( Util . LINE_SEPARATOR ) . append ( "<STR_LIT:t>" ) ; for ( int i = begin ; i < startPosition ; i ++ ) { errorBuffer . append ( ( unitSource [ i ] == TAB ) ? TAB : SPACE ) ; } for ( int i = startPosition ; i <= ( endPosition >= length ? length - <NUM_LIT:1> : endPosition ) ; i ++ ) { errorBuffer . append ( MARK ) ; } return errorBuffer . toString ( ) ; } private void extractContext ( CategorizedProblem problem , char [ ] unitSource ) { int startPosition = problem . getSourceStart ( ) ; int endPosition = problem . getSourceEnd ( ) ; if ( unitSource == null ) { if ( problem . getOriginatingFileName ( ) != null ) { try { unitSource = Util . getFileCharContent ( new File ( new String ( problem . getOriginatingFileName ( ) ) ) , null ) ; } catch ( IOException e ) { } } } int length ; if ( ( startPosition > endPosition ) || ( ( startPosition < <NUM_LIT:0> ) && ( endPosition < <NUM_LIT:0> ) ) || ( unitSource == null ) || ( ( length = unitSource . length ) <= <NUM_LIT:0> ) || ( endPosition > length ) ) { this . parameters . put ( Logger . VALUE , Messages . problem_noSourceInformation ) ; this . parameters . put ( Logger . SOURCE_START , "<STR_LIT:-1>" ) ; this . parameters . put ( Logger . SOURCE_END , "<STR_LIT:-1>" ) ; printTag ( Logger . SOURCE_CONTEXT , this . parameters , true , true ) ; return ; } char c ; int begin , end ; for ( begin = startPosition >= length ? length - <NUM_LIT:1> : startPosition ; begin > <NUM_LIT:0> ; begin -- ) { if ( ( c = unitSource [ begin - <NUM_LIT:1> ] ) == '<STR_LIT:\n>' || c == '<STR_LIT>' ) break ; } for ( end = endPosition >= length ? length - <NUM_LIT:1> : endPosition ; end + <NUM_LIT:1> < length ; end ++ ) { if ( ( c = unitSource [ end + <NUM_LIT:1> ] ) == '<STR_LIT>' || c == '<STR_LIT:\n>' ) break ; } while ( ( c = unitSource [ begin ] ) == '<CHAR_LIT:U+0020>' || c == '<STR_LIT:\t>' ) begin ++ ; while ( ( c = unitSource [ end ] ) == '<CHAR_LIT:U+0020>' || c == '<STR_LIT:\t>' ) end -- ; StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( unitSource , begin , end - begin + <NUM_LIT:1> ) ; this . parameters . put ( Logger . VALUE , String . valueOf ( buffer ) ) ; this . parameters . put ( Logger . SOURCE_START , Integer . toString ( startPosition - begin ) ) ; this . parameters . put ( Logger . SOURCE_END , Integer . toString ( endPosition - begin ) ) ; printTag ( Logger . SOURCE_CONTEXT , this . parameters , true , true ) ; } public void flush ( ) { this . out . flush ( ) ; this . err . flush ( ) ; if ( this . log != null ) { this . log . flush ( ) ; } } private String getFieldName ( int id ) { int key2 = id & IProblem . IgnoreCategoriesMask ; if ( key2 == <NUM_LIT:0> ) { key2 = Integer . MAX_VALUE ; } return ( String ) Logger . FIELD_TABLE . get ( key2 ) ; } private String getProblemOptionKey ( int problemID ) { int irritant = ProblemReporter . getIrritant ( problemID ) ; return CompilerOptions . optionKeyFromIrritant ( irritant ) ; } public void logAverage ( ) { Arrays . sort ( this . main . compilerStats ) ; long lineCount = this . main . compilerStats [ <NUM_LIT:0> ] . lineCount ; final int length = this . main . maxRepetition ; long sum = <NUM_LIT:0> ; long parseSum = <NUM_LIT:0> , resolveSum = <NUM_LIT:0> , analyzeSum = <NUM_LIT:0> , generateSum = <NUM_LIT:0> ; for ( int i = <NUM_LIT:1> , max = length - <NUM_LIT:1> ; i < max ; i ++ ) { CompilerStats stats = this . main . compilerStats [ i ] ; sum += stats . elapsedTime ( ) ; parseSum += stats . parseTime ; resolveSum += stats . resolveTime ; analyzeSum += stats . analyzeTime ; generateSum += stats . generateTime ; } long time = sum / ( length - <NUM_LIT:2> ) ; long parseTime = parseSum / ( length - <NUM_LIT:2> ) ; long resolveTime = resolveSum / ( length - <NUM_LIT:2> ) ; long analyzeTime = analyzeSum / ( length - <NUM_LIT:2> ) ; long generateTime = generateSum / ( length - <NUM_LIT:2> ) ; printlnOut ( this . main . bind ( "<STR_LIT>" , new String [ ] { String . valueOf ( lineCount ) , String . valueOf ( time ) , String . valueOf ( ( ( int ) ( lineCount * <NUM_LIT> / time ) ) / <NUM_LIT> ) , } ) ) ; if ( ( this . main . timing & Main . TIMING_DETAILED ) != <NUM_LIT:0> ) { printlnOut ( this . main . bind ( "<STR_LIT>" , new String [ ] { String . valueOf ( parseTime ) , String . valueOf ( ( ( int ) ( parseTime * <NUM_LIT> / time ) ) / <NUM_LIT> ) , String . valueOf ( resolveTime ) , String . valueOf ( ( ( int ) ( resolveTime * <NUM_LIT> / time ) ) / <NUM_LIT> ) , String . valueOf ( analyzeTime ) , String . valueOf ( ( ( int ) ( analyzeTime * <NUM_LIT> / time ) ) / <NUM_LIT> ) , String . valueOf ( generateTime ) , String . valueOf ( ( ( int ) ( generateTime * <NUM_LIT> / time ) ) / <NUM_LIT> ) , } ) ) ; } } public void logClassFile ( boolean generatePackagesStructure , String outputPath , String relativeFileName ) { if ( ( this . tagBits & Logger . XML ) != <NUM_LIT:0> ) { String fileName = null ; if ( generatePackagesStructure ) { fileName = buildFileName ( outputPath , relativeFileName ) ; } else { char fileSeparatorChar = File . separatorChar ; String fileSeparator = File . separator ; outputPath = outputPath . replace ( '<CHAR_LIT:/>' , fileSeparatorChar ) ; int indexOfPackageSeparator = relativeFileName . lastIndexOf ( fileSeparatorChar ) ; if ( indexOfPackageSeparator == - <NUM_LIT:1> ) { if ( outputPath . endsWith ( fileSeparator ) ) { fileName = outputPath + relativeFileName ; } else { fileName = outputPath + fileSeparator + relativeFileName ; } } else { int length = relativeFileName . length ( ) ; if ( outputPath . endsWith ( fileSeparator ) ) { fileName = outputPath + relativeFileName . substring ( indexOfPackageSeparator + <NUM_LIT:1> , length ) ; } else { fileName = outputPath + fileSeparator + relativeFileName . substring ( indexOfPackageSeparator + <NUM_LIT:1> , length ) ; } } } File f = new File ( fileName ) ; try { this . parameters . put ( Logger . PATH , f . getCanonicalPath ( ) ) ; printTag ( Logger . CLASS_FILE , this . parameters , true , true ) ; } catch ( IOException e ) { logNoClassFileCreated ( outputPath , relativeFileName , e ) ; } } } public void logClasspath ( FileSystem . Classpath [ ] classpaths ) { if ( classpaths == null ) return ; if ( ( this . tagBits & Logger . XML ) != <NUM_LIT:0> ) { final int length = classpaths . length ; if ( length != <NUM_LIT:0> ) { printTag ( Logger . CLASSPATHS , null , true , false ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { String classpath = classpaths [ i ] . getPath ( ) ; this . parameters . put ( Logger . PATH , classpath ) ; File f = new File ( classpath ) ; String id = null ; if ( f . isFile ( ) ) { if ( Util . isPotentialZipArchive ( classpath ) ) { id = Logger . CLASSPATH_JAR ; } else { id = Logger . CLASSPATH_FILE ; } } else if ( f . isDirectory ( ) ) { id = Logger . CLASSPATH_FOLDER ; } if ( id != null ) { this . parameters . put ( Logger . CLASSPATH_ID , id ) ; printTag ( Logger . CLASSPATH , this . parameters , true , true ) ; } } endTag ( Logger . CLASSPATHS ) ; } } } public void logCommandLineArguments ( String [ ] commandLineArguments ) { if ( commandLineArguments == null ) return ; if ( ( this . tagBits & Logger . XML ) != <NUM_LIT:0> ) { final int length = commandLineArguments . length ; if ( length != <NUM_LIT:0> ) { printTag ( Logger . COMMAND_LINE_ARGUMENTS , null , true , false ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { this . parameters . put ( Logger . VALUE , commandLineArguments [ i ] ) ; printTag ( Logger . COMMAND_LINE_ARGUMENT , this . parameters , true , true ) ; } endTag ( Logger . COMMAND_LINE_ARGUMENTS ) ; } } } public void logException ( Exception e ) { StringWriter writer = new StringWriter ( ) ; PrintWriter printWriter = new PrintWriter ( writer ) ; e . printStackTrace ( printWriter ) ; printWriter . flush ( ) ; printWriter . close ( ) ; final String stackTrace = writer . toString ( ) ; if ( ( this . tagBits & Logger . XML ) != <NUM_LIT:0> ) { LineNumberReader reader = new LineNumberReader ( new StringReader ( stackTrace ) ) ; String line ; int i = <NUM_LIT:0> ; StringBuffer buffer = new StringBuffer ( ) ; String message = e . getMessage ( ) ; if ( message != null ) { buffer . append ( message ) . append ( Util . LINE_SEPARATOR ) ; } try { while ( ( line = reader . readLine ( ) ) != null && i < <NUM_LIT:4> ) { buffer . append ( line ) . append ( Util . LINE_SEPARATOR ) ; i ++ ; } reader . close ( ) ; } catch ( IOException e1 ) { } message = buffer . toString ( ) ; this . parameters . put ( Logger . MESSAGE , message ) ; this . parameters . put ( Logger . CLASS , e . getClass ( ) ) ; printTag ( Logger . EXCEPTION , this . parameters , true , true ) ; } String message = e . getMessage ( ) ; if ( message == null ) { this . printlnErr ( stackTrace ) ; } else { this . printlnErr ( message ) ; } } private void logExtraProblem ( CategorizedProblem problem , int localErrorCount , int globalErrorCount ) { char [ ] originatingFileName = problem . getOriginatingFileName ( ) ; if ( originatingFileName == null ) { if ( problem . isError ( ) ) { printErr ( this . main . bind ( "<STR_LIT>" , Integer . toString ( globalErrorCount ) ) ) ; } else { printErr ( this . main . bind ( "<STR_LIT>" , Integer . toString ( globalErrorCount ) ) ) ; } printErr ( "<STR_LIT:U+0020>" ) ; this . printlnErr ( problem . getMessage ( ) ) ; } else { String fileName = new String ( originatingFileName ) ; if ( ( this . tagBits & Logger . EMACS ) != <NUM_LIT:0> ) { String result = fileName + "<STR_LIT::>" + problem . getSourceLineNumber ( ) + "<STR_LIT::U+0020>" + ( problem . isError ( ) ? this . main . bind ( "<STR_LIT>" ) : this . main . bind ( "<STR_LIT>" ) ) + "<STR_LIT::U+0020>" + problem . getMessage ( ) ; this . printlnErr ( result ) ; final String errorReportSource = errorReportSource ( problem , null , this . tagBits ) ; this . printlnErr ( errorReportSource ) ; } else { if ( localErrorCount == <NUM_LIT:0> ) { this . printlnErr ( "<STR_LIT>" ) ; } printErr ( problem . isError ( ) ? this . main . bind ( "<STR_LIT>" , Integer . toString ( globalErrorCount ) , new String ( fileName ) ) : this . main . bind ( "<STR_LIT>" , Integer . toString ( globalErrorCount ) , new String ( fileName ) ) ) ; final String errorReportSource = errorReportSource ( problem , null , <NUM_LIT:0> ) ; this . printlnErr ( errorReportSource ) ; this . printlnErr ( problem . getMessage ( ) ) ; this . printlnErr ( "<STR_LIT>" ) ; } } } public void loggingExtraProblems ( Main currentMain ) { ArrayList problems = currentMain . extraProblems ; final int count = problems . size ( ) ; int localProblemCount = <NUM_LIT:0> ; if ( count != <NUM_LIT:0> ) { int errors = <NUM_LIT:0> ; int warnings = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < count ; i ++ ) { CategorizedProblem problem = ( CategorizedProblem ) problems . get ( i ) ; if ( problem != null ) { currentMain . globalProblemsCount ++ ; logExtraProblem ( problem , localProblemCount , currentMain . globalProblemsCount ) ; localProblemCount ++ ; if ( problem . isError ( ) ) { errors ++ ; currentMain . globalErrorsCount ++ ; } else if ( problem . isWarning ( ) ) { currentMain . globalWarningsCount ++ ; warnings ++ ; } } } if ( ( this . tagBits & Logger . XML ) != <NUM_LIT:0> ) { if ( ( errors + warnings ) != <NUM_LIT:0> ) { startLoggingExtraProblems ( count ) ; for ( int i = <NUM_LIT:0> ; i < count ; i ++ ) { CategorizedProblem problem = ( CategorizedProblem ) problems . get ( i ) ; if ( problem != null ) { if ( problem . getID ( ) != IProblem . Task ) { logXmlExtraProblem ( problem , localProblemCount , currentMain . globalProblemsCount ) ; } } } endLoggingExtraProblems ( ) ; } } } } public void logIncorrectVMVersionForAnnotationProcessing ( ) { if ( ( this . tagBits & Logger . XML ) != <NUM_LIT:0> ) { this . parameters . put ( Logger . MESSAGE , this . main . bind ( "<STR_LIT>" ) ) ; printTag ( Logger . ERROR_TAG , this . parameters , true , true ) ; } this . printlnErr ( this . main . bind ( "<STR_LIT>" ) ) ; } public void logNoClassFileCreated ( String outputDir , String relativeFileName , IOException e ) { if ( ( this . tagBits & Logger . XML ) != <NUM_LIT:0> ) { this . parameters . put ( Logger . MESSAGE , this . main . bind ( "<STR_LIT>" , new String [ ] { outputDir , relativeFileName , e . getMessage ( ) } ) ) ; printTag ( Logger . ERROR_TAG , this . parameters , true , true ) ; } this . printlnErr ( this . main . bind ( "<STR_LIT>" , new String [ ] { outputDir , relativeFileName , e . getMessage ( ) } ) ) ; } public void logNumberOfClassFilesGenerated ( int exportedClassFilesCounter ) { if ( ( this . tagBits & Logger . XML ) != <NUM_LIT:0> ) { this . parameters . put ( Logger . VALUE , new Integer ( exportedClassFilesCounter ) ) ; printTag ( Logger . NUMBER_OF_CLASSFILES , this . parameters , true , true ) ; } if ( exportedClassFilesCounter == <NUM_LIT:1> ) { printlnOut ( this . main . bind ( "<STR_LIT>" ) ) ; } else { printlnOut ( this . main . bind ( "<STR_LIT>" , String . valueOf ( exportedClassFilesCounter ) ) ) ; } } public void logOptions ( Map options ) { if ( ( this . tagBits & Logger . XML ) != <NUM_LIT:0> ) { printTag ( Logger . OPTIONS , null , true , false ) ; final Set entriesSet = options . entrySet ( ) ; Object [ ] entries = entriesSet . toArray ( ) ; Arrays . sort ( entries , new Comparator ( ) { public int compare ( Object o1 , Object o2 ) { Map . Entry entry1 = ( Map . Entry ) o1 ; Map . Entry entry2 = ( Map . Entry ) o2 ; return ( ( String ) entry1 . getKey ( ) ) . compareTo ( ( String ) entry2 . getKey ( ) ) ; } } ) ; for ( int i = <NUM_LIT:0> , max = entries . length ; i < max ; i ++ ) { Map . Entry entry = ( Map . Entry ) entries [ i ] ; String key = ( String ) entry . getKey ( ) ; this . parameters . put ( Logger . KEY , key ) ; this . parameters . put ( Logger . VALUE , entry . getValue ( ) ) ; printTag ( Logger . OPTION , this . parameters , true , true ) ; } endTag ( Logger . OPTIONS ) ; } } public void logPendingError ( String error ) { if ( ( this . tagBits & Logger . XML ) != <NUM_LIT:0> ) { this . parameters . put ( Logger . MESSAGE , error ) ; printTag ( Logger . ERROR_TAG , this . parameters , true , true ) ; } this . printlnErr ( error ) ; } public void logWarning ( String message ) { if ( ( this . tagBits & Logger . XML ) != <NUM_LIT:0> ) { this . parameters . put ( Logger . MESSAGE , message ) ; printTag ( Logger . WARNING_TAG , this . parameters , true , true ) ; } this . printlnOut ( message ) ; } private void logProblem ( CategorizedProblem problem , int localErrorCount , int globalErrorCount , char [ ] unitSource ) { if ( ( this . tagBits & Logger . EMACS ) != <NUM_LIT:0> ) { String result = ( new String ( problem . getOriginatingFileName ( ) ) + "<STR_LIT::>" + problem . getSourceLineNumber ( ) + "<STR_LIT::U+0020>" + ( problem . isError ( ) ? this . main . bind ( "<STR_LIT>" ) : this . main . bind ( "<STR_LIT>" ) ) + "<STR_LIT::U+0020>" + problem . getMessage ( ) ) ; this . printlnErr ( result ) ; final String errorReportSource = errorReportSource ( problem , unitSource , this . tagBits ) ; if ( errorReportSource . length ( ) != <NUM_LIT:0> ) this . printlnErr ( errorReportSource ) ; } else { if ( localErrorCount == <NUM_LIT:0> ) { this . printlnErr ( "<STR_LIT>" ) ; } printErr ( problem . isError ( ) ? this . main . bind ( "<STR_LIT>" , Integer . toString ( globalErrorCount ) , new String ( problem . getOriginatingFileName ( ) ) ) : this . main . bind ( "<STR_LIT>" , Integer . toString ( globalErrorCount ) , new String ( problem . getOriginatingFileName ( ) ) ) ) ; try { final String errorReportSource = errorReportSource ( problem , unitSource , <NUM_LIT:0> ) ; this . printlnErr ( errorReportSource ) ; this . printlnErr ( problem . getMessage ( ) ) ; } catch ( Exception e ) { this . printlnErr ( this . main . bind ( "<STR_LIT>" , problem . toString ( ) ) ) ; } this . printlnErr ( "<STR_LIT>" ) ; } } public int logProblems ( CategorizedProblem [ ] problems , char [ ] unitSource , Main currentMain ) { final int count = problems . length ; int localErrorCount = <NUM_LIT:0> ; int localProblemCount = <NUM_LIT:0> ; if ( count != <NUM_LIT:0> ) { int errors = <NUM_LIT:0> ; int warnings = <NUM_LIT:0> ; int tasks = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < count ; i ++ ) { CategorizedProblem problem = problems [ i ] ; if ( problem != null ) { currentMain . globalProblemsCount ++ ; logProblem ( problem , localProblemCount , currentMain . globalProblemsCount , unitSource ) ; localProblemCount ++ ; if ( problem . isError ( ) ) { localErrorCount ++ ; errors ++ ; currentMain . globalErrorsCount ++ ; } else if ( problem . getID ( ) == IProblem . Task ) { currentMain . globalTasksCount ++ ; tasks ++ ; } else { currentMain . globalWarningsCount ++ ; warnings ++ ; } } } if ( ( this . tagBits & Logger . XML ) != <NUM_LIT:0> ) { if ( ( errors + warnings ) != <NUM_LIT:0> ) { startLoggingProblems ( errors , warnings ) ; for ( int i = <NUM_LIT:0> ; i < count ; i ++ ) { CategorizedProblem problem = problems [ i ] ; if ( problem != null ) { if ( problem . getID ( ) != IProblem . Task ) { logXmlProblem ( problem , unitSource ) ; } } } endLoggingProblems ( ) ; } if ( tasks != <NUM_LIT:0> ) { startLoggingTasks ( tasks ) ; for ( int i = <NUM_LIT:0> ; i < count ; i ++ ) { CategorizedProblem problem = problems [ i ] ; if ( problem != null ) { if ( problem . getID ( ) == IProblem . Task ) { logXmlTask ( problem , unitSource ) ; } } } endLoggingTasks ( ) ; } } } return localErrorCount ; } public void logProblemsSummary ( int globalProblemsCount , int globalErrorsCount , int globalWarningsCount , int globalTasksCount ) { if ( ( this . tagBits & Logger . XML ) != <NUM_LIT:0> ) { this . parameters . put ( Logger . NUMBER_OF_PROBLEMS , new Integer ( globalProblemsCount ) ) ; this . parameters . put ( Logger . NUMBER_OF_ERRORS , new Integer ( globalErrorsCount ) ) ; this . parameters . put ( Logger . NUMBER_OF_WARNINGS , new Integer ( globalWarningsCount ) ) ; this . parameters . put ( Logger . NUMBER_OF_TASKS , new Integer ( globalTasksCount ) ) ; printTag ( Logger . PROBLEM_SUMMARY , this . parameters , true , true ) ; } if ( globalProblemsCount == <NUM_LIT:1> ) { String message = null ; if ( globalErrorsCount == <NUM_LIT:1> ) { message = this . main . bind ( "<STR_LIT>" ) ; } else { message = this . main . bind ( "<STR_LIT>" ) ; } printErr ( this . main . bind ( "<STR_LIT>" , message ) ) ; } else { String errorMessage = null ; String warningMessage = null ; if ( globalErrorsCount > <NUM_LIT:0> ) { if ( globalErrorsCount == <NUM_LIT:1> ) { errorMessage = this . main . bind ( "<STR_LIT>" ) ; } else { errorMessage = this . main . bind ( "<STR_LIT>" , String . valueOf ( globalErrorsCount ) ) ; } } int warningsNumber = globalWarningsCount + globalTasksCount ; if ( warningsNumber > <NUM_LIT:0> ) { if ( warningsNumber == <NUM_LIT:1> ) { warningMessage = this . main . bind ( "<STR_LIT>" ) ; } else { warningMessage = this . main . bind ( "<STR_LIT>" , String . valueOf ( warningsNumber ) ) ; } } if ( errorMessage == null || warningMessage == null ) { if ( errorMessage == null ) { printErr ( this . main . bind ( "<STR_LIT>" , String . valueOf ( globalProblemsCount ) , warningMessage ) ) ; } else { printErr ( this . main . bind ( "<STR_LIT>" , String . valueOf ( globalProblemsCount ) , errorMessage ) ) ; } } else { printErr ( this . main . bind ( "<STR_LIT>" , new String [ ] { String . valueOf ( globalProblemsCount ) , errorMessage , warningMessage } ) ) ; } } if ( ( this . tagBits & Logger . EMACS ) != <NUM_LIT:0> ) { this . printlnErr ( ) ; } } public void logProgress ( ) { printOut ( '<CHAR_LIT:.>' ) ; } public void logRepetition ( int i , int repetitions ) { printlnOut ( this . main . bind ( "<STR_LIT>" , String . valueOf ( i + <NUM_LIT:1> ) , String . valueOf ( repetitions ) ) ) ; } public void logTiming ( CompilerStats compilerStats ) { long time = compilerStats . elapsedTime ( ) ; long lineCount = compilerStats . lineCount ; if ( ( this . tagBits & Logger . XML ) != <NUM_LIT:0> ) { this . parameters . put ( Logger . VALUE , new Long ( time ) ) ; printTag ( Logger . TIME , this . parameters , true , true ) ; this . parameters . put ( Logger . VALUE , new Long ( lineCount ) ) ; printTag ( Logger . NUMBER_OF_LINES , this . parameters , true , true ) ; } if ( lineCount != <NUM_LIT:0> ) { printlnOut ( this . main . bind ( "<STR_LIT>" , new String [ ] { String . valueOf ( lineCount ) , String . valueOf ( time ) , String . valueOf ( ( ( int ) ( lineCount * <NUM_LIT> / time ) ) / <NUM_LIT> ) , } ) ) ; } else { printlnOut ( this . main . bind ( "<STR_LIT>" , new String [ ] { String . valueOf ( time ) , } ) ) ; } if ( ( this . main . timing & Main . TIMING_DETAILED ) != <NUM_LIT:0> ) { printlnOut ( this . main . bind ( "<STR_LIT>" , new String [ ] { String . valueOf ( compilerStats . parseTime ) , String . valueOf ( ( ( int ) ( compilerStats . parseTime * <NUM_LIT> / time ) ) / <NUM_LIT> ) , String . valueOf ( compilerStats . resolveTime ) , String . valueOf ( ( ( int ) ( compilerStats . resolveTime * <NUM_LIT> / time ) ) / <NUM_LIT> ) , String . valueOf ( compilerStats . analyzeTime ) , String . valueOf ( ( ( int ) ( compilerStats . analyzeTime * <NUM_LIT> / time ) ) / <NUM_LIT> ) , String . valueOf ( compilerStats . generateTime ) , String . valueOf ( ( ( int ) ( compilerStats . generateTime * <NUM_LIT> / time ) ) / <NUM_LIT> ) , } ) ) ; } } public void logUsage ( String usage ) { printlnOut ( usage ) ; } public void logVersion ( final boolean printToOut ) { if ( this . log != null && ( this . tagBits & Logger . XML ) == <NUM_LIT:0> ) { final String version = this . main . bind ( "<STR_LIT>" , new String [ ] { this . main . bind ( "<STR_LIT>" ) , this . main . bind ( "<STR_LIT>" ) , this . main . bind ( "<STR_LIT>" ) } ) ; this . log . println ( "<STR_LIT>" + version ) ; if ( printToOut ) { this . out . println ( version ) ; this . out . flush ( ) ; } } else if ( printToOut ) { final String version = this . main . bind ( "<STR_LIT>" , new String [ ] { this . main . bind ( "<STR_LIT>" ) , this . main . bind ( "<STR_LIT>" ) , this . main . bind ( "<STR_LIT>" ) } ) ; this . out . println ( version ) ; this . out . flush ( ) ; } } public void logWrongJDK ( ) { if ( ( this . tagBits & Logger . XML ) != <NUM_LIT:0> ) { this . parameters . put ( Logger . MESSAGE , this . main . bind ( "<STR_LIT>" ) ) ; printTag ( Logger . ERROR , this . parameters , true , true ) ; } this . printlnErr ( this . main . bind ( "<STR_LIT>" ) ) ; } private void logXmlExtraProblem ( CategorizedProblem problem , int globalErrorCount , int localErrorCount ) { final int sourceStart = problem . getSourceStart ( ) ; final int sourceEnd = problem . getSourceEnd ( ) ; boolean isError = problem . isError ( ) ; this . parameters . put ( Logger . PROBLEM_SEVERITY , isError ? Logger . ERROR : Logger . WARNING ) ; this . parameters . put ( Logger . PROBLEM_LINE , new Integer ( problem . getSourceLineNumber ( ) ) ) ; this . parameters . put ( Logger . PROBLEM_SOURCE_START , new Integer ( sourceStart ) ) ; this . parameters . put ( Logger . PROBLEM_SOURCE_END , new Integer ( sourceEnd ) ) ; printTag ( Logger . EXTRA_PROBLEM_TAG , this . parameters , true , false ) ; this . parameters . put ( Logger . VALUE , problem . getMessage ( ) ) ; printTag ( Logger . PROBLEM_MESSAGE , this . parameters , true , true ) ; extractContext ( problem , null ) ; endTag ( Logger . EXTRA_PROBLEM_TAG ) ; } private void logXmlProblem ( CategorizedProblem problem , char [ ] unitSource ) { final int sourceStart = problem . getSourceStart ( ) ; final int sourceEnd = problem . getSourceEnd ( ) ; final int id = problem . getID ( ) ; this . parameters . put ( Logger . ID , getFieldName ( id ) ) ; this . parameters . put ( Logger . PROBLEM_ID , new Integer ( id ) ) ; boolean isError = problem . isError ( ) ; int severity = isError ? ProblemSeverities . Error : ProblemSeverities . Warning ; this . parameters . put ( Logger . PROBLEM_SEVERITY , isError ? Logger . ERROR : Logger . WARNING ) ; this . parameters . put ( Logger . PROBLEM_LINE , new Integer ( problem . getSourceLineNumber ( ) ) ) ; this . parameters . put ( Logger . PROBLEM_SOURCE_START , new Integer ( sourceStart ) ) ; this . parameters . put ( Logger . PROBLEM_SOURCE_END , new Integer ( sourceEnd ) ) ; String problemOptionKey = getProblemOptionKey ( id ) ; if ( problemOptionKey != null ) { this . parameters . put ( Logger . PROBLEM_OPTION_KEY , problemOptionKey ) ; } int categoryID = ProblemReporter . getProblemCategory ( severity , id ) ; this . parameters . put ( Logger . PROBLEM_CATEGORY_ID , new Integer ( categoryID ) ) ; printTag ( Logger . PROBLEM_TAG , this . parameters , true , false ) ; this . parameters . put ( Logger . VALUE , problem . getMessage ( ) ) ; printTag ( Logger . PROBLEM_MESSAGE , this . parameters , true , true ) ; extractContext ( problem , unitSource ) ; String [ ] arguments = problem . getArguments ( ) ; final int length = arguments . length ; if ( length != <NUM_LIT:0> ) { printTag ( Logger . PROBLEM_ARGUMENTS , null , true , false ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { this . parameters . put ( Logger . PROBLEM_ARGUMENT_VALUE , arguments [ i ] ) ; printTag ( Logger . PROBLEM_ARGUMENT , this . parameters , true , true ) ; } endTag ( Logger . PROBLEM_ARGUMENTS ) ; } endTag ( Logger . PROBLEM_TAG ) ; } private void logXmlTask ( CategorizedProblem problem , char [ ] unitSource ) { this . parameters . put ( Logger . PROBLEM_LINE , new Integer ( problem . getSourceLineNumber ( ) ) ) ; this . parameters . put ( Logger . PROBLEM_SOURCE_START , new Integer ( problem . getSourceStart ( ) ) ) ; this . parameters . put ( Logger . PROBLEM_SOURCE_END , new Integer ( problem . getSourceEnd ( ) ) ) ; String problemOptionKey = getProblemOptionKey ( problem . getID ( ) ) ; if ( problemOptionKey != null ) { this . parameters . put ( Logger . PROBLEM_OPTION_KEY , problemOptionKey ) ; } printTag ( Logger . TASK , this . parameters , true , false ) ; this . parameters . put ( Logger . VALUE , problem . getMessage ( ) ) ; printTag ( Logger . PROBLEM_MESSAGE , this . parameters , true , true ) ; extractContext ( problem , unitSource ) ; endTag ( Logger . TASK ) ; } private void printErr ( String s ) { this . err . print ( s ) ; if ( ( this . tagBits & Logger . XML ) == <NUM_LIT:0> && this . log != null ) { this . log . print ( s ) ; } } private void printlnErr ( ) { this . err . println ( ) ; if ( ( this . tagBits & Logger . XML ) == <NUM_LIT:0> && this . log != null ) { this . log . println ( ) ; } } private void printlnErr ( String s ) { this . err . println ( s ) ; if ( ( this . tagBits & Logger . XML ) == <NUM_LIT:0> && this . log != null ) { this . log . println ( s ) ; } } private void printlnOut ( String s ) { this . out . println ( s ) ; if ( ( this . tagBits & Logger . XML ) == <NUM_LIT:0> && this . log != null ) { this . log . println ( s ) ; } } public void printNewLine ( ) { this . out . println ( ) ; } private void printOut ( char c ) { this . out . print ( c ) ; } public void printStats ( ) { final boolean isTimed = ( this . main . timing & TIMING_ENABLED ) != <NUM_LIT:0> ; if ( ( this . tagBits & Logger . XML ) != <NUM_LIT:0> ) { printTag ( Logger . STATS , null , true , false ) ; } if ( isTimed ) { CompilerStats compilerStats = this . main . batchCompiler . stats ; compilerStats . startTime = this . main . startTime ; compilerStats . endTime = System . currentTimeMillis ( ) ; logTiming ( compilerStats ) ; } if ( this . main . globalProblemsCount > <NUM_LIT:0> ) { logProblemsSummary ( this . main . globalProblemsCount , this . main . globalErrorsCount , this . main . globalWarningsCount , this . main . globalTasksCount ) ; } if ( this . main . exportedClassFilesCounter != <NUM_LIT:0> && ( this . main . showProgress || isTimed || this . main . verbose ) ) { logNumberOfClassFilesGenerated ( this . main . exportedClassFilesCounter ) ; } if ( ( this . tagBits & Logger . XML ) != <NUM_LIT:0> ) { endTag ( Logger . STATS ) ; } } private void printTag ( String name , HashMap params , boolean insertNewLine , boolean closeTag ) { if ( this . log != null ) { ( ( GenericXMLWriter ) this . log ) . printTag ( name , this . parameters , true , insertNewLine , closeTag ) ; } this . parameters . clear ( ) ; } public void setEmacs ( ) { this . tagBits |= Logger . EMACS ; } public void setLog ( String logFileName ) { final Date date = new Date ( ) ; final DateFormat dateFormat = DateFormat . getDateTimeInstance ( DateFormat . SHORT , DateFormat . LONG , Locale . getDefault ( ) ) ; try { int index = logFileName . lastIndexOf ( '<CHAR_LIT:.>' ) ; if ( index != - <NUM_LIT:1> ) { if ( logFileName . substring ( index ) . toLowerCase ( ) . equals ( "<STR_LIT>" ) ) { this . log = new GenericXMLWriter ( new OutputStreamWriter ( new FileOutputStream ( logFileName , false ) , Util . UTF_8 ) , Util . LINE_SEPARATOR , true ) ; this . tagBits |= Logger . XML ; this . log . println ( "<STR_LIT>" + dateFormat . format ( date ) + "<STR_LIT>" ) ; this . log . println ( Logger . XML_DTD_DECLARATION ) ; this . parameters . put ( Logger . COMPILER_NAME , this . main . bind ( "<STR_LIT>" ) ) ; this . parameters . put ( Logger . COMPILER_VERSION , this . main . bind ( "<STR_LIT>" ) ) ; this . parameters . put ( Logger . COMPILER_COPYRIGHT , this . main . bind ( "<STR_LIT>" ) ) ; printTag ( Logger . COMPILER , this . parameters , true , false ) ; } else { this . log = new PrintWriter ( new FileOutputStream ( logFileName , false ) ) ; this . log . println ( "<STR_LIT>" + dateFormat . format ( date ) ) ; } } else { this . log = new PrintWriter ( new FileOutputStream ( logFileName , false ) ) ; this . log . println ( "<STR_LIT>" + dateFormat . format ( date ) ) ; } } catch ( FileNotFoundException e ) { throw new IllegalArgumentException ( this . main . bind ( "<STR_LIT>" , logFileName ) ) ; } catch ( UnsupportedEncodingException e ) { throw new IllegalArgumentException ( this . main . bind ( "<STR_LIT>" , logFileName ) ) ; } } private void startLoggingExtraProblems ( int count ) { this . parameters . put ( Logger . NUMBER_OF_PROBLEMS , new Integer ( count ) ) ; printTag ( Logger . EXTRA_PROBLEMS , this . parameters , true , false ) ; } private void startLoggingProblems ( int errors , int warnings ) { this . parameters . put ( Logger . NUMBER_OF_PROBLEMS , new Integer ( errors + warnings ) ) ; this . parameters . put ( Logger . NUMBER_OF_ERRORS , new Integer ( errors ) ) ; this . parameters . put ( Logger . NUMBER_OF_WARNINGS , new Integer ( warnings ) ) ; printTag ( Logger . PROBLEMS , this . parameters , true , false ) ; } public void startLoggingSource ( CompilationResult compilationResult ) { if ( ( this . tagBits & Logger . XML ) != <NUM_LIT:0> ) { ICompilationUnit compilationUnit = compilationResult . compilationUnit ; if ( compilationUnit != null ) { char [ ] fileName = compilationUnit . getFileName ( ) ; File f = new File ( new String ( fileName ) ) ; if ( fileName != null ) { this . parameters . put ( Logger . PATH , f . getAbsolutePath ( ) ) ; } char [ ] [ ] packageName = compilationResult . packageName ; if ( packageName != null ) { this . parameters . put ( Logger . PACKAGE , new String ( CharOperation . concatWith ( packageName , File . separatorChar ) ) ) ; } CompilationUnit unit = ( CompilationUnit ) compilationUnit ; String destinationPath = unit . destinationPath ; if ( destinationPath == null ) { destinationPath = this . main . destinationPath ; } if ( destinationPath != null && destinationPath != NONE ) { if ( File . separatorChar == '<CHAR_LIT:/>' ) { this . parameters . put ( Logger . OUTPUT , destinationPath ) ; } else { this . parameters . put ( Logger . OUTPUT , destinationPath . replace ( '<CHAR_LIT:/>' , File . separatorChar ) ) ; } } } printTag ( Logger . SOURCE , this . parameters , true , false ) ; } } public void startLoggingSources ( ) { if ( ( this . tagBits & Logger . XML ) != <NUM_LIT:0> ) { printTag ( Logger . SOURCES , null , true , false ) ; } } public void startLoggingTasks ( int tasks ) { if ( ( this . tagBits & Logger . XML ) != <NUM_LIT:0> ) { this . parameters . put ( Logger . NUMBER_OF_TASKS , new Integer ( tasks ) ) ; printTag ( Logger . TASKS , this . parameters , true , false ) ; } } } public static class ResourceBundleFactory { private static HashMap Cache = new HashMap ( ) ; public static synchronized ResourceBundle getBundle ( Locale locale ) { ResourceBundle bundle = ( ResourceBundle ) Cache . get ( locale ) ; if ( bundle == null ) { bundle = ResourceBundle . getBundle ( Main . bundleName , locale ) ; Cache . put ( locale , bundle ) ; } return bundle ; } } boolean enableJavadocOn ; boolean warnJavadocOn ; boolean warnAllJavadocOn ; public Compiler batchCompiler ; public ResourceBundle bundle ; protected FileSystem . Classpath [ ] checkedClasspaths ; public Locale compilerLocale ; public CompilerOptions compilerOptions ; public CompilationProgress progress ; public String destinationPath ; public String [ ] destinationPaths ; private boolean didSpecifySource ; private boolean didSpecifyTarget ; public String [ ] encodings ; public int exportedClassFilesCounter ; public String [ ] filenames ; public String [ ] classNames ; public int globalErrorsCount ; public int globalProblemsCount ; public int globalTasksCount ; public int globalWarningsCount ; private File javaHomeCache ; private boolean javaHomeChecked = false ; public long lineCount0 ; public String log ; public Logger logger ; public int maxProblems ; public Map options ; protected PrintWriter out ; public boolean proceed = true ; public boolean proceedOnError = false ; public boolean produceRefInfo = false ; public int currentRepetition , maxRepetition ; public boolean showProgress = false ; public long startTime ; public ArrayList pendingErrors ; public boolean systemExitWhenFinished = true ; public static final int TIMING_DISABLED = <NUM_LIT:0> ; public static final int TIMING_ENABLED = <NUM_LIT:1> ; public static final int TIMING_DETAILED = <NUM_LIT:2> ; public int timing = TIMING_DISABLED ; public CompilerStats [ ] compilerStats ; public boolean verbose = false ; private String [ ] expandedCommandLine ; private PrintWriter err ; protected ArrayList extraProblems ; public final static String bundleName = "<STR_LIT>" ; public static final int DEFAULT_SIZE_CLASSPATH = <NUM_LIT:4> ; public static final String NONE = "<STR_LIT:none>" ; public static boolean compile ( String commandLine ) { return new Main ( new PrintWriter ( System . out ) , new PrintWriter ( System . err ) , false , null , null ) . compile ( tokenize ( commandLine ) ) ; } public static boolean compile ( String commandLine , PrintWriter outWriter , PrintWriter errWriter ) { return new Main ( outWriter , errWriter , false , null , null ) . compile ( tokenize ( commandLine ) ) ; } public static boolean compile ( String [ ] commandLineArguments , PrintWriter outWriter , PrintWriter errWriter , CompilationProgress progress ) { return new Main ( outWriter , errWriter , false , null , progress ) . compile ( commandLineArguments ) ; } public static File [ ] [ ] getLibrariesFiles ( File [ ] files ) { FilenameFilter filter = new FilenameFilter ( ) { public boolean accept ( File dir , String name ) { return Util . isPotentialZipArchive ( name ) ; } } ; final int filesLength = files . length ; File [ ] [ ] result = new File [ filesLength ] [ ] ; for ( int i = <NUM_LIT:0> ; i < filesLength ; i ++ ) { File currentFile = files [ i ] ; if ( currentFile . exists ( ) && currentFile . isDirectory ( ) ) { result [ i ] = currentFile . listFiles ( filter ) ; } } return result ; } public static void main ( String [ ] argv ) { new Main ( new PrintWriter ( System . out ) , new PrintWriter ( System . err ) , true , null , null ) . compile ( argv ) ; } public static String [ ] tokenize ( String commandLine ) { int count = <NUM_LIT:0> ; String [ ] arguments = new String [ <NUM_LIT:10> ] ; StringTokenizer tokenizer = new StringTokenizer ( commandLine , "<STR_LIT>" , true ) ; String token = Util . EMPTY_STRING ; boolean insideQuotes = false ; boolean startNewToken = true ; while ( tokenizer . hasMoreTokens ( ) ) { token = tokenizer . nextToken ( ) ; if ( token . equals ( "<STR_LIT:U+0020>" ) ) { if ( insideQuotes ) { arguments [ count - <NUM_LIT:1> ] += token ; startNewToken = false ; } else { startNewToken = true ; } } else if ( token . equals ( "<STR_LIT:\">" ) ) { if ( ! insideQuotes && startNewToken ) { if ( count == arguments . length ) System . arraycopy ( arguments , <NUM_LIT:0> , ( arguments = new String [ count * <NUM_LIT:2> ] ) , <NUM_LIT:0> , count ) ; arguments [ count ++ ] = Util . EMPTY_STRING ; } insideQuotes = ! insideQuotes ; startNewToken = false ; } else { if ( insideQuotes ) { arguments [ count - <NUM_LIT:1> ] += token ; } else { if ( token . length ( ) > <NUM_LIT:0> && ! startNewToken ) { arguments [ count - <NUM_LIT:1> ] += token ; } else { if ( count == arguments . length ) System . arraycopy ( arguments , <NUM_LIT:0> , ( arguments = new String [ count * <NUM_LIT:2> ] ) , <NUM_LIT:0> , count ) ; String trimmedToken = token . trim ( ) ; if ( trimmedToken . length ( ) != <NUM_LIT:0> ) { arguments [ count ++ ] = trimmedToken ; } } } startNewToken = false ; } } System . arraycopy ( arguments , <NUM_LIT:0> , arguments = new String [ count ] , <NUM_LIT:0> , count ) ; return arguments ; } public Main ( PrintWriter outWriter , PrintWriter errWriter , boolean systemExitWhenFinished ) { this ( outWriter , errWriter , systemExitWhenFinished , null , null ) ; } public Main ( PrintWriter outWriter , PrintWriter errWriter , boolean systemExitWhenFinished , Map customDefaultOptions ) { this ( outWriter , errWriter , systemExitWhenFinished , customDefaultOptions , null ) ; } public Main ( PrintWriter outWriter , PrintWriter errWriter , boolean systemExitWhenFinished , Map customDefaultOptions , CompilationProgress compilationProgress ) { this . initialize ( outWriter , errWriter , systemExitWhenFinished , customDefaultOptions , compilationProgress ) ; this . relocalize ( ) ; } public void addExtraProblems ( CategorizedProblem problem ) { if ( this . extraProblems == null ) { this . extraProblems = new ArrayList ( ) ; } this . extraProblems . add ( problem ) ; } protected void addNewEntry ( ArrayList paths , String currentClasspathName , ArrayList currentRuleSpecs , String customEncoding , String destPath , boolean isSourceOnly , boolean rejectDestinationPathOnJars ) { int rulesSpecsSize = currentRuleSpecs . size ( ) ; AccessRuleSet accessRuleSet = null ; if ( rulesSpecsSize != <NUM_LIT:0> ) { AccessRule [ ] accessRules = new AccessRule [ currentRuleSpecs . size ( ) ] ; boolean rulesOK = true ; Iterator i = currentRuleSpecs . iterator ( ) ; int j = <NUM_LIT:0> ; while ( i . hasNext ( ) ) { String ruleSpec = ( String ) i . next ( ) ; char key = ruleSpec . charAt ( <NUM_LIT:0> ) ; String pattern = ruleSpec . substring ( <NUM_LIT:1> ) ; if ( pattern . length ( ) > <NUM_LIT:0> ) { switch ( key ) { case '<CHAR_LIT>' : accessRules [ j ++ ] = new AccessRule ( pattern . toCharArray ( ) , <NUM_LIT:0> ) ; break ; case '<CHAR_LIT>' : accessRules [ j ++ ] = new AccessRule ( pattern . toCharArray ( ) , IProblem . DiscouragedReference ) ; break ; case '<CHAR_LIT:->' : accessRules [ j ++ ] = new AccessRule ( pattern . toCharArray ( ) , IProblem . ForbiddenReference ) ; break ; case '<CHAR_LIT>' : accessRules [ j ++ ] = new AccessRule ( pattern . toCharArray ( ) , IProblem . ForbiddenReference , true ) ; break ; default : rulesOK = false ; } } else { rulesOK = false ; } } if ( rulesOK ) { accessRuleSet = new AccessRuleSet ( accessRules , AccessRestriction . COMMAND_LINE , currentClasspathName ) ; } else { if ( currentClasspathName . length ( ) != <NUM_LIT:0> ) { addPendingErrors ( this . bind ( "<STR_LIT>" , currentClasspathName ) ) ; } return ; } } if ( NONE . equals ( destPath ) ) { destPath = NONE ; } if ( rejectDestinationPathOnJars && destPath != null && Util . isPotentialZipArchive ( currentClasspathName ) ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , currentClasspathName ) ) ; } FileSystem . Classpath currentClasspath = FileSystem . getClasspath ( currentClasspathName , customEncoding , isSourceOnly , accessRuleSet , destPath ) ; if ( currentClasspath != null ) { paths . add ( currentClasspath ) ; } else if ( currentClasspathName . length ( ) != <NUM_LIT:0> ) { addPendingErrors ( this . bind ( "<STR_LIT>" , currentClasspathName ) ) ; } } void addPendingErrors ( String message ) { if ( this . pendingErrors == null ) { this . pendingErrors = new ArrayList ( ) ; } this . pendingErrors . add ( message ) ; } public String bind ( String id ) { return bind ( id , ( String [ ] ) null ) ; } public String bind ( String id , String binding ) { return bind ( id , new String [ ] { binding } ) ; } public String bind ( String id , String binding1 , String binding2 ) { return bind ( id , new String [ ] { binding1 , binding2 } ) ; } public String bind ( String id , String [ ] arguments ) { if ( id == null ) return "<STR_LIT>" ; String message = null ; try { message = this . bundle . getString ( id ) ; } catch ( MissingResourceException e ) { return "<STR_LIT>" + id + "<STR_LIT>" + Main . bundleName ; } return MessageFormat . format ( message , arguments ) ; } private boolean checkVMVersion ( long minimalSupportedVersion ) { String classFileVersion = System . getProperty ( "<STR_LIT>" ) ; if ( classFileVersion == null ) { return false ; } int index = classFileVersion . indexOf ( '<CHAR_LIT:.>' ) ; if ( index == - <NUM_LIT:1> ) { return false ; } int majorVersion ; try { majorVersion = Integer . parseInt ( classFileVersion . substring ( <NUM_LIT:0> , index ) ) ; } catch ( NumberFormatException e ) { return false ; } switch ( majorVersion ) { case <NUM_LIT> : return ClassFileConstants . JDK1_1 >= minimalSupportedVersion ; case <NUM_LIT> : return ClassFileConstants . JDK1_2 >= minimalSupportedVersion ; case <NUM_LIT> : return ClassFileConstants . JDK1_3 >= minimalSupportedVersion ; case <NUM_LIT> : return ClassFileConstants . JDK1_4 >= minimalSupportedVersion ; case <NUM_LIT> : return ClassFileConstants . JDK1_5 >= minimalSupportedVersion ; case <NUM_LIT> : return ClassFileConstants . JDK1_6 >= minimalSupportedVersion ; case <NUM_LIT> : return ClassFileConstants . JDK1_7 >= minimalSupportedVersion ; } return false ; } public boolean compile ( String [ ] argv ) { try { configure ( argv ) ; if ( this . progress != null ) this . progress . begin ( this . filenames == null ? <NUM_LIT:0> : this . filenames . length * this . maxRepetition ) ; if ( this . proceed ) { if ( this . showProgress ) this . logger . compiling ( ) ; for ( this . currentRepetition = <NUM_LIT:0> ; this . currentRepetition < this . maxRepetition ; this . currentRepetition ++ ) { this . globalProblemsCount = <NUM_LIT:0> ; this . globalErrorsCount = <NUM_LIT:0> ; this . globalWarningsCount = <NUM_LIT:0> ; this . globalTasksCount = <NUM_LIT:0> ; this . exportedClassFilesCounter = <NUM_LIT:0> ; if ( this . maxRepetition > <NUM_LIT:1> ) { this . logger . flush ( ) ; this . logger . logRepetition ( this . currentRepetition , this . maxRepetition ) ; } performCompilation ( ) ; } if ( this . compilerStats != null ) { this . logger . logAverage ( ) ; } if ( this . showProgress ) this . logger . printNewLine ( ) ; } if ( this . systemExitWhenFinished ) { this . logger . flush ( ) ; this . logger . close ( ) ; System . exit ( this . globalErrorsCount > <NUM_LIT:0> ? - <NUM_LIT:1> : <NUM_LIT:0> ) ; } } catch ( IllegalArgumentException e ) { this . logger . logException ( e ) ; if ( this . systemExitWhenFinished ) { this . logger . flush ( ) ; this . logger . close ( ) ; System . exit ( - <NUM_LIT:1> ) ; } return false ; } catch ( RuntimeException e ) { this . logger . logException ( e ) ; if ( this . systemExitWhenFinished ) { this . logger . flush ( ) ; this . logger . close ( ) ; System . exit ( - <NUM_LIT:1> ) ; } return false ; } finally { this . logger . flush ( ) ; this . logger . close ( ) ; if ( this . progress != null ) this . progress . done ( ) ; } if ( this . globalErrorsCount == <NUM_LIT:0> && ( this . progress == null || ! this . progress . isCanceled ( ) ) ) return true ; return false ; } public void configure ( String [ ] argv ) { if ( ( argv == null ) || ( argv . length == <NUM_LIT:0> ) ) { printUsage ( ) ; return ; } final int INSIDE_CLASSPATH_start = <NUM_LIT:1> ; final int INSIDE_DESTINATION_PATH = <NUM_LIT:3> ; final int INSIDE_TARGET = <NUM_LIT:4> ; final int INSIDE_LOG = <NUM_LIT:5> ; final int INSIDE_REPETITION = <NUM_LIT:6> ; final int INSIDE_SOURCE = <NUM_LIT:7> ; final int INSIDE_DEFAULT_ENCODING = <NUM_LIT:8> ; final int INSIDE_BOOTCLASSPATH_start = <NUM_LIT:9> ; final int INSIDE_MAX_PROBLEMS = <NUM_LIT:11> ; final int INSIDE_EXT_DIRS = <NUM_LIT:12> ; final int INSIDE_SOURCE_PATH_start = <NUM_LIT> ; final int INSIDE_ENDORSED_DIRS = <NUM_LIT:15> ; final int INSIDE_SOURCE_DIRECTORY_DESTINATION_PATH = <NUM_LIT:16> ; final int INSIDE_PROCESSOR_PATH_start = <NUM_LIT> ; final int INSIDE_PROCESSOR_start = <NUM_LIT> ; final int INSIDE_S_start = <NUM_LIT> ; final int INSIDE_CLASS_NAMES = <NUM_LIT:20> ; final int INSIDE_WARNINGS_PROPERTIES = <NUM_LIT> ; final int DEFAULT = <NUM_LIT:0> ; ArrayList bootclasspaths = new ArrayList ( DEFAULT_SIZE_CLASSPATH ) ; String sourcepathClasspathArg = null ; ArrayList sourcepathClasspaths = new ArrayList ( DEFAULT_SIZE_CLASSPATH ) ; ArrayList classpaths = new ArrayList ( DEFAULT_SIZE_CLASSPATH ) ; ArrayList extdirsClasspaths = null ; ArrayList endorsedDirClasspaths = null ; int index = - <NUM_LIT:1> ; int filesCount = <NUM_LIT:0> ; int classCount = <NUM_LIT:0> ; int argCount = argv . length ; int mode = DEFAULT ; this . maxRepetition = <NUM_LIT:0> ; boolean printUsageRequired = false ; String usageSection = null ; boolean printVersionRequired = false ; boolean didSpecifyDeprecation = false ; boolean didSpecifyCompliance = false ; boolean didSpecifyDisabledAnnotationProcessing = false ; boolean encounteredGroovySourceFile = false ; String customEncoding = null ; String customDestinationPath = null ; String currentSourceDirectory = null ; String currentArg = Util . EMPTY_STRING ; Set specifiedEncodings = null ; boolean needExpansion = false ; loop : for ( int i = <NUM_LIT:0> ; i < argCount ; i ++ ) { if ( argv [ i ] . startsWith ( "<STR_LIT:@>" ) ) { needExpansion = true ; break loop ; } } String [ ] newCommandLineArgs = null ; if ( needExpansion ) { newCommandLineArgs = new String [ argCount ] ; index = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < argCount ; i ++ ) { String [ ] newArgs = null ; String arg = argv [ i ] . trim ( ) ; if ( arg . startsWith ( "<STR_LIT:@>" ) ) { try { LineNumberReader reader = new LineNumberReader ( new StringReader ( new String ( Util . getFileCharContent ( new File ( arg . substring ( <NUM_LIT:1> ) ) , null ) ) ) ) ; StringBuffer buffer = new StringBuffer ( ) ; String line ; while ( ( line = reader . readLine ( ) ) != null ) { line = line . trim ( ) ; if ( ! line . startsWith ( "<STR_LIT:#>" ) ) { buffer . append ( line ) . append ( "<STR_LIT:U+0020>" ) ; } } newArgs = tokenize ( buffer . toString ( ) ) ; } catch ( IOException e ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , arg ) ) ; } } if ( newArgs != null ) { int newCommandLineArgsLength = newCommandLineArgs . length ; int newArgsLength = newArgs . length ; System . arraycopy ( newCommandLineArgs , <NUM_LIT:0> , ( newCommandLineArgs = new String [ newCommandLineArgsLength + newArgsLength - <NUM_LIT:1> ] ) , <NUM_LIT:0> , index ) ; System . arraycopy ( newArgs , <NUM_LIT:0> , newCommandLineArgs , index , newArgsLength ) ; index += newArgsLength ; } else { newCommandLineArgs [ index ++ ] = arg ; } } index = - <NUM_LIT:1> ; } else { newCommandLineArgs = argv ; for ( int i = <NUM_LIT:0> ; i < argCount ; i ++ ) { newCommandLineArgs [ i ] = newCommandLineArgs [ i ] . trim ( ) ; } } argCount = newCommandLineArgs . length ; this . expandedCommandLine = newCommandLineArgs ; while ( ++ index < argCount ) { if ( customEncoding != null ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , currentArg , customEncoding ) ) ; } currentArg = newCommandLineArgs [ index ] ; switch ( mode ) { case DEFAULT : if ( currentArg . startsWith ( "<STR_LIT:[>" ) ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , currentArg ) ) ; } if ( currentArg . endsWith ( "<STR_LIT:]>" ) ) { int encodingStart = currentArg . indexOf ( '<CHAR_LIT:[>' ) + <NUM_LIT:1> ; if ( encodingStart <= <NUM_LIT:1> ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , currentArg ) ) ; } int encodingEnd = currentArg . length ( ) - <NUM_LIT:1> ; if ( encodingStart >= <NUM_LIT:1> ) { if ( encodingStart < encodingEnd ) { customEncoding = currentArg . substring ( encodingStart , encodingEnd ) ; try { new InputStreamReader ( new ByteArrayInputStream ( new byte [ <NUM_LIT:0> ] ) , customEncoding ) ; } catch ( UnsupportedEncodingException e ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , customEncoding ) ) ; } } currentArg = currentArg . substring ( <NUM_LIT:0> , encodingStart - <NUM_LIT:1> ) ; } } if ( currentArg . endsWith ( SuffixConstants . SUFFIX_STRING_java ) || currentArg . endsWith ( "<STR_LIT>" ) ) { if ( currentArg . endsWith ( "<STR_LIT>" ) ) { encounteredGroovySourceFile = true ; } if ( this . filenames == null ) { this . filenames = new String [ argCount - index ] ; this . encodings = new String [ argCount - index ] ; this . destinationPaths = new String [ argCount - index ] ; } else if ( filesCount == this . filenames . length ) { int length = this . filenames . length ; System . arraycopy ( this . filenames , <NUM_LIT:0> , ( this . filenames = new String [ length + argCount - index ] ) , <NUM_LIT:0> , length ) ; System . arraycopy ( this . encodings , <NUM_LIT:0> , ( this . encodings = new String [ length + argCount - index ] ) , <NUM_LIT:0> , length ) ; System . arraycopy ( this . destinationPaths , <NUM_LIT:0> , ( this . destinationPaths = new String [ length + argCount - index ] ) , <NUM_LIT:0> , length ) ; } this . filenames [ filesCount ] = currentArg ; this . encodings [ filesCount ++ ] = customEncoding ; customEncoding = null ; mode = DEFAULT ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) ) { if ( this . log != null ) throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , currentArg ) ) ; mode = INSIDE_LOG ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) ) { if ( this . maxRepetition > <NUM_LIT:0> ) throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , currentArg ) ) ; mode = INSIDE_REPETITION ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) ) { if ( this . maxProblems > <NUM_LIT:0> ) throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , currentArg ) ) ; mode = INSIDE_MAX_PROBLEMS ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) ) { mode = INSIDE_SOURCE ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) ) { mode = INSIDE_DEFAULT_ENCODING ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) ) { if ( didSpecifyCompliance ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , currentArg ) ) ; } didSpecifyCompliance = true ; this . options . put ( CompilerOptions . OPTION_Compliance , CompilerOptions . VERSION_1_3 ) ; mode = DEFAULT ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) ) { if ( didSpecifyCompliance ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , currentArg ) ) ; } didSpecifyCompliance = true ; this . options . put ( CompilerOptions . OPTION_Compliance , CompilerOptions . VERSION_1_4 ) ; mode = DEFAULT ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) || currentArg . equals ( "<STR_LIT>" ) || currentArg . equals ( "<STR_LIT>" ) ) { if ( didSpecifyCompliance ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , currentArg ) ) ; } didSpecifyCompliance = true ; this . options . put ( CompilerOptions . OPTION_Compliance , CompilerOptions . VERSION_1_5 ) ; mode = DEFAULT ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) || currentArg . equals ( "<STR_LIT>" ) || currentArg . equals ( "<STR_LIT>" ) ) { if ( didSpecifyCompliance ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , currentArg ) ) ; } didSpecifyCompliance = true ; this . options . put ( CompilerOptions . OPTION_Compliance , CompilerOptions . VERSION_1_6 ) ; mode = DEFAULT ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) || currentArg . equals ( "<STR_LIT>" ) || currentArg . equals ( "<STR_LIT>" ) ) { if ( didSpecifyCompliance ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , currentArg ) ) ; } didSpecifyCompliance = true ; this . options . put ( CompilerOptions . OPTION_Compliance , CompilerOptions . VERSION_1_7 ) ; mode = DEFAULT ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) ) { if ( this . destinationPath != null ) { StringBuffer errorMessage = new StringBuffer ( ) ; errorMessage . append ( currentArg ) ; if ( ( index + <NUM_LIT:1> ) < argCount ) { errorMessage . append ( '<CHAR_LIT:U+0020>' ) ; errorMessage . append ( newCommandLineArgs [ index + <NUM_LIT:1> ] ) ; } throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , errorMessage . toString ( ) ) ) ; } mode = INSIDE_DESTINATION_PATH ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) || currentArg . equals ( "<STR_LIT>" ) ) { mode = INSIDE_CLASSPATH_start ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) ) { if ( bootclasspaths . size ( ) > <NUM_LIT:0> ) { StringBuffer errorMessage = new StringBuffer ( ) ; errorMessage . append ( currentArg ) ; if ( ( index + <NUM_LIT:1> ) < argCount ) { errorMessage . append ( '<CHAR_LIT:U+0020>' ) ; errorMessage . append ( newCommandLineArgs [ index + <NUM_LIT:1> ] ) ; } throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , errorMessage . toString ( ) ) ) ; } mode = INSIDE_BOOTCLASSPATH_start ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) ) { if ( sourcepathClasspathArg != null ) { StringBuffer errorMessage = new StringBuffer ( ) ; errorMessage . append ( currentArg ) ; if ( ( index + <NUM_LIT:1> ) < argCount ) { errorMessage . append ( '<CHAR_LIT:U+0020>' ) ; errorMessage . append ( newCommandLineArgs [ index + <NUM_LIT:1> ] ) ; } throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , errorMessage . toString ( ) ) ) ; } mode = INSIDE_SOURCE_PATH_start ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) ) { if ( extdirsClasspaths != null ) { StringBuffer errorMessage = new StringBuffer ( ) ; errorMessage . append ( currentArg ) ; if ( ( index + <NUM_LIT:1> ) < argCount ) { errorMessage . append ( '<CHAR_LIT:U+0020>' ) ; errorMessage . append ( newCommandLineArgs [ index + <NUM_LIT:1> ] ) ; } throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , errorMessage . toString ( ) ) ) ; } mode = INSIDE_EXT_DIRS ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) ) { if ( endorsedDirClasspaths != null ) { StringBuffer errorMessage = new StringBuffer ( ) ; errorMessage . append ( currentArg ) ; if ( ( index + <NUM_LIT:1> ) < argCount ) { errorMessage . append ( '<CHAR_LIT:U+0020>' ) ; errorMessage . append ( newCommandLineArgs [ index + <NUM_LIT:1> ] ) ; } throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , errorMessage . toString ( ) ) ) ; } mode = INSIDE_ENDORSED_DIRS ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) ) { mode = DEFAULT ; this . showProgress = true ; continue ; } if ( currentArg . startsWith ( "<STR_LIT>" ) ) { mode = DEFAULT ; int length = currentArg . length ( ) ; if ( length > <NUM_LIT:15> ) { if ( currentArg . equals ( "<STR_LIT>" ) ) { this . options . put ( CompilerOptions . OPTION_FatalOptionalError , CompilerOptions . ENABLED ) ; } else { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , currentArg ) ) ; } } else { this . options . put ( CompilerOptions . OPTION_FatalOptionalError , CompilerOptions . DISABLED ) ; } this . proceedOnError = true ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) ) { mode = DEFAULT ; this . timing = TIMING_ENABLED ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) ) { mode = DEFAULT ; this . timing = TIMING_ENABLED | TIMING_DETAILED ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) || currentArg . equals ( "<STR_LIT>" ) ) { this . logger . logVersion ( true ) ; this . proceed = false ; return ; } if ( currentArg . equals ( "<STR_LIT>" ) ) { printVersionRequired = true ; mode = DEFAULT ; continue ; } if ( "<STR_LIT>" . equals ( currentArg ) ) { didSpecifyDeprecation = true ; this . options . put ( CompilerOptions . OPTION_ReportDeprecation , CompilerOptions . WARNING ) ; mode = DEFAULT ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) || currentArg . equals ( "<STR_LIT>" ) ) { printUsageRequired = true ; mode = DEFAULT ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) || currentArg . equals ( "<STR_LIT>" ) ) { printUsageRequired = true ; usageSection = "<STR_LIT>" ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) ) { this . systemExitWhenFinished = false ; mode = DEFAULT ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) ) { this . verbose = true ; mode = DEFAULT ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) ) { this . produceRefInfo = true ; mode = DEFAULT ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) ) { mode = DEFAULT ; this . options . put ( CompilerOptions . OPTION_InlineJsr , CompilerOptions . ENABLED ) ; continue ; } if ( currentArg . startsWith ( "<STR_LIT>" ) ) { mode = DEFAULT ; String debugOption = currentArg ; int length = currentArg . length ( ) ; if ( length == <NUM_LIT:2> ) { this . options . put ( CompilerOptions . OPTION_LocalVariableAttribute , CompilerOptions . GENERATE ) ; this . options . put ( CompilerOptions . OPTION_LineNumberAttribute , CompilerOptions . GENERATE ) ; this . options . put ( CompilerOptions . OPTION_SourceFileAttribute , CompilerOptions . GENERATE ) ; continue ; } if ( length > <NUM_LIT:3> ) { this . options . put ( CompilerOptions . OPTION_LocalVariableAttribute , CompilerOptions . DO_NOT_GENERATE ) ; this . options . put ( CompilerOptions . OPTION_LineNumberAttribute , CompilerOptions . DO_NOT_GENERATE ) ; this . options . put ( CompilerOptions . OPTION_SourceFileAttribute , CompilerOptions . DO_NOT_GENERATE ) ; if ( length == <NUM_LIT:7> && debugOption . equals ( "<STR_LIT>" + NONE ) ) continue ; StringTokenizer tokenizer = new StringTokenizer ( debugOption . substring ( <NUM_LIT:3> , debugOption . length ( ) ) , "<STR_LIT:U+002C>" ) ; while ( tokenizer . hasMoreTokens ( ) ) { String token = tokenizer . nextToken ( ) ; if ( token . equals ( "<STR_LIT>" ) ) { this . options . put ( CompilerOptions . OPTION_LocalVariableAttribute , CompilerOptions . GENERATE ) ; } else if ( token . equals ( "<STR_LIT>" ) ) { this . options . put ( CompilerOptions . OPTION_LineNumberAttribute , CompilerOptions . GENERATE ) ; } else if ( token . equals ( "<STR_LIT:source>" ) ) { this . options . put ( CompilerOptions . OPTION_SourceFileAttribute , CompilerOptions . GENERATE ) ; } else { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , debugOption ) ) ; } } continue ; } throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , debugOption ) ) ; } if ( currentArg . startsWith ( "<STR_LIT>" ) ) { disableWarnings ( ) ; mode = DEFAULT ; continue ; } if ( currentArg . startsWith ( "<STR_LIT>" ) ) { mode = DEFAULT ; String warningOption = currentArg ; int length = currentArg . length ( ) ; if ( length == <NUM_LIT:10> && warningOption . equals ( "<STR_LIT>" + NONE ) ) { disableWarnings ( ) ; continue ; } if ( length <= <NUM_LIT:6> ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , warningOption ) ) ; } int warnTokenStart ; boolean isEnabling , allowPlusOrMinus ; switch ( warningOption . charAt ( <NUM_LIT:6> ) ) { case '<CHAR_LIT>' : warnTokenStart = <NUM_LIT:7> ; isEnabling = true ; allowPlusOrMinus = true ; break ; case '<CHAR_LIT:->' : warnTokenStart = <NUM_LIT:7> ; isEnabling = false ; allowPlusOrMinus = true ; break ; default : disableWarnings ( ) ; warnTokenStart = <NUM_LIT:6> ; isEnabling = true ; allowPlusOrMinus = false ; } StringTokenizer tokenizer = new StringTokenizer ( warningOption . substring ( warnTokenStart , warningOption . length ( ) ) , "<STR_LIT:U+002C>" ) ; int tokenCounter = <NUM_LIT:0> ; if ( didSpecifyDeprecation ) { this . options . put ( CompilerOptions . OPTION_ReportDeprecation , CompilerOptions . WARNING ) ; } while ( tokenizer . hasMoreTokens ( ) ) { String token = tokenizer . nextToken ( ) ; tokenCounter ++ ; switch ( token . charAt ( <NUM_LIT:0> ) ) { case '<CHAR_LIT>' : if ( allowPlusOrMinus ) { isEnabling = true ; token = token . substring ( <NUM_LIT:1> ) ; } else { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , token ) ) ; } break ; case '<CHAR_LIT:->' : if ( allowPlusOrMinus ) { isEnabling = false ; token = token . substring ( <NUM_LIT:1> ) ; } else { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , token ) ) ; } } handleWarningToken ( token , isEnabling ) ; } if ( tokenCounter == <NUM_LIT:0> ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , currentArg ) ) ; } continue ; } if ( currentArg . startsWith ( "<STR_LIT>" ) ) { mode = DEFAULT ; String errorOption = currentArg ; int length = currentArg . length ( ) ; if ( length <= <NUM_LIT:5> ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , errorOption ) ) ; } int errorTokenStart ; boolean isEnabling , allowPlusOrMinus ; switch ( errorOption . charAt ( <NUM_LIT:5> ) ) { case '<CHAR_LIT>' : errorTokenStart = <NUM_LIT:6> ; isEnabling = true ; allowPlusOrMinus = true ; break ; case '<CHAR_LIT:->' : errorTokenStart = <NUM_LIT:6> ; isEnabling = false ; allowPlusOrMinus = true ; break ; default : disableErrors ( ) ; errorTokenStart = <NUM_LIT:5> ; isEnabling = true ; allowPlusOrMinus = false ; } StringTokenizer tokenizer = new StringTokenizer ( errorOption . substring ( errorTokenStart , errorOption . length ( ) ) , "<STR_LIT:U+002C>" ) ; int tokenCounter = <NUM_LIT:0> ; while ( tokenizer . hasMoreTokens ( ) ) { String token = tokenizer . nextToken ( ) ; tokenCounter ++ ; switch ( token . charAt ( <NUM_LIT:0> ) ) { case '<CHAR_LIT>' : if ( allowPlusOrMinus ) { isEnabling = true ; token = token . substring ( <NUM_LIT:1> ) ; } else { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , token ) ) ; } break ; case '<CHAR_LIT:->' : if ( allowPlusOrMinus ) { isEnabling = false ; token = token . substring ( <NUM_LIT:1> ) ; } else { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , token ) ) ; } break ; } handleErrorToken ( token , isEnabling ) ; } if ( tokenCounter == <NUM_LIT:0> ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , currentArg ) ) ; } continue ; } if ( currentArg . equals ( "<STR_LIT>" ) ) { mode = INSIDE_TARGET ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) ) { this . options . put ( CompilerOptions . OPTION_PreserveUnusedLocal , CompilerOptions . PRESERVE ) ; mode = DEFAULT ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) ) { mode = DEFAULT ; this . enableJavadocOn = true ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) ) { mode = DEFAULT ; this . logger . setEmacs ( ) ; continue ; } if ( currentArg . startsWith ( "<STR_LIT>" ) ) { mode = DEFAULT ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) ) { mode = INSIDE_PROCESSOR_PATH_start ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) ) { mode = INSIDE_PROCESSOR_start ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) ) { this . options . put ( CompilerOptions . OPTION_GenerateClassFiles , CompilerOptions . DISABLED ) ; mode = DEFAULT ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) ) { didSpecifyDisabledAnnotationProcessing = true ; this . options . put ( CompilerOptions . OPTION_Process_Annotations , CompilerOptions . DISABLED ) ; mode = DEFAULT ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) ) { mode = INSIDE_S_start ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) || currentArg . equals ( "<STR_LIT>" ) ) { mode = DEFAULT ; continue ; } if ( currentArg . startsWith ( "<STR_LIT>" ) ) { mode = DEFAULT ; continue ; } if ( currentArg . startsWith ( "<STR_LIT>" ) ) { mode = DEFAULT ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) ) { mode = DEFAULT ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) ) { mode = INSIDE_CLASS_NAMES ; continue ; } if ( currentArg . equals ( "<STR_LIT>" ) ) { mode = INSIDE_WARNINGS_PROPERTIES ; continue ; } break ; case INSIDE_TARGET : if ( this . didSpecifyTarget ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , currentArg ) ) ; } this . didSpecifyTarget = true ; if ( currentArg . equals ( "<STR_LIT>" ) ) { this . options . put ( CompilerOptions . OPTION_TargetPlatform , CompilerOptions . VERSION_1_1 ) ; } else if ( currentArg . equals ( "<STR_LIT>" ) ) { this . options . put ( CompilerOptions . OPTION_TargetPlatform , CompilerOptions . VERSION_1_2 ) ; } else if ( currentArg . equals ( "<STR_LIT>" ) ) { this . options . put ( CompilerOptions . OPTION_TargetPlatform , CompilerOptions . VERSION_1_3 ) ; } else if ( currentArg . equals ( "<STR_LIT>" ) ) { this . options . put ( CompilerOptions . OPTION_TargetPlatform , CompilerOptions . VERSION_1_4 ) ; } else if ( currentArg . equals ( "<STR_LIT>" ) || currentArg . equals ( "<STR_LIT:5>" ) || currentArg . equals ( "<STR_LIT>" ) ) { this . options . put ( CompilerOptions . OPTION_TargetPlatform , CompilerOptions . VERSION_1_5 ) ; } else if ( currentArg . equals ( "<STR_LIT>" ) || currentArg . equals ( "<STR_LIT:6>" ) || currentArg . equals ( "<STR_LIT>" ) ) { this . options . put ( CompilerOptions . OPTION_TargetPlatform , CompilerOptions . VERSION_1_6 ) ; } else if ( currentArg . equals ( "<STR_LIT>" ) || currentArg . equals ( "<STR_LIT>" ) || currentArg . equals ( "<STR_LIT>" ) ) { this . options . put ( CompilerOptions . OPTION_TargetPlatform , CompilerOptions . VERSION_1_7 ) ; } else if ( currentArg . equals ( "<STR_LIT>" ) ) { this . options . put ( CompilerOptions . OPTION_TargetPlatform , CompilerOptions . VERSION_JSR14 ) ; } else if ( currentArg . equals ( "<STR_LIT>" ) ) { this . options . put ( CompilerOptions . OPTION_TargetPlatform , CompilerOptions . VERSION_CLDC1_1 ) ; this . options . put ( CompilerOptions . OPTION_InlineJsr , CompilerOptions . ENABLED ) ; } else { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , currentArg ) ) ; } mode = DEFAULT ; continue ; case INSIDE_LOG : this . log = currentArg ; mode = DEFAULT ; continue ; case INSIDE_REPETITION : try { this . maxRepetition = Integer . parseInt ( currentArg ) ; if ( this . maxRepetition <= <NUM_LIT:0> ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , currentArg ) ) ; } } catch ( NumberFormatException e ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , currentArg ) ) ; } mode = DEFAULT ; continue ; case INSIDE_MAX_PROBLEMS : try { this . maxProblems = Integer . parseInt ( currentArg ) ; if ( this . maxProblems <= <NUM_LIT:0> ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , currentArg ) ) ; } this . options . put ( CompilerOptions . OPTION_MaxProblemPerUnit , currentArg ) ; } catch ( NumberFormatException e ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , currentArg ) ) ; } mode = DEFAULT ; continue ; case INSIDE_SOURCE : if ( this . didSpecifySource ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , currentArg ) ) ; } this . didSpecifySource = true ; if ( currentArg . equals ( "<STR_LIT>" ) ) { this . options . put ( CompilerOptions . OPTION_Source , CompilerOptions . VERSION_1_3 ) ; } else if ( currentArg . equals ( "<STR_LIT>" ) ) { this . options . put ( CompilerOptions . OPTION_Source , CompilerOptions . VERSION_1_4 ) ; } else if ( currentArg . equals ( "<STR_LIT>" ) || currentArg . equals ( "<STR_LIT:5>" ) || currentArg . equals ( "<STR_LIT>" ) ) { this . options . put ( CompilerOptions . OPTION_Source , CompilerOptions . VERSION_1_5 ) ; } else if ( currentArg . equals ( "<STR_LIT>" ) || currentArg . equals ( "<STR_LIT:6>" ) || currentArg . equals ( "<STR_LIT>" ) ) { this . options . put ( CompilerOptions . OPTION_Source , CompilerOptions . VERSION_1_6 ) ; } else if ( currentArg . equals ( "<STR_LIT>" ) || currentArg . equals ( "<STR_LIT>" ) || currentArg . equals ( "<STR_LIT>" ) ) { this . options . put ( CompilerOptions . OPTION_Source , CompilerOptions . VERSION_1_7 ) ; } else { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , currentArg ) ) ; } mode = DEFAULT ; continue ; case INSIDE_DEFAULT_ENCODING : if ( specifiedEncodings != null ) { if ( ! specifiedEncodings . contains ( currentArg ) ) { if ( specifiedEncodings . size ( ) > <NUM_LIT:1> ) { this . logger . logWarning ( this . bind ( "<STR_LIT>" , currentArg , getAllEncodings ( specifiedEncodings ) ) ) ; } else { this . logger . logWarning ( this . bind ( "<STR_LIT>" , currentArg , getAllEncodings ( specifiedEncodings ) ) ) ; } } } else { specifiedEncodings = new HashSet ( ) ; } try { new InputStreamReader ( new ByteArrayInputStream ( new byte [ <NUM_LIT:0> ] ) , currentArg ) ; } catch ( UnsupportedEncodingException e ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , currentArg ) ) ; } specifiedEncodings . add ( currentArg ) ; this . options . put ( CompilerOptions . OPTION_Encoding , currentArg ) ; mode = DEFAULT ; continue ; case INSIDE_DESTINATION_PATH : setDestinationPath ( currentArg . equals ( NONE ) ? NONE : currentArg ) ; mode = DEFAULT ; continue ; case INSIDE_CLASSPATH_start : mode = DEFAULT ; index += processPaths ( newCommandLineArgs , index , currentArg , classpaths ) ; continue ; case INSIDE_BOOTCLASSPATH_start : mode = DEFAULT ; index += processPaths ( newCommandLineArgs , index , currentArg , bootclasspaths ) ; continue ; case INSIDE_SOURCE_PATH_start : mode = DEFAULT ; String [ ] sourcePaths = new String [ <NUM_LIT:1> ] ; index += processPaths ( newCommandLineArgs , index , currentArg , sourcePaths ) ; sourcepathClasspathArg = sourcePaths [ <NUM_LIT:0> ] ; continue ; case INSIDE_EXT_DIRS : if ( currentArg . indexOf ( "<STR_LIT>" ) != - <NUM_LIT:1> ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , "<STR_LIT>" ) ) ; } StringTokenizer tokenizer = new StringTokenizer ( currentArg , File . pathSeparator , false ) ; extdirsClasspaths = new ArrayList ( DEFAULT_SIZE_CLASSPATH ) ; while ( tokenizer . hasMoreTokens ( ) ) extdirsClasspaths . add ( tokenizer . nextToken ( ) ) ; mode = DEFAULT ; continue ; case INSIDE_ENDORSED_DIRS : if ( currentArg . indexOf ( "<STR_LIT>" ) != - <NUM_LIT:1> ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , "<STR_LIT>" ) ) ; } tokenizer = new StringTokenizer ( currentArg , File . pathSeparator , false ) ; endorsedDirClasspaths = new ArrayList ( DEFAULT_SIZE_CLASSPATH ) ; while ( tokenizer . hasMoreTokens ( ) ) endorsedDirClasspaths . add ( tokenizer . nextToken ( ) ) ; mode = DEFAULT ; continue ; case INSIDE_SOURCE_DIRECTORY_DESTINATION_PATH : if ( currentArg . endsWith ( "<STR_LIT:]>" ) ) { customDestinationPath = currentArg . substring ( <NUM_LIT:0> , currentArg . length ( ) - <NUM_LIT:1> ) ; } else { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , "<STR_LIT>" + currentArg ) ) ; } break ; case INSIDE_PROCESSOR_PATH_start : mode = DEFAULT ; continue ; case INSIDE_PROCESSOR_start : mode = DEFAULT ; continue ; case INSIDE_S_start : mode = DEFAULT ; continue ; case INSIDE_CLASS_NAMES : tokenizer = new StringTokenizer ( currentArg , "<STR_LIT:U+002C>" ) ; if ( this . classNames == null ) { this . classNames = new String [ DEFAULT_SIZE_CLASSPATH ] ; } while ( tokenizer . hasMoreTokens ( ) ) { if ( this . classNames . length == classCount ) { System . arraycopy ( this . classNames , <NUM_LIT:0> , ( this . classNames = new String [ classCount * <NUM_LIT:2> ] ) , <NUM_LIT:0> , classCount ) ; } this . classNames [ classCount ++ ] = tokenizer . nextToken ( ) ; } mode = DEFAULT ; continue ; case INSIDE_WARNINGS_PROPERTIES : initializeWarnings ( currentArg ) ; mode = DEFAULT ; continue ; } if ( customDestinationPath == null ) { if ( File . separatorChar != '<CHAR_LIT:/>' ) { currentArg = currentArg . replace ( '<CHAR_LIT:/>' , File . separatorChar ) ; } if ( currentArg . endsWith ( "<STR_LIT>" ) ) { currentSourceDirectory = currentArg . substring ( <NUM_LIT:0> , currentArg . length ( ) - <NUM_LIT:3> ) ; mode = INSIDE_SOURCE_DIRECTORY_DESTINATION_PATH ; continue ; } currentSourceDirectory = currentArg ; } File dir = new File ( currentSourceDirectory ) ; if ( ! dir . isDirectory ( ) ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , currentSourceDirectory ) ) ; } String [ ] result = FileFinder . find ( dir , SuffixConstants . SUFFIX_STRING_JAVA ) ; if ( NONE . equals ( customDestinationPath ) ) { customDestinationPath = NONE ; } if ( this . filenames != null ) { int length = result . length ; System . arraycopy ( this . filenames , <NUM_LIT:0> , ( this . filenames = new String [ length + filesCount ] ) , <NUM_LIT:0> , filesCount ) ; System . arraycopy ( this . encodings , <NUM_LIT:0> , ( this . encodings = new String [ length + filesCount ] ) , <NUM_LIT:0> , filesCount ) ; System . arraycopy ( this . destinationPaths , <NUM_LIT:0> , ( this . destinationPaths = new String [ length + filesCount ] ) , <NUM_LIT:0> , filesCount ) ; System . arraycopy ( result , <NUM_LIT:0> , this . filenames , filesCount , length ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { this . encodings [ filesCount + i ] = customEncoding ; this . destinationPaths [ filesCount + i ] = customDestinationPath ; } filesCount += length ; customEncoding = null ; customDestinationPath = null ; currentSourceDirectory = null ; } else { this . filenames = result ; filesCount = this . filenames . length ; this . encodings = new String [ filesCount ] ; this . destinationPaths = new String [ filesCount ] ; for ( int i = <NUM_LIT:0> ; i < filesCount ; i ++ ) { this . encodings [ i ] = customEncoding ; this . destinationPaths [ i ] = customDestinationPath ; } customEncoding = null ; customDestinationPath = null ; currentSourceDirectory = null ; } mode = DEFAULT ; continue ; } if ( this . enableJavadocOn ) { this . options . put ( CompilerOptions . OPTION_DocCommentSupport , CompilerOptions . ENABLED ) ; } else if ( this . warnJavadocOn || this . warnAllJavadocOn ) { this . options . put ( CompilerOptions . OPTION_DocCommentSupport , CompilerOptions . ENABLED ) ; this . options . put ( CompilerOptions . OPTION_ReportUnusedParameterIncludeDocCommentReference , CompilerOptions . DISABLED ) ; this . options . put ( CompilerOptions . OPTION_ReportUnusedDeclaredThrownExceptionIncludeDocCommentReference , CompilerOptions . DISABLED ) ; } if ( this . warnJavadocOn ) { this . options . put ( CompilerOptions . OPTION_ReportInvalidJavadocTags , CompilerOptions . ENABLED ) ; this . options . put ( CompilerOptions . OPTION_ReportInvalidJavadocTagsDeprecatedRef , CompilerOptions . ENABLED ) ; this . options . put ( CompilerOptions . OPTION_ReportInvalidJavadocTagsNotVisibleRef , CompilerOptions . ENABLED ) ; this . options . put ( CompilerOptions . OPTION_ReportMissingJavadocTagsVisibility , CompilerOptions . PRIVATE ) ; } if ( encounteredGroovySourceFile ) { this . options . put ( CompilerOptions . OPTIONG_BuildGroovyFiles , CompilerOptions . ENABLED ) ; } else { this . options . put ( CompilerOptions . OPTIONG_BuildGroovyFiles , CompilerOptions . DISABLED ) ; } if ( printUsageRequired || ( filesCount == <NUM_LIT:0> && classCount == <NUM_LIT:0> ) ) { if ( usageSection == null ) { printUsage ( ) ; } else { printUsage ( usageSection ) ; } this . proceed = false ; return ; } if ( this . log != null ) { this . logger . setLog ( this . log ) ; } else { this . showProgress = false ; } this . logger . logVersion ( printVersionRequired ) ; validateOptions ( didSpecifyCompliance ) ; if ( ! didSpecifyDisabledAnnotationProcessing && CompilerOptions . versionToJdkLevel ( this . options . get ( CompilerOptions . OPTION_Compliance ) ) >= ClassFileConstants . JDK1_6 ) { this . options . put ( CompilerOptions . OPTION_Process_Annotations , CompilerOptions . ENABLED ) ; } this . logger . logCommandLineArguments ( newCommandLineArgs ) ; this . logger . logOptions ( this . options ) ; if ( this . maxRepetition == <NUM_LIT:0> ) { this . maxRepetition = <NUM_LIT:1> ; } if ( this . maxRepetition >= <NUM_LIT:3> && ( this . timing & TIMING_ENABLED ) != <NUM_LIT:0> ) { this . compilerStats = new CompilerStats [ this . maxRepetition ] ; } if ( filesCount != <NUM_LIT:0> ) { System . arraycopy ( this . filenames , <NUM_LIT:0> , ( this . filenames = new String [ filesCount ] ) , <NUM_LIT:0> , filesCount ) ; } if ( classCount != <NUM_LIT:0> ) { System . arraycopy ( this . classNames , <NUM_LIT:0> , ( this . classNames = new String [ classCount ] ) , <NUM_LIT:0> , classCount ) ; } setPaths ( bootclasspaths , sourcepathClasspathArg , sourcepathClasspaths , classpaths , extdirsClasspaths , endorsedDirClasspaths , customEncoding ) ; if ( specifiedEncodings != null && specifiedEncodings . size ( ) > <NUM_LIT:1> ) { this . logger . logWarning ( this . bind ( "<STR_LIT>" , ( String ) this . options . get ( CompilerOptions . OPTION_Encoding ) , getAllEncodings ( specifiedEncodings ) ) ) ; } if ( this . pendingErrors != null ) { for ( Iterator iterator = this . pendingErrors . iterator ( ) ; iterator . hasNext ( ) ; ) { String message = ( String ) iterator . next ( ) ; this . logger . logPendingError ( message ) ; } this . pendingErrors = null ; } } private static String getAllEncodings ( Set encodings ) { int size = encodings . size ( ) ; String [ ] allEncodings = new String [ size ] ; encodings . toArray ( allEncodings ) ; Arrays . sort ( allEncodings ) ; StringBuffer buffer = new StringBuffer ( ) ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) { if ( i > <NUM_LIT:0> ) { buffer . append ( "<STR_LIT:U+002CU+0020>" ) ; } buffer . append ( allEncodings [ i ] ) ; } return String . valueOf ( buffer ) ; } private void initializeWarnings ( String propertiesFile ) { File file = new File ( propertiesFile ) ; if ( ! file . exists ( ) ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , propertiesFile ) ) ; } BufferedInputStream stream = null ; Properties properties = null ; try { stream = new BufferedInputStream ( new FileInputStream ( propertiesFile ) ) ; properties = new Properties ( ) ; properties . load ( stream ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , propertiesFile ) ) ; } finally { if ( stream != null ) { try { stream . close ( ) ; } catch ( IOException e ) { } } } for ( Iterator iterator = properties . entrySet ( ) . iterator ( ) ; iterator . hasNext ( ) ; ) { Map . Entry entry = ( Map . Entry ) iterator . next ( ) ; final String key = ( String ) entry . getKey ( ) ; if ( key . startsWith ( "<STR_LIT>" ) ) { this . options . put ( key , entry . getValue ( ) ) ; } } } protected void disableWarnings ( ) { Object [ ] entries = this . options . entrySet ( ) . toArray ( ) ; for ( int i = <NUM_LIT:0> , max = entries . length ; i < max ; i ++ ) { Map . Entry entry = ( Map . Entry ) entries [ i ] ; if ( ! ( entry . getKey ( ) instanceof String ) ) continue ; if ( ! ( entry . getValue ( ) instanceof String ) ) continue ; if ( ( ( String ) entry . getValue ( ) ) . equals ( CompilerOptions . WARNING ) ) { this . options . put ( entry . getKey ( ) , CompilerOptions . IGNORE ) ; } } this . options . put ( CompilerOptions . OPTION_TaskTags , Util . EMPTY_STRING ) ; } protected void disableErrors ( ) { Object [ ] entries = this . options . entrySet ( ) . toArray ( ) ; for ( int i = <NUM_LIT:0> , max = entries . length ; i < max ; i ++ ) { Map . Entry entry = ( Map . Entry ) entries [ i ] ; if ( ! ( entry . getKey ( ) instanceof String ) ) continue ; if ( ! ( entry . getValue ( ) instanceof String ) ) continue ; if ( ( ( String ) entry . getValue ( ) ) . equals ( CompilerOptions . ERROR ) ) { this . options . put ( entry . getKey ( ) , CompilerOptions . IGNORE ) ; } } } public String extractDestinationPathFromSourceFile ( CompilationResult result ) { ICompilationUnit compilationUnit = result . compilationUnit ; if ( compilationUnit != null ) { char [ ] fileName = compilationUnit . getFileName ( ) ; int lastIndex = CharOperation . lastIndexOf ( java . io . File . separatorChar , fileName ) ; if ( lastIndex != - <NUM_LIT:1> ) { final String outputPathName = new String ( fileName , <NUM_LIT:0> , lastIndex ) ; final File output = new File ( outputPathName ) ; if ( output . exists ( ) && output . isDirectory ( ) ) { return outputPathName ; } } } return System . getProperty ( "<STR_LIT>" ) ; } public ICompilerRequestor getBatchRequestor ( ) { return new ICompilerRequestor ( ) { int lineDelta = <NUM_LIT:0> ; public void acceptResult ( CompilationResult compilationResult ) { if ( compilationResult . lineSeparatorPositions != null ) { int unitLineCount = compilationResult . lineSeparatorPositions . length ; this . lineDelta += unitLineCount ; if ( Main . this . showProgress && this . lineDelta > <NUM_LIT> ) { Main . this . logger . logProgress ( ) ; this . lineDelta = <NUM_LIT:0> ; } } Main . this . logger . startLoggingSource ( compilationResult ) ; if ( compilationResult . hasProblems ( ) || compilationResult . hasTasks ( ) ) { Main . this . logger . logProblems ( compilationResult . getAllProblems ( ) , compilationResult . compilationUnit . getContents ( ) , Main . this ) ; } outputClassFiles ( compilationResult ) ; Main . this . logger . endLoggingSource ( ) ; } } ; } public CompilationUnit [ ] getCompilationUnits ( ) { int fileCount = this . filenames . length ; CompilationUnit [ ] units = new CompilationUnit [ fileCount ] ; HashtableOfObject knownFileNames = new HashtableOfObject ( fileCount ) ; String defaultEncoding = ( String ) this . options . get ( CompilerOptions . OPTION_Encoding ) ; if ( Util . EMPTY_STRING . equals ( defaultEncoding ) ) defaultEncoding = null ; for ( int i = <NUM_LIT:0> ; i < fileCount ; i ++ ) { char [ ] charName = this . filenames [ i ] . toCharArray ( ) ; if ( knownFileNames . get ( charName ) != null ) throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , this . filenames [ i ] ) ) ; knownFileNames . put ( charName , charName ) ; File file = new File ( this . filenames [ i ] ) ; if ( ! file . exists ( ) ) throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , this . filenames [ i ] ) ) ; String encoding = this . encodings [ i ] ; if ( encoding == null ) encoding = defaultEncoding ; units [ i ] = new CompilationUnit ( null , this . filenames [ i ] , encoding , this . destinationPaths [ i ] ) ; } return units ; } public IErrorHandlingPolicy getHandlingPolicy ( ) { return new IErrorHandlingPolicy ( ) { public boolean proceedOnErrors ( ) { return Main . this . proceedOnError ; } public boolean stopOnFirstError ( ) { return false ; } } ; } public File getJavaHome ( ) { if ( ! this . javaHomeChecked ) { this . javaHomeChecked = true ; this . javaHomeCache = Util . getJavaHome ( ) ; } return this . javaHomeCache ; } public FileSystem getLibraryAccess ( ) { return new FileSystem ( this . checkedClasspaths , this . filenames ) ; } public IProblemFactory getProblemFactory ( ) { return new DefaultProblemFactory ( this . compilerLocale ) ; } protected ArrayList handleBootclasspath ( ArrayList bootclasspaths , String customEncoding ) { final int bootclasspathsSize ; if ( ( bootclasspaths != null ) && ( ( bootclasspathsSize = bootclasspaths . size ( ) ) != <NUM_LIT:0> ) ) { String [ ] paths = new String [ bootclasspathsSize ] ; bootclasspaths . toArray ( paths ) ; bootclasspaths . clear ( ) ; for ( int i = <NUM_LIT:0> ; i < bootclasspathsSize ; i ++ ) { processPathEntries ( DEFAULT_SIZE_CLASSPATH , bootclasspaths , paths [ i ] , customEncoding , false , true ) ; } } else { bootclasspaths = new ArrayList ( DEFAULT_SIZE_CLASSPATH ) ; try { Util . collectRunningVMBootclasspath ( bootclasspaths ) ; } catch ( IllegalStateException e ) { this . logger . logWrongJDK ( ) ; this . proceed = false ; return null ; } } return bootclasspaths ; } protected ArrayList handleClasspath ( ArrayList classpaths , String customEncoding ) { final int classpathsSize ; if ( ( classpaths != null ) && ( ( classpathsSize = classpaths . size ( ) ) != <NUM_LIT:0> ) ) { String [ ] paths = new String [ classpathsSize ] ; classpaths . toArray ( paths ) ; classpaths . clear ( ) ; for ( int i = <NUM_LIT:0> ; i < classpathsSize ; i ++ ) { processPathEntries ( DEFAULT_SIZE_CLASSPATH , classpaths , paths [ i ] , customEncoding , false , true ) ; } } else { classpaths = new ArrayList ( DEFAULT_SIZE_CLASSPATH ) ; String classProp = System . getProperty ( "<STR_LIT>" ) ; if ( ( classProp == null ) || ( classProp . length ( ) == <NUM_LIT:0> ) ) { addPendingErrors ( this . bind ( "<STR_LIT>" ) ) ; final Classpath classpath = FileSystem . getClasspath ( System . getProperty ( "<STR_LIT>" ) , customEncoding , null ) ; if ( classpath != null ) { classpaths . add ( classpath ) ; } } else { StringTokenizer tokenizer = new StringTokenizer ( classProp , File . pathSeparator ) ; String token ; while ( tokenizer . hasMoreTokens ( ) ) { token = tokenizer . nextToken ( ) ; FileSystem . Classpath currentClasspath = FileSystem . getClasspath ( token , customEncoding , null ) ; if ( currentClasspath != null ) { classpaths . add ( currentClasspath ) ; } else if ( token . length ( ) != <NUM_LIT:0> ) { addPendingErrors ( this . bind ( "<STR_LIT>" , token ) ) ; } } } } ArrayList result = new ArrayList ( ) ; HashMap knownNames = new HashMap ( ) ; FileSystem . ClasspathSectionProblemReporter problemReporter = new FileSystem . ClasspathSectionProblemReporter ( ) { public void invalidClasspathSection ( String jarFilePath ) { addPendingErrors ( bind ( "<STR_LIT>" , jarFilePath ) ) ; } public void multipleClasspathSections ( String jarFilePath ) { addPendingErrors ( bind ( "<STR_LIT>" , jarFilePath ) ) ; } } ; while ( ! classpaths . isEmpty ( ) ) { Classpath current = ( Classpath ) classpaths . remove ( <NUM_LIT:0> ) ; String currentPath = current . getPath ( ) ; if ( knownNames . get ( currentPath ) == null ) { knownNames . put ( currentPath , current ) ; result . add ( current ) ; List linkedJars = current . fetchLinkedJars ( problemReporter ) ; if ( linkedJars != null ) { classpaths . addAll ( <NUM_LIT:0> , linkedJars ) ; } } } return result ; } protected ArrayList handleEndorseddirs ( ArrayList endorsedDirClasspaths ) { final File javaHome = getJavaHome ( ) ; if ( endorsedDirClasspaths == null ) { endorsedDirClasspaths = new ArrayList ( DEFAULT_SIZE_CLASSPATH ) ; String endorsedDirsStr = System . getProperty ( "<STR_LIT>" ) ; if ( endorsedDirsStr == null ) { if ( javaHome != null ) { endorsedDirClasspaths . add ( javaHome . getAbsolutePath ( ) + "<STR_LIT>" ) ; } } else { StringTokenizer tokenizer = new StringTokenizer ( endorsedDirsStr , File . pathSeparator ) ; while ( tokenizer . hasMoreTokens ( ) ) { endorsedDirClasspaths . add ( tokenizer . nextToken ( ) ) ; } } } if ( endorsedDirClasspaths . size ( ) != <NUM_LIT:0> ) { File [ ] directoriesToCheck = new File [ endorsedDirClasspaths . size ( ) ] ; for ( int i = <NUM_LIT:0> ; i < directoriesToCheck . length ; i ++ ) directoriesToCheck [ i ] = new File ( ( String ) endorsedDirClasspaths . get ( i ) ) ; endorsedDirClasspaths . clear ( ) ; File [ ] [ ] endorsedDirsJars = getLibrariesFiles ( directoriesToCheck ) ; if ( endorsedDirsJars != null ) { for ( int i = <NUM_LIT:0> , max = endorsedDirsJars . length ; i < max ; i ++ ) { File [ ] current = endorsedDirsJars [ i ] ; if ( current != null ) { for ( int j = <NUM_LIT:0> , max2 = current . length ; j < max2 ; j ++ ) { FileSystem . Classpath classpath = FileSystem . getClasspath ( current [ j ] . getAbsolutePath ( ) , null , null ) ; if ( classpath != null ) { endorsedDirClasspaths . add ( classpath ) ; } } } else if ( directoriesToCheck [ i ] . isFile ( ) ) { addPendingErrors ( this . bind ( "<STR_LIT>" , directoriesToCheck [ i ] . getAbsolutePath ( ) ) ) ; } } } } return endorsedDirClasspaths ; } protected ArrayList handleExtdirs ( ArrayList extdirsClasspaths ) { final File javaHome = getJavaHome ( ) ; if ( extdirsClasspaths == null ) { extdirsClasspaths = new ArrayList ( DEFAULT_SIZE_CLASSPATH ) ; String extdirsStr = System . getProperty ( "<STR_LIT>" ) ; if ( extdirsStr == null ) { extdirsClasspaths . add ( javaHome . getAbsolutePath ( ) + "<STR_LIT>" ) ; } else { StringTokenizer tokenizer = new StringTokenizer ( extdirsStr , File . pathSeparator ) ; while ( tokenizer . hasMoreTokens ( ) ) extdirsClasspaths . add ( tokenizer . nextToken ( ) ) ; } } if ( extdirsClasspaths . size ( ) != <NUM_LIT:0> ) { File [ ] directoriesToCheck = new File [ extdirsClasspaths . size ( ) ] ; for ( int i = <NUM_LIT:0> ; i < directoriesToCheck . length ; i ++ ) directoriesToCheck [ i ] = new File ( ( String ) extdirsClasspaths . get ( i ) ) ; extdirsClasspaths . clear ( ) ; File [ ] [ ] extdirsJars = getLibrariesFiles ( directoriesToCheck ) ; if ( extdirsJars != null ) { for ( int i = <NUM_LIT:0> , max = extdirsJars . length ; i < max ; i ++ ) { File [ ] current = extdirsJars [ i ] ; if ( current != null ) { for ( int j = <NUM_LIT:0> , max2 = current . length ; j < max2 ; j ++ ) { FileSystem . Classpath classpath = FileSystem . getClasspath ( current [ j ] . getAbsolutePath ( ) , null , null ) ; if ( classpath != null ) { extdirsClasspaths . add ( classpath ) ; } } } else if ( directoriesToCheck [ i ] . isFile ( ) ) { addPendingErrors ( this . bind ( "<STR_LIT>" , directoriesToCheck [ i ] . getAbsolutePath ( ) ) ) ; } } } } return extdirsClasspaths ; } protected void handleWarningToken ( String token , boolean isEnabling ) { handleErrorOrWarningToken ( token , isEnabling , ProblemSeverities . Warning ) ; } protected void handleErrorToken ( String token , boolean isEnabling ) { handleErrorOrWarningToken ( token , isEnabling , ProblemSeverities . Error ) ; } private void setSeverity ( String compilerOptions , int severity , boolean isEnabling ) { if ( isEnabling ) { switch ( severity ) { case ProblemSeverities . Error : this . options . put ( compilerOptions , CompilerOptions . ERROR ) ; break ; case ProblemSeverities . Warning : this . options . put ( compilerOptions , CompilerOptions . WARNING ) ; break ; default : this . options . put ( compilerOptions , CompilerOptions . IGNORE ) ; } } else { switch ( severity ) { case ProblemSeverities . Error : String currentValue = ( String ) this . options . get ( compilerOptions ) ; if ( CompilerOptions . ERROR . equals ( currentValue ) ) { this . options . put ( compilerOptions , CompilerOptions . IGNORE ) ; } break ; case ProblemSeverities . Warning : currentValue = ( String ) this . options . get ( compilerOptions ) ; if ( CompilerOptions . WARNING . equals ( currentValue ) ) { this . options . put ( compilerOptions , CompilerOptions . IGNORE ) ; } break ; default : this . options . put ( compilerOptions , CompilerOptions . IGNORE ) ; } } } private void handleErrorOrWarningToken ( String token , boolean isEnabling , int severity ) { if ( token . length ( ) == <NUM_LIT:0> ) return ; switch ( token . charAt ( <NUM_LIT:0> ) ) { case '<CHAR_LIT:a>' : if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportDeprecation , severity , isEnabling ) ; this . options . put ( CompilerOptions . OPTION_ReportDeprecationInDeprecatedCode , isEnabling ? CompilerOptions . ENABLED : CompilerOptions . DISABLED ) ; this . options . put ( CompilerOptions . OPTION_ReportDeprecationWhenOverridingDeprecatedMethod , isEnabling ? CompilerOptions . ENABLED : CompilerOptions . DISABLED ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { this . warnAllJavadocOn = this . warnJavadocOn = isEnabling ; setSeverity ( CompilerOptions . OPTION_ReportInvalidJavadoc , severity , isEnabling ) ; setSeverity ( CompilerOptions . OPTION_ReportMissingJavadocTags , severity , isEnabling ) ; setSeverity ( CompilerOptions . OPTION_ReportMissingJavadocComments , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportAssertIdentifier , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportDeadCode , severity , isEnabling ) ; this . options . put ( CompilerOptions . OPTION_ReportDeadCodeInTrivialIfStatement , isEnabling ? CompilerOptions . ENABLED : CompilerOptions . DISABLED ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportMissingOverrideAnnotation , severity , isEnabling ) ; this . options . put ( CompilerOptions . OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation , isEnabling ? CompilerOptions . ENABLED : CompilerOptions . DISABLED ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportMethodCanBeStatic , severity , isEnabling ) ; setSeverity ( CompilerOptions . OPTION_ReportMethodCanBePotentiallyStatic , severity , isEnabling ) ; return ; } break ; case '<CHAR_LIT:b>' : if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportAutoboxing , severity , isEnabling ) ; return ; } break ; case '<CHAR_LIT:c>' : if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportMethodWithConstructorName , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportPossibleAccidentalBooleanAssignment , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportComparingIdentical , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportNoImplicitStringConversion , severity , isEnabling ) ; return ; } break ; case '<CHAR_LIT>' : if ( token . equals ( "<STR_LIT:deprecation>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportDeprecation , severity , isEnabling ) ; this . options . put ( CompilerOptions . OPTION_ReportDeprecationInDeprecatedCode , CompilerOptions . DISABLED ) ; this . options . put ( CompilerOptions . OPTION_ReportDeprecationWhenOverridingDeprecatedMethod , CompilerOptions . DISABLED ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportMissingDeprecatedAnnotation , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportDiscouragedReference , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportDeadCode , severity , isEnabling ) ; this . options . put ( CompilerOptions . OPTION_ReportDeadCodeInTrivialIfStatement , CompilerOptions . DISABLED ) ; return ; } break ; case '<CHAR_LIT:e>' : if ( token . equals ( "<STR_LIT>" ) || token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportIncompleteEnumSwitch , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportUndocumentedEmptyBlock , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportEnumIdentifier , severity , isEnabling ) ; return ; } break ; case '<CHAR_LIT>' : if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportFieldHiding , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportFinalParameterBound , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportFinallyBlockNotCompletingNormally , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportForbiddenReference , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportFallthroughCase , severity , isEnabling ) ; return ; } break ; case '<CHAR_LIT>' : if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportHiddenCatchBlock , severity , isEnabling ) ; setSeverity ( CompilerOptions . OPTION_ReportLocalVariableHiding , severity , isEnabling ) ; setSeverity ( CompilerOptions . OPTION_ReportFieldHiding , severity , isEnabling ) ; setSeverity ( CompilerOptions . OPTION_ReportTypeParameterHiding , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportMissingHashCodeMethod , severity , isEnabling ) ; return ; } break ; case '<CHAR_LIT>' : if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportIndirectStaticAccess , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) || token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportIncompatibleNonInheritedInterfaceMethod , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportAnnotationSuperInterface , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportRedundantSuperinterface , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { this . options . put ( CompilerOptions . OPTION_IncludeNullInfoFromAsserts , isEnabling ? CompilerOptions . ENABLED : CompilerOptions . DISABLED ) ; return ; } break ; case '<CHAR_LIT>' : if ( token . equals ( "<STR_LIT>" ) ) { this . warnJavadocOn = isEnabling ; setSeverity ( CompilerOptions . OPTION_ReportInvalidJavadoc , severity , isEnabling ) ; setSeverity ( CompilerOptions . OPTION_ReportMissingJavadocTags , severity , isEnabling ) ; return ; } break ; case '<CHAR_LIT>' : if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportLocalVariableHiding , severity , isEnabling ) ; return ; } break ; case '<CHAR_LIT>' : if ( token . equals ( "<STR_LIT>" ) || token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportHiddenCatchBlock , severity , isEnabling ) ; return ; } break ; case '<CHAR_LIT>' : if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportNonExternalizedStringLiteral , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportNoEffectAssignment , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportNoImplicitStringConversion , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT:null>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportNullReference , severity , isEnabling ) ; setSeverity ( CompilerOptions . OPTION_ReportPotentialNullReference , severity , isEnabling ) ; setSeverity ( CompilerOptions . OPTION_ReportRedundantNullCheck , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportNullReference , severity , isEnabling ) ; if ( ! isEnabling ) { setSeverity ( CompilerOptions . OPTION_ReportPotentialNullReference , ProblemSeverities . Ignore , isEnabling ) ; setSeverity ( CompilerOptions . OPTION_ReportRedundantNullCheck , ProblemSeverities . Ignore , isEnabling ) ; } return ; } break ; case '<CHAR_LIT>' : if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportMissingSynchronizedOnInheritedMethod , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportMissingOverrideAnnotation , severity , isEnabling ) ; this . options . put ( CompilerOptions . OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation , CompilerOptions . DISABLED ) ; return ; } break ; case '<CHAR_LIT>' : if ( token . equals ( "<STR_LIT>" ) || token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportOverridingPackageDefaultMethod , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportParameterAssignment , severity , isEnabling ) ; return ; } break ; case '<CHAR_LIT>' : if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportRawTypeReference , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportRedundantSuperinterface , severity , isEnabling ) ; return ; } break ; case '<CHAR_LIT>' : if ( token . equals ( "<STR_LIT>" ) ) { this . options . put ( CompilerOptions . OPTION_ReportSpecialParameterHidingField , isEnabling ? CompilerOptions . ENABLED : CompilerOptions . DISABLED ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) || token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportSyntheticAccessEmulation , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportNonStaticAccessToStatic , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportMissingSynchronizedOnInheritedMethod , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportEmptyStatement , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT:serial>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportMissingSerialVersion , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { switch ( severity ) { case ProblemSeverities . Warning : this . options . put ( CompilerOptions . OPTION_SuppressWarnings , isEnabling ? CompilerOptions . ENABLED : CompilerOptions . DISABLED ) ; this . options . put ( CompilerOptions . OPTION_SuppressOptionalErrors , CompilerOptions . DISABLED ) ; break ; case ProblemSeverities . Error : this . options . put ( CompilerOptions . OPTION_SuppressWarnings , isEnabling ? CompilerOptions . ENABLED : CompilerOptions . DISABLED ) ; this . options . put ( CompilerOptions . OPTION_SuppressOptionalErrors , isEnabling ? CompilerOptions . ENABLED : CompilerOptions . DISABLED ) ; } return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportNonStaticAccessToStatic , severity , isEnabling ) ; setSeverity ( CompilerOptions . OPTION_ReportIndirectStaticAccess , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportOverridingMethodWithoutSuperInvocation , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportMethodCanBeStatic , severity , isEnabling ) ; return ; } break ; case '<CHAR_LIT>' : if ( token . startsWith ( "<STR_LIT>" ) ) { String taskTags = Util . EMPTY_STRING ; int start = token . indexOf ( '<CHAR_LIT:(>' ) ; int end = token . indexOf ( '<CHAR_LIT:)>' ) ; if ( start >= <NUM_LIT:0> && end >= <NUM_LIT:0> && start < end ) { taskTags = token . substring ( start + <NUM_LIT:1> , end ) . trim ( ) ; taskTags = taskTags . replace ( '<CHAR_LIT>' , '<CHAR_LIT:U+002C>' ) ; } if ( taskTags . length ( ) == <NUM_LIT:0> ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , token ) ) ; } this . options . put ( CompilerOptions . OPTION_TaskTags , isEnabling ? taskTags : Util . EMPTY_STRING ) ; setSeverity ( CompilerOptions . OPTION_ReportTasks , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportTypeParameterHiding , severity , isEnabling ) ; return ; } break ; case '<CHAR_LIT>' : if ( token . equals ( "<STR_LIT>" ) || token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportUnusedLocal , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) || token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportUnusedParameter , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) || token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportUnusedImport , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportUnusedObjectAllocation , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportUnusedPrivateMember , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportUnusedLabel , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportUnnecessaryTypeCheck , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT:unchecked>" ) || token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportUncheckedTypeOperation , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportUnnecessaryElse , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportUnusedDeclaredThrownException , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) || token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportUnqualifiedFieldAccess , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT:unused>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportUnusedLocal , severity , isEnabling ) ; setSeverity ( CompilerOptions . OPTION_ReportUnusedParameter , severity , isEnabling ) ; setSeverity ( CompilerOptions . OPTION_ReportUnusedImport , severity , isEnabling ) ; setSeverity ( CompilerOptions . OPTION_ReportUnusedPrivateMember , severity , isEnabling ) ; setSeverity ( CompilerOptions . OPTION_ReportUnusedDeclaredThrownException , severity , isEnabling ) ; setSeverity ( CompilerOptions . OPTION_ReportUnusedLabel , severity , isEnabling ) ; setSeverity ( CompilerOptions . OPTION_ReportUnusedTypeArgumentsForMethodInvocation , severity , isEnabling ) ; setSeverity ( CompilerOptions . OPTION_ReportRedundantSpecificationOfTypeArguments , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportUnusedTypeArgumentsForMethodInvocation , severity , isEnabling ) ; setSeverity ( CompilerOptions . OPTION_ReportRedundantSpecificationOfTypeArguments , severity , isEnabling ) ; return ; } else if ( token . equals ( "<STR_LIT>" ) ) { this . options . put ( CompilerOptions . OPTION_ReportUnavoidableGenericTypeProblems , isEnabling ? CompilerOptions . ENABLED : CompilerOptions . DISABLED ) ; return ; } break ; case '<CHAR_LIT>' : if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportVarargsArgumentNeedCast , severity , isEnabling ) ; return ; } break ; case '<CHAR_LIT>' : if ( token . equals ( "<STR_LIT>" ) ) { setSeverity ( CompilerOptions . OPTION_ReportUnhandledWarningToken , severity , isEnabling ) ; setSeverity ( CompilerOptions . OPTION_ReportUnusedWarningToken , severity , isEnabling ) ; return ; } break ; } String message = null ; switch ( severity ) { case ProblemSeverities . Warning : message = this . bind ( "<STR_LIT>" , token ) ; break ; case ProblemSeverities . Error : message = this . bind ( "<STR_LIT>" , token ) ; } addPendingErrors ( message ) ; } protected void initialize ( PrintWriter outWriter , PrintWriter errWriter , boolean systemExit ) { this . initialize ( outWriter , errWriter , systemExit , null , null ) ; } protected void initialize ( PrintWriter outWriter , PrintWriter errWriter , boolean systemExit , Map customDefaultOptions ) { this . initialize ( outWriter , errWriter , systemExit , customDefaultOptions , null ) ; } protected void initialize ( PrintWriter outWriter , PrintWriter errWriter , boolean systemExit , Map customDefaultOptions , CompilationProgress compilationProgress ) { this . logger = new Logger ( this , outWriter , errWriter ) ; this . proceed = true ; this . out = outWriter ; this . err = errWriter ; this . systemExitWhenFinished = systemExit ; this . options = new CompilerOptions ( ) . getMap ( ) ; this . progress = compilationProgress ; if ( customDefaultOptions != null ) { this . didSpecifySource = customDefaultOptions . get ( CompilerOptions . OPTION_Source ) != null ; this . didSpecifyTarget = customDefaultOptions . get ( CompilerOptions . OPTION_TargetPlatform ) != null ; for ( Iterator iter = customDefaultOptions . entrySet ( ) . iterator ( ) ; iter . hasNext ( ) ; ) { Map . Entry entry = ( Map . Entry ) iter . next ( ) ; this . options . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } } else { this . didSpecifySource = false ; this . didSpecifyTarget = false ; } this . classNames = null ; } protected void initializeAnnotationProcessorManager ( ) { try { Class c = Class . forName ( "<STR_LIT>" ) ; AbstractAnnotationProcessorManager annotationManager = ( AbstractAnnotationProcessorManager ) c . newInstance ( ) ; annotationManager . configure ( this , this . expandedCommandLine ) ; annotationManager . setErr ( this . err ) ; annotationManager . setOut ( this . out ) ; this . batchCompiler . annotationProcessorManager = annotationManager ; } catch ( ClassNotFoundException e ) { } catch ( InstantiationException e ) { throw new org . eclipse . jdt . internal . compiler . problem . AbortCompilation ( ) ; } catch ( IllegalAccessException e ) { throw new org . eclipse . jdt . internal . compiler . problem . AbortCompilation ( ) ; } catch ( UnsupportedClassVersionError e ) { this . logger . logIncorrectVMVersionForAnnotationProcessing ( ) ; } } public void outputClassFiles ( CompilationResult unitResult ) { if ( ! ( ( unitResult == null ) || ( unitResult . hasErrors ( ) && ! this . proceedOnError ) ) ) { ClassFile [ ] classFiles = unitResult . getClassFiles ( ) ; String currentDestinationPath = null ; boolean generateClasspathStructure = false ; CompilationUnit compilationUnit = ( CompilationUnit ) unitResult . compilationUnit ; if ( compilationUnit . destinationPath == null ) { if ( this . destinationPath == null ) { currentDestinationPath = extractDestinationPathFromSourceFile ( unitResult ) ; } else if ( this . destinationPath != NONE ) { currentDestinationPath = this . destinationPath ; generateClasspathStructure = true ; } } else if ( compilationUnit . destinationPath != NONE ) { currentDestinationPath = compilationUnit . destinationPath ; generateClasspathStructure = true ; } if ( currentDestinationPath != null ) { for ( int i = <NUM_LIT:0> , fileCount = classFiles . length ; i < fileCount ; i ++ ) { ClassFile classFile = classFiles [ i ] ; char [ ] filename = classFile . fileName ( ) ; int length = filename . length ; char [ ] relativeName = new char [ length + <NUM_LIT:6> ] ; System . arraycopy ( filename , <NUM_LIT:0> , relativeName , <NUM_LIT:0> , length ) ; System . arraycopy ( SuffixConstants . SUFFIX_class , <NUM_LIT:0> , relativeName , length , <NUM_LIT:6> ) ; CharOperation . replace ( relativeName , '<CHAR_LIT:/>' , File . separatorChar ) ; String relativeStringName = new String ( relativeName ) ; try { if ( this . compilerOptions . verbose ) this . out . println ( Messages . bind ( Messages . compilation_write , new String [ ] { String . valueOf ( this . exportedClassFilesCounter + <NUM_LIT:1> ) , relativeStringName } ) ) ; Util . writeToDisk ( generateClasspathStructure , currentDestinationPath , relativeStringName , classFile ) ; this . logger . logClassFile ( generateClasspathStructure , currentDestinationPath , relativeStringName ) ; this . exportedClassFilesCounter ++ ; } catch ( IOException e ) { this . logger . logNoClassFileCreated ( currentDestinationPath , relativeStringName , e ) ; } } this . batchCompiler . lookupEnvironment . releaseClassFiles ( classFiles ) ; } } } public void performCompilation ( ) { this . startTime = System . currentTimeMillis ( ) ; FileSystem environment = getLibraryAccess ( ) ; this . compilerOptions = new CompilerOptions ( this . options ) ; this . compilerOptions . performMethodsFullRecovery = false ; this . compilerOptions . performStatementsRecovery = false ; this . batchCompiler = new Compiler ( environment , getHandlingPolicy ( ) , this . compilerOptions , getBatchRequestor ( ) , getProblemFactory ( ) , this . out , this . progress ) ; this . batchCompiler . remainingIterations = this . maxRepetition - this . currentRepetition ; String setting = System . getProperty ( "<STR_LIT>" ) ; this . batchCompiler . useSingleThread = setting != null && setting . equals ( "<STR_LIT:true>" ) ; if ( this . compilerOptions . complianceLevel >= ClassFileConstants . JDK1_6 && this . compilerOptions . processAnnotations ) { if ( checkVMVersion ( ClassFileConstants . JDK1_6 ) ) { initializeAnnotationProcessorManager ( ) ; if ( this . classNames != null ) { this . batchCompiler . setBinaryTypes ( processClassNames ( this . batchCompiler . lookupEnvironment ) ) ; } } else { this . logger . logIncorrectVMVersionForAnnotationProcessing ( ) ; } } this . compilerOptions . verbose = this . verbose ; this . compilerOptions . produceReferenceInfo = this . produceRefInfo ; try { this . logger . startLoggingSources ( ) ; this . batchCompiler . compile ( getCompilationUnits ( ) ) ; } finally { this . logger . endLoggingSources ( ) ; } if ( this . extraProblems != null ) { loggingExtraProblems ( ) ; this . extraProblems = null ; } if ( this . compilerStats != null ) { this . compilerStats [ this . currentRepetition ] = this . batchCompiler . stats ; } this . logger . printStats ( ) ; environment . cleanup ( ) ; } protected void loggingExtraProblems ( ) { this . logger . loggingExtraProblems ( this ) ; } public void printUsage ( ) { printUsage ( "<STR_LIT>" ) ; } private void printUsage ( String sectionID ) { this . logger . logUsage ( this . bind ( sectionID , new String [ ] { System . getProperty ( "<STR_LIT>" ) , this . bind ( "<STR_LIT>" ) , this . bind ( "<STR_LIT>" ) , this . bind ( "<STR_LIT>" ) } ) ) ; this . logger . flush ( ) ; } private ReferenceBinding [ ] processClassNames ( LookupEnvironment environment ) { int length = this . classNames . length ; ReferenceBinding [ ] referenceBindings = new ReferenceBinding [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { String currentName = this . classNames [ i ] ; char [ ] [ ] compoundName = null ; if ( currentName . indexOf ( '<CHAR_LIT:.>' ) != - <NUM_LIT:1> ) { char [ ] typeName = currentName . toCharArray ( ) ; compoundName = CharOperation . splitOn ( '<CHAR_LIT:.>' , typeName ) ; } else { compoundName = new char [ ] [ ] { currentName . toCharArray ( ) } ; } ReferenceBinding type = environment . getType ( compoundName ) ; if ( type != null && type . isValidBinding ( ) ) { if ( type . isBinaryBinding ( ) ) { referenceBindings [ i ] = type ; } } else { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , currentName ) ) ; } } return referenceBindings ; } public void processPathEntries ( final int defaultSize , final ArrayList paths , final String currentPath , String customEncoding , boolean isSourceOnly , boolean rejectDestinationPathOnJars ) { String currentClasspathName = null ; String currentDestinationPath = null ; ArrayList currentRuleSpecs = new ArrayList ( defaultSize ) ; StringTokenizer tokenizer = new StringTokenizer ( currentPath , File . pathSeparator + "<STR_LIT:[]>" , true ) ; ArrayList tokens = new ArrayList ( ) ; while ( tokenizer . hasMoreTokens ( ) ) { tokens . add ( tokenizer . nextToken ( ) ) ; } final int start = <NUM_LIT:0> ; final int readyToClose = <NUM_LIT:1> ; final int readyToCloseEndingWithRules = <NUM_LIT:2> ; final int readyToCloseOrOtherEntry = <NUM_LIT:3> ; final int rulesNeedAnotherRule = <NUM_LIT:4> ; final int rulesStart = <NUM_LIT:5> ; final int rulesReadyToClose = <NUM_LIT:6> ; final int destinationPathReadyToClose = <NUM_LIT:7> ; final int readyToCloseEndingWithDestinationPath = <NUM_LIT:8> ; final int destinationPathStart = <NUM_LIT:9> ; final int bracketOpened = <NUM_LIT:10> ; final int bracketClosed = <NUM_LIT:11> ; final int error = <NUM_LIT> ; int state = start ; String token = null ; int cursor = <NUM_LIT:0> , tokensNb = tokens . size ( ) , bracket = - <NUM_LIT:1> ; while ( cursor < tokensNb && state != error ) { token = ( String ) tokens . get ( cursor ++ ) ; if ( token . equals ( File . pathSeparator ) ) { switch ( state ) { case start : case readyToCloseOrOtherEntry : case bracketOpened : break ; case readyToClose : case readyToCloseEndingWithRules : case readyToCloseEndingWithDestinationPath : state = readyToCloseOrOtherEntry ; addNewEntry ( paths , currentClasspathName , currentRuleSpecs , customEncoding , currentDestinationPath , isSourceOnly , rejectDestinationPathOnJars ) ; currentRuleSpecs . clear ( ) ; break ; case rulesReadyToClose : state = rulesNeedAnotherRule ; break ; case destinationPathReadyToClose : throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , currentPath ) ) ; case bracketClosed : cursor = bracket + <NUM_LIT:1> ; state = rulesStart ; break ; default : state = error ; } } else if ( token . equals ( "<STR_LIT:[>" ) ) { switch ( state ) { case start : currentClasspathName = "<STR_LIT>" ; case readyToClose : bracket = cursor - <NUM_LIT:1> ; case bracketClosed : state = bracketOpened ; break ; case readyToCloseEndingWithRules : state = destinationPathStart ; break ; case readyToCloseEndingWithDestinationPath : state = rulesStart ; break ; case bracketOpened : default : state = error ; } } else if ( token . equals ( "<STR_LIT:]>" ) ) { switch ( state ) { case rulesReadyToClose : state = readyToCloseEndingWithRules ; break ; case destinationPathReadyToClose : state = readyToCloseEndingWithDestinationPath ; break ; case bracketOpened : state = bracketClosed ; break ; case bracketClosed : default : state = error ; } } else { switch ( state ) { case start : case readyToCloseOrOtherEntry : state = readyToClose ; currentClasspathName = token ; break ; case rulesStart : if ( token . startsWith ( "<STR_LIT>" ) ) { if ( currentDestinationPath != null ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , currentPath ) ) ; } currentDestinationPath = token . substring ( <NUM_LIT:3> ) . trim ( ) ; state = destinationPathReadyToClose ; break ; } case rulesNeedAnotherRule : if ( currentDestinationPath != null ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , currentPath ) ) ; } state = rulesReadyToClose ; currentRuleSpecs . add ( token ) ; break ; case destinationPathStart : if ( ! token . startsWith ( "<STR_LIT>" ) ) { state = error ; } else { currentDestinationPath = token . substring ( <NUM_LIT:3> ) . trim ( ) ; state = destinationPathReadyToClose ; } break ; case bracketClosed : for ( int i = bracket ; i < cursor ; i ++ ) { currentClasspathName += ( String ) tokens . get ( i ) ; } state = readyToClose ; break ; case bracketOpened : break ; default : state = error ; } } if ( state == bracketClosed && cursor == tokensNb ) { cursor = bracket + <NUM_LIT:1> ; state = rulesStart ; } } switch ( state ) { case readyToCloseOrOtherEntry : break ; case readyToClose : case readyToCloseEndingWithRules : case readyToCloseEndingWithDestinationPath : addNewEntry ( paths , currentClasspathName , currentRuleSpecs , customEncoding , currentDestinationPath , isSourceOnly , rejectDestinationPathOnJars ) ; break ; case bracketOpened : case bracketClosed : default : if ( currentPath . length ( ) != <NUM_LIT:0> ) { addPendingErrors ( this . bind ( "<STR_LIT>" , currentPath ) ) ; } } } private int processPaths ( String [ ] args , int index , String currentArg , ArrayList paths ) { int localIndex = index ; int count = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> , max = currentArg . length ( ) ; i < max ; i ++ ) { switch ( currentArg . charAt ( i ) ) { case '<CHAR_LIT:[>' : count ++ ; break ; case '<CHAR_LIT:]>' : count -- ; break ; } } if ( count == <NUM_LIT:0> ) { paths . add ( currentArg ) ; } else if ( count > <NUM_LIT:1> ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , currentArg ) ) ; } else { StringBuffer currentPath = new StringBuffer ( currentArg ) ; while ( true ) { if ( localIndex >= args . length ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , currentArg ) ) ; } localIndex ++ ; String nextArg = args [ localIndex ] ; for ( int i = <NUM_LIT:0> , max = nextArg . length ( ) ; i < max ; i ++ ) { switch ( nextArg . charAt ( i ) ) { case '<CHAR_LIT:[>' : if ( count > <NUM_LIT:1> ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , nextArg ) ) ; } count ++ ; break ; case '<CHAR_LIT:]>' : count -- ; break ; } } if ( count == <NUM_LIT:0> ) { currentPath . append ( '<CHAR_LIT:U+0020>' ) ; currentPath . append ( nextArg ) ; paths . add ( currentPath . toString ( ) ) ; return localIndex - index ; } else if ( count < <NUM_LIT:0> ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , nextArg ) ) ; } else { currentPath . append ( '<CHAR_LIT:U+0020>' ) ; currentPath . append ( nextArg ) ; } } } return localIndex - index ; } private int processPaths ( String [ ] args , int index , String currentArg , String [ ] paths ) { int localIndex = index ; int count = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> , max = currentArg . length ( ) ; i < max ; i ++ ) { switch ( currentArg . charAt ( i ) ) { case '<CHAR_LIT:[>' : count ++ ; break ; case '<CHAR_LIT:]>' : count -- ; break ; } } if ( count == <NUM_LIT:0> ) { paths [ <NUM_LIT:0> ] = currentArg ; } else { StringBuffer currentPath = new StringBuffer ( currentArg ) ; while ( true ) { localIndex ++ ; if ( localIndex >= args . length ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , currentArg ) ) ; } String nextArg = args [ localIndex ] ; for ( int i = <NUM_LIT:0> , max = nextArg . length ( ) ; i < max ; i ++ ) { switch ( nextArg . charAt ( i ) ) { case '<CHAR_LIT:[>' : if ( count > <NUM_LIT:1> ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , currentArg ) ) ; } count ++ ; break ; case '<CHAR_LIT:]>' : count -- ; break ; } } if ( count == <NUM_LIT:0> ) { currentPath . append ( '<CHAR_LIT:U+0020>' ) ; currentPath . append ( nextArg ) ; paths [ <NUM_LIT:0> ] = currentPath . toString ( ) ; return localIndex - index ; } else if ( count < <NUM_LIT:0> ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , currentArg ) ) ; } else { currentPath . append ( '<CHAR_LIT:U+0020>' ) ; currentPath . append ( nextArg ) ; } } } return localIndex - index ; } public void relocalize ( ) { relocalize ( Locale . getDefault ( ) ) ; } private void relocalize ( Locale locale ) { this . compilerLocale = locale ; try { this . bundle = ResourceBundleFactory . getBundle ( locale ) ; } catch ( MissingResourceException e ) { System . out . println ( "<STR_LIT>" + Main . bundleName . replace ( '<CHAR_LIT:.>' , '<CHAR_LIT:/>' ) + "<STR_LIT>" + locale ) ; throw e ; } } public void setDestinationPath ( String dest ) { this . destinationPath = dest ; } public void setLocale ( Locale locale ) { relocalize ( locale ) ; } protected void setPaths ( ArrayList bootclasspaths , String sourcepathClasspathArg , ArrayList sourcepathClasspaths , ArrayList classpaths , ArrayList extdirsClasspaths , ArrayList endorsedDirClasspaths , String customEncoding ) { bootclasspaths = handleBootclasspath ( bootclasspaths , customEncoding ) ; classpaths = handleClasspath ( classpaths , customEncoding ) ; if ( sourcepathClasspathArg != null ) { processPathEntries ( DEFAULT_SIZE_CLASSPATH , sourcepathClasspaths , sourcepathClasspathArg , customEncoding , true , false ) ; } extdirsClasspaths = handleExtdirs ( extdirsClasspaths ) ; endorsedDirClasspaths = handleEndorseddirs ( endorsedDirClasspaths ) ; bootclasspaths . addAll ( endorsedDirClasspaths ) ; bootclasspaths . addAll ( extdirsClasspaths ) ; bootclasspaths . addAll ( sourcepathClasspaths ) ; bootclasspaths . addAll ( classpaths ) ; classpaths = bootclasspaths ; classpaths = FileSystem . ClasspathNormalizer . normalize ( classpaths ) ; this . checkedClasspaths = new FileSystem . Classpath [ classpaths . size ( ) ] ; classpaths . toArray ( this . checkedClasspaths ) ; this . logger . logClasspath ( this . checkedClasspaths ) ; } protected void validateOptions ( boolean didSpecifyCompliance ) { if ( didSpecifyCompliance ) { Object version = this . options . get ( CompilerOptions . OPTION_Compliance ) ; if ( CompilerOptions . VERSION_1_3 . equals ( version ) ) { if ( ! this . didSpecifySource ) this . options . put ( CompilerOptions . OPTION_Source , CompilerOptions . VERSION_1_3 ) ; if ( ! this . didSpecifyTarget ) this . options . put ( CompilerOptions . OPTION_TargetPlatform , CompilerOptions . VERSION_1_1 ) ; } else if ( CompilerOptions . VERSION_1_4 . equals ( version ) ) { if ( this . didSpecifySource ) { Object source = this . options . get ( CompilerOptions . OPTION_Source ) ; if ( CompilerOptions . VERSION_1_3 . equals ( source ) ) { if ( ! this . didSpecifyTarget ) this . options . put ( CompilerOptions . OPTION_TargetPlatform , CompilerOptions . VERSION_1_2 ) ; } else if ( CompilerOptions . VERSION_1_4 . equals ( source ) ) { if ( ! this . didSpecifyTarget ) this . options . put ( CompilerOptions . OPTION_TargetPlatform , CompilerOptions . VERSION_1_4 ) ; } } else { this . options . put ( CompilerOptions . OPTION_Source , CompilerOptions . VERSION_1_3 ) ; if ( ! this . didSpecifyTarget ) this . options . put ( CompilerOptions . OPTION_TargetPlatform , CompilerOptions . VERSION_1_2 ) ; } } else if ( CompilerOptions . VERSION_1_5 . equals ( version ) ) { if ( this . didSpecifySource ) { Object source = this . options . get ( CompilerOptions . OPTION_Source ) ; if ( CompilerOptions . VERSION_1_3 . equals ( source ) || CompilerOptions . VERSION_1_4 . equals ( source ) ) { if ( ! this . didSpecifyTarget ) this . options . put ( CompilerOptions . OPTION_TargetPlatform , CompilerOptions . VERSION_1_4 ) ; } else if ( CompilerOptions . VERSION_1_5 . equals ( source ) ) { if ( ! this . didSpecifyTarget ) this . options . put ( CompilerOptions . OPTION_TargetPlatform , CompilerOptions . VERSION_1_5 ) ; } } else { this . options . put ( CompilerOptions . OPTION_Source , CompilerOptions . VERSION_1_5 ) ; if ( ! this . didSpecifyTarget ) this . options . put ( CompilerOptions . OPTION_TargetPlatform , CompilerOptions . VERSION_1_5 ) ; } } else if ( CompilerOptions . VERSION_1_6 . equals ( version ) ) { if ( this . didSpecifySource ) { Object source = this . options . get ( CompilerOptions . OPTION_Source ) ; if ( CompilerOptions . VERSION_1_3 . equals ( source ) || CompilerOptions . VERSION_1_4 . equals ( source ) ) { if ( ! this . didSpecifyTarget ) this . options . put ( CompilerOptions . OPTION_TargetPlatform , CompilerOptions . VERSION_1_4 ) ; } else if ( CompilerOptions . VERSION_1_5 . equals ( source ) || CompilerOptions . VERSION_1_6 . equals ( source ) ) { if ( ! this . didSpecifyTarget ) this . options . put ( CompilerOptions . OPTION_TargetPlatform , CompilerOptions . VERSION_1_6 ) ; } } else { this . options . put ( CompilerOptions . OPTION_Source , CompilerOptions . VERSION_1_6 ) ; if ( ! this . didSpecifyTarget ) this . options . put ( CompilerOptions . OPTION_TargetPlatform , CompilerOptions . VERSION_1_6 ) ; } } else if ( CompilerOptions . VERSION_1_7 . equals ( version ) ) { if ( this . didSpecifySource ) { Object source = this . options . get ( CompilerOptions . OPTION_Source ) ; if ( CompilerOptions . VERSION_1_3 . equals ( source ) || CompilerOptions . VERSION_1_4 . equals ( source ) ) { if ( ! this . didSpecifyTarget ) this . options . put ( CompilerOptions . OPTION_TargetPlatform , CompilerOptions . VERSION_1_4 ) ; } else if ( CompilerOptions . VERSION_1_5 . equals ( source ) || CompilerOptions . VERSION_1_6 . equals ( source ) ) { if ( ! this . didSpecifyTarget ) this . options . put ( CompilerOptions . OPTION_TargetPlatform , CompilerOptions . VERSION_1_6 ) ; } else if ( CompilerOptions . VERSION_1_7 . equals ( source ) ) { if ( ! this . didSpecifyTarget ) this . options . put ( CompilerOptions . OPTION_TargetPlatform , CompilerOptions . VERSION_1_7 ) ; } } else { this . options . put ( CompilerOptions . OPTION_Source , CompilerOptions . VERSION_1_7 ) ; if ( ! this . didSpecifyTarget ) this . options . put ( CompilerOptions . OPTION_TargetPlatform , CompilerOptions . VERSION_1_7 ) ; } } } else if ( this . didSpecifySource ) { Object version = this . options . get ( CompilerOptions . OPTION_Source ) ; if ( CompilerOptions . VERSION_1_4 . equals ( version ) ) { if ( ! didSpecifyCompliance ) this . options . put ( CompilerOptions . OPTION_Compliance , CompilerOptions . VERSION_1_4 ) ; if ( ! this . didSpecifyTarget ) this . options . put ( CompilerOptions . OPTION_TargetPlatform , CompilerOptions . VERSION_1_4 ) ; } else if ( CompilerOptions . VERSION_1_5 . equals ( version ) ) { if ( ! didSpecifyCompliance ) this . options . put ( CompilerOptions . OPTION_Compliance , CompilerOptions . VERSION_1_5 ) ; if ( ! this . didSpecifyTarget ) this . options . put ( CompilerOptions . OPTION_TargetPlatform , CompilerOptions . VERSION_1_5 ) ; } else if ( CompilerOptions . VERSION_1_6 . equals ( version ) ) { if ( ! didSpecifyCompliance ) this . options . put ( CompilerOptions . OPTION_Compliance , CompilerOptions . VERSION_1_6 ) ; if ( ! this . didSpecifyTarget ) this . options . put ( CompilerOptions . OPTION_TargetPlatform , CompilerOptions . VERSION_1_6 ) ; } else if ( CompilerOptions . VERSION_1_7 . equals ( version ) ) { if ( ! didSpecifyCompliance ) this . options . put ( CompilerOptions . OPTION_Compliance , CompilerOptions . VERSION_1_7 ) ; if ( ! this . didSpecifyTarget ) this . options . put ( CompilerOptions . OPTION_TargetPlatform , CompilerOptions . VERSION_1_7 ) ; } } final Object sourceVersion = this . options . get ( CompilerOptions . OPTION_Source ) ; final Object compliance = this . options . get ( CompilerOptions . OPTION_Compliance ) ; if ( sourceVersion . equals ( CompilerOptions . VERSION_1_7 ) && CompilerOptions . versionToJdkLevel ( compliance ) < ClassFileConstants . JDK1_7 ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , ( String ) this . options . get ( CompilerOptions . OPTION_Compliance ) , CompilerOptions . VERSION_1_7 ) ) ; } else if ( sourceVersion . equals ( CompilerOptions . VERSION_1_6 ) && CompilerOptions . versionToJdkLevel ( compliance ) < ClassFileConstants . JDK1_6 ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , ( String ) this . options . get ( CompilerOptions . OPTION_Compliance ) , CompilerOptions . VERSION_1_6 ) ) ; } else if ( sourceVersion . equals ( CompilerOptions . VERSION_1_5 ) && CompilerOptions . versionToJdkLevel ( compliance ) < ClassFileConstants . JDK1_5 ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , ( String ) this . options . get ( CompilerOptions . OPTION_Compliance ) , CompilerOptions . VERSION_1_5 ) ) ; } else if ( sourceVersion . equals ( CompilerOptions . VERSION_1_4 ) && CompilerOptions . versionToJdkLevel ( compliance ) < ClassFileConstants . JDK1_4 ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , ( String ) this . options . get ( CompilerOptions . OPTION_Compliance ) , CompilerOptions . VERSION_1_4 ) ) ; } if ( this . didSpecifyTarget ) { final Object targetVersion = this . options . get ( CompilerOptions . OPTION_TargetPlatform ) ; if ( CompilerOptions . VERSION_JSR14 . equals ( targetVersion ) ) { if ( CompilerOptions . versionToJdkLevel ( sourceVersion ) < ClassFileConstants . JDK1_5 ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , ( String ) targetVersion , ( String ) sourceVersion ) ) ; } } else if ( CompilerOptions . VERSION_CLDC1_1 . equals ( targetVersion ) ) { if ( this . didSpecifySource && CompilerOptions . versionToJdkLevel ( sourceVersion ) >= ClassFileConstants . JDK1_4 ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , ( String ) targetVersion , ( String ) sourceVersion ) ) ; } if ( CompilerOptions . versionToJdkLevel ( compliance ) >= ClassFileConstants . JDK1_5 ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , ( String ) targetVersion , ( String ) sourceVersion ) ) ; } } else { if ( CompilerOptions . versionToJdkLevel ( sourceVersion ) >= ClassFileConstants . JDK1_7 && CompilerOptions . versionToJdkLevel ( targetVersion ) < ClassFileConstants . JDK1_7 ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , ( String ) targetVersion , CompilerOptions . VERSION_1_7 ) ) ; } if ( CompilerOptions . versionToJdkLevel ( sourceVersion ) >= ClassFileConstants . JDK1_6 && CompilerOptions . versionToJdkLevel ( targetVersion ) < ClassFileConstants . JDK1_6 ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , ( String ) targetVersion , CompilerOptions . VERSION_1_6 ) ) ; } if ( CompilerOptions . versionToJdkLevel ( sourceVersion ) >= ClassFileConstants . JDK1_5 && CompilerOptions . versionToJdkLevel ( targetVersion ) < ClassFileConstants . JDK1_5 ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , ( String ) targetVersion , CompilerOptions . VERSION_1_5 ) ) ; } if ( CompilerOptions . versionToJdkLevel ( sourceVersion ) >= ClassFileConstants . JDK1_4 && CompilerOptions . versionToJdkLevel ( targetVersion ) < ClassFileConstants . JDK1_4 ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , ( String ) targetVersion , CompilerOptions . VERSION_1_4 ) ) ; } if ( CompilerOptions . versionToJdkLevel ( compliance ) < CompilerOptions . versionToJdkLevel ( targetVersion ) ) { throw new IllegalArgumentException ( this . bind ( "<STR_LIT>" , ( String ) this . options . get ( CompilerOptions . OPTION_Compliance ) , ( String ) targetVersion ) ) ; } } } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . batch ; import java . io . File ; import java . io . FilenameFilter ; import java . io . IOException ; import java . util . Hashtable ; import java . util . List ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileReader ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFormatException ; import org . eclipse . jdt . internal . compiler . env . AccessRuleSet ; import org . eclipse . jdt . internal . compiler . env . NameEnvironmentAnswer ; import org . eclipse . jdt . internal . compiler . parser . ScannerHelper ; import org . eclipse . jdt . internal . compiler . util . Util ; public class ClasspathDirectory extends ClasspathLocation { private Hashtable directoryCache ; private String [ ] missingPackageHolder = new String [ <NUM_LIT:1> ] ; private int mode ; private String encoding ; ClasspathDirectory ( File directory , String encoding , int mode , AccessRuleSet accessRuleSet , String destinationPath ) { super ( accessRuleSet , destinationPath ) ; this . mode = mode ; try { this . path = directory . getCanonicalPath ( ) ; } catch ( IOException e ) { this . path = directory . getAbsolutePath ( ) ; } if ( ! this . path . endsWith ( File . separator ) ) this . path += File . separator ; this . directoryCache = new Hashtable ( <NUM_LIT:11> ) ; this . encoding = encoding ; } String [ ] directoryList ( String qualifiedPackageName ) { String [ ] dirList = ( String [ ] ) this . directoryCache . get ( qualifiedPackageName ) ; if ( dirList == this . missingPackageHolder ) return null ; if ( dirList != null ) return dirList ; File dir = new File ( this . path + qualifiedPackageName ) ; notFound : if ( dir . isDirectory ( ) ) { int index = qualifiedPackageName . length ( ) ; int last = qualifiedPackageName . lastIndexOf ( File . separatorChar ) ; while ( -- index > last && ! ScannerHelper . isUpperCase ( qualifiedPackageName . charAt ( index ) ) ) { } if ( index > last ) { if ( last == - <NUM_LIT:1> ) { if ( ! doesFileExist ( qualifiedPackageName , Util . EMPTY_STRING ) ) break notFound ; } else { String packageName = qualifiedPackageName . substring ( last + <NUM_LIT:1> ) ; String parentPackage = qualifiedPackageName . substring ( <NUM_LIT:0> , last ) ; if ( ! doesFileExist ( packageName , parentPackage ) ) break notFound ; } } if ( ( dirList = dir . list ( ) ) == null ) dirList = CharOperation . NO_STRINGS ; this . directoryCache . put ( qualifiedPackageName , dirList ) ; return dirList ; } this . directoryCache . put ( qualifiedPackageName , this . missingPackageHolder ) ; return null ; } boolean doesFileExist ( String fileName , String qualifiedPackageName ) { String [ ] dirList = directoryList ( qualifiedPackageName ) ; if ( dirList == null ) return false ; for ( int i = dirList . length ; -- i >= <NUM_LIT:0> ; ) if ( fileName . equals ( dirList [ i ] ) ) return true ; return false ; } public List fetchLinkedJars ( FileSystem . ClasspathSectionProblemReporter problemReporter ) { return null ; } public NameEnvironmentAnswer findClass ( char [ ] typeName , String qualifiedPackageName , String qualifiedBinaryFileName ) { return findClass ( typeName , qualifiedPackageName , qualifiedBinaryFileName , false ) ; } public NameEnvironmentAnswer findClass ( char [ ] typeName , String qualifiedPackageName , String qualifiedBinaryFileName , boolean asBinaryOnly ) { if ( ! isPackage ( qualifiedPackageName ) ) return null ; String fileName = new String ( typeName ) ; boolean binaryExists = ( ( this . mode & BINARY ) != <NUM_LIT:0> ) && doesFileExist ( fileName + SUFFIX_STRING_class , qualifiedPackageName ) ; boolean sourceExists = ( ( this . mode & SOURCE ) != <NUM_LIT:0> ) && doesFileExist ( fileName + SUFFIX_STRING_java , qualifiedPackageName ) ; if ( sourceExists && ! asBinaryOnly ) { String fullSourcePath = this . path + qualifiedBinaryFileName . substring ( <NUM_LIT:0> , qualifiedBinaryFileName . length ( ) - <NUM_LIT:6> ) + SUFFIX_STRING_java ; if ( ! binaryExists ) return new NameEnvironmentAnswer ( new CompilationUnit ( null , fullSourcePath , this . encoding , this . destinationPath ) , fetchAccessRestriction ( qualifiedBinaryFileName ) ) ; String fullBinaryPath = this . path + qualifiedBinaryFileName ; long binaryModified = new File ( fullBinaryPath ) . lastModified ( ) ; long sourceModified = new File ( fullSourcePath ) . lastModified ( ) ; if ( sourceModified > binaryModified ) return new NameEnvironmentAnswer ( new CompilationUnit ( null , fullSourcePath , this . encoding , this . destinationPath ) , fetchAccessRestriction ( qualifiedBinaryFileName ) ) ; } if ( binaryExists ) { try { ClassFileReader reader = ClassFileReader . read ( this . path + qualifiedBinaryFileName ) ; String typeSearched = qualifiedPackageName . length ( ) > <NUM_LIT:0> ? qualifiedPackageName . replace ( File . separatorChar , '<CHAR_LIT:/>' ) + "<STR_LIT:/>" + fileName : fileName ; if ( ! CharOperation . equals ( reader . getName ( ) , typeSearched . toCharArray ( ) ) ) { reader = null ; } if ( reader != null ) return new NameEnvironmentAnswer ( reader , fetchAccessRestriction ( qualifiedBinaryFileName ) ) ; } catch ( IOException e ) { } catch ( ClassFormatException e ) { } } return null ; } public char [ ] [ ] [ ] findTypeNames ( String qualifiedPackageName ) { if ( ! isPackage ( qualifiedPackageName ) ) { return null ; } File dir = new File ( this . path + qualifiedPackageName ) ; if ( ! dir . exists ( ) || ! dir . isDirectory ( ) ) { return null ; } String [ ] listFiles = dir . list ( new FilenameFilter ( ) { public boolean accept ( File directory , String name ) { String fileName = name . toLowerCase ( ) ; return fileName . endsWith ( "<STR_LIT:.class>" ) || fileName . endsWith ( "<STR_LIT>" ) ; } } ) ; int length ; if ( listFiles == null || ( length = listFiles . length ) == <NUM_LIT:0> ) { return null ; } char [ ] [ ] [ ] result = new char [ length ] [ ] [ ] ; char [ ] [ ] packageName = CharOperation . splitOn ( File . separatorChar , qualifiedPackageName . toCharArray ( ) ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { String fileName = listFiles [ i ] ; int indexOfLastDot = fileName . indexOf ( '<CHAR_LIT:.>' ) ; result [ i ] = CharOperation . arrayConcat ( packageName , fileName . substring ( <NUM_LIT:0> , indexOfLastDot ) . toCharArray ( ) ) ; } return result ; } public void initialize ( ) throws IOException { } public boolean isPackage ( String qualifiedPackageName ) { return directoryList ( qualifiedPackageName ) != null ; } public void reset ( ) { this . directoryCache = new Hashtable ( <NUM_LIT:11> ) ; } public String toString ( ) { return "<STR_LIT>" + this . path ; } public char [ ] normalizedPath ( ) { if ( this . normalizedPath == null ) { this . normalizedPath = this . path . toCharArray ( ) ; if ( File . separatorChar == '<STR_LIT:\\>' ) { CharOperation . replace ( this . normalizedPath , '<STR_LIT:\\>' , '<CHAR_LIT:/>' ) ; } } return this . normalizedPath ; } public String getPath ( ) { return this . path ; } public int getMode ( ) { return this . mode ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . impl ; public class FloatConstant extends Constant { float value ; public static Constant fromValue ( float value ) { return new FloatConstant ( value ) ; } private FloatConstant ( float value ) { this . value = value ; } public byte byteValue ( ) { return ( byte ) this . value ; } public char charValue ( ) { return ( char ) this . value ; } public double doubleValue ( ) { return this . value ; } public float floatValue ( ) { return this . value ; } public int intValue ( ) { return ( int ) this . value ; } public long longValue ( ) { return ( long ) this . value ; } public short shortValue ( ) { return ( short ) this . value ; } public String stringValue ( ) { return String . valueOf ( this . value ) ; } public String toString ( ) { return "<STR_LIT>" + this . value ; } public int typeID ( ) { return T_float ; } public int hashCode ( ) { return Float . floatToIntBits ( this . value ) ; } public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } FloatConstant other = ( FloatConstant ) obj ; return Float . floatToIntBits ( this . value ) == Float . floatToIntBits ( other . value ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . impl ; import org . eclipse . jdt . internal . compiler . ast . OperatorIds ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; import org . eclipse . jdt . internal . compiler . problem . ShouldNotImplement ; import org . eclipse . jdt . internal . compiler . util . Messages ; public abstract class Constant implements TypeIds , OperatorIds { public static final Constant NotAConstant = DoubleConstant . fromValue ( Double . NaN ) ; public boolean booleanValue ( ) { throw new ShouldNotImplement ( Messages . bind ( Messages . constant_cannotCastedInto , new String [ ] { typeName ( ) , "<STR_LIT:boolean>" } ) ) ; } public byte byteValue ( ) { throw new ShouldNotImplement ( Messages . bind ( Messages . constant_cannotCastedInto , new String [ ] { typeName ( ) , "<STR_LIT>" } ) ) ; } public final Constant castTo ( int conversionToTargetType ) { if ( this == NotAConstant ) return NotAConstant ; switch ( conversionToTargetType ) { case T_undefined : return this ; case ( T_byte << <NUM_LIT:4> ) + T_byte : return this ; case ( T_byte << <NUM_LIT:4> ) + T_long : return ByteConstant . fromValue ( ( byte ) longValue ( ) ) ; case ( T_byte << <NUM_LIT:4> ) + T_short : return ByteConstant . fromValue ( ( byte ) shortValue ( ) ) ; case ( T_byte << <NUM_LIT:4> ) + T_double : return ByteConstant . fromValue ( ( byte ) doubleValue ( ) ) ; case ( T_byte << <NUM_LIT:4> ) + T_float : return ByteConstant . fromValue ( ( byte ) floatValue ( ) ) ; case ( T_byte << <NUM_LIT:4> ) + T_char : return ByteConstant . fromValue ( ( byte ) charValue ( ) ) ; case ( T_byte << <NUM_LIT:4> ) + T_int : return ByteConstant . fromValue ( ( byte ) intValue ( ) ) ; case ( T_long << <NUM_LIT:4> ) + T_byte : return LongConstant . fromValue ( byteValue ( ) ) ; case ( T_long << <NUM_LIT:4> ) + T_long : return this ; case ( T_long << <NUM_LIT:4> ) + T_short : return LongConstant . fromValue ( shortValue ( ) ) ; case ( T_long << <NUM_LIT:4> ) + T_double : return LongConstant . fromValue ( ( long ) doubleValue ( ) ) ; case ( T_long << <NUM_LIT:4> ) + T_float : return LongConstant . fromValue ( ( long ) floatValue ( ) ) ; case ( T_long << <NUM_LIT:4> ) + T_char : return LongConstant . fromValue ( charValue ( ) ) ; case ( T_long << <NUM_LIT:4> ) + T_int : return LongConstant . fromValue ( intValue ( ) ) ; case ( T_short << <NUM_LIT:4> ) + T_byte : return ShortConstant . fromValue ( byteValue ( ) ) ; case ( T_short << <NUM_LIT:4> ) + T_long : return ShortConstant . fromValue ( ( short ) longValue ( ) ) ; case ( T_short << <NUM_LIT:4> ) + T_short : return this ; case ( T_short << <NUM_LIT:4> ) + T_double : return ShortConstant . fromValue ( ( short ) doubleValue ( ) ) ; case ( T_short << <NUM_LIT:4> ) + T_float : return ShortConstant . fromValue ( ( short ) floatValue ( ) ) ; case ( T_short << <NUM_LIT:4> ) + T_char : return ShortConstant . fromValue ( ( short ) charValue ( ) ) ; case ( T_short << <NUM_LIT:4> ) + T_int : return ShortConstant . fromValue ( ( short ) intValue ( ) ) ; case ( T_JavaLangString << <NUM_LIT:4> ) + T_JavaLangString : return this ; case ( T_double << <NUM_LIT:4> ) + T_byte : return DoubleConstant . fromValue ( byteValue ( ) ) ; case ( T_double << <NUM_LIT:4> ) + T_long : return DoubleConstant . fromValue ( longValue ( ) ) ; case ( T_double << <NUM_LIT:4> ) + T_short : return DoubleConstant . fromValue ( shortValue ( ) ) ; case ( T_double << <NUM_LIT:4> ) + T_double : return this ; case ( T_double << <NUM_LIT:4> ) + T_float : return DoubleConstant . fromValue ( floatValue ( ) ) ; case ( T_double << <NUM_LIT:4> ) + T_char : return DoubleConstant . fromValue ( charValue ( ) ) ; case ( T_double << <NUM_LIT:4> ) + T_int : return DoubleConstant . fromValue ( intValue ( ) ) ; case ( T_float << <NUM_LIT:4> ) + T_byte : return FloatConstant . fromValue ( byteValue ( ) ) ; case ( T_float << <NUM_LIT:4> ) + T_long : return FloatConstant . fromValue ( longValue ( ) ) ; case ( T_float << <NUM_LIT:4> ) + T_short : return FloatConstant . fromValue ( shortValue ( ) ) ; case ( T_float << <NUM_LIT:4> ) + T_double : return FloatConstant . fromValue ( ( float ) doubleValue ( ) ) ; case ( T_float << <NUM_LIT:4> ) + T_float : return this ; case ( T_float << <NUM_LIT:4> ) + T_char : return FloatConstant . fromValue ( charValue ( ) ) ; case ( T_float << <NUM_LIT:4> ) + T_int : return FloatConstant . fromValue ( intValue ( ) ) ; case ( T_boolean << <NUM_LIT:4> ) + T_boolean : return this ; case ( T_char << <NUM_LIT:4> ) + T_byte : return CharConstant . fromValue ( ( char ) byteValue ( ) ) ; case ( T_char << <NUM_LIT:4> ) + T_long : return CharConstant . fromValue ( ( char ) longValue ( ) ) ; case ( T_char << <NUM_LIT:4> ) + T_short : return CharConstant . fromValue ( ( char ) shortValue ( ) ) ; case ( T_char << <NUM_LIT:4> ) + T_double : return CharConstant . fromValue ( ( char ) doubleValue ( ) ) ; case ( T_char << <NUM_LIT:4> ) + T_float : return CharConstant . fromValue ( ( char ) floatValue ( ) ) ; case ( T_char << <NUM_LIT:4> ) + T_char : return this ; case ( T_char << <NUM_LIT:4> ) + T_int : return CharConstant . fromValue ( ( char ) intValue ( ) ) ; case ( T_int << <NUM_LIT:4> ) + T_byte : return IntConstant . fromValue ( byteValue ( ) ) ; case ( T_int << <NUM_LIT:4> ) + T_long : return IntConstant . fromValue ( ( int ) longValue ( ) ) ; case ( T_int << <NUM_LIT:4> ) + T_short : return IntConstant . fromValue ( shortValue ( ) ) ; case ( T_int << <NUM_LIT:4> ) + T_double : return IntConstant . fromValue ( ( int ) doubleValue ( ) ) ; case ( T_int << <NUM_LIT:4> ) + T_float : return IntConstant . fromValue ( ( int ) floatValue ( ) ) ; case ( T_int << <NUM_LIT:4> ) + T_char : return IntConstant . fromValue ( charValue ( ) ) ; case ( T_int << <NUM_LIT:4> ) + T_int : return this ; } return NotAConstant ; } public char charValue ( ) { throw new ShouldNotImplement ( Messages . bind ( Messages . constant_cannotCastedInto , new String [ ] { typeName ( ) , "<STR_LIT>" } ) ) ; } public static final Constant computeConstantOperation ( Constant cst , int id , int operator ) { switch ( operator ) { case NOT : return BooleanConstant . fromValue ( ! cst . booleanValue ( ) ) ; case PLUS : return computeConstantOperationPLUS ( IntConstant . fromValue ( <NUM_LIT:0> ) , T_int , cst , id ) ; case MINUS : switch ( id ) { case T_float : float f ; if ( ( f = cst . floatValue ( ) ) == <NUM_LIT:0.0f> ) { if ( Float . floatToIntBits ( f ) == <NUM_LIT:0> ) return FloatConstant . fromValue ( - <NUM_LIT:0.0f> ) ; else return FloatConstant . fromValue ( <NUM_LIT:0.0f> ) ; } break ; case T_double : double d ; if ( ( d = cst . doubleValue ( ) ) == <NUM_LIT> ) { if ( Double . doubleToLongBits ( d ) == <NUM_LIT:0> ) return DoubleConstant . fromValue ( - <NUM_LIT> ) ; else return DoubleConstant . fromValue ( <NUM_LIT> ) ; } break ; } return computeConstantOperationMINUS ( IntConstant . fromValue ( <NUM_LIT:0> ) , T_int , cst , id ) ; case TWIDDLE : switch ( id ) { case T_char : return IntConstant . fromValue ( ~ cst . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( ~ cst . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( ~ cst . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( ~ cst . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( ~ cst . longValue ( ) ) ; default : return NotAConstant ; } default : return NotAConstant ; } } public static final Constant computeConstantOperation ( Constant left , int leftId , int operator , Constant right , int rightId ) { switch ( operator ) { case AND : return computeConstantOperationAND ( left , leftId , right , rightId ) ; case AND_AND : return computeConstantOperationAND_AND ( left , leftId , right , rightId ) ; case DIVIDE : return computeConstantOperationDIVIDE ( left , leftId , right , rightId ) ; case GREATER : return computeConstantOperationGREATER ( left , leftId , right , rightId ) ; case GREATER_EQUAL : return computeConstantOperationGREATER_EQUAL ( left , leftId , right , rightId ) ; case LEFT_SHIFT : return computeConstantOperationLEFT_SHIFT ( left , leftId , right , rightId ) ; case LESS : return computeConstantOperationLESS ( left , leftId , right , rightId ) ; case LESS_EQUAL : return computeConstantOperationLESS_EQUAL ( left , leftId , right , rightId ) ; case MINUS : return computeConstantOperationMINUS ( left , leftId , right , rightId ) ; case MULTIPLY : return computeConstantOperationMULTIPLY ( left , leftId , right , rightId ) ; case OR : return computeConstantOperationOR ( left , leftId , right , rightId ) ; case OR_OR : return computeConstantOperationOR_OR ( left , leftId , right , rightId ) ; case PLUS : return computeConstantOperationPLUS ( left , leftId , right , rightId ) ; case REMAINDER : return computeConstantOperationREMAINDER ( left , leftId , right , rightId ) ; case RIGHT_SHIFT : return computeConstantOperationRIGHT_SHIFT ( left , leftId , right , rightId ) ; case UNSIGNED_RIGHT_SHIFT : return computeConstantOperationUNSIGNED_RIGHT_SHIFT ( left , leftId , right , rightId ) ; case XOR : return computeConstantOperationXOR ( left , leftId , right , rightId ) ; default : return NotAConstant ; } } public static final Constant computeConstantOperationAND ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_boolean : return BooleanConstant . fromValue ( left . booleanValue ( ) & right . booleanValue ( ) ) ; case T_char : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . charValue ( ) & right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . charValue ( ) & right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . charValue ( ) & right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . charValue ( ) & right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . charValue ( ) & right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . byteValue ( ) & right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . byteValue ( ) & right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . byteValue ( ) & right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . byteValue ( ) & right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . byteValue ( ) & right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . shortValue ( ) & right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . shortValue ( ) & right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . shortValue ( ) & right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . shortValue ( ) & right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . shortValue ( ) & right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . intValue ( ) & right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . intValue ( ) & right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . intValue ( ) & right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . intValue ( ) & right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . intValue ( ) & right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return LongConstant . fromValue ( left . longValue ( ) & right . charValue ( ) ) ; case T_byte : return LongConstant . fromValue ( left . longValue ( ) & right . byteValue ( ) ) ; case T_short : return LongConstant . fromValue ( left . longValue ( ) & right . shortValue ( ) ) ; case T_int : return LongConstant . fromValue ( left . longValue ( ) & right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . longValue ( ) & right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationAND_AND ( Constant left , int leftId , Constant right , int rightId ) { return BooleanConstant . fromValue ( left . booleanValue ( ) && right . booleanValue ( ) ) ; } public static final Constant computeConstantOperationDIVIDE ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_char : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . charValue ( ) / right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . charValue ( ) / right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . charValue ( ) / right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . charValue ( ) / right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . charValue ( ) / right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . charValue ( ) / right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . charValue ( ) / right . longValue ( ) ) ; } break ; case T_float : switch ( rightId ) { case T_char : return FloatConstant . fromValue ( left . floatValue ( ) / right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . floatValue ( ) / right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . floatValue ( ) / right . doubleValue ( ) ) ; case T_byte : return FloatConstant . fromValue ( left . floatValue ( ) / right . byteValue ( ) ) ; case T_short : return FloatConstant . fromValue ( left . floatValue ( ) / right . shortValue ( ) ) ; case T_int : return FloatConstant . fromValue ( left . floatValue ( ) / right . intValue ( ) ) ; case T_long : return FloatConstant . fromValue ( left . floatValue ( ) / right . longValue ( ) ) ; } break ; case T_double : switch ( rightId ) { case T_char : return DoubleConstant . fromValue ( left . doubleValue ( ) / right . charValue ( ) ) ; case T_float : return DoubleConstant . fromValue ( left . doubleValue ( ) / right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . doubleValue ( ) / right . doubleValue ( ) ) ; case T_byte : return DoubleConstant . fromValue ( left . doubleValue ( ) / right . byteValue ( ) ) ; case T_short : return DoubleConstant . fromValue ( left . doubleValue ( ) / right . shortValue ( ) ) ; case T_int : return DoubleConstant . fromValue ( left . doubleValue ( ) / right . intValue ( ) ) ; case T_long : return DoubleConstant . fromValue ( left . doubleValue ( ) / right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . byteValue ( ) / right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . byteValue ( ) / right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . byteValue ( ) / right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . byteValue ( ) / right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . byteValue ( ) / right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . byteValue ( ) / right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . byteValue ( ) / right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . shortValue ( ) / right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . shortValue ( ) / right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . shortValue ( ) / right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . shortValue ( ) / right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . shortValue ( ) / right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . shortValue ( ) / right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . shortValue ( ) / right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . intValue ( ) / right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . intValue ( ) / right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . intValue ( ) / right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . intValue ( ) / right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . intValue ( ) / right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . intValue ( ) / right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . intValue ( ) / right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return LongConstant . fromValue ( left . longValue ( ) / right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . longValue ( ) / right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . longValue ( ) / right . doubleValue ( ) ) ; case T_byte : return LongConstant . fromValue ( left . longValue ( ) / right . byteValue ( ) ) ; case T_short : return LongConstant . fromValue ( left . longValue ( ) / right . shortValue ( ) ) ; case T_int : return LongConstant . fromValue ( left . longValue ( ) / right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . longValue ( ) / right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationEQUAL_EQUAL ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_boolean : if ( rightId == T_boolean ) { return BooleanConstant . fromValue ( left . booleanValue ( ) == right . booleanValue ( ) ) ; } break ; case T_char : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . charValue ( ) == right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . charValue ( ) == right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . charValue ( ) == right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . charValue ( ) == right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . charValue ( ) == right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . charValue ( ) == right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . charValue ( ) == right . longValue ( ) ) ; } break ; case T_float : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . floatValue ( ) == right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . floatValue ( ) == right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . floatValue ( ) == right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . floatValue ( ) == right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . floatValue ( ) == right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . floatValue ( ) == right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . floatValue ( ) == right . longValue ( ) ) ; } break ; case T_double : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . doubleValue ( ) == right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . doubleValue ( ) == right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . doubleValue ( ) == right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . doubleValue ( ) == right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . doubleValue ( ) == right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . doubleValue ( ) == right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . doubleValue ( ) == right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . byteValue ( ) == right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . byteValue ( ) == right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . byteValue ( ) == right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . byteValue ( ) == right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . byteValue ( ) == right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . byteValue ( ) == right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . byteValue ( ) == right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . shortValue ( ) == right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . shortValue ( ) == right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . shortValue ( ) == right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . shortValue ( ) == right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . shortValue ( ) == right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . shortValue ( ) == right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . shortValue ( ) == right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . intValue ( ) == right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . intValue ( ) == right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . intValue ( ) == right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . intValue ( ) == right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . intValue ( ) == right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . intValue ( ) == right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . intValue ( ) == right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . longValue ( ) == right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . longValue ( ) == right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . longValue ( ) == right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . longValue ( ) == right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . longValue ( ) == right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . longValue ( ) == right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . longValue ( ) == right . longValue ( ) ) ; } break ; case T_JavaLangString : if ( rightId == T_JavaLangString ) { return BooleanConstant . fromValue ( ( ( StringConstant ) left ) . hasSameValue ( right ) ) ; } break ; case T_null : if ( rightId == T_JavaLangString ) { return BooleanConstant . fromValue ( false ) ; } else { if ( rightId == T_null ) { return BooleanConstant . fromValue ( true ) ; } } } return BooleanConstant . fromValue ( false ) ; } public static final Constant computeConstantOperationGREATER ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_char : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . charValue ( ) > right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . charValue ( ) > right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . charValue ( ) > right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . charValue ( ) > right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . charValue ( ) > right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . charValue ( ) > right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . charValue ( ) > right . longValue ( ) ) ; } break ; case T_float : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . floatValue ( ) > right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . floatValue ( ) > right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . floatValue ( ) > right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . floatValue ( ) > right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . floatValue ( ) > right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . floatValue ( ) > right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . floatValue ( ) > right . longValue ( ) ) ; } break ; case T_double : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . doubleValue ( ) > right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . doubleValue ( ) > right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . doubleValue ( ) > right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . doubleValue ( ) > right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . doubleValue ( ) > right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . doubleValue ( ) > right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . doubleValue ( ) > right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . byteValue ( ) > right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . byteValue ( ) > right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . byteValue ( ) > right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . byteValue ( ) > right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . byteValue ( ) > right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . byteValue ( ) > right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . byteValue ( ) > right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . shortValue ( ) > right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . shortValue ( ) > right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . shortValue ( ) > right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . shortValue ( ) > right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . shortValue ( ) > right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . shortValue ( ) > right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . shortValue ( ) > right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . intValue ( ) > right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . intValue ( ) > right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . intValue ( ) > right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . intValue ( ) > right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . intValue ( ) > right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . intValue ( ) > right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . intValue ( ) > right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . longValue ( ) > right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . longValue ( ) > right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . longValue ( ) > right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . longValue ( ) > right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . longValue ( ) > right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . longValue ( ) > right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . longValue ( ) > right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationGREATER_EQUAL ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_char : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . charValue ( ) >= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . charValue ( ) >= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . charValue ( ) >= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . charValue ( ) >= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . charValue ( ) >= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . charValue ( ) >= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . charValue ( ) >= right . longValue ( ) ) ; } break ; case T_float : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . floatValue ( ) >= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . floatValue ( ) >= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . floatValue ( ) >= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . floatValue ( ) >= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . floatValue ( ) >= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . floatValue ( ) >= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . floatValue ( ) >= right . longValue ( ) ) ; } break ; case T_double : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . doubleValue ( ) >= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . doubleValue ( ) >= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . doubleValue ( ) >= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . doubleValue ( ) >= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . doubleValue ( ) >= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . doubleValue ( ) >= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . doubleValue ( ) >= right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . byteValue ( ) >= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . byteValue ( ) >= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . byteValue ( ) >= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . byteValue ( ) >= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . byteValue ( ) >= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . byteValue ( ) >= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . byteValue ( ) >= right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . shortValue ( ) >= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . shortValue ( ) >= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . shortValue ( ) >= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . shortValue ( ) >= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . shortValue ( ) >= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . shortValue ( ) >= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . shortValue ( ) >= right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . intValue ( ) >= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . intValue ( ) >= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . intValue ( ) >= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . intValue ( ) >= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . intValue ( ) >= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . intValue ( ) >= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . intValue ( ) >= right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . longValue ( ) >= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . longValue ( ) >= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . longValue ( ) >= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . longValue ( ) >= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . longValue ( ) >= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . longValue ( ) >= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . longValue ( ) >= right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationLEFT_SHIFT ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_char : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . charValue ( ) << right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . charValue ( ) << right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . charValue ( ) << right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . charValue ( ) << right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . charValue ( ) << right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . byteValue ( ) << right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . byteValue ( ) << right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . byteValue ( ) << right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . byteValue ( ) << right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . byteValue ( ) << right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . shortValue ( ) << right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . shortValue ( ) << right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . shortValue ( ) << right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . shortValue ( ) << right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . shortValue ( ) << right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . intValue ( ) << right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . intValue ( ) << right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . intValue ( ) << right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . intValue ( ) << right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . intValue ( ) << right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return LongConstant . fromValue ( left . longValue ( ) << right . charValue ( ) ) ; case T_byte : return LongConstant . fromValue ( left . longValue ( ) << right . byteValue ( ) ) ; case T_short : return LongConstant . fromValue ( left . longValue ( ) << right . shortValue ( ) ) ; case T_int : return LongConstant . fromValue ( left . longValue ( ) << right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . longValue ( ) << right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationLESS ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_char : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . charValue ( ) < right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . charValue ( ) < right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . charValue ( ) < right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . charValue ( ) < right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . charValue ( ) < right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . charValue ( ) < right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . charValue ( ) < right . longValue ( ) ) ; } break ; case T_float : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . floatValue ( ) < right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . floatValue ( ) < right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . floatValue ( ) < right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . floatValue ( ) < right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . floatValue ( ) < right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . floatValue ( ) < right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . floatValue ( ) < right . longValue ( ) ) ; } break ; case T_double : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . doubleValue ( ) < right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . doubleValue ( ) < right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . doubleValue ( ) < right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . doubleValue ( ) < right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . doubleValue ( ) < right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . doubleValue ( ) < right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . doubleValue ( ) < right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . byteValue ( ) < right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . byteValue ( ) < right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . byteValue ( ) < right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . byteValue ( ) < right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . byteValue ( ) < right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . byteValue ( ) < right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . byteValue ( ) < right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . shortValue ( ) < right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . shortValue ( ) < right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . shortValue ( ) < right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . shortValue ( ) < right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . shortValue ( ) < right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . shortValue ( ) < right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . shortValue ( ) < right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . intValue ( ) < right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . intValue ( ) < right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . intValue ( ) < right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . intValue ( ) < right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . intValue ( ) < right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . intValue ( ) < right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . intValue ( ) < right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . longValue ( ) < right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . longValue ( ) < right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . longValue ( ) < right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . longValue ( ) < right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . longValue ( ) < right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . longValue ( ) < right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . longValue ( ) < right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationLESS_EQUAL ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_char : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . charValue ( ) <= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . charValue ( ) <= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . charValue ( ) <= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . charValue ( ) <= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . charValue ( ) <= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . charValue ( ) <= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . charValue ( ) <= right . longValue ( ) ) ; } break ; case T_float : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . floatValue ( ) <= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . floatValue ( ) <= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . floatValue ( ) <= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . floatValue ( ) <= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . floatValue ( ) <= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . floatValue ( ) <= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . floatValue ( ) <= right . longValue ( ) ) ; } break ; case T_double : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . doubleValue ( ) <= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . doubleValue ( ) <= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . doubleValue ( ) <= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . doubleValue ( ) <= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . doubleValue ( ) <= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . doubleValue ( ) <= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . doubleValue ( ) <= right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . byteValue ( ) <= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . byteValue ( ) <= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . byteValue ( ) <= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . byteValue ( ) <= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . byteValue ( ) <= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . byteValue ( ) <= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . byteValue ( ) <= right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . shortValue ( ) <= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . shortValue ( ) <= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . shortValue ( ) <= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . shortValue ( ) <= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . shortValue ( ) <= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . shortValue ( ) <= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . shortValue ( ) <= right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . intValue ( ) <= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . intValue ( ) <= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . intValue ( ) <= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . intValue ( ) <= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . intValue ( ) <= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . intValue ( ) <= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . intValue ( ) <= right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . longValue ( ) <= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . longValue ( ) <= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . longValue ( ) <= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . longValue ( ) <= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . longValue ( ) <= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . longValue ( ) <= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . longValue ( ) <= right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationMINUS ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_char : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . charValue ( ) - right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . charValue ( ) - right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . charValue ( ) - right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . charValue ( ) - right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . charValue ( ) - right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . charValue ( ) - right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . charValue ( ) - right . longValue ( ) ) ; } break ; case T_float : switch ( rightId ) { case T_char : return FloatConstant . fromValue ( left . floatValue ( ) - right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . floatValue ( ) - right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . floatValue ( ) - right . doubleValue ( ) ) ; case T_byte : return FloatConstant . fromValue ( left . floatValue ( ) - right . byteValue ( ) ) ; case T_short : return FloatConstant . fromValue ( left . floatValue ( ) - right . shortValue ( ) ) ; case T_int : return FloatConstant . fromValue ( left . floatValue ( ) - right . intValue ( ) ) ; case T_long : return FloatConstant . fromValue ( left . floatValue ( ) - right . longValue ( ) ) ; } break ; case T_double : switch ( rightId ) { case T_char : return DoubleConstant . fromValue ( left . doubleValue ( ) - right . charValue ( ) ) ; case T_float : return DoubleConstant . fromValue ( left . doubleValue ( ) - right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . doubleValue ( ) - right . doubleValue ( ) ) ; case T_byte : return DoubleConstant . fromValue ( left . doubleValue ( ) - right . byteValue ( ) ) ; case T_short : return DoubleConstant . fromValue ( left . doubleValue ( ) - right . shortValue ( ) ) ; case T_int : return DoubleConstant . fromValue ( left . doubleValue ( ) - right . intValue ( ) ) ; case T_long : return DoubleConstant . fromValue ( left . doubleValue ( ) - right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . byteValue ( ) - right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . byteValue ( ) - right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . byteValue ( ) - right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . byteValue ( ) - right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . byteValue ( ) - right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . byteValue ( ) - right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . byteValue ( ) - right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . shortValue ( ) - right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . shortValue ( ) - right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . shortValue ( ) - right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . shortValue ( ) - right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . shortValue ( ) - right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . shortValue ( ) - right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . shortValue ( ) - right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . intValue ( ) - right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . intValue ( ) - right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . intValue ( ) - right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . intValue ( ) - right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . intValue ( ) - right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . intValue ( ) - right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . intValue ( ) - right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return LongConstant . fromValue ( left . longValue ( ) - right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . longValue ( ) - right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . longValue ( ) - right . doubleValue ( ) ) ; case T_byte : return LongConstant . fromValue ( left . longValue ( ) - right . byteValue ( ) ) ; case T_short : return LongConstant . fromValue ( left . longValue ( ) - right . shortValue ( ) ) ; case T_int : return LongConstant . fromValue ( left . longValue ( ) - right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . longValue ( ) - right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationMULTIPLY ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_char : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . charValue ( ) * right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . charValue ( ) * right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . charValue ( ) * right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . charValue ( ) * right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . charValue ( ) * right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . charValue ( ) * right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . charValue ( ) * right . longValue ( ) ) ; } break ; case T_float : switch ( rightId ) { case T_char : return FloatConstant . fromValue ( left . floatValue ( ) * right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . floatValue ( ) * right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . floatValue ( ) * right . doubleValue ( ) ) ; case T_byte : return FloatConstant . fromValue ( left . floatValue ( ) * right . byteValue ( ) ) ; case T_short : return FloatConstant . fromValue ( left . floatValue ( ) * right . shortValue ( ) ) ; case T_int : return FloatConstant . fromValue ( left . floatValue ( ) * right . intValue ( ) ) ; case T_long : return FloatConstant . fromValue ( left . floatValue ( ) * right . longValue ( ) ) ; } break ; case T_double : switch ( rightId ) { case T_char : return DoubleConstant . fromValue ( left . doubleValue ( ) * right . charValue ( ) ) ; case T_float : return DoubleConstant . fromValue ( left . doubleValue ( ) * right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . doubleValue ( ) * right . doubleValue ( ) ) ; case T_byte : return DoubleConstant . fromValue ( left . doubleValue ( ) * right . byteValue ( ) ) ; case T_short : return DoubleConstant . fromValue ( left . doubleValue ( ) * right . shortValue ( ) ) ; case T_int : return DoubleConstant . fromValue ( left . doubleValue ( ) * right . intValue ( ) ) ; case T_long : return DoubleConstant . fromValue ( left . doubleValue ( ) * right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . byteValue ( ) * right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . byteValue ( ) * right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . byteValue ( ) * right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . byteValue ( ) * right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . byteValue ( ) * right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . byteValue ( ) * right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . byteValue ( ) * right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . shortValue ( ) * right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . shortValue ( ) * right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . shortValue ( ) * right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . shortValue ( ) * right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . shortValue ( ) * right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . shortValue ( ) * right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . shortValue ( ) * right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . intValue ( ) * right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . intValue ( ) * right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . intValue ( ) * right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . intValue ( ) * right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . intValue ( ) * right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . intValue ( ) * right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . intValue ( ) * right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return LongConstant . fromValue ( left . longValue ( ) * right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . longValue ( ) * right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . longValue ( ) * right . doubleValue ( ) ) ; case T_byte : return LongConstant . fromValue ( left . longValue ( ) * right . byteValue ( ) ) ; case T_short : return LongConstant . fromValue ( left . longValue ( ) * right . shortValue ( ) ) ; case T_int : return LongConstant . fromValue ( left . longValue ( ) * right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . longValue ( ) * right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationOR ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_boolean : return BooleanConstant . fromValue ( left . booleanValue ( ) | right . booleanValue ( ) ) ; case T_char : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . charValue ( ) | right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . charValue ( ) | right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . charValue ( ) | right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . charValue ( ) | right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . charValue ( ) | right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . byteValue ( ) | right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . byteValue ( ) | right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . byteValue ( ) | right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . byteValue ( ) | right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . byteValue ( ) | right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . shortValue ( ) | right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . shortValue ( ) | right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . shortValue ( ) | right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . shortValue ( ) | right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . shortValue ( ) | right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . intValue ( ) | right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . intValue ( ) | right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . intValue ( ) | right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . intValue ( ) | right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . intValue ( ) | right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return LongConstant . fromValue ( left . longValue ( ) | right . charValue ( ) ) ; case T_byte : return LongConstant . fromValue ( left . longValue ( ) | right . byteValue ( ) ) ; case T_short : return LongConstant . fromValue ( left . longValue ( ) | right . shortValue ( ) ) ; case T_int : return LongConstant . fromValue ( left . longValue ( ) | right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . longValue ( ) | right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationOR_OR ( Constant left , int leftId , Constant right , int rightId ) { return BooleanConstant . fromValue ( left . booleanValue ( ) || right . booleanValue ( ) ) ; } public static final Constant computeConstantOperationPLUS ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_JavaLangObject : if ( rightId == T_JavaLangString ) { return StringConstant . fromValue ( left . stringValue ( ) + right . stringValue ( ) ) ; } break ; case T_boolean : if ( rightId == T_JavaLangString ) { return StringConstant . fromValue ( left . stringValue ( ) + right . stringValue ( ) ) ; } break ; case T_char : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . charValue ( ) + right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . charValue ( ) + right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . charValue ( ) + right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . charValue ( ) + right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . charValue ( ) + right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . charValue ( ) + right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . charValue ( ) + right . longValue ( ) ) ; case T_JavaLangString : return StringConstant . fromValue ( left . stringValue ( ) + right . stringValue ( ) ) ; } break ; case T_float : switch ( rightId ) { case T_char : return FloatConstant . fromValue ( left . floatValue ( ) + right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . floatValue ( ) + right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . floatValue ( ) + right . doubleValue ( ) ) ; case T_byte : return FloatConstant . fromValue ( left . floatValue ( ) + right . byteValue ( ) ) ; case T_short : return FloatConstant . fromValue ( left . floatValue ( ) + right . shortValue ( ) ) ; case T_int : return FloatConstant . fromValue ( left . floatValue ( ) + right . intValue ( ) ) ; case T_long : return FloatConstant . fromValue ( left . floatValue ( ) + right . longValue ( ) ) ; case T_JavaLangString : return StringConstant . fromValue ( left . stringValue ( ) + right . stringValue ( ) ) ; } break ; case T_double : switch ( rightId ) { case T_char : return DoubleConstant . fromValue ( left . doubleValue ( ) + right . charValue ( ) ) ; case T_float : return DoubleConstant . fromValue ( left . doubleValue ( ) + right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . doubleValue ( ) + right . doubleValue ( ) ) ; case T_byte : return DoubleConstant . fromValue ( left . doubleValue ( ) + right . byteValue ( ) ) ; case T_short : return DoubleConstant . fromValue ( left . doubleValue ( ) + right . shortValue ( ) ) ; case T_int : return DoubleConstant . fromValue ( left . doubleValue ( ) + right . intValue ( ) ) ; case T_long : return DoubleConstant . fromValue ( left . doubleValue ( ) + right . longValue ( ) ) ; case T_JavaLangString : return StringConstant . fromValue ( left . stringValue ( ) + right . stringValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . byteValue ( ) + right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . byteValue ( ) + right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . byteValue ( ) + right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . byteValue ( ) + right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . byteValue ( ) + right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . byteValue ( ) + right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . byteValue ( ) + right . longValue ( ) ) ; case T_JavaLangString : return StringConstant . fromValue ( left . stringValue ( ) + right . stringValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . shortValue ( ) + right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . shortValue ( ) + right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . shortValue ( ) + right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . shortValue ( ) + right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . shortValue ( ) + right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . shortValue ( ) + right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . shortValue ( ) + right . longValue ( ) ) ; case T_JavaLangString : return StringConstant . fromValue ( left . stringValue ( ) + right . stringValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . intValue ( ) + right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . intValue ( ) + right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . intValue ( ) + right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . intValue ( ) + right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . intValue ( ) + right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . intValue ( ) + right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . intValue ( ) + right . longValue ( ) ) ; case T_JavaLangString : return StringConstant . fromValue ( left . stringValue ( ) + right . stringValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return LongConstant . fromValue ( left . longValue ( ) + right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . longValue ( ) + right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . longValue ( ) + right . doubleValue ( ) ) ; case T_byte : return LongConstant . fromValue ( left . longValue ( ) + right . byteValue ( ) ) ; case T_short : return LongConstant . fromValue ( left . longValue ( ) + right . shortValue ( ) ) ; case T_int : return LongConstant . fromValue ( left . longValue ( ) + right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . longValue ( ) + right . longValue ( ) ) ; case T_JavaLangString : return StringConstant . fromValue ( left . stringValue ( ) + right . stringValue ( ) ) ; } break ; case T_JavaLangString : switch ( rightId ) { case T_char : return StringConstant . fromValue ( left . stringValue ( ) + String . valueOf ( right . charValue ( ) ) ) ; case T_float : return StringConstant . fromValue ( left . stringValue ( ) + String . valueOf ( right . floatValue ( ) ) ) ; case T_double : return StringConstant . fromValue ( left . stringValue ( ) + String . valueOf ( right . doubleValue ( ) ) ) ; case T_byte : return StringConstant . fromValue ( left . stringValue ( ) + String . valueOf ( right . byteValue ( ) ) ) ; case T_short : return StringConstant . fromValue ( left . stringValue ( ) + String . valueOf ( right . shortValue ( ) ) ) ; case T_int : return StringConstant . fromValue ( left . stringValue ( ) + String . valueOf ( right . intValue ( ) ) ) ; case T_long : return StringConstant . fromValue ( left . stringValue ( ) + String . valueOf ( right . longValue ( ) ) ) ; case T_JavaLangString : return StringConstant . fromValue ( left . stringValue ( ) + right . stringValue ( ) ) ; case T_boolean : return StringConstant . fromValue ( left . stringValue ( ) + right . booleanValue ( ) ) ; } break ; } return NotAConstant ; } public static final Constant computeConstantOperationREMAINDER ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_char : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . charValue ( ) % right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . charValue ( ) % right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . charValue ( ) % right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . charValue ( ) % right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . charValue ( ) % right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . charValue ( ) % right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . charValue ( ) % right . longValue ( ) ) ; } break ; case T_float : switch ( rightId ) { case T_char : return FloatConstant . fromValue ( left . floatValue ( ) % right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . floatValue ( ) % right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . floatValue ( ) % right . doubleValue ( ) ) ; case T_byte : return FloatConstant . fromValue ( left . floatValue ( ) % right . byteValue ( ) ) ; case T_short : return FloatConstant . fromValue ( left . floatValue ( ) % right . shortValue ( ) ) ; case T_int : return FloatConstant . fromValue ( left . floatValue ( ) % right . intValue ( ) ) ; case T_long : return FloatConstant . fromValue ( left . floatValue ( ) % right . longValue ( ) ) ; } break ; case T_double : switch ( rightId ) { case T_char : return DoubleConstant . fromValue ( left . doubleValue ( ) % right . charValue ( ) ) ; case T_float : return DoubleConstant . fromValue ( left . doubleValue ( ) % right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . doubleValue ( ) % right . doubleValue ( ) ) ; case T_byte : return DoubleConstant . fromValue ( left . doubleValue ( ) % right . byteValue ( ) ) ; case T_short : return DoubleConstant . fromValue ( left . doubleValue ( ) % right . shortValue ( ) ) ; case T_int : return DoubleConstant . fromValue ( left . doubleValue ( ) % right . intValue ( ) ) ; case T_long : return DoubleConstant . fromValue ( left . doubleValue ( ) % right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . byteValue ( ) % right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . byteValue ( ) % right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . byteValue ( ) % right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . byteValue ( ) % right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . byteValue ( ) % right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . byteValue ( ) % right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . byteValue ( ) % right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . shortValue ( ) % right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . shortValue ( ) % right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . shortValue ( ) % right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . shortValue ( ) % right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . shortValue ( ) % right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . shortValue ( ) % right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . shortValue ( ) % right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . intValue ( ) % right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . intValue ( ) % right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . intValue ( ) % right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . intValue ( ) % right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . intValue ( ) % right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . intValue ( ) % right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . intValue ( ) % right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return LongConstant . fromValue ( left . longValue ( ) % right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . longValue ( ) % right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . longValue ( ) % right . doubleValue ( ) ) ; case T_byte : return LongConstant . fromValue ( left . longValue ( ) % right . byteValue ( ) ) ; case T_short : return LongConstant . fromValue ( left . longValue ( ) % right . shortValue ( ) ) ; case T_int : return LongConstant . fromValue ( left . longValue ( ) % right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . longValue ( ) % right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationRIGHT_SHIFT ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_char : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . charValue ( ) > > right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . charValue ( ) > > right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . charValue ( ) > > right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . charValue ( ) > > right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . charValue ( ) > > right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . byteValue ( ) > > right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . byteValue ( ) > > right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . byteValue ( ) > > right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . byteValue ( ) > > right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . byteValue ( ) > > right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . shortValue ( ) > > right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . shortValue ( ) > > right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . shortValue ( ) > > right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . shortValue ( ) > > right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . shortValue ( ) > > right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . intValue ( ) > > right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . intValue ( ) > > right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . intValue ( ) > > right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . intValue ( ) > > right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . intValue ( ) > > right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return LongConstant . fromValue ( left . longValue ( ) > > right . charValue ( ) ) ; case T_byte : return LongConstant . fromValue ( left . longValue ( ) > > right . byteValue ( ) ) ; case T_short : return LongConstant . fromValue ( left . longValue ( ) > > right . shortValue ( ) ) ; case T_int : return LongConstant . fromValue ( left . longValue ( ) > > right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . longValue ( ) > > right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationUNSIGNED_RIGHT_SHIFT ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_char : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . charValue ( ) > > > right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . charValue ( ) > > > right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . charValue ( ) > > > right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . charValue ( ) > > > right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . charValue ( ) > > > right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . byteValue ( ) > > > right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . byteValue ( ) > > > right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . byteValue ( ) > > > right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . byteValue ( ) > > > right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . byteValue ( ) > > > right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . shortValue ( ) > > > right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . shortValue ( ) > > > right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . shortValue ( ) > > > right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . shortValue ( ) > > > right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . shortValue ( ) > > > right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . intValue ( ) > > > right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . intValue ( ) > > > right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . intValue ( ) > > > right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . intValue ( ) > > > right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . intValue ( ) > > > right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return LongConstant . fromValue ( left . longValue ( ) > > > right . charValue ( ) ) ; case T_byte : return LongConstant . fromValue ( left . longValue ( ) > > > right . byteValue ( ) ) ; case T_short : return LongConstant . fromValue ( left . longValue ( ) > > > right . shortValue ( ) ) ; case T_int : return LongConstant . fromValue ( left . longValue ( ) > > > right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . longValue ( ) > > > right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationXOR ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_boolean : return BooleanConstant . fromValue ( left . booleanValue ( ) ^ right . booleanValue ( ) ) ; case T_char : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . charValue ( ) ^ right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . charValue ( ) ^ right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . charValue ( ) ^ right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . charValue ( ) ^ right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . charValue ( ) ^ right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . byteValue ( ) ^ right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . byteValue ( ) ^ right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . byteValue ( ) ^ right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . byteValue ( ) ^ right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . byteValue ( ) ^ right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . shortValue ( ) ^ right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . shortValue ( ) ^ right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . shortValue ( ) ^ right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . shortValue ( ) ^ right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . shortValue ( ) ^ right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . intValue ( ) ^ right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . intValue ( ) ^ right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . intValue ( ) ^ right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . intValue ( ) ^ right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . intValue ( ) ^ right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return LongConstant . fromValue ( left . longValue ( ) ^ right . charValue ( ) ) ; case T_byte : return LongConstant . fromValue ( left . longValue ( ) ^ right . byteValue ( ) ) ; case T_short : return LongConstant . fromValue ( left . longValue ( ) ^ right . shortValue ( ) ) ; case T_int : return LongConstant . fromValue ( left . longValue ( ) ^ right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . longValue ( ) ^ right . longValue ( ) ) ; } } return NotAConstant ; } public double doubleValue ( ) { throw new ShouldNotImplement ( Messages . bind ( Messages . constant_cannotCastedInto , new String [ ] { typeName ( ) , "<STR_LIT:double>" } ) ) ; } public float floatValue ( ) { throw new ShouldNotImplement ( Messages . bind ( Messages . constant_cannotCastedInto , new String [ ] { typeName ( ) , "<STR_LIT:float>" } ) ) ; } public boolean hasSameValue ( Constant otherConstant ) { if ( this == otherConstant ) return true ; int typeID ; if ( ( typeID = typeID ( ) ) != otherConstant . typeID ( ) ) return false ; switch ( typeID ) { case TypeIds . T_boolean : return booleanValue ( ) == otherConstant . booleanValue ( ) ; case TypeIds . T_byte : return byteValue ( ) == otherConstant . byteValue ( ) ; case TypeIds . T_char : return charValue ( ) == otherConstant . charValue ( ) ; case TypeIds . T_double : return doubleValue ( ) == otherConstant . doubleValue ( ) ; case TypeIds . T_float : return floatValue ( ) == otherConstant . floatValue ( ) ; case TypeIds . T_int : return intValue ( ) == otherConstant . intValue ( ) ; case TypeIds . T_short : return shortValue ( ) == otherConstant . shortValue ( ) ; case TypeIds . T_long : return longValue ( ) == otherConstant . longValue ( ) ; case TypeIds . T_JavaLangString : String value = stringValue ( ) ; return value == null ? otherConstant . stringValue ( ) == null : value . equals ( otherConstant . stringValue ( ) ) ; } return false ; } public int intValue ( ) { throw new ShouldNotImplement ( Messages . bind ( Messages . constant_cannotCastedInto , new String [ ] { typeName ( ) , "<STR_LIT:int>" } ) ) ; } public long longValue ( ) { throw new ShouldNotImplement ( Messages . bind ( Messages . constant_cannotCastedInto , new String [ ] { typeName ( ) , "<STR_LIT:long>" } ) ) ; } public short shortValue ( ) { throw new ShouldNotImplement ( Messages . bind ( Messages . constant_cannotConvertedTo , new String [ ] { typeName ( ) , "<STR_LIT>" } ) ) ; } public String stringValue ( ) { throw new ShouldNotImplement ( Messages . bind ( Messages . constant_cannotConvertedTo , new String [ ] { typeName ( ) , "<STR_LIT:String>" } ) ) ; } public String toString ( ) { if ( this == NotAConstant ) return "<STR_LIT>" ; return super . toString ( ) ; } public abstract int typeID ( ) ; public String typeName ( ) { switch ( typeID ( ) ) { case T_int : return "<STR_LIT:int>" ; case T_byte : return "<STR_LIT>" ; case T_short : return "<STR_LIT>" ; case T_char : return "<STR_LIT>" ; case T_float : return "<STR_LIT:float>" ; case T_double : return "<STR_LIT:double>" ; case T_boolean : return "<STR_LIT:boolean>" ; case T_long : return "<STR_LIT:long>" ; case T_JavaLangString : return "<STR_LIT>" ; default : return "<STR_LIT:unknown>" ; } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . impl ; public class CharConstant extends Constant { private char value ; public static Constant fromValue ( char value ) { return new CharConstant ( value ) ; } private CharConstant ( char value ) { this . value = value ; } public byte byteValue ( ) { return ( byte ) this . value ; } public char charValue ( ) { return this . value ; } public double doubleValue ( ) { return this . value ; } public float floatValue ( ) { return this . value ; } public int intValue ( ) { return this . value ; } public long longValue ( ) { return this . value ; } public short shortValue ( ) { return ( short ) this . value ; } public String stringValue ( ) { return String . valueOf ( this . value ) ; } public String toString ( ) { return "<STR_LIT>" + this . value ; } public int typeID ( ) { return T_char ; } public int hashCode ( ) { return this . value ; } public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } CharConstant other = ( CharConstant ) obj ; return this . value == other . value ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . impl ; public class ShortConstant extends Constant { private short value ; public static Constant fromValue ( short value ) { return new ShortConstant ( value ) ; } private ShortConstant ( short value ) { this . value = value ; } public byte byteValue ( ) { return ( byte ) this . value ; } public char charValue ( ) { return ( char ) this . value ; } public double doubleValue ( ) { return this . value ; } public float floatValue ( ) { return this . value ; } public int intValue ( ) { return this . value ; } public long longValue ( ) { return this . value ; } public short shortValue ( ) { return this . value ; } public String stringValue ( ) { return String . valueOf ( this . value ) ; } public String toString ( ) { return "<STR_LIT>" + this . value ; } public int typeID ( ) { return T_short ; } public int hashCode ( ) { return this . value ; } public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } ShortConstant other = ( ShortConstant ) obj ; return this . value == other . value ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . impl ; public class ByteConstant extends Constant { private byte value ; public static Constant fromValue ( byte value ) { return new ByteConstant ( value ) ; } private ByteConstant ( byte value ) { this . value = value ; } public byte byteValue ( ) { return this . value ; } public char charValue ( ) { return ( char ) this . value ; } public double doubleValue ( ) { return this . value ; } public float floatValue ( ) { return this . value ; } public int intValue ( ) { return this . value ; } public long longValue ( ) { return this . value ; } public short shortValue ( ) { return this . value ; } public String stringValue ( ) { return String . valueOf ( this . value ) ; } public String toString ( ) { return "<STR_LIT>" + this . value ; } public int typeID ( ) { return T_byte ; } public int hashCode ( ) { return this . value ; } public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } ByteConstant other = ( ByteConstant ) obj ; return this . value == other . value ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . impl ; import org . eclipse . jdt . internal . compiler . env . AccessRestriction ; import org . eclipse . jdt . internal . compiler . env . IBinaryType ; import org . eclipse . jdt . internal . compiler . env . ICompilationUnit ; import org . eclipse . jdt . internal . compiler . env . ISourceType ; import org . eclipse . jdt . internal . compiler . lookup . PackageBinding ; public interface ITypeRequestor { void accept ( IBinaryType binaryType , PackageBinding packageBinding , AccessRestriction accessRestriction ) ; void accept ( ICompilationUnit unit , AccessRestriction accessRestriction ) ; void accept ( ISourceType [ ] sourceType , PackageBinding packageBinding , AccessRestriction accessRestriction ) ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . impl ; public class StringConstant extends Constant { private String value ; public static Constant fromValue ( String value ) { return new StringConstant ( value ) ; } private StringConstant ( String value ) { this . value = value ; } public String stringValue ( ) { return this . value ; } public String toString ( ) { return "<STR_LIT>" + this . value + "<STR_LIT:\">" ; } public int typeID ( ) { return T_JavaLangString ; } public int hashCode ( ) { final int prime = <NUM_LIT:31> ; int result = <NUM_LIT:1> ; result = prime * result + ( ( this . value == null ) ? <NUM_LIT:0> : this . value . hashCode ( ) ) ; return result ; } public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } StringConstant other = ( StringConstant ) obj ; if ( this . value == null ) { return other . value == null ; } else { return this . value . equals ( other . value ) ; } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . impl ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; public class IrritantSet { public final static int GROUP_MASK = ASTNode . Bit32 | ASTNode . Bit31 | ASTNode . Bit30 ; public final static int GROUP_SHIFT = <NUM_LIT> ; public final static int GROUP_MAX = <NUM_LIT:3> ; public final static int GROUP0 = <NUM_LIT:0> << GROUP_SHIFT ; public final static int GROUP1 = <NUM_LIT:1> << GROUP_SHIFT ; public final static int GROUP2 = <NUM_LIT:2> << GROUP_SHIFT ; public static final IrritantSet ALL = new IrritantSet ( <NUM_LIT> & ~ GROUP_MASK ) ; public static final IrritantSet BOXING = new IrritantSet ( CompilerOptions . AutoBoxing ) ; public static final IrritantSet CAST = new IrritantSet ( CompilerOptions . UnnecessaryTypeCheck ) ; public static final IrritantSet DEPRECATION = new IrritantSet ( CompilerOptions . UsingDeprecatedAPI ) ; public static final IrritantSet DEP_ANN = new IrritantSet ( CompilerOptions . MissingDeprecatedAnnotation ) ; public static final IrritantSet FALLTHROUGH = new IrritantSet ( CompilerOptions . FallthroughCase ) ; public static final IrritantSet FINALLY = new IrritantSet ( CompilerOptions . FinallyBlockNotCompleting ) ; public static final IrritantSet HIDING = new IrritantSet ( CompilerOptions . MaskedCatchBlock ) ; public static final IrritantSet INCOMPLETE_SWITCH = new IrritantSet ( CompilerOptions . IncompleteEnumSwitch ) ; public static final IrritantSet NLS = new IrritantSet ( CompilerOptions . NonExternalizedString ) ; public static final IrritantSet NULL = new IrritantSet ( CompilerOptions . NullReference ) ; public static final IrritantSet RAW = new IrritantSet ( CompilerOptions . RawTypeReference ) ; public static final IrritantSet RESTRICTION = new IrritantSet ( CompilerOptions . ForbiddenReference ) ; public static final IrritantSet SERIAL = new IrritantSet ( CompilerOptions . MissingSerialVersion ) ; public static final IrritantSet STATIC_ACCESS = new IrritantSet ( CompilerOptions . IndirectStaticAccess ) ; public static final IrritantSet STATIC_METHOD = new IrritantSet ( CompilerOptions . MethodCanBeStatic ) ; public static final IrritantSet SYNTHETIC_ACCESS = new IrritantSet ( CompilerOptions . AccessEmulation ) ; public static final IrritantSet SUPER = new IrritantSet ( CompilerOptions . OverridingMethodWithoutSuperInvocation ) ; public static final IrritantSet UNUSED = new IrritantSet ( CompilerOptions . UnusedLocalVariable ) ; public static final IrritantSet UNCHECKED = new IrritantSet ( CompilerOptions . UncheckedTypeOperation ) ; public static final IrritantSet UNQUALIFIED_FIELD_ACCESS = new IrritantSet ( CompilerOptions . UnqualifiedFieldAccess ) ; public static final IrritantSet JAVADOC = new IrritantSet ( CompilerOptions . InvalidJavadoc ) ; public static final IrritantSet COMPILER_DEFAULT_ERRORS = new IrritantSet ( <NUM_LIT:0> ) ; public static final IrritantSet COMPILER_DEFAULT_WARNINGS = new IrritantSet ( <NUM_LIT:0> ) ; static { COMPILER_DEFAULT_WARNINGS . set ( CompilerOptions . MethodWithConstructorName | CompilerOptions . OverriddenPackageDefaultMethod | CompilerOptions . UsingDeprecatedAPI | CompilerOptions . MaskedCatchBlock | CompilerOptions . UnusedLocalVariable | CompilerOptions . NoImplicitStringConversion | CompilerOptions . AssertUsedAsAnIdentifier | CompilerOptions . UnusedImport | CompilerOptions . NonStaticAccessToStatic | CompilerOptions . NoEffectAssignment | CompilerOptions . IncompatibleNonInheritedInterfaceMethod | CompilerOptions . UnusedPrivateMember | CompilerOptions . FinallyBlockNotCompleting ) . set ( CompilerOptions . UncheckedTypeOperation | CompilerOptions . FinalParameterBound | CompilerOptions . MissingSerialVersion | CompilerOptions . EnumUsedAsAnIdentifier | CompilerOptions . ForbiddenReference | CompilerOptions . VarargsArgumentNeedCast | CompilerOptions . NullReference | CompilerOptions . AnnotationSuperInterface | CompilerOptions . TypeHiding | CompilerOptions . DiscouragedReference | CompilerOptions . UnhandledWarningToken | CompilerOptions . RawTypeReference | CompilerOptions . UnusedLabel | CompilerOptions . UnusedTypeArguments | CompilerOptions . UnusedWarningToken | CompilerOptions . ComparingIdentical ) . set ( CompilerOptions . DeadCode | CompilerOptions . Tasks ) ; ALL . setAll ( ) ; HIDING . set ( CompilerOptions . FieldHiding ) . set ( CompilerOptions . LocalVariableHiding ) . set ( CompilerOptions . TypeHiding ) ; NULL . set ( CompilerOptions . PotentialNullReference ) . set ( CompilerOptions . RedundantNullCheck ) ; RESTRICTION . set ( CompilerOptions . DiscouragedReference ) ; STATIC_ACCESS . set ( CompilerOptions . NonStaticAccessToStatic ) ; UNUSED . set ( CompilerOptions . UnusedArgument ) . set ( CompilerOptions . UnusedPrivateMember ) . set ( CompilerOptions . UnusedDeclaredThrownException ) . set ( CompilerOptions . UnusedLabel ) . set ( CompilerOptions . UnusedImport ) . set ( CompilerOptions . UnusedTypeArguments ) . set ( CompilerOptions . RedundantSuperinterface ) . set ( CompilerOptions . DeadCode ) . set ( CompilerOptions . UnusedObjectAllocation ) . set ( CompilerOptions . RedundantSpecificationOfTypeArguments ) ; STATIC_METHOD . set ( CompilerOptions . MethodCanBePotentiallyStatic ) ; String suppressRawWhenUnchecked = System . getProperty ( "<STR_LIT>" ) ; if ( suppressRawWhenUnchecked != null && "<STR_LIT:true>" . equalsIgnoreCase ( suppressRawWhenUnchecked ) ) { UNCHECKED . set ( CompilerOptions . RawTypeReference ) ; } JAVADOC . set ( CompilerOptions . MissingJavadocComments ) . set ( CompilerOptions . MissingJavadocTags ) ; } private int [ ] bits = new int [ GROUP_MAX ] ; public IrritantSet ( int singleGroupIrritants ) { initialize ( singleGroupIrritants ) ; } public IrritantSet ( IrritantSet other ) { initialize ( other ) ; } public boolean areAllSet ( ) { for ( int i = <NUM_LIT:0> ; i < GROUP_MAX ; i ++ ) { if ( this . bits [ i ] != ( <NUM_LIT> & ~ GROUP_MASK ) ) return false ; } return true ; } public IrritantSet clear ( int singleGroupIrritants ) { int group = ( singleGroupIrritants & GROUP_MASK ) > > GROUP_SHIFT ; this . bits [ group ] &= ~ singleGroupIrritants ; return this ; } public IrritantSet clearAll ( ) { for ( int i = <NUM_LIT:0> ; i < GROUP_MAX ; i ++ ) { this . bits [ i ] = <NUM_LIT:0> ; } return this ; } public void initialize ( int singleGroupIrritants ) { if ( singleGroupIrritants == <NUM_LIT:0> ) return ; int group = ( singleGroupIrritants & GROUP_MASK ) > > GROUP_SHIFT ; this . bits [ group ] = singleGroupIrritants & ~ GROUP_MASK ; } public void initialize ( IrritantSet other ) { if ( other == null ) return ; System . arraycopy ( other . bits , <NUM_LIT:0> , this . bits = new int [ GROUP_MAX ] , <NUM_LIT:0> , GROUP_MAX ) ; } public boolean isAnySet ( IrritantSet other ) { if ( other == null ) return false ; for ( int i = <NUM_LIT:0> ; i < GROUP_MAX ; i ++ ) { if ( ( this . bits [ i ] & other . bits [ i ] ) != <NUM_LIT:0> ) return true ; } return false ; } public boolean hasSameIrritants ( IrritantSet irritantSet ) { if ( irritantSet == null ) return false ; for ( int i = <NUM_LIT:0> ; i < GROUP_MAX ; i ++ ) { if ( this . bits [ i ] != irritantSet . bits [ i ] ) return false ; } return true ; } public boolean isSet ( int singleGroupIrritants ) { int group = ( singleGroupIrritants & GROUP_MASK ) > > GROUP_SHIFT ; return ( this . bits [ group ] & singleGroupIrritants ) != <NUM_LIT:0> ; } public IrritantSet set ( int singleGroupIrritants ) { int group = ( singleGroupIrritants & GROUP_MASK ) > > GROUP_SHIFT ; this . bits [ group ] |= ( singleGroupIrritants & ~ GROUP_MASK ) ; return this ; } public IrritantSet set ( IrritantSet other ) { if ( other == null ) return this ; boolean wasNoOp = true ; for ( int i = <NUM_LIT:0> ; i < GROUP_MAX ; i ++ ) { int otherIrritant = other . bits [ i ] & ~ GROUP_MASK ; if ( ( this . bits [ i ] & otherIrritant ) != otherIrritant ) { wasNoOp = false ; this . bits [ i ] |= otherIrritant ; } } return wasNoOp ? null : this ; } public IrritantSet setAll ( ) { for ( int i = <NUM_LIT:0> ; i < GROUP_MAX ; i ++ ) { this . bits [ i ] |= <NUM_LIT> & ~ GROUP_MASK ; } return this ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . impl ; public class BooleanConstant extends Constant { private boolean value ; private static final BooleanConstant TRUE = new BooleanConstant ( true ) ; private static final BooleanConstant FALSE = new BooleanConstant ( false ) ; public static Constant fromValue ( boolean value ) { return value ? BooleanConstant . TRUE : BooleanConstant . FALSE ; } private BooleanConstant ( boolean value ) { this . value = value ; } public boolean booleanValue ( ) { return this . value ; } public String stringValue ( ) { return String . valueOf ( this . value ) ; } public String toString ( ) { return "<STR_LIT>" + this . value ; } public int typeID ( ) { return T_boolean ; } public int hashCode ( ) { return this . value ? <NUM_LIT> : <NUM_LIT> ; } public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } return false ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . impl ; public class IntConstant extends Constant { int value ; private static final IntConstant MIN_VALUE = new IntConstant ( Integer . MIN_VALUE ) ; private static final IntConstant MINUS_FOUR = new IntConstant ( - <NUM_LIT:4> ) ; private static final IntConstant MINUS_THREE = new IntConstant ( - <NUM_LIT:3> ) ; private static final IntConstant MINUS_TWO = new IntConstant ( - <NUM_LIT:2> ) ; private static final IntConstant MINUS_ONE = new IntConstant ( - <NUM_LIT:1> ) ; private static final IntConstant ZERO = new IntConstant ( <NUM_LIT:0> ) ; private static final IntConstant ONE = new IntConstant ( <NUM_LIT:1> ) ; private static final IntConstant TWO = new IntConstant ( <NUM_LIT:2> ) ; private static final IntConstant THREE = new IntConstant ( <NUM_LIT:3> ) ; private static final IntConstant FOUR = new IntConstant ( <NUM_LIT:4> ) ; private static final IntConstant FIVE = new IntConstant ( <NUM_LIT:5> ) ; private static final IntConstant SIX = new IntConstant ( <NUM_LIT:6> ) ; private static final IntConstant SEVEN = new IntConstant ( <NUM_LIT:7> ) ; private static final IntConstant EIGHT = new IntConstant ( <NUM_LIT:8> ) ; private static final IntConstant NINE = new IntConstant ( <NUM_LIT:9> ) ; private static final IntConstant TEN = new IntConstant ( <NUM_LIT:10> ) ; public static Constant fromValue ( int value ) { switch ( value ) { case Integer . MIN_VALUE : return IntConstant . MIN_VALUE ; case - <NUM_LIT:4> : return IntConstant . MINUS_FOUR ; case - <NUM_LIT:3> : return IntConstant . MINUS_THREE ; case - <NUM_LIT:2> : return IntConstant . MINUS_TWO ; case - <NUM_LIT:1> : return IntConstant . MINUS_ONE ; case <NUM_LIT:0> : return IntConstant . ZERO ; case <NUM_LIT:1> : return IntConstant . ONE ; case <NUM_LIT:2> : return IntConstant . TWO ; case <NUM_LIT:3> : return IntConstant . THREE ; case <NUM_LIT:4> : return IntConstant . FOUR ; case <NUM_LIT:5> : return IntConstant . FIVE ; case <NUM_LIT:6> : return IntConstant . SIX ; case <NUM_LIT:7> : return IntConstant . SEVEN ; case <NUM_LIT:8> : return IntConstant . EIGHT ; case <NUM_LIT:9> : return IntConstant . NINE ; case <NUM_LIT:10> : return IntConstant . TEN ; } return new IntConstant ( value ) ; } private IntConstant ( int value ) { this . value = value ; } public byte byteValue ( ) { return ( byte ) this . value ; } public char charValue ( ) { return ( char ) this . value ; } public double doubleValue ( ) { return this . value ; } public float floatValue ( ) { return this . value ; } public int intValue ( ) { return this . value ; } public long longValue ( ) { return this . value ; } public short shortValue ( ) { return ( short ) this . value ; } public String stringValue ( ) { return String . valueOf ( this . value ) ; } public String toString ( ) { return "<STR_LIT>" + this . value ; } public int typeID ( ) { return T_int ; } public int hashCode ( ) { return this . value ; } public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } IntConstant other = ( IntConstant ) obj ; return this . value == other . value ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . impl ; public class LongConstant extends Constant { private static final LongConstant ZERO = new LongConstant ( <NUM_LIT> ) ; private static final LongConstant MIN_VALUE = new LongConstant ( Long . MIN_VALUE ) ; private long value ; public static Constant fromValue ( long value ) { if ( value == <NUM_LIT> ) { return ZERO ; } else if ( value == Long . MIN_VALUE ) { return MIN_VALUE ; } return new LongConstant ( value ) ; } private LongConstant ( long value ) { this . value = value ; } public byte byteValue ( ) { return ( byte ) this . value ; } public char charValue ( ) { return ( char ) this . value ; } public double doubleValue ( ) { return this . value ; } public float floatValue ( ) { return this . value ; } public int intValue ( ) { return ( int ) this . value ; } public long longValue ( ) { return this . value ; } public short shortValue ( ) { return ( short ) this . value ; } public String stringValue ( ) { return String . valueOf ( this . value ) ; } public String toString ( ) { return "<STR_LIT>" + this . value ; } public int typeID ( ) { return T_long ; } public int hashCode ( ) { return ( int ) ( this . value ^ ( this . value > > > <NUM_LIT:32> ) ) ; } public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } LongConstant other = ( LongConstant ) obj ; return this . value == other . value ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . impl ; public class DoubleConstant extends Constant { private double value ; public static Constant fromValue ( double value ) { return new DoubleConstant ( value ) ; } private DoubleConstant ( double value ) { this . value = value ; } public byte byteValue ( ) { return ( byte ) this . value ; } public char charValue ( ) { return ( char ) this . value ; } public double doubleValue ( ) { return this . value ; } public float floatValue ( ) { return ( float ) this . value ; } public int intValue ( ) { return ( int ) this . value ; } public long longValue ( ) { return ( long ) this . value ; } public short shortValue ( ) { return ( short ) this . value ; } public String stringValue ( ) { return String . valueOf ( this . value ) ; } public String toString ( ) { if ( this == NotAConstant ) return "<STR_LIT>" ; return "<STR_LIT>" + this . value ; } public int typeID ( ) { return T_double ; } public int hashCode ( ) { long temp = Double . doubleToLongBits ( this . value ) ; return ( int ) ( temp ^ ( temp > > > <NUM_LIT:32> ) ) ; } public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } DoubleConstant other = ( DoubleConstant ) obj ; return Double . doubleToLongBits ( this . value ) == Double . doubleToLongBits ( other . value ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . impl ; import org . eclipse . jdt . core . compiler . CategorizedProblem ; import org . eclipse . jdt . internal . compiler . CompilationResult ; public interface ReferenceContext { void abort ( int abortLevel , CategorizedProblem problem ) ; CompilationResult compilationResult ( ) ; boolean hasErrors ( ) ; void tagAsHavingErrors ( ) ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . impl ; import java . io . ByteArrayInputStream ; import java . io . InputStreamReader ; import java . io . UnsupportedEncodingException ; import java . util . HashMap ; import java . util . Map ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . Compiler ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . lookup . ExtraCompilerModifiers ; import org . eclipse . jdt . internal . compiler . problem . ProblemSeverities ; import org . eclipse . jdt . internal . compiler . util . Util ; public class CompilerOptions { public static final String OPTION_LocalVariableAttribute = "<STR_LIT>" ; public static final String OPTION_LineNumberAttribute = "<STR_LIT>" ; public static final String OPTION_SourceFileAttribute = "<STR_LIT>" ; public static final String OPTION_PreserveUnusedLocal = "<STR_LIT>" ; public static final String OPTION_DocCommentSupport = "<STR_LIT>" ; public static final String OPTION_ReportMethodWithConstructorName = "<STR_LIT>" ; public static final String OPTION_ReportOverridingPackageDefaultMethod = "<STR_LIT>" ; public static final String OPTION_ReportDeprecation = "<STR_LIT>" ; public static final String OPTION_ReportDeprecationInDeprecatedCode = "<STR_LIT>" ; public static final String OPTION_ReportDeprecationWhenOverridingDeprecatedMethod = "<STR_LIT>" ; public static final String OPTION_ReportHiddenCatchBlock = "<STR_LIT>" ; public static final String OPTION_ReportUnusedLocal = "<STR_LIT>" ; public static final String OPTION_ReportUnusedParameter = "<STR_LIT>" ; public static final String OPTION_ReportUnusedParameterWhenImplementingAbstract = "<STR_LIT>" ; public static final String OPTION_ReportUnusedParameterWhenOverridingConcrete = "<STR_LIT>" ; public static final String OPTION_ReportUnusedParameterIncludeDocCommentReference = "<STR_LIT>" ; public static final String OPTION_ReportUnusedImport = "<STR_LIT>" ; public static final String OPTION_ReportSyntheticAccessEmulation = "<STR_LIT>" ; public static final String OPTION_ReportNoEffectAssignment = "<STR_LIT>" ; public static final String OPTION_ReportLocalVariableHiding = "<STR_LIT>" ; public static final String OPTION_ReportSpecialParameterHidingField = "<STR_LIT>" ; public static final String OPTION_ReportFieldHiding = "<STR_LIT>" ; public static final String OPTION_ReportTypeParameterHiding = "<STR_LIT>" ; public static final String OPTION_ReportPossibleAccidentalBooleanAssignment = "<STR_LIT>" ; public static final String OPTION_ReportNonExternalizedStringLiteral = "<STR_LIT>" ; public static final String OPTION_ReportIncompatibleNonInheritedInterfaceMethod = "<STR_LIT>" ; public static final String OPTION_ReportUnusedPrivateMember = "<STR_LIT>" ; public static final String OPTION_ReportNoImplicitStringConversion = "<STR_LIT>" ; public static final String OPTION_ReportAssertIdentifier = "<STR_LIT>" ; public static final String OPTION_ReportEnumIdentifier = "<STR_LIT>" ; public static final String OPTION_ReportNonStaticAccessToStatic = "<STR_LIT>" ; public static final String OPTION_ReportIndirectStaticAccess = "<STR_LIT>" ; public static final String OPTION_ReportEmptyStatement = "<STR_LIT>" ; public static final String OPTION_ReportUnnecessaryTypeCheck = "<STR_LIT>" ; public static final String OPTION_ReportUnnecessaryElse = "<STR_LIT>" ; public static final String OPTION_ReportUndocumentedEmptyBlock = "<STR_LIT>" ; public static final String OPTION_ReportInvalidJavadoc = "<STR_LIT>" ; public static final String OPTION_ReportInvalidJavadocTags = "<STR_LIT>" ; public static final String OPTION_ReportInvalidJavadocTagsDeprecatedRef = "<STR_LIT>" ; public static final String OPTION_ReportInvalidJavadocTagsNotVisibleRef = "<STR_LIT>" ; public static final String OPTION_ReportInvalidJavadocTagsVisibility = "<STR_LIT>" ; public static final String OPTION_ReportMissingJavadocTags = "<STR_LIT>" ; public static final String OPTION_ReportMissingJavadocTagsVisibility = "<STR_LIT>" ; public static final String OPTION_ReportMissingJavadocTagsOverriding = "<STR_LIT>" ; public static final String OPTION_ReportMissingJavadocTagsMethodTypeParameters = "<STR_LIT>" ; public static final String OPTION_ReportMissingJavadocComments = "<STR_LIT>" ; public static final String OPTION_ReportMissingJavadocTagDescription = "<STR_LIT>" ; public static final String OPTION_ReportMissingJavadocCommentsVisibility = "<STR_LIT>" ; public static final String OPTION_ReportMissingJavadocCommentsOverriding = "<STR_LIT>" ; public static final String OPTION_ReportFinallyBlockNotCompletingNormally = "<STR_LIT>" ; public static final String OPTION_ReportUnusedDeclaredThrownException = "<STR_LIT>" ; public static final String OPTION_ReportUnusedDeclaredThrownExceptionWhenOverriding = "<STR_LIT>" ; public static final String OPTION_ReportUnusedDeclaredThrownExceptionIncludeDocCommentReference = "<STR_LIT>" ; public static final String OPTION_ReportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable = "<STR_LIT>" ; public static final String OPTION_ReportUnqualifiedFieldAccess = "<STR_LIT>" ; public static final String OPTION_ReportUnavoidableGenericTypeProblems = "<STR_LIT>" ; public static final String OPTION_ReportUncheckedTypeOperation = "<STR_LIT>" ; public static final String OPTION_ReportRawTypeReference = "<STR_LIT>" ; public static final String OPTION_ReportFinalParameterBound = "<STR_LIT>" ; public static final String OPTION_ReportMissingSerialVersion = "<STR_LIT>" ; public static final String OPTION_ReportVarargsArgumentNeedCast = "<STR_LIT>" ; public static final String OPTION_ReportUnusedTypeArgumentsForMethodInvocation = "<STR_LIT>" ; public static final String OPTION_Source = "<STR_LIT>" ; public static final String OPTION_TargetPlatform = "<STR_LIT>" ; public static final String OPTION_Compliance = "<STR_LIT>" ; public static final String OPTION_Encoding = "<STR_LIT>" ; public static final String OPTION_MaxProblemPerUnit = "<STR_LIT>" ; public static final String OPTION_TaskTags = "<STR_LIT>" ; public static final String OPTION_TaskPriorities = "<STR_LIT>" ; public static final String OPTION_TaskCaseSensitive = "<STR_LIT>" ; public static final String OPTION_InlineJsr = "<STR_LIT>" ; public static final String OPTION_ReportNullReference = "<STR_LIT>" ; public static final String OPTION_ReportPotentialNullReference = "<STR_LIT>" ; public static final String OPTION_ReportRedundantNullCheck = "<STR_LIT>" ; public static final String OPTION_ReportAutoboxing = "<STR_LIT>" ; public static final String OPTION_ReportAnnotationSuperInterface = "<STR_LIT>" ; public static final String OPTION_ReportMissingOverrideAnnotation = "<STR_LIT>" ; public static final String OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation = "<STR_LIT>" ; public static final String OPTION_ReportMissingDeprecatedAnnotation = "<STR_LIT>" ; public static final String OPTION_ReportIncompleteEnumSwitch = "<STR_LIT>" ; public static final String OPTION_ReportForbiddenReference = "<STR_LIT>" ; public static final String OPTION_ReportDiscouragedReference = "<STR_LIT>" ; public static final String OPTION_SuppressWarnings = "<STR_LIT>" ; public static final String OPTION_SuppressOptionalErrors = "<STR_LIT>" ; public static final String OPTION_ReportUnhandledWarningToken = "<STR_LIT>" ; public static final String OPTION_ReportUnusedWarningToken = "<STR_LIT>" ; public static final String OPTION_ReportUnusedLabel = "<STR_LIT>" ; public static final String OPTION_FatalOptionalError = "<STR_LIT>" ; public static final String OPTION_ReportParameterAssignment = "<STR_LIT>" ; public static final String OPTION_ReportFallthroughCase = "<STR_LIT>" ; public static final String OPTION_ReportOverridingMethodWithoutSuperInvocation = "<STR_LIT>" ; public static final String OPTION_GenerateClassFiles = "<STR_LIT>" ; public static final String OPTION_Process_Annotations = "<STR_LIT>" ; public static final String OPTION_ReportRedundantSuperinterface = "<STR_LIT>" ; public static final String OPTION_ReportComparingIdentical = "<STR_LIT>" ; public static final String OPTION_ReportMissingSynchronizedOnInheritedMethod = "<STR_LIT>" ; public static final String OPTION_ReportMissingHashCodeMethod = "<STR_LIT>" ; public static final String OPTION_ReportDeadCode = "<STR_LIT>" ; public static final String OPTION_ReportDeadCodeInTrivialIfStatement = "<STR_LIT>" ; public static final String OPTION_ReportTasks = "<STR_LIT>" ; public static final String OPTION_ReportUnusedObjectAllocation = "<STR_LIT>" ; public static final String OPTION_IncludeNullInfoFromAsserts = "<STR_LIT>" ; public static final String OPTION_ReportMethodCanBeStatic = "<STR_LIT>" ; public static final String OPTION_ReportMethodCanBePotentiallyStatic = "<STR_LIT>" ; public static final String OPTION_ReportRedundantSpecificationOfTypeArguments = "<STR_LIT>" ; public static final String OPTIONG_BuildGroovyFiles = "<STR_LIT>" ; public static final String OPTIONG_GroovyFlags = "<STR_LIT>" ; public static final String OPTIONG_GroovyClassLoaderPath = "<STR_LIT>" ; public static final String OPTIONG_GroovyProjectName = "<STR_LIT>" ; public static final String OPTIONG_GroovyExtraImports = "<STR_LIT>" ; public static final String OPTIONG_GroovyTransformsToRunOnReconcile = "<STR_LIT>" ; public static final String GENERATE = "<STR_LIT>" ; public static final String DO_NOT_GENERATE = "<STR_LIT>" ; public static final String PRESERVE = "<STR_LIT>" ; public static final String OPTIMIZE_OUT = "<STR_LIT>" ; public static final String VERSION_1_1 = "<STR_LIT>" ; public static final String VERSION_1_2 = "<STR_LIT>" ; public static final String VERSION_1_3 = "<STR_LIT>" ; public static final String VERSION_1_4 = "<STR_LIT>" ; public static final String VERSION_JSR14 = "<STR_LIT>" ; public static final String VERSION_CLDC1_1 = "<STR_LIT>" ; public static final String VERSION_1_5 = "<STR_LIT>" ; public static final String VERSION_1_6 = "<STR_LIT>" ; public static final String VERSION_1_7 = "<STR_LIT>" ; public static final String ERROR = "<STR_LIT:error>" ; public static final String WARNING = "<STR_LIT>" ; public static final String IGNORE = "<STR_LIT>" ; public static final String ENABLED = "<STR_LIT>" ; public static final String DISABLED = "<STR_LIT>" ; public static final String PUBLIC = "<STR_LIT>" ; public static final String PROTECTED = "<STR_LIT>" ; public static final String DEFAULT = "<STR_LIT:default>" ; public static final String PRIVATE = "<STR_LIT>" ; public static final String RETURN_TAG = "<STR_LIT>" ; public static final String NO_TAG = "<STR_LIT>" ; public static final String ALL_STANDARD_TAGS = "<STR_LIT>" ; public static final int MethodWithConstructorName = IrritantSet . GROUP0 | ASTNode . Bit1 ; public static final int OverriddenPackageDefaultMethod = IrritantSet . GROUP0 | ASTNode . Bit2 ; public static final int UsingDeprecatedAPI = IrritantSet . GROUP0 | ASTNode . Bit3 ; public static final int MaskedCatchBlock = IrritantSet . GROUP0 | ASTNode . Bit4 ; public static final int UnusedLocalVariable = IrritantSet . GROUP0 | ASTNode . Bit5 ; public static final int UnusedArgument = IrritantSet . GROUP0 | ASTNode . Bit6 ; public static final int NoImplicitStringConversion = IrritantSet . GROUP0 | ASTNode . Bit7 ; public static final int AccessEmulation = IrritantSet . GROUP0 | ASTNode . Bit8 ; public static final int NonExternalizedString = IrritantSet . GROUP0 | ASTNode . Bit9 ; public static final int AssertUsedAsAnIdentifier = IrritantSet . GROUP0 | ASTNode . Bit10 ; public static final int UnusedImport = IrritantSet . GROUP0 | ASTNode . Bit11 ; public static final int NonStaticAccessToStatic = IrritantSet . GROUP0 | ASTNode . Bit12 ; public static final int Task = IrritantSet . GROUP0 | ASTNode . Bit13 ; public static final int NoEffectAssignment = IrritantSet . GROUP0 | ASTNode . Bit14 ; public static final int IncompatibleNonInheritedInterfaceMethod = IrritantSet . GROUP0 | ASTNode . Bit15 ; public static final int UnusedPrivateMember = IrritantSet . GROUP0 | ASTNode . Bit16 ; public static final int LocalVariableHiding = IrritantSet . GROUP0 | ASTNode . Bit17 ; public static final int FieldHiding = IrritantSet . GROUP0 | ASTNode . Bit18 ; public static final int AccidentalBooleanAssign = IrritantSet . GROUP0 | ASTNode . Bit19 ; public static final int EmptyStatement = IrritantSet . GROUP0 | ASTNode . Bit20 ; public static final int MissingJavadocComments = IrritantSet . GROUP0 | ASTNode . Bit21 ; public static final int MissingJavadocTags = IrritantSet . GROUP0 | ASTNode . Bit22 ; public static final int UnqualifiedFieldAccess = IrritantSet . GROUP0 | ASTNode . Bit23 ; public static final int UnusedDeclaredThrownException = IrritantSet . GROUP0 | ASTNode . Bit24 ; public static final int FinallyBlockNotCompleting = IrritantSet . GROUP0 | ASTNode . Bit25 ; public static final int InvalidJavadoc = IrritantSet . GROUP0 | ASTNode . Bit26 ; public static final int UnnecessaryTypeCheck = IrritantSet . GROUP0 | ASTNode . Bit27 ; public static final int UndocumentedEmptyBlock = IrritantSet . GROUP0 | ASTNode . Bit28 ; public static final int IndirectStaticAccess = IrritantSet . GROUP0 | ASTNode . Bit29 ; public static final int UnnecessaryElse = IrritantSet . GROUP1 | ASTNode . Bit1 ; public static final int UncheckedTypeOperation = IrritantSet . GROUP1 | ASTNode . Bit2 ; public static final int FinalParameterBound = IrritantSet . GROUP1 | ASTNode . Bit3 ; public static final int MissingSerialVersion = IrritantSet . GROUP1 | ASTNode . Bit4 ; public static final int EnumUsedAsAnIdentifier = IrritantSet . GROUP1 | ASTNode . Bit5 ; public static final int ForbiddenReference = IrritantSet . GROUP1 | ASTNode . Bit6 ; public static final int VarargsArgumentNeedCast = IrritantSet . GROUP1 | ASTNode . Bit7 ; public static final int NullReference = IrritantSet . GROUP1 | ASTNode . Bit8 ; public static final int AutoBoxing = IrritantSet . GROUP1 | ASTNode . Bit9 ; public static final int AnnotationSuperInterface = IrritantSet . GROUP1 | ASTNode . Bit10 ; public static final int TypeHiding = IrritantSet . GROUP1 | ASTNode . Bit11 ; public static final int MissingOverrideAnnotation = IrritantSet . GROUP1 | ASTNode . Bit12 ; public static final int IncompleteEnumSwitch = IrritantSet . GROUP1 | ASTNode . Bit13 ; public static final int MissingDeprecatedAnnotation = IrritantSet . GROUP1 | ASTNode . Bit14 ; public static final int DiscouragedReference = IrritantSet . GROUP1 | ASTNode . Bit15 ; public static final int UnhandledWarningToken = IrritantSet . GROUP1 | ASTNode . Bit16 ; public static final int RawTypeReference = IrritantSet . GROUP1 | ASTNode . Bit17 ; public static final int UnusedLabel = IrritantSet . GROUP1 | ASTNode . Bit18 ; public static final int ParameterAssignment = IrritantSet . GROUP1 | ASTNode . Bit19 ; public static final int FallthroughCase = IrritantSet . GROUP1 | ASTNode . Bit20 ; public static final int OverridingMethodWithoutSuperInvocation = IrritantSet . GROUP1 | ASTNode . Bit21 ; public static final int PotentialNullReference = IrritantSet . GROUP1 | ASTNode . Bit22 ; public static final int RedundantNullCheck = IrritantSet . GROUP1 | ASTNode . Bit23 ; public static final int MissingJavadocTagDescription = IrritantSet . GROUP1 | ASTNode . Bit24 ; public static final int UnusedTypeArguments = IrritantSet . GROUP1 | ASTNode . Bit25 ; public static final int UnusedWarningToken = IrritantSet . GROUP1 | ASTNode . Bit26 ; public static final int RedundantSuperinterface = IrritantSet . GROUP1 | ASTNode . Bit27 ; public static final int ComparingIdentical = IrritantSet . GROUP1 | ASTNode . Bit28 ; public static final int MissingSynchronizedModifierInInheritedMethod = IrritantSet . GROUP1 | ASTNode . Bit29 ; public static final int ShouldImplementHashcode = IrritantSet . GROUP2 | ASTNode . Bit1 ; public static final int DeadCode = IrritantSet . GROUP2 | ASTNode . Bit2 ; public static final int Tasks = IrritantSet . GROUP2 | ASTNode . Bit3 ; public static final int UnusedObjectAllocation = IrritantSet . GROUP2 | ASTNode . Bit4 ; public static final int MethodCanBeStatic = IrritantSet . GROUP2 | ASTNode . Bit5 ; public static final int MethodCanBePotentiallyStatic = IrritantSet . GROUP2 | ASTNode . Bit6 ; public static final int RedundantSpecificationOfTypeArguments = IrritantSet . GROUP2 | ASTNode . Bit7 ; protected IrritantSet errorThreshold ; protected IrritantSet warningThreshold ; public int produceDebugAttributes ; public long complianceLevel ; public long originalComplianceLevel ; public long sourceLevel ; public long originalSourceLevel ; public long targetJDK ; public String defaultEncoding ; public boolean verbose ; public boolean produceReferenceInfo ; public boolean preserveAllLocalVariables ; public boolean parseLiteralExpressionsAsConstants ; public int maxProblemsPerUnit ; public char [ ] [ ] taskTags ; public char [ ] [ ] taskPriorities ; public boolean isTaskCaseSensitive ; public boolean reportDeprecationInsideDeprecatedCode ; public boolean reportDeprecationWhenOverridingDeprecatedMethod ; public boolean reportUnusedParameterWhenImplementingAbstract ; public boolean reportUnusedParameterWhenOverridingConcrete ; public boolean reportUnusedParameterIncludeDocCommentReference ; public boolean reportUnusedDeclaredThrownExceptionWhenOverriding ; public boolean reportUnusedDeclaredThrownExceptionIncludeDocCommentReference ; public boolean reportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable ; public boolean reportSpecialParameterHidingField ; public boolean reportDeadCodeInTrivialIfStatement ; public boolean docCommentSupport ; public boolean reportInvalidJavadocTags ; public int reportInvalidJavadocTagsVisibility ; public boolean reportInvalidJavadocTagsDeprecatedRef ; public boolean reportInvalidJavadocTagsNotVisibleRef ; public String reportMissingJavadocTagDescription ; public int reportMissingJavadocTagsVisibility ; public boolean reportMissingJavadocTagsOverriding ; public boolean reportMissingJavadocTagsMethodTypeParameters ; public int reportMissingJavadocCommentsVisibility ; public boolean reportMissingJavadocCommentsOverriding ; public boolean inlineJsrBytecode ; public boolean suppressWarnings ; public boolean suppressOptionalErrors ; public boolean treatOptionalErrorAsFatal ; public boolean performMethodsFullRecovery ; public boolean performStatementsRecovery ; public boolean processAnnotations ; public boolean storeAnnotations ; public boolean reportMissingOverrideAnnotationForInterfaceMethodImplementation ; public boolean generateClassFiles ; public boolean ignoreMethodBodies ; public boolean includeNullInfoFromAsserts ; public boolean reportUnavoidableGenericTypeProblems ; public int buildGroovyFiles = <NUM_LIT:0> ; public int groovyFlags = <NUM_LIT:0> ; public String groovyClassLoaderPath = null ; public String groovyExtraImports = null ; public String groovyProjectName = null ; public String groovyTransformsToRunOnReconcile = null ; public final static String [ ] warningTokens = { "<STR_LIT:all>" , "<STR_LIT>" , "<STR_LIT:cast>" , "<STR_LIT>" , "<STR_LIT:deprecation>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT:null>" , "<STR_LIT>" , "<STR_LIT:rawtypes>" , "<STR_LIT:serial>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT:unchecked>" , "<STR_LIT>" , "<STR_LIT:unused>" , } ; public CompilerOptions ( ) { this ( null ) ; } public CompilerOptions ( Map settings ) { resetDefaults ( ) ; if ( settings != null ) { set ( settings ) ; } } public CompilerOptions ( Map settings , boolean parseLiteralExpressionsAsConstants ) { this ( settings ) ; this . parseLiteralExpressionsAsConstants = parseLiteralExpressionsAsConstants ; } public static String optionKeyFromIrritant ( int irritant ) { switch ( irritant ) { case MethodWithConstructorName : return OPTION_ReportMethodWithConstructorName ; case OverriddenPackageDefaultMethod : return OPTION_ReportOverridingPackageDefaultMethod ; case UsingDeprecatedAPI : case ( InvalidJavadoc | UsingDeprecatedAPI ) : return OPTION_ReportDeprecation ; case MaskedCatchBlock : return OPTION_ReportHiddenCatchBlock ; case UnusedLocalVariable : return OPTION_ReportUnusedLocal ; case UnusedArgument : return OPTION_ReportUnusedParameter ; case NoImplicitStringConversion : return OPTION_ReportNoImplicitStringConversion ; case AccessEmulation : return OPTION_ReportSyntheticAccessEmulation ; case NonExternalizedString : return OPTION_ReportNonExternalizedStringLiteral ; case AssertUsedAsAnIdentifier : return OPTION_ReportAssertIdentifier ; case UnusedImport : return OPTION_ReportUnusedImport ; case NonStaticAccessToStatic : return OPTION_ReportNonStaticAccessToStatic ; case Task : return OPTION_TaskTags ; case NoEffectAssignment : return OPTION_ReportNoEffectAssignment ; case IncompatibleNonInheritedInterfaceMethod : return OPTION_ReportIncompatibleNonInheritedInterfaceMethod ; case UnusedPrivateMember : return OPTION_ReportUnusedPrivateMember ; case LocalVariableHiding : return OPTION_ReportLocalVariableHiding ; case FieldHiding : return OPTION_ReportFieldHiding ; case AccidentalBooleanAssign : return OPTION_ReportPossibleAccidentalBooleanAssignment ; case EmptyStatement : return OPTION_ReportEmptyStatement ; case MissingJavadocComments : return OPTION_ReportMissingJavadocComments ; case MissingJavadocTags : return OPTION_ReportMissingJavadocTags ; case UnqualifiedFieldAccess : return OPTION_ReportUnqualifiedFieldAccess ; case UnusedDeclaredThrownException : return OPTION_ReportUnusedDeclaredThrownExceptionWhenOverriding ; case FinallyBlockNotCompleting : return OPTION_ReportFinallyBlockNotCompletingNormally ; case InvalidJavadoc : return OPTION_ReportInvalidJavadoc ; case UnnecessaryTypeCheck : return OPTION_ReportUnnecessaryTypeCheck ; case UndocumentedEmptyBlock : return OPTION_ReportUndocumentedEmptyBlock ; case IndirectStaticAccess : return OPTION_ReportIndirectStaticAccess ; case UnnecessaryElse : return OPTION_ReportUnnecessaryElse ; case UncheckedTypeOperation : return OPTION_ReportUncheckedTypeOperation ; case FinalParameterBound : return OPTION_ReportFinalParameterBound ; case MissingSerialVersion : return OPTION_ReportMissingSerialVersion ; case EnumUsedAsAnIdentifier : return OPTION_ReportEnumIdentifier ; case ForbiddenReference : return OPTION_ReportForbiddenReference ; case VarargsArgumentNeedCast : return OPTION_ReportVarargsArgumentNeedCast ; case NullReference : return OPTION_ReportNullReference ; case PotentialNullReference : return OPTION_ReportPotentialNullReference ; case RedundantNullCheck : return OPTION_ReportRedundantNullCheck ; case AutoBoxing : return OPTION_ReportAutoboxing ; case AnnotationSuperInterface : return OPTION_ReportAnnotationSuperInterface ; case TypeHiding : return OPTION_ReportTypeParameterHiding ; case MissingOverrideAnnotation : return OPTION_ReportMissingOverrideAnnotation ; case IncompleteEnumSwitch : return OPTION_ReportIncompleteEnumSwitch ; case MissingDeprecatedAnnotation : return OPTION_ReportMissingDeprecatedAnnotation ; case DiscouragedReference : return OPTION_ReportDiscouragedReference ; case UnhandledWarningToken : return OPTION_ReportUnhandledWarningToken ; case RawTypeReference : return OPTION_ReportRawTypeReference ; case UnusedLabel : return OPTION_ReportUnusedLabel ; case ParameterAssignment : return OPTION_ReportParameterAssignment ; case FallthroughCase : return OPTION_ReportFallthroughCase ; case OverridingMethodWithoutSuperInvocation : return OPTION_ReportOverridingMethodWithoutSuperInvocation ; case MissingJavadocTagDescription : return OPTION_ReportMissingJavadocTagDescription ; case UnusedTypeArguments : return OPTION_ReportUnusedTypeArgumentsForMethodInvocation ; case UnusedWarningToken : return OPTION_ReportUnusedWarningToken ; case RedundantSuperinterface : return OPTION_ReportRedundantSuperinterface ; case ComparingIdentical : return OPTION_ReportComparingIdentical ; case MissingSynchronizedModifierInInheritedMethod : return OPTION_ReportMissingSynchronizedOnInheritedMethod ; case ShouldImplementHashcode : return OPTION_ReportMissingHashCodeMethod ; case DeadCode : return OPTION_ReportDeadCode ; case UnusedObjectAllocation : return OPTION_ReportUnusedObjectAllocation ; case MethodCanBeStatic : return OPTION_ReportMethodCanBeStatic ; case MethodCanBePotentiallyStatic : return OPTION_ReportMethodCanBePotentiallyStatic ; case RedundantSpecificationOfTypeArguments : return OPTION_ReportRedundantSpecificationOfTypeArguments ; } return null ; } public static String versionFromJdkLevel ( long jdkLevel ) { switch ( ( int ) ( jdkLevel > > <NUM_LIT:16> ) ) { case ClassFileConstants . MAJOR_VERSION_1_1 : if ( jdkLevel == ClassFileConstants . JDK1_1 ) return VERSION_1_1 ; break ; case ClassFileConstants . MAJOR_VERSION_1_2 : if ( jdkLevel == ClassFileConstants . JDK1_2 ) return VERSION_1_2 ; break ; case ClassFileConstants . MAJOR_VERSION_1_3 : if ( jdkLevel == ClassFileConstants . JDK1_3 ) return VERSION_1_3 ; break ; case ClassFileConstants . MAJOR_VERSION_1_4 : if ( jdkLevel == ClassFileConstants . JDK1_4 ) return VERSION_1_4 ; break ; case ClassFileConstants . MAJOR_VERSION_1_5 : if ( jdkLevel == ClassFileConstants . JDK1_5 ) return VERSION_1_5 ; break ; case ClassFileConstants . MAJOR_VERSION_1_6 : if ( jdkLevel == ClassFileConstants . JDK1_6 ) return VERSION_1_6 ; break ; case ClassFileConstants . MAJOR_VERSION_1_7 : if ( jdkLevel == ClassFileConstants . JDK1_7 ) return VERSION_1_7 ; break ; } return Util . EMPTY_STRING ; } public static long versionToJdkLevel ( Object versionID ) { if ( versionID instanceof String ) { String version = ( String ) versionID ; if ( version . length ( ) == <NUM_LIT:3> && version . charAt ( <NUM_LIT:0> ) == '<CHAR_LIT:1>' && version . charAt ( <NUM_LIT:1> ) == '<CHAR_LIT:.>' ) { switch ( version . charAt ( <NUM_LIT:2> ) ) { case '<CHAR_LIT:1>' : return ClassFileConstants . JDK1_1 ; case '<CHAR_LIT>' : return ClassFileConstants . JDK1_2 ; case '<CHAR_LIT>' : return ClassFileConstants . JDK1_3 ; case '<CHAR_LIT>' : return ClassFileConstants . JDK1_4 ; case '<CHAR_LIT>' : return ClassFileConstants . JDK1_5 ; case '<CHAR_LIT>' : return ClassFileConstants . JDK1_6 ; case '<CHAR_LIT>' : return ClassFileConstants . JDK1_7 ; default : return <NUM_LIT:0> ; } } if ( VERSION_JSR14 . equals ( versionID ) ) { return ClassFileConstants . JDK1_4 ; } if ( VERSION_CLDC1_1 . equals ( versionID ) ) { return ClassFileConstants . CLDC_1_1 ; } } return <NUM_LIT:0> ; } public static String [ ] warningOptionNames ( ) { String [ ] result = { OPTION_ReportAnnotationSuperInterface , OPTION_ReportAssertIdentifier , OPTION_ReportAutoboxing , OPTION_ReportComparingIdentical , OPTION_ReportDeadCode , OPTION_ReportDeadCodeInTrivialIfStatement , OPTION_ReportDeprecation , OPTION_ReportDeprecationInDeprecatedCode , OPTION_ReportDeprecationWhenOverridingDeprecatedMethod , OPTION_ReportDiscouragedReference , OPTION_ReportEmptyStatement , OPTION_ReportEnumIdentifier , OPTION_ReportFallthroughCase , OPTION_ReportFieldHiding , OPTION_ReportFinallyBlockNotCompletingNormally , OPTION_ReportFinalParameterBound , OPTION_ReportForbiddenReference , OPTION_ReportHiddenCatchBlock , OPTION_ReportIncompatibleNonInheritedInterfaceMethod , OPTION_ReportIncompleteEnumSwitch , OPTION_ReportIndirectStaticAccess , OPTION_ReportInvalidJavadoc , OPTION_ReportInvalidJavadocTags , OPTION_ReportInvalidJavadocTagsDeprecatedRef , OPTION_ReportInvalidJavadocTagsNotVisibleRef , OPTION_ReportInvalidJavadocTagsVisibility , OPTION_ReportLocalVariableHiding , OPTION_ReportMethodCanBePotentiallyStatic , OPTION_ReportMethodCanBeStatic , OPTION_ReportMethodWithConstructorName , OPTION_ReportMissingDeprecatedAnnotation , OPTION_ReportMissingHashCodeMethod , OPTION_ReportMissingJavadocComments , OPTION_ReportMissingJavadocCommentsOverriding , OPTION_ReportMissingJavadocCommentsVisibility , OPTION_ReportMissingJavadocTagDescription , OPTION_ReportMissingJavadocTags , OPTION_ReportMissingJavadocTagsMethodTypeParameters , OPTION_ReportMissingJavadocTagsOverriding , OPTION_ReportMissingJavadocTagsVisibility , OPTION_ReportMissingOverrideAnnotation , OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation , OPTION_ReportMissingSerialVersion , OPTION_ReportMissingSynchronizedOnInheritedMethod , OPTION_ReportNoEffectAssignment , OPTION_ReportNoImplicitStringConversion , OPTION_ReportNonExternalizedStringLiteral , OPTION_ReportNonStaticAccessToStatic , OPTION_ReportNullReference , OPTION_ReportOverridingMethodWithoutSuperInvocation , OPTION_ReportOverridingPackageDefaultMethod , OPTION_ReportParameterAssignment , OPTION_ReportPossibleAccidentalBooleanAssignment , OPTION_ReportPotentialNullReference , OPTION_ReportRawTypeReference , OPTION_ReportRedundantNullCheck , OPTION_ReportRedundantSuperinterface , OPTION_ReportRedundantSpecificationOfTypeArguments , OPTION_ReportSpecialParameterHidingField , OPTION_ReportSyntheticAccessEmulation , OPTION_ReportTasks , OPTION_ReportTypeParameterHiding , OPTION_ReportUnavoidableGenericTypeProblems , OPTION_ReportUncheckedTypeOperation , OPTION_ReportUndocumentedEmptyBlock , OPTION_ReportUnhandledWarningToken , OPTION_ReportUnnecessaryElse , OPTION_ReportUnnecessaryTypeCheck , OPTION_ReportUnqualifiedFieldAccess , OPTION_ReportUnusedDeclaredThrownException , OPTION_ReportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable , OPTION_ReportUnusedDeclaredThrownExceptionIncludeDocCommentReference , OPTION_ReportUnusedDeclaredThrownExceptionWhenOverriding , OPTION_ReportUnusedImport , OPTION_ReportUnusedLabel , OPTION_ReportUnusedLocal , OPTION_ReportUnusedObjectAllocation , OPTION_ReportUnusedParameter , OPTION_ReportUnusedParameterIncludeDocCommentReference , OPTION_ReportUnusedParameterWhenImplementingAbstract , OPTION_ReportUnusedParameterWhenOverridingConcrete , OPTION_ReportUnusedPrivateMember , OPTION_ReportUnusedTypeArgumentsForMethodInvocation , OPTION_ReportUnusedWarningToken , OPTION_ReportVarargsArgumentNeedCast , } ; return result ; } public static String warningTokenFromIrritant ( int irritant ) { switch ( irritant ) { case ( InvalidJavadoc | UsingDeprecatedAPI ) : case UsingDeprecatedAPI : return "<STR_LIT:deprecation>" ; case FinallyBlockNotCompleting : return "<STR_LIT>" ; case FieldHiding : case LocalVariableHiding : case MaskedCatchBlock : return "<STR_LIT>" ; case NonExternalizedString : return "<STR_LIT>" ; case UnnecessaryTypeCheck : return "<STR_LIT:cast>" ; case IndirectStaticAccess : case NonStaticAccessToStatic : return "<STR_LIT>" ; case AccessEmulation : return "<STR_LIT>" ; case UnqualifiedFieldAccess : return "<STR_LIT>" ; case UncheckedTypeOperation : return "<STR_LIT:unchecked>" ; case MissingSerialVersion : return "<STR_LIT:serial>" ; case AutoBoxing : return "<STR_LIT>" ; case TypeHiding : return "<STR_LIT>" ; case IncompleteEnumSwitch : return "<STR_LIT>" ; case MissingDeprecatedAnnotation : return "<STR_LIT>" ; case RawTypeReference : return "<STR_LIT:rawtypes>" ; case UnusedLabel : case UnusedTypeArguments : case RedundantSuperinterface : case UnusedLocalVariable : case UnusedArgument : case UnusedImport : case UnusedPrivateMember : case UnusedDeclaredThrownException : case DeadCode : case UnusedObjectAllocation : case RedundantSpecificationOfTypeArguments : return "<STR_LIT:unused>" ; case DiscouragedReference : case ForbiddenReference : return "<STR_LIT>" ; case NullReference : case PotentialNullReference : case RedundantNullCheck : return "<STR_LIT:null>" ; case FallthroughCase : return "<STR_LIT>" ; case OverridingMethodWithoutSuperInvocation : return "<STR_LIT>" ; case MethodCanBeStatic : case MethodCanBePotentiallyStatic : return "<STR_LIT>" ; case InvalidJavadoc : case MissingJavadocComments : case MissingJavadocTags : return "<STR_LIT>" ; } return null ; } public static IrritantSet warningTokenToIrritants ( String warningToken ) { if ( warningToken == null || warningToken . length ( ) == <NUM_LIT:0> ) return null ; switch ( warningToken . charAt ( <NUM_LIT:0> ) ) { case '<CHAR_LIT:a>' : if ( "<STR_LIT:all>" . equals ( warningToken ) ) return IrritantSet . ALL ; break ; case '<CHAR_LIT:b>' : if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . BOXING ; break ; case '<CHAR_LIT:c>' : if ( "<STR_LIT:cast>" . equals ( warningToken ) ) return IrritantSet . CAST ; break ; case '<CHAR_LIT>' : if ( "<STR_LIT:deprecation>" . equals ( warningToken ) ) return IrritantSet . DEPRECATION ; if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . DEP_ANN ; break ; case '<CHAR_LIT>' : if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . FALLTHROUGH ; if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . FINALLY ; break ; case '<CHAR_LIT>' : if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . HIDING ; break ; case '<CHAR_LIT>' : if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . INCOMPLETE_SWITCH ; break ; case '<CHAR_LIT>' : if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . JAVADOC ; break ; case '<CHAR_LIT>' : if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . NLS ; if ( "<STR_LIT:null>" . equals ( warningToken ) ) return IrritantSet . NULL ; break ; case '<CHAR_LIT>' : if ( "<STR_LIT:rawtypes>" . equals ( warningToken ) ) return IrritantSet . RAW ; if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . RESTRICTION ; break ; case '<CHAR_LIT>' : if ( "<STR_LIT:serial>" . equals ( warningToken ) ) return IrritantSet . SERIAL ; if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . STATIC_ACCESS ; if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . STATIC_METHOD ; if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . SYNTHETIC_ACCESS ; if ( "<STR_LIT>" . equals ( warningToken ) ) { return IrritantSet . SUPER ; } break ; case '<CHAR_LIT>' : if ( "<STR_LIT:unused>" . equals ( warningToken ) ) return IrritantSet . UNUSED ; if ( "<STR_LIT:unchecked>" . equals ( warningToken ) ) return IrritantSet . UNCHECKED ; if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . UNQUALIFIED_FIELD_ACCESS ; break ; } return null ; } public Map getMap ( ) { Map optionsMap = new HashMap ( <NUM_LIT:30> ) ; optionsMap . put ( OPTION_LocalVariableAttribute , ( this . produceDebugAttributes & ClassFileConstants . ATTR_VARS ) != <NUM_LIT:0> ? GENERATE : DO_NOT_GENERATE ) ; optionsMap . put ( OPTION_LineNumberAttribute , ( this . produceDebugAttributes & ClassFileConstants . ATTR_LINES ) != <NUM_LIT:0> ? GENERATE : DO_NOT_GENERATE ) ; optionsMap . put ( OPTION_SourceFileAttribute , ( this . produceDebugAttributes & ClassFileConstants . ATTR_SOURCE ) != <NUM_LIT:0> ? GENERATE : DO_NOT_GENERATE ) ; optionsMap . put ( OPTION_PreserveUnusedLocal , this . preserveAllLocalVariables ? PRESERVE : OPTIMIZE_OUT ) ; optionsMap . put ( OPTION_DocCommentSupport , this . docCommentSupport ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportMethodWithConstructorName , getSeverityString ( MethodWithConstructorName ) ) ; optionsMap . put ( OPTION_ReportOverridingPackageDefaultMethod , getSeverityString ( OverriddenPackageDefaultMethod ) ) ; optionsMap . put ( OPTION_ReportDeprecation , getSeverityString ( UsingDeprecatedAPI ) ) ; optionsMap . put ( OPTION_ReportDeprecationInDeprecatedCode , this . reportDeprecationInsideDeprecatedCode ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportDeprecationWhenOverridingDeprecatedMethod , this . reportDeprecationWhenOverridingDeprecatedMethod ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportHiddenCatchBlock , getSeverityString ( MaskedCatchBlock ) ) ; optionsMap . put ( OPTION_ReportUnusedLocal , getSeverityString ( UnusedLocalVariable ) ) ; optionsMap . put ( OPTION_ReportUnusedParameter , getSeverityString ( UnusedArgument ) ) ; optionsMap . put ( OPTION_ReportUnusedImport , getSeverityString ( UnusedImport ) ) ; optionsMap . put ( OPTION_ReportSyntheticAccessEmulation , getSeverityString ( AccessEmulation ) ) ; optionsMap . put ( OPTION_ReportNoEffectAssignment , getSeverityString ( NoEffectAssignment ) ) ; optionsMap . put ( OPTION_ReportNonExternalizedStringLiteral , getSeverityString ( NonExternalizedString ) ) ; optionsMap . put ( OPTION_ReportNoImplicitStringConversion , getSeverityString ( NoImplicitStringConversion ) ) ; optionsMap . put ( OPTION_ReportNonStaticAccessToStatic , getSeverityString ( NonStaticAccessToStatic ) ) ; optionsMap . put ( OPTION_ReportIndirectStaticAccess , getSeverityString ( IndirectStaticAccess ) ) ; optionsMap . put ( OPTION_ReportIncompatibleNonInheritedInterfaceMethod , getSeverityString ( IncompatibleNonInheritedInterfaceMethod ) ) ; optionsMap . put ( OPTION_ReportUnusedPrivateMember , getSeverityString ( UnusedPrivateMember ) ) ; optionsMap . put ( OPTION_ReportLocalVariableHiding , getSeverityString ( LocalVariableHiding ) ) ; optionsMap . put ( OPTION_ReportFieldHiding , getSeverityString ( FieldHiding ) ) ; optionsMap . put ( OPTION_ReportTypeParameterHiding , getSeverityString ( TypeHiding ) ) ; optionsMap . put ( OPTION_ReportPossibleAccidentalBooleanAssignment , getSeverityString ( AccidentalBooleanAssign ) ) ; optionsMap . put ( OPTION_ReportEmptyStatement , getSeverityString ( EmptyStatement ) ) ; optionsMap . put ( OPTION_ReportAssertIdentifier , getSeverityString ( AssertUsedAsAnIdentifier ) ) ; optionsMap . put ( OPTION_ReportEnumIdentifier , getSeverityString ( EnumUsedAsAnIdentifier ) ) ; optionsMap . put ( OPTION_ReportUndocumentedEmptyBlock , getSeverityString ( UndocumentedEmptyBlock ) ) ; optionsMap . put ( OPTION_ReportUnnecessaryTypeCheck , getSeverityString ( UnnecessaryTypeCheck ) ) ; optionsMap . put ( OPTION_ReportUnnecessaryElse , getSeverityString ( UnnecessaryElse ) ) ; optionsMap . put ( OPTION_ReportAutoboxing , getSeverityString ( AutoBoxing ) ) ; optionsMap . put ( OPTION_ReportAnnotationSuperInterface , getSeverityString ( AnnotationSuperInterface ) ) ; optionsMap . put ( OPTION_ReportIncompleteEnumSwitch , getSeverityString ( IncompleteEnumSwitch ) ) ; optionsMap . put ( OPTION_ReportInvalidJavadoc , getSeverityString ( InvalidJavadoc ) ) ; optionsMap . put ( OPTION_ReportInvalidJavadocTagsVisibility , getVisibilityString ( this . reportInvalidJavadocTagsVisibility ) ) ; optionsMap . put ( OPTION_ReportInvalidJavadocTags , this . reportInvalidJavadocTags ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportInvalidJavadocTagsDeprecatedRef , this . reportInvalidJavadocTagsDeprecatedRef ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportInvalidJavadocTagsNotVisibleRef , this . reportInvalidJavadocTagsNotVisibleRef ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportMissingJavadocTags , getSeverityString ( MissingJavadocTags ) ) ; optionsMap . put ( OPTION_ReportMissingJavadocTagsVisibility , getVisibilityString ( this . reportMissingJavadocTagsVisibility ) ) ; optionsMap . put ( OPTION_ReportMissingJavadocTagsOverriding , this . reportMissingJavadocTagsOverriding ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportMissingJavadocTagsMethodTypeParameters , this . reportMissingJavadocTagsMethodTypeParameters ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportMissingJavadocComments , getSeverityString ( MissingJavadocComments ) ) ; optionsMap . put ( OPTION_ReportMissingJavadocTagDescription , this . reportMissingJavadocTagDescription ) ; optionsMap . put ( OPTION_ReportMissingJavadocCommentsVisibility , getVisibilityString ( this . reportMissingJavadocCommentsVisibility ) ) ; optionsMap . put ( OPTION_ReportMissingJavadocCommentsOverriding , this . reportMissingJavadocCommentsOverriding ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportFinallyBlockNotCompletingNormally , getSeverityString ( FinallyBlockNotCompleting ) ) ; optionsMap . put ( OPTION_ReportUnusedDeclaredThrownException , getSeverityString ( UnusedDeclaredThrownException ) ) ; optionsMap . put ( OPTION_ReportUnusedDeclaredThrownExceptionWhenOverriding , this . reportUnusedDeclaredThrownExceptionWhenOverriding ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportUnusedDeclaredThrownExceptionIncludeDocCommentReference , this . reportUnusedDeclaredThrownExceptionIncludeDocCommentReference ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable , this . reportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportUnqualifiedFieldAccess , getSeverityString ( UnqualifiedFieldAccess ) ) ; optionsMap . put ( OPTION_ReportUnavoidableGenericTypeProblems , this . reportUnavoidableGenericTypeProblems ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportUncheckedTypeOperation , getSeverityString ( UncheckedTypeOperation ) ) ; optionsMap . put ( OPTION_ReportRawTypeReference , getSeverityString ( RawTypeReference ) ) ; optionsMap . put ( OPTION_ReportFinalParameterBound , getSeverityString ( FinalParameterBound ) ) ; optionsMap . put ( OPTION_ReportMissingSerialVersion , getSeverityString ( MissingSerialVersion ) ) ; optionsMap . put ( OPTION_ReportForbiddenReference , getSeverityString ( ForbiddenReference ) ) ; optionsMap . put ( OPTION_ReportDiscouragedReference , getSeverityString ( DiscouragedReference ) ) ; optionsMap . put ( OPTION_ReportVarargsArgumentNeedCast , getSeverityString ( VarargsArgumentNeedCast ) ) ; optionsMap . put ( OPTION_ReportMissingOverrideAnnotation , getSeverityString ( MissingOverrideAnnotation ) ) ; optionsMap . put ( OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation , this . reportMissingOverrideAnnotationForInterfaceMethodImplementation ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportMissingDeprecatedAnnotation , getSeverityString ( MissingDeprecatedAnnotation ) ) ; optionsMap . put ( OPTION_ReportIncompleteEnumSwitch , getSeverityString ( IncompleteEnumSwitch ) ) ; optionsMap . put ( OPTION_ReportUnusedLabel , getSeverityString ( UnusedLabel ) ) ; optionsMap . put ( OPTION_ReportUnusedTypeArgumentsForMethodInvocation , getSeverityString ( UnusedTypeArguments ) ) ; optionsMap . put ( OPTION_Compliance , versionFromJdkLevel ( this . complianceLevel ) ) ; optionsMap . put ( OPTION_Source , versionFromJdkLevel ( this . sourceLevel ) ) ; optionsMap . put ( OPTION_TargetPlatform , versionFromJdkLevel ( this . targetJDK ) ) ; optionsMap . put ( OPTION_FatalOptionalError , this . treatOptionalErrorAsFatal ? ENABLED : DISABLED ) ; if ( this . defaultEncoding != null ) { optionsMap . put ( OPTION_Encoding , this . defaultEncoding ) ; } optionsMap . put ( OPTION_TaskTags , this . taskTags == null ? Util . EMPTY_STRING : new String ( CharOperation . concatWith ( this . taskTags , '<CHAR_LIT:U+002C>' ) ) ) ; optionsMap . put ( OPTION_TaskPriorities , this . taskPriorities == null ? Util . EMPTY_STRING : new String ( CharOperation . concatWith ( this . taskPriorities , '<CHAR_LIT:U+002C>' ) ) ) ; optionsMap . put ( OPTION_TaskCaseSensitive , this . isTaskCaseSensitive ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportUnusedParameterWhenImplementingAbstract , this . reportUnusedParameterWhenImplementingAbstract ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportUnusedParameterWhenOverridingConcrete , this . reportUnusedParameterWhenOverridingConcrete ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportUnusedParameterIncludeDocCommentReference , this . reportUnusedParameterIncludeDocCommentReference ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportSpecialParameterHidingField , this . reportSpecialParameterHidingField ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_MaxProblemPerUnit , String . valueOf ( this . maxProblemsPerUnit ) ) ; optionsMap . put ( OPTION_InlineJsr , this . inlineJsrBytecode ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportNullReference , getSeverityString ( NullReference ) ) ; optionsMap . put ( OPTION_ReportPotentialNullReference , getSeverityString ( PotentialNullReference ) ) ; optionsMap . put ( OPTION_ReportRedundantNullCheck , getSeverityString ( RedundantNullCheck ) ) ; optionsMap . put ( OPTION_SuppressWarnings , this . suppressWarnings ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_SuppressOptionalErrors , this . suppressOptionalErrors ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportUnhandledWarningToken , getSeverityString ( UnhandledWarningToken ) ) ; optionsMap . put ( OPTION_ReportUnusedWarningToken , getSeverityString ( UnusedWarningToken ) ) ; optionsMap . put ( OPTION_ReportParameterAssignment , getSeverityString ( ParameterAssignment ) ) ; optionsMap . put ( OPTION_ReportFallthroughCase , getSeverityString ( FallthroughCase ) ) ; optionsMap . put ( OPTION_ReportOverridingMethodWithoutSuperInvocation , getSeverityString ( OverridingMethodWithoutSuperInvocation ) ) ; optionsMap . put ( OPTION_GenerateClassFiles , this . generateClassFiles ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_Process_Annotations , this . processAnnotations ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportRedundantSuperinterface , getSeverityString ( RedundantSuperinterface ) ) ; optionsMap . put ( OPTION_ReportComparingIdentical , getSeverityString ( ComparingIdentical ) ) ; optionsMap . put ( OPTION_ReportMissingSynchronizedOnInheritedMethod , getSeverityString ( MissingSynchronizedModifierInInheritedMethod ) ) ; optionsMap . put ( OPTION_ReportMissingHashCodeMethod , getSeverityString ( ShouldImplementHashcode ) ) ; optionsMap . put ( OPTION_ReportDeadCode , getSeverityString ( DeadCode ) ) ; optionsMap . put ( OPTION_ReportDeadCodeInTrivialIfStatement , this . reportDeadCodeInTrivialIfStatement ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportTasks , getSeverityString ( Tasks ) ) ; optionsMap . put ( OPTION_ReportUnusedObjectAllocation , getSeverityString ( UnusedObjectAllocation ) ) ; optionsMap . put ( OPTION_IncludeNullInfoFromAsserts , this . includeNullInfoFromAsserts ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportMethodCanBeStatic , getSeverityString ( MethodCanBeStatic ) ) ; optionsMap . put ( OPTION_ReportMethodCanBePotentiallyStatic , getSeverityString ( MethodCanBePotentiallyStatic ) ) ; optionsMap . put ( OPTION_ReportRedundantSpecificationOfTypeArguments , getSeverityString ( RedundantSpecificationOfTypeArguments ) ) ; optionsMap . put ( OPTIONG_GroovyTransformsToRunOnReconcile , "<STR_LIT>" ) ; return optionsMap ; } public int getSeverity ( int irritant ) { if ( this . errorThreshold . isSet ( irritant ) ) { if ( ( irritant & ( IrritantSet . GROUP_MASK | UnusedWarningToken ) ) == UnusedWarningToken ) { return ProblemSeverities . Error | ProblemSeverities . Optional ; } return this . treatOptionalErrorAsFatal ? ProblemSeverities . Error | ProblemSeverities . Optional | ProblemSeverities . Fatal : ProblemSeverities . Error | ProblemSeverities . Optional ; } if ( this . warningThreshold . isSet ( irritant ) ) { return ProblemSeverities . Warning | ProblemSeverities . Optional ; } return ProblemSeverities . Ignore ; } public String getSeverityString ( int irritant ) { if ( this . errorThreshold . isSet ( irritant ) ) return ERROR ; if ( this . warningThreshold . isSet ( irritant ) ) return WARNING ; return IGNORE ; } public String getVisibilityString ( int level ) { switch ( level & ExtraCompilerModifiers . AccVisibilityMASK ) { case ClassFileConstants . AccPublic : return PUBLIC ; case ClassFileConstants . AccProtected : return PROTECTED ; case ClassFileConstants . AccPrivate : return PRIVATE ; default : return DEFAULT ; } } public boolean isAnyEnabled ( IrritantSet irritants ) { return this . warningThreshold . isAnySet ( irritants ) || this . errorThreshold . isAnySet ( irritants ) ; } protected void resetDefaults ( ) { this . errorThreshold = new IrritantSet ( IrritantSet . COMPILER_DEFAULT_ERRORS ) ; this . warningThreshold = new IrritantSet ( IrritantSet . COMPILER_DEFAULT_WARNINGS ) ; this . produceDebugAttributes = ClassFileConstants . ATTR_SOURCE | ClassFileConstants . ATTR_LINES ; this . complianceLevel = this . originalComplianceLevel = ClassFileConstants . JDK1_4 ; this . sourceLevel = this . originalSourceLevel = ClassFileConstants . JDK1_3 ; this . targetJDK = ClassFileConstants . JDK1_2 ; this . defaultEncoding = null ; this . verbose = Compiler . DEBUG ; this . produceReferenceInfo = false ; this . preserveAllLocalVariables = false ; this . parseLiteralExpressionsAsConstants = true ; this . maxProblemsPerUnit = <NUM_LIT:100> ; this . taskTags = null ; this . taskPriorities = null ; this . isTaskCaseSensitive = true ; this . reportDeprecationInsideDeprecatedCode = false ; this . reportDeprecationWhenOverridingDeprecatedMethod = false ; this . reportUnusedParameterWhenImplementingAbstract = false ; this . reportUnusedParameterWhenOverridingConcrete = false ; this . reportUnusedParameterIncludeDocCommentReference = true ; this . reportUnusedDeclaredThrownExceptionWhenOverriding = false ; this . reportUnusedDeclaredThrownExceptionIncludeDocCommentReference = true ; this . reportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable = true ; this . reportSpecialParameterHidingField = false ; this . reportUnavoidableGenericTypeProblems = true ; this . reportInvalidJavadocTagsVisibility = ClassFileConstants . AccPublic ; this . reportInvalidJavadocTags = false ; this . reportInvalidJavadocTagsDeprecatedRef = false ; this . reportInvalidJavadocTagsNotVisibleRef = false ; this . reportMissingJavadocTagDescription = RETURN_TAG ; this . reportMissingJavadocTagsVisibility = ClassFileConstants . AccPublic ; this . reportMissingJavadocTagsOverriding = false ; this . reportMissingJavadocTagsMethodTypeParameters = false ; this . reportMissingJavadocCommentsVisibility = ClassFileConstants . AccPublic ; this . reportMissingJavadocCommentsOverriding = false ; this . inlineJsrBytecode = false ; this . docCommentSupport = false ; this . suppressWarnings = true ; this . suppressOptionalErrors = false ; this . treatOptionalErrorAsFatal = false ; this . performMethodsFullRecovery = true ; this . performStatementsRecovery = true ; this . storeAnnotations = false ; this . generateClassFiles = true ; this . processAnnotations = false ; this . reportMissingOverrideAnnotationForInterfaceMethodImplementation = true ; this . reportDeadCodeInTrivialIfStatement = false ; this . ignoreMethodBodies = false ; this . includeNullInfoFromAsserts = false ; } public void set ( Map optionsMap ) { Object optionValue ; if ( ( optionValue = optionsMap . get ( OPTION_LocalVariableAttribute ) ) != null ) { if ( GENERATE . equals ( optionValue ) ) { this . produceDebugAttributes |= ClassFileConstants . ATTR_VARS ; } else if ( DO_NOT_GENERATE . equals ( optionValue ) ) { this . produceDebugAttributes &= ~ ClassFileConstants . ATTR_VARS ; } } if ( ( optionValue = optionsMap . get ( OPTION_LineNumberAttribute ) ) != null ) { if ( GENERATE . equals ( optionValue ) ) { this . produceDebugAttributes |= ClassFileConstants . ATTR_LINES ; } else if ( DO_NOT_GENERATE . equals ( optionValue ) ) { this . produceDebugAttributes &= ~ ClassFileConstants . ATTR_LINES ; } } if ( ( optionValue = optionsMap . get ( OPTION_SourceFileAttribute ) ) != null ) { if ( GENERATE . equals ( optionValue ) ) { this . produceDebugAttributes |= ClassFileConstants . ATTR_SOURCE ; } else if ( DO_NOT_GENERATE . equals ( optionValue ) ) { this . produceDebugAttributes &= ~ ClassFileConstants . ATTR_SOURCE ; } } if ( ( optionValue = optionsMap . get ( OPTION_PreserveUnusedLocal ) ) != null ) { if ( PRESERVE . equals ( optionValue ) ) { this . preserveAllLocalVariables = true ; } else if ( OPTIMIZE_OUT . equals ( optionValue ) ) { this . preserveAllLocalVariables = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportDeprecationInDeprecatedCode ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportDeprecationInsideDeprecatedCode = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportDeprecationInsideDeprecatedCode = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportDeprecationWhenOverridingDeprecatedMethod ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportDeprecationWhenOverridingDeprecatedMethod = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportDeprecationWhenOverridingDeprecatedMethod = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedDeclaredThrownExceptionWhenOverriding ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportUnusedDeclaredThrownExceptionWhenOverriding = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportUnusedDeclaredThrownExceptionWhenOverriding = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedDeclaredThrownExceptionIncludeDocCommentReference ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportUnusedDeclaredThrownExceptionIncludeDocCommentReference = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportUnusedDeclaredThrownExceptionIncludeDocCommentReference = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_Compliance ) ) != null ) { long level = versionToJdkLevel ( optionValue ) ; if ( level != <NUM_LIT:0> ) this . complianceLevel = this . originalComplianceLevel = level ; } if ( ( optionValue = optionsMap . get ( OPTION_Source ) ) != null ) { long level = versionToJdkLevel ( optionValue ) ; if ( level != <NUM_LIT:0> ) this . sourceLevel = this . originalSourceLevel = level ; } if ( ( optionValue = optionsMap . get ( OPTION_TargetPlatform ) ) != null ) { long level = versionToJdkLevel ( optionValue ) ; if ( level != <NUM_LIT:0> ) { this . targetJDK = level ; } if ( this . targetJDK >= ClassFileConstants . JDK1_5 ) this . inlineJsrBytecode = true ; } if ( ( optionValue = optionsMap . get ( OPTION_Encoding ) ) != null ) { if ( optionValue instanceof String ) { this . defaultEncoding = null ; String stringValue = ( String ) optionValue ; if ( stringValue . length ( ) > <NUM_LIT:0> ) { try { new InputStreamReader ( new ByteArrayInputStream ( new byte [ <NUM_LIT:0> ] ) , stringValue ) ; this . defaultEncoding = stringValue ; } catch ( UnsupportedEncodingException e ) { } } } } if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedParameterWhenImplementingAbstract ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportUnusedParameterWhenImplementingAbstract = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportUnusedParameterWhenImplementingAbstract = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedParameterWhenOverridingConcrete ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportUnusedParameterWhenOverridingConcrete = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportUnusedParameterWhenOverridingConcrete = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedParameterIncludeDocCommentReference ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportUnusedParameterIncludeDocCommentReference = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportUnusedParameterIncludeDocCommentReference = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportSpecialParameterHidingField ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportSpecialParameterHidingField = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportSpecialParameterHidingField = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportUnavoidableGenericTypeProblems ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportUnavoidableGenericTypeProblems = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportUnavoidableGenericTypeProblems = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportDeadCodeInTrivialIfStatement ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportDeadCodeInTrivialIfStatement = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportDeadCodeInTrivialIfStatement = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_MaxProblemPerUnit ) ) != null ) { if ( optionValue instanceof String ) { String stringValue = ( String ) optionValue ; try { int val = Integer . parseInt ( stringValue ) ; if ( val >= <NUM_LIT:0> ) this . maxProblemsPerUnit = val ; } catch ( NumberFormatException e ) { } } } if ( ( optionValue = optionsMap . get ( OPTION_TaskTags ) ) != null ) { if ( optionValue instanceof String ) { String stringValue = ( String ) optionValue ; if ( stringValue . length ( ) == <NUM_LIT:0> ) { this . taskTags = null ; } else { this . taskTags = CharOperation . splitAndTrimOn ( '<CHAR_LIT:U+002C>' , stringValue . toCharArray ( ) ) ; } } } if ( ( optionValue = optionsMap . get ( OPTION_TaskPriorities ) ) != null ) { if ( optionValue instanceof String ) { String stringValue = ( String ) optionValue ; if ( stringValue . length ( ) == <NUM_LIT:0> ) { this . taskPriorities = null ; } else { this . taskPriorities = CharOperation . splitAndTrimOn ( '<CHAR_LIT:U+002C>' , stringValue . toCharArray ( ) ) ; } } } if ( ( optionValue = optionsMap . get ( OPTION_TaskCaseSensitive ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . isTaskCaseSensitive = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . isTaskCaseSensitive = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_InlineJsr ) ) != null ) { if ( this . targetJDK < ClassFileConstants . JDK1_5 ) { if ( ENABLED . equals ( optionValue ) ) { this . inlineJsrBytecode = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . inlineJsrBytecode = false ; } } } if ( ( optionValue = optionsMap . get ( OPTION_SuppressWarnings ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . suppressWarnings = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . suppressWarnings = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_SuppressOptionalErrors ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . suppressOptionalErrors = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . suppressOptionalErrors = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_FatalOptionalError ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . treatOptionalErrorAsFatal = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . treatOptionalErrorAsFatal = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportMissingOverrideAnnotationForInterfaceMethodImplementation = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportMissingOverrideAnnotationForInterfaceMethodImplementation = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_IncludeNullInfoFromAsserts ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . includeNullInfoFromAsserts = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . includeNullInfoFromAsserts = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportMethodWithConstructorName ) ) != null ) updateSeverity ( MethodWithConstructorName , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportOverridingPackageDefaultMethod ) ) != null ) updateSeverity ( OverriddenPackageDefaultMethod , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportDeprecation ) ) != null ) updateSeverity ( UsingDeprecatedAPI , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportHiddenCatchBlock ) ) != null ) updateSeverity ( MaskedCatchBlock , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedLocal ) ) != null ) updateSeverity ( UnusedLocalVariable , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedParameter ) ) != null ) updateSeverity ( UnusedArgument , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedImport ) ) != null ) updateSeverity ( UnusedImport , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedPrivateMember ) ) != null ) updateSeverity ( UnusedPrivateMember , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedDeclaredThrownException ) ) != null ) updateSeverity ( UnusedDeclaredThrownException , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportNoImplicitStringConversion ) ) != null ) updateSeverity ( NoImplicitStringConversion , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportSyntheticAccessEmulation ) ) != null ) updateSeverity ( AccessEmulation , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportLocalVariableHiding ) ) != null ) updateSeverity ( LocalVariableHiding , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportFieldHiding ) ) != null ) updateSeverity ( FieldHiding , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportTypeParameterHiding ) ) != null ) updateSeverity ( TypeHiding , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportPossibleAccidentalBooleanAssignment ) ) != null ) updateSeverity ( AccidentalBooleanAssign , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportEmptyStatement ) ) != null ) updateSeverity ( EmptyStatement , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportNonExternalizedStringLiteral ) ) != null ) updateSeverity ( NonExternalizedString , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportAssertIdentifier ) ) != null ) updateSeverity ( AssertUsedAsAnIdentifier , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportEnumIdentifier ) ) != null ) updateSeverity ( EnumUsedAsAnIdentifier , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportNonStaticAccessToStatic ) ) != null ) updateSeverity ( NonStaticAccessToStatic , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportIndirectStaticAccess ) ) != null ) updateSeverity ( IndirectStaticAccess , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportIncompatibleNonInheritedInterfaceMethod ) ) != null ) updateSeverity ( IncompatibleNonInheritedInterfaceMethod , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUndocumentedEmptyBlock ) ) != null ) updateSeverity ( UndocumentedEmptyBlock , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnnecessaryTypeCheck ) ) != null ) updateSeverity ( UnnecessaryTypeCheck , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnnecessaryElse ) ) != null ) updateSeverity ( UnnecessaryElse , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportFinallyBlockNotCompletingNormally ) ) != null ) updateSeverity ( FinallyBlockNotCompleting , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnqualifiedFieldAccess ) ) != null ) updateSeverity ( UnqualifiedFieldAccess , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportNoEffectAssignment ) ) != null ) updateSeverity ( NoEffectAssignment , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUncheckedTypeOperation ) ) != null ) updateSeverity ( UncheckedTypeOperation , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportRawTypeReference ) ) != null ) updateSeverity ( RawTypeReference , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportFinalParameterBound ) ) != null ) updateSeverity ( FinalParameterBound , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingSerialVersion ) ) != null ) updateSeverity ( MissingSerialVersion , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportForbiddenReference ) ) != null ) updateSeverity ( ForbiddenReference , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportDiscouragedReference ) ) != null ) updateSeverity ( DiscouragedReference , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportVarargsArgumentNeedCast ) ) != null ) updateSeverity ( VarargsArgumentNeedCast , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportNullReference ) ) != null ) updateSeverity ( NullReference , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportPotentialNullReference ) ) != null ) updateSeverity ( PotentialNullReference , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportRedundantNullCheck ) ) != null ) updateSeverity ( RedundantNullCheck , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportAutoboxing ) ) != null ) updateSeverity ( AutoBoxing , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportAnnotationSuperInterface ) ) != null ) updateSeverity ( AnnotationSuperInterface , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingOverrideAnnotation ) ) != null ) updateSeverity ( MissingOverrideAnnotation , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingDeprecatedAnnotation ) ) != null ) updateSeverity ( MissingDeprecatedAnnotation , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportIncompleteEnumSwitch ) ) != null ) updateSeverity ( IncompleteEnumSwitch , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnhandledWarningToken ) ) != null ) updateSeverity ( UnhandledWarningToken , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedWarningToken ) ) != null ) updateSeverity ( UnusedWarningToken , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedLabel ) ) != null ) updateSeverity ( UnusedLabel , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportParameterAssignment ) ) != null ) updateSeverity ( ParameterAssignment , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportFallthroughCase ) ) != null ) updateSeverity ( FallthroughCase , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportOverridingMethodWithoutSuperInvocation ) ) != null ) updateSeverity ( OverridingMethodWithoutSuperInvocation , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedTypeArgumentsForMethodInvocation ) ) != null ) updateSeverity ( UnusedTypeArguments , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportRedundantSuperinterface ) ) != null ) updateSeverity ( RedundantSuperinterface , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportComparingIdentical ) ) != null ) updateSeverity ( ComparingIdentical , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingSynchronizedOnInheritedMethod ) ) != null ) updateSeverity ( MissingSynchronizedModifierInInheritedMethod , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingHashCodeMethod ) ) != null ) updateSeverity ( ShouldImplementHashcode , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportDeadCode ) ) != null ) updateSeverity ( DeadCode , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportTasks ) ) != null ) updateSeverity ( Tasks , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedObjectAllocation ) ) != null ) updateSeverity ( UnusedObjectAllocation , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportMethodCanBeStatic ) ) != null ) updateSeverity ( MethodCanBeStatic , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportMethodCanBePotentiallyStatic ) ) != null ) updateSeverity ( MethodCanBePotentiallyStatic , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportRedundantSpecificationOfTypeArguments ) ) != null ) updateSeverity ( RedundantSpecificationOfTypeArguments , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_DocCommentSupport ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . docCommentSupport = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . docCommentSupport = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportInvalidJavadoc ) ) != null ) { updateSeverity ( InvalidJavadoc , optionValue ) ; } if ( ( optionValue = optionsMap . get ( OPTION_ReportInvalidJavadocTagsVisibility ) ) != null ) { if ( PUBLIC . equals ( optionValue ) ) { this . reportInvalidJavadocTagsVisibility = ClassFileConstants . AccPublic ; } else if ( PROTECTED . equals ( optionValue ) ) { this . reportInvalidJavadocTagsVisibility = ClassFileConstants . AccProtected ; } else if ( DEFAULT . equals ( optionValue ) ) { this . reportInvalidJavadocTagsVisibility = ClassFileConstants . AccDefault ; } else if ( PRIVATE . equals ( optionValue ) ) { this . reportInvalidJavadocTagsVisibility = ClassFileConstants . AccPrivate ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportInvalidJavadocTags ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportInvalidJavadocTags = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportInvalidJavadocTags = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportInvalidJavadocTagsDeprecatedRef ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportInvalidJavadocTagsDeprecatedRef = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportInvalidJavadocTagsDeprecatedRef = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportInvalidJavadocTagsNotVisibleRef ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportInvalidJavadocTagsNotVisibleRef = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportInvalidJavadocTagsNotVisibleRef = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingJavadocTags ) ) != null ) { updateSeverity ( MissingJavadocTags , optionValue ) ; } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingJavadocTagsVisibility ) ) != null ) { if ( PUBLIC . equals ( optionValue ) ) { this . reportMissingJavadocTagsVisibility = ClassFileConstants . AccPublic ; } else if ( PROTECTED . equals ( optionValue ) ) { this . reportMissingJavadocTagsVisibility = ClassFileConstants . AccProtected ; } else if ( DEFAULT . equals ( optionValue ) ) { this . reportMissingJavadocTagsVisibility = ClassFileConstants . AccDefault ; } else if ( PRIVATE . equals ( optionValue ) ) { this . reportMissingJavadocTagsVisibility = ClassFileConstants . AccPrivate ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingJavadocTagsOverriding ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportMissingJavadocTagsOverriding = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportMissingJavadocTagsOverriding = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingJavadocTagsMethodTypeParameters ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportMissingJavadocTagsMethodTypeParameters = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportMissingJavadocTagsMethodTypeParameters = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingJavadocComments ) ) != null ) { updateSeverity ( MissingJavadocComments , optionValue ) ; } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingJavadocTagDescription ) ) != null ) { this . reportMissingJavadocTagDescription = ( String ) optionValue ; } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingJavadocCommentsVisibility ) ) != null ) { if ( PUBLIC . equals ( optionValue ) ) { this . reportMissingJavadocCommentsVisibility = ClassFileConstants . AccPublic ; } else if ( PROTECTED . equals ( optionValue ) ) { this . reportMissingJavadocCommentsVisibility = ClassFileConstants . AccProtected ; } else if ( DEFAULT . equals ( optionValue ) ) { this . reportMissingJavadocCommentsVisibility = ClassFileConstants . AccDefault ; } else if ( PRIVATE . equals ( optionValue ) ) { this . reportMissingJavadocCommentsVisibility = ClassFileConstants . AccPrivate ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingJavadocCommentsOverriding ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportMissingJavadocCommentsOverriding = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportMissingJavadocCommentsOverriding = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_GenerateClassFiles ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . generateClassFiles = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . generateClassFiles = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_Process_Annotations ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . processAnnotations = true ; this . storeAnnotations = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . processAnnotations = false ; this . storeAnnotations = false ; } } if ( ( optionValue = optionsMap . get ( OPTIONG_BuildGroovyFiles ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . buildGroovyFiles = <NUM_LIT:2> ; this . storeAnnotations = true ; String s = ( String ) optionsMap . get ( OPTIONG_GroovyFlags ) ; if ( s != null && s . equals ( "<STR_LIT:1>" ) ) { this . groovyFlags = <NUM_LIT> ; } else { this . groovyFlags = <NUM_LIT:0> ; } } else if ( DISABLED . equals ( optionValue ) ) { this . buildGroovyFiles = <NUM_LIT:1> ; this . groovyFlags = <NUM_LIT:0> ; } } if ( ( optionValue = optionsMap . get ( OPTIONG_GroovyClassLoaderPath ) ) != null ) { this . groovyClassLoaderPath = ( String ) optionValue ; } if ( ( optionValue = optionsMap . get ( OPTIONG_GroovyExtraImports ) ) != null ) { this . groovyExtraImports = ( String ) optionValue ; } else { if ( sysPropConfiguredExtraImports != null ) { this . groovyExtraImports = sysPropConfiguredExtraImports ; } } optionValue = optionsMap . get ( OPTIONG_GroovyTransformsToRunOnReconcile ) ; if ( optionValue != null && ( ( String ) optionValue ) . length ( ) != <NUM_LIT:0> ) { this . groovyTransformsToRunOnReconcile = ( String ) optionValue ; } else { if ( sysPropConfiguredGroovyTransforms != null ) { this . groovyTransformsToRunOnReconcile = sysPropConfiguredGroovyTransforms ; } } if ( ( optionValue = optionsMap . get ( OPTIONG_GroovyProjectName ) ) != null ) { this . groovyProjectName = ( String ) optionValue ; } } static String sysPropConfiguredExtraImports = null ; static String sysPropConfiguredGroovyTransforms = null ; static { try { sysPropConfiguredExtraImports = System . getProperty ( "<STR_LIT>" ) ; } catch ( Exception e ) { sysPropConfiguredExtraImports = null ; } try { sysPropConfiguredGroovyTransforms = System . getProperty ( "<STR_LIT>" ) ; } catch ( Exception e ) { sysPropConfiguredGroovyTransforms = null ; } } public String toString ( ) { StringBuffer buf = new StringBuffer ( "<STR_LIT>" ) ; buf . append ( "<STR_LIT>" ) . append ( ( this . produceDebugAttributes & ClassFileConstants . ATTR_VARS ) != <NUM_LIT:0> ? "<STR_LIT>" : "<STR_LIT>" ) ; buf . append ( "<STR_LIT>" ) . append ( ( this . produceDebugAttributes & ClassFileConstants . ATTR_LINES ) != <NUM_LIT:0> ? "<STR_LIT>" : "<STR_LIT>" ) ; buf . append ( "<STR_LIT>" ) . append ( ( this . produceDebugAttributes & ClassFileConstants . ATTR_SOURCE ) != <NUM_LIT:0> ? "<STR_LIT>" : "<STR_LIT>" ) ; buf . append ( "<STR_LIT>" ) . append ( this . preserveAllLocalVariables ? "<STR_LIT>" : "<STR_LIT>" ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( MethodWithConstructorName ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( OverriddenPackageDefaultMethod ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UsingDeprecatedAPI ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( MaskedCatchBlock ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnusedLocalVariable ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnusedArgument ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnusedImport ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( AccessEmulation ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( NoEffectAssignment ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( NonExternalizedString ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( NonStaticAccessToStatic ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( IndirectStaticAccess ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( IncompatibleNonInheritedInterfaceMethod ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnusedPrivateMember ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( LocalVariableHiding ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( FieldHiding ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( TypeHiding ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( AccidentalBooleanAssign ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( EmptyStatement ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UndocumentedEmptyBlock ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnnecessaryTypeCheck ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . docCommentSupport ? "<STR_LIT>" : "<STR_LIT>" ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( InvalidJavadoc ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportInvalidJavadocTags ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportInvalidJavadocTagsDeprecatedRef ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportInvalidJavadocTagsNotVisibleRef ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( getVisibilityString ( this . reportInvalidJavadocTagsVisibility ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( MissingJavadocTags ) ) ; buf . append ( "<STR_LIT>" ) . append ( getVisibilityString ( this . reportMissingJavadocTagsVisibility ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportMissingJavadocTagsMethodTypeParameters ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportMissingJavadocTagsOverriding ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( MissingJavadocComments ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportMissingJavadocTagDescription ) ; buf . append ( "<STR_LIT>" ) . append ( getVisibilityString ( this . reportMissingJavadocCommentsVisibility ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportMissingJavadocCommentsOverriding ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( FinallyBlockNotCompleting ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnusedDeclaredThrownException ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportUnusedDeclaredThrownExceptionWhenOverriding ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportUnusedDeclaredThrownExceptionIncludeDocCommentReference ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnnecessaryElse ) ) ; buf . append ( "<STR_LIT>" + versionFromJdkLevel ( this . complianceLevel ) ) ; buf . append ( "<STR_LIT>" + versionFromJdkLevel ( this . sourceLevel ) ) ; buf . append ( "<STR_LIT>" + versionFromJdkLevel ( this . targetJDK ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . verbose ? "<STR_LIT>" : "<STR_LIT>" ) ; buf . append ( "<STR_LIT>" ) . append ( this . produceReferenceInfo ? "<STR_LIT>" : "<STR_LIT>" ) ; buf . append ( "<STR_LIT>" ) . append ( this . parseLiteralExpressionsAsConstants ? "<STR_LIT>" : "<STR_LIT>" ) ; buf . append ( "<STR_LIT>" ) . append ( this . defaultEncoding == null ? "<STR_LIT>" : this . defaultEncoding ) ; buf . append ( "<STR_LIT>" ) . append ( this . taskTags == null ? Util . EMPTY_STRING : new String ( CharOperation . concatWith ( this . taskTags , '<CHAR_LIT:U+002C>' ) ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . taskPriorities == null ? Util . EMPTY_STRING : new String ( CharOperation . concatWith ( this . taskPriorities , '<CHAR_LIT:U+002C>' ) ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportDeprecationInsideDeprecatedCode ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportDeprecationWhenOverridingDeprecatedMethod ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportUnusedParameterWhenImplementingAbstract ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportUnusedParameterWhenOverridingConcrete ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportUnusedParameterIncludeDocCommentReference ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportSpecialParameterHidingField ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . inlineJsrBytecode ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportUnavoidableGenericTypeProblems ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UncheckedTypeOperation ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( RawTypeReference ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( FinalParameterBound ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( MissingSerialVersion ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( VarargsArgumentNeedCast ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( ForbiddenReference ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( DiscouragedReference ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( NullReference ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( PotentialNullReference ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( RedundantNullCheck ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( AutoBoxing ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( AnnotationSuperInterface ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( MissingOverrideAnnotation ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportMissingOverrideAnnotationForInterfaceMethodImplementation ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( MissingDeprecatedAnnotation ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( IncompleteEnumSwitch ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . includeNullInfoFromAsserts ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . suppressWarnings ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . suppressOptionalErrors ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnhandledWarningToken ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnusedWarningToken ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnusedLabel ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . treatOptionalErrorAsFatal ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( ParameterAssignment ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . generateClassFiles ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . processAnnotations ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnusedTypeArguments ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( RedundantSuperinterface ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( ComparingIdentical ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( MissingSynchronizedModifierInInheritedMethod ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( ShouldImplementHashcode ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( DeadCode ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportDeadCodeInTrivialIfStatement ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( Tasks ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnusedObjectAllocation ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( MethodCanBeStatic ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( MethodCanBePotentiallyStatic ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( RedundantSpecificationOfTypeArguments ) ) ; buf . append ( "<STR_LIT>" ) . append ( ( this . buildGroovyFiles == <NUM_LIT:0> ) ? "<STR_LIT>" : ( this . buildGroovyFiles == <NUM_LIT:1> ? "<STR_LIT>" : "<STR_LIT:yes>" ) ) ; buf . append ( "<STR_LIT>" ) . append ( Integer . toHexString ( this . groovyFlags ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . groovyClassLoaderPath ) ; buf . append ( "<STR_LIT>" ) . append ( this . groovyProjectName ) ; buf . append ( "<STR_LIT>" ) . append ( this . groovyExtraImports ) ; return buf . toString ( ) ; } protected void updateSeverity ( int irritant , Object severityString ) { if ( ERROR . equals ( severityString ) ) { this . errorThreshold . set ( irritant ) ; this . warningThreshold . clear ( irritant ) ; } else if ( WARNING . equals ( severityString ) ) { this . errorThreshold . clear ( irritant ) ; this . warningThreshold . set ( irritant ) ; } else if ( IGNORE . equals ( severityString ) ) { this . errorThreshold . clear ( irritant ) ; this . warningThreshold . clear ( irritant ) ; } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . impl ; public class CompilerStats implements Comparable { public long startTime ; public long endTime ; public long lineCount ; public long parseTime ; public long resolveTime ; public long analyzeTime ; public long generateTime ; public long elapsedTime ( ) { return this . endTime - this . startTime ; } public int compareTo ( Object o ) { CompilerStats otherStats = ( CompilerStats ) o ; long time1 = elapsedTime ( ) ; long time2 = otherStats . elapsedTime ( ) ; return time1 < time2 ? - <NUM_LIT:1> : ( time1 == time2 ? <NUM_LIT:0> : <NUM_LIT:1> ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler ; import java . lang . reflect . InvocationTargetException ; import org . eclipse . jdt . internal . compiler . env . ICompilationUnit ; public class ReadManager implements Runnable { ICompilationUnit [ ] units ; int nextFileToRead ; ICompilationUnit [ ] filesRead ; char [ ] [ ] contentsRead ; int readyToReadPosition ; int nextAvailablePosition ; Thread [ ] readingThreads ; char [ ] readInProcessMarker = new char [ <NUM_LIT:0> ] ; int sleepingThreadCount ; private Throwable caughtException ; static final int START_CUSHION = <NUM_LIT:5> ; public static final int THRESHOLD = <NUM_LIT:10> ; static final int CACHE_SIZE = <NUM_LIT:15> ; public ReadManager ( ICompilationUnit [ ] files , int length ) { int threadCount = <NUM_LIT:0> ; try { Class runtime = Class . forName ( "<STR_LIT>" ) ; java . lang . reflect . Method m = runtime . getDeclaredMethod ( "<STR_LIT>" , new Class [ <NUM_LIT:0> ] ) ; if ( m != null ) { Integer result = ( Integer ) m . invoke ( Runtime . getRuntime ( ) , null ) ; threadCount = result . intValue ( ) + <NUM_LIT:1> ; if ( threadCount < <NUM_LIT:2> ) threadCount = <NUM_LIT:0> ; else if ( threadCount > CACHE_SIZE ) threadCount = CACHE_SIZE ; } } catch ( IllegalAccessException ignored ) { } catch ( ClassNotFoundException e ) { } catch ( SecurityException e ) { } catch ( NoSuchMethodException e ) { } catch ( IllegalArgumentException e ) { } catch ( InvocationTargetException e ) { } if ( threadCount > <NUM_LIT:0> ) { synchronized ( this ) { this . units = new ICompilationUnit [ length ] ; System . arraycopy ( files , <NUM_LIT:0> , this . units , <NUM_LIT:0> , length ) ; this . nextFileToRead = START_CUSHION ; this . filesRead = new ICompilationUnit [ CACHE_SIZE ] ; this . contentsRead = new char [ CACHE_SIZE ] [ ] ; this . readyToReadPosition = <NUM_LIT:0> ; this . nextAvailablePosition = <NUM_LIT:0> ; this . sleepingThreadCount = <NUM_LIT:0> ; this . readingThreads = new Thread [ threadCount ] ; for ( int i = threadCount ; -- i >= <NUM_LIT:0> ; ) { this . readingThreads [ i ] = new Thread ( this , "<STR_LIT>" ) ; this . readingThreads [ i ] . setDaemon ( true ) ; this . readingThreads [ i ] . start ( ) ; } } } } public char [ ] getContents ( ICompilationUnit unit ) throws Error { if ( this . readingThreads == null || this . units . length == <NUM_LIT:0> ) { if ( this . caughtException != null ) { if ( this . caughtException instanceof Error ) throw ( Error ) this . caughtException ; throw ( RuntimeException ) this . caughtException ; } return unit . getContents ( ) ; } boolean yield = false ; char [ ] result = null ; synchronized ( this ) { if ( unit == this . filesRead [ this . readyToReadPosition ] ) { result = this . contentsRead [ this . readyToReadPosition ] ; while ( result == this . readInProcessMarker || result == null ) { this . contentsRead [ this . readyToReadPosition ] = null ; try { wait ( <NUM_LIT> ) ; } catch ( InterruptedException ignore ) { } if ( this . caughtException != null ) { if ( this . caughtException instanceof Error ) throw ( Error ) this . caughtException ; throw ( RuntimeException ) this . caughtException ; } result = this . contentsRead [ this . readyToReadPosition ] ; } this . filesRead [ this . readyToReadPosition ] = null ; this . contentsRead [ this . readyToReadPosition ] = null ; if ( ++ this . readyToReadPosition >= this . contentsRead . length ) this . readyToReadPosition = <NUM_LIT:0> ; if ( this . sleepingThreadCount > <NUM_LIT:0> ) { notify ( ) ; yield = this . sleepingThreadCount == this . readingThreads . length ; } } else { int unitIndex = <NUM_LIT:0> ; for ( int l = this . units . length ; unitIndex < l ; unitIndex ++ ) if ( this . units [ unitIndex ] == unit ) break ; if ( unitIndex == this . units . length ) { this . units = new ICompilationUnit [ <NUM_LIT:0> ] ; } else if ( unitIndex >= this . nextFileToRead ) { this . nextFileToRead = unitIndex + START_CUSHION ; this . readyToReadPosition = <NUM_LIT:0> ; this . nextAvailablePosition = <NUM_LIT:0> ; this . filesRead = new ICompilationUnit [ CACHE_SIZE ] ; this . contentsRead = new char [ CACHE_SIZE ] [ ] ; notifyAll ( ) ; } } } if ( yield ) Thread . yield ( ) ; if ( result != null ) return result ; return unit . getContents ( ) ; } public void run ( ) { try { while ( this . readingThreads != null && this . nextFileToRead < this . units . length ) { ICompilationUnit unit = null ; int position = - <NUM_LIT:1> ; synchronized ( this ) { if ( this . readingThreads == null ) return ; while ( this . filesRead [ this . nextAvailablePosition ] != null ) { this . sleepingThreadCount ++ ; try { wait ( <NUM_LIT> ) ; } catch ( InterruptedException e ) { } this . sleepingThreadCount -- ; if ( this . readingThreads == null ) return ; } if ( this . nextFileToRead >= this . units . length ) return ; unit = this . units [ this . nextFileToRead ++ ] ; position = this . nextAvailablePosition ; if ( ++ this . nextAvailablePosition >= this . contentsRead . length ) this . nextAvailablePosition = <NUM_LIT:0> ; this . filesRead [ position ] = unit ; this . contentsRead [ position ] = this . readInProcessMarker ; } char [ ] result = unit . getContents ( ) ; synchronized ( this ) { if ( this . filesRead [ position ] == unit ) { if ( this . contentsRead [ position ] == null ) notifyAll ( ) ; this . contentsRead [ position ] = result ; } } } } catch ( Error e ) { synchronized ( this ) { this . caughtException = e ; shutdown ( ) ; } return ; } catch ( RuntimeException e ) { synchronized ( this ) { this . caughtException = e ; shutdown ( ) ; } return ; } } public synchronized void shutdown ( ) { this . readingThreads = null ; notifyAll ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler ; import java . io . PrintWriter ; import org . eclipse . jdt . internal . compiler . ast . CompilationUnitDeclaration ; import org . eclipse . jdt . internal . compiler . env . ICompilationUnit ; import org . eclipse . jdt . internal . compiler . lookup . ReferenceBinding ; public abstract class AbstractAnnotationProcessorManager { public abstract void configure ( Object batchCompiler , String [ ] options ) ; public abstract void configureFromPlatform ( Compiler compiler , Object compilationUnitLocator , Object javaProject ) ; public abstract void setOut ( PrintWriter out ) ; public abstract void setErr ( PrintWriter err ) ; public abstract ICompilationUnit [ ] getNewUnits ( ) ; public abstract ReferenceBinding [ ] getNewClassFiles ( ) ; public abstract ICompilationUnit [ ] getDeletedUnits ( ) ; public abstract void reset ( ) ; public abstract void processAnnotations ( CompilationUnitDeclaration [ ] units , ReferenceBinding [ ] referenceBindings , boolean isLastRound ) ; public abstract void setProcessors ( Object [ ] processors ) ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler ; public interface IDebugRequestor { void acceptDebugResult ( CompilationResult result ) ; boolean isActive ( ) ; void activate ( ) ; void deactivate ( ) ; void reset ( ) ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler ; import org . codehaus . jdt . groovy . integration . LanguageSupportFactory ; import org . eclipse . jdt . core . compiler . * ; import org . eclipse . jdt . internal . compiler . env . * ; import org . eclipse . jdt . internal . compiler . impl . * ; import org . eclipse . jdt . internal . compiler . ast . * ; import org . eclipse . jdt . internal . compiler . lookup . * ; import org . eclipse . jdt . internal . compiler . parser . * ; import org . eclipse . jdt . internal . compiler . problem . * ; import org . eclipse . jdt . internal . compiler . util . * ; import java . io . * ; import java . util . * ; public class Compiler implements ITypeRequestor , ProblemSeverities { public Parser parser ; public ICompilerRequestor requestor ; public CompilerOptions options ; public ProblemReporter problemReporter ; protected PrintWriter out ; public CompilerStats stats ; public CompilationProgress progress ; public int remainingIterations = <NUM_LIT:1> ; public CompilationUnitDeclaration [ ] unitsToProcess ; public int totalUnits ; public LookupEnvironment lookupEnvironment ; public static boolean DEBUG = false ; public int parseThreshold = - <NUM_LIT:1> ; public AbstractAnnotationProcessorManager annotationProcessorManager ; public int annotationProcessorStartIndex = <NUM_LIT:0> ; public ReferenceBinding [ ] referenceBindings ; public boolean useSingleThread = true ; public static IDebugRequestor DebugRequestor = null ; public Compiler ( INameEnvironment environment , IErrorHandlingPolicy policy , Map settings , final ICompilerRequestor requestor , IProblemFactory problemFactory ) { this ( environment , policy , new CompilerOptions ( settings ) , requestor , problemFactory , null , null ) ; } public Compiler ( INameEnvironment environment , IErrorHandlingPolicy policy , Map settings , final ICompilerRequestor requestor , IProblemFactory problemFactory , boolean parseLiteralExpressionsAsConstants ) { this ( environment , policy , new CompilerOptions ( settings , parseLiteralExpressionsAsConstants ) , requestor , problemFactory , null , null ) ; } public Compiler ( INameEnvironment environment , IErrorHandlingPolicy policy , CompilerOptions options , final ICompilerRequestor requestor , IProblemFactory problemFactory ) { this ( environment , policy , options , requestor , problemFactory , null , null ) ; } public Compiler ( INameEnvironment environment , IErrorHandlingPolicy policy , CompilerOptions options , final ICompilerRequestor requestor , IProblemFactory problemFactory , PrintWriter out ) { this ( environment , policy , options , requestor , problemFactory , out , null ) ; } public Compiler ( INameEnvironment environment , IErrorHandlingPolicy policy , CompilerOptions options , final ICompilerRequestor requestor , IProblemFactory problemFactory , PrintWriter out , CompilationProgress progress ) { this . options = options ; this . progress = progress ; if ( this . options . buildGroovyFiles == <NUM_LIT:0> ) { this . options . buildGroovyFiles = <NUM_LIT:1> ; this . options . groovyFlags = <NUM_LIT:0> ; } if ( DebugRequestor == null ) { this . requestor = requestor ; } else { this . requestor = new ICompilerRequestor ( ) { public void acceptResult ( CompilationResult result ) { if ( DebugRequestor . isActive ( ) ) { DebugRequestor . acceptDebugResult ( result ) ; } requestor . acceptResult ( result ) ; } } ; } this . problemReporter = new ProblemReporter ( policy , this . options , problemFactory ) ; this . lookupEnvironment = new LookupEnvironment ( this , this . options , this . problemReporter , environment ) ; this . out = out == null ? new PrintWriter ( System . out , true ) : out ; this . stats = new CompilerStats ( ) ; initializeParser ( ) ; } public void accept ( IBinaryType binaryType , PackageBinding packageBinding , AccessRestriction accessRestriction ) { if ( this . options . verbose ) { this . out . println ( Messages . bind ( Messages . compilation_loadBinary , new String ( binaryType . getName ( ) ) ) ) ; } this . lookupEnvironment . createBinaryTypeFrom ( binaryType , packageBinding , accessRestriction ) ; } public void accept ( ICompilationUnit sourceUnit , AccessRestriction accessRestriction ) { CompilationResult unitResult = new CompilationResult ( sourceUnit , this . totalUnits , this . totalUnits , this . options . maxProblemsPerUnit ) ; unitResult . checkSecondaryTypes = true ; try { if ( this . options . verbose ) { String count = String . valueOf ( this . totalUnits + <NUM_LIT:1> ) ; this . out . println ( Messages . bind ( Messages . compilation_request , new String [ ] { count , count , new String ( sourceUnit . getFileName ( ) ) } ) ) ; } CompilationUnitDeclaration parsedUnit ; if ( this . totalUnits < this . parseThreshold ) { parsedUnit = this . parser . parse ( sourceUnit , unitResult ) ; } else { parsedUnit = this . parser . dietParse ( sourceUnit , unitResult ) ; } parsedUnit . bits |= ASTNode . IsImplicitUnit ; this . lookupEnvironment . buildTypeBindings ( parsedUnit , accessRestriction ) ; addCompilationUnit ( sourceUnit , parsedUnit ) ; this . lookupEnvironment . completeTypeBindings ( parsedUnit ) ; } catch ( AbortCompilationUnit e ) { if ( unitResult . compilationUnit == sourceUnit ) { this . requestor . acceptResult ( unitResult . tagAsAccepted ( ) ) ; } else { throw e ; } } } public void accept ( ISourceType [ ] sourceTypes , PackageBinding packageBinding , AccessRestriction accessRestriction ) { this . problemReporter . abortDueToInternalError ( Messages . bind ( Messages . abort_againstSourceModel , new String [ ] { String . valueOf ( sourceTypes [ <NUM_LIT:0> ] . getName ( ) ) , String . valueOf ( sourceTypes [ <NUM_LIT:0> ] . getFileName ( ) ) } ) ) ; } protected synchronized void addCompilationUnit ( ICompilationUnit sourceUnit , CompilationUnitDeclaration parsedUnit ) { if ( this . unitsToProcess == null ) return ; int size = this . unitsToProcess . length ; if ( this . totalUnits == size ) System . arraycopy ( this . unitsToProcess , <NUM_LIT:0> , ( this . unitsToProcess = new CompilationUnitDeclaration [ size * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . totalUnits ) ; this . unitsToProcess [ this . totalUnits ++ ] = parsedUnit ; } protected void beginToCompile ( ICompilationUnit [ ] sourceUnits ) { int maxUnits = sourceUnits . length ; this . totalUnits = <NUM_LIT:0> ; this . unitsToProcess = new CompilationUnitDeclaration [ maxUnits ] ; internalBeginToCompile ( sourceUnits , maxUnits ) ; } protected void reportProgress ( String taskDecription ) { if ( this . progress != null ) { if ( this . progress . isCanceled ( ) ) { throw new AbortCompilation ( true , null ) ; } this . progress . setTaskName ( taskDecription ) ; } } protected void reportWorked ( int workIncrement , int currentUnitIndex ) { if ( this . progress != null ) { if ( this . progress . isCanceled ( ) ) { throw new AbortCompilation ( true , null ) ; } this . progress . worked ( workIncrement , ( this . totalUnits * this . remainingIterations ) - currentUnitIndex - <NUM_LIT:1> ) ; } } public void compile ( ICompilationUnit [ ] sourceUnits ) { this . stats . startTime = System . currentTimeMillis ( ) ; if ( this . options . buildGroovyFiles == <NUM_LIT:2> ) { int groovyFileIndex = - <NUM_LIT:1> ; for ( int u = <NUM_LIT:0> , max = sourceUnits . length ; u < max ; u ++ ) { char [ ] fn = sourceUnits [ u ] . getFileName ( ) ; boolean isDotJava = fn [ fn . length - <NUM_LIT:1> ] == '<CHAR_LIT:a>' ; if ( isDotJava ) { if ( groovyFileIndex != - <NUM_LIT:1> ) { ICompilationUnit swap = sourceUnits [ groovyFileIndex ] ; sourceUnits [ groovyFileIndex ] = sourceUnits [ u ] ; sourceUnits [ u ] = swap ; int newGroovyFileIndex = - <NUM_LIT:1> ; for ( int g = groovyFileIndex ; g <= u ; g ++ ) { char [ ] fn2 = sourceUnits [ g ] . getFileName ( ) ; boolean isDotGroovy = fn2 [ fn2 . length - <NUM_LIT:1> ] == '<CHAR_LIT>' ; if ( isDotGroovy ) { newGroovyFileIndex = g ; break ; } } groovyFileIndex = newGroovyFileIndex ; } } else { if ( groovyFileIndex == - <NUM_LIT:1> ) { groovyFileIndex = u ; } } } } CompilationUnitDeclaration unit = null ; ProcessTaskManager processingTask = null ; try { reportProgress ( Messages . compilation_beginningToCompile ) ; if ( this . annotationProcessorManager == null ) { beginToCompile ( sourceUnits ) ; } else { ICompilationUnit [ ] originalUnits = ( ICompilationUnit [ ] ) sourceUnits . clone ( ) ; try { beginToCompile ( sourceUnits ) ; processAnnotations ( ) ; if ( ! this . options . generateClassFiles ) { return ; } } catch ( SourceTypeCollisionException e ) { reset ( ) ; int originalLength = originalUnits . length ; int newProcessedLength = e . newAnnotationProcessorUnits . length ; ICompilationUnit [ ] combinedUnits = new ICompilationUnit [ originalLength + newProcessedLength ] ; System . arraycopy ( originalUnits , <NUM_LIT:0> , combinedUnits , <NUM_LIT:0> , originalLength ) ; System . arraycopy ( e . newAnnotationProcessorUnits , <NUM_LIT:0> , combinedUnits , originalLength , newProcessedLength ) ; this . annotationProcessorStartIndex = originalLength ; compile ( combinedUnits ) ; return ; } } if ( this . useSingleThread ) { for ( int i = <NUM_LIT:0> ; i < this . totalUnits ; i ++ ) { unit = this . unitsToProcess [ i ] ; reportProgress ( Messages . bind ( Messages . compilation_processing , new String ( unit . getFileName ( ) ) ) ) ; try { if ( this . options . verbose ) this . out . println ( Messages . bind ( Messages . compilation_process , new String [ ] { String . valueOf ( i + <NUM_LIT:1> ) , String . valueOf ( this . totalUnits ) , new String ( this . unitsToProcess [ i ] . getFileName ( ) ) } ) ) ; process ( unit , i ) ; } finally { unit . cleanUp ( ) ; } this . unitsToProcess [ i ] = null ; reportWorked ( <NUM_LIT:1> , i ) ; this . stats . lineCount += unit . compilationResult . lineSeparatorPositions . length ; long acceptStart = System . currentTimeMillis ( ) ; this . requestor . acceptResult ( unit . compilationResult . tagAsAccepted ( ) ) ; this . stats . generateTime += System . currentTimeMillis ( ) - acceptStart ; if ( this . options . verbose ) this . out . println ( Messages . bind ( Messages . compilation_done , new String [ ] { String . valueOf ( i + <NUM_LIT:1> ) , String . valueOf ( this . totalUnits ) , new String ( unit . getFileName ( ) ) } ) ) ; } } else { processingTask = new ProcessTaskManager ( this ) ; int acceptedCount = <NUM_LIT:0> ; while ( true ) { try { unit = processingTask . removeNextUnit ( ) ; } catch ( Error e ) { unit = processingTask . unitToProcess ; throw e ; } catch ( RuntimeException e ) { unit = processingTask . unitToProcess ; throw e ; } if ( unit == null ) break ; reportWorked ( <NUM_LIT:1> , acceptedCount ++ ) ; this . stats . lineCount += unit . compilationResult . lineSeparatorPositions . length ; this . requestor . acceptResult ( unit . compilationResult . tagAsAccepted ( ) ) ; if ( this . options . verbose ) this . out . println ( Messages . bind ( Messages . compilation_done , new String [ ] { String . valueOf ( acceptedCount ) , String . valueOf ( this . totalUnits ) , new String ( unit . getFileName ( ) ) } ) ) ; } } } catch ( AbortCompilation e ) { this . handleInternalException ( e , unit ) ; } catch ( Error e ) { this . handleInternalException ( e , unit , null ) ; throw e ; } catch ( RuntimeException e ) { this . handleInternalException ( e , unit , null ) ; throw e ; } finally { if ( processingTask != null ) { processingTask . shutdown ( ) ; processingTask = null ; } reset ( ) ; this . annotationProcessorStartIndex = <NUM_LIT:0> ; this . stats . endTime = System . currentTimeMillis ( ) ; } if ( this . options . verbose ) { if ( this . totalUnits > <NUM_LIT:1> ) { this . out . println ( Messages . bind ( Messages . compilation_units , String . valueOf ( this . totalUnits ) ) ) ; } else { this . out . println ( Messages . bind ( Messages . compilation_unit , String . valueOf ( this . totalUnits ) ) ) ; } } } public synchronized CompilationUnitDeclaration getUnitToProcess ( int next ) { if ( next < this . totalUnits ) { CompilationUnitDeclaration unit = this . unitsToProcess [ next ] ; this . unitsToProcess [ next ] = null ; return unit ; } return null ; } public void setBinaryTypes ( ReferenceBinding [ ] binaryTypes ) { this . referenceBindings = binaryTypes ; } protected void handleInternalException ( Throwable internalException , CompilationUnitDeclaration unit , CompilationResult result ) { if ( result == null && unit != null ) { result = unit . compilationResult ; } if ( result == null && this . lookupEnvironment . unitBeingCompleted != null ) { result = this . lookupEnvironment . unitBeingCompleted . compilationResult ; } if ( result == null ) { synchronized ( this ) { if ( this . unitsToProcess != null && this . totalUnits > <NUM_LIT:0> ) result = this . unitsToProcess [ this . totalUnits - <NUM_LIT:1> ] . compilationResult ; } } boolean needToPrint = true ; if ( result != null ) { String [ ] pbArguments = new String [ ] { Messages . bind ( Messages . compilation_internalError , Util . getExceptionSummary ( internalException ) ) , } ; result . record ( this . problemReporter . createProblem ( result . getFileName ( ) , IProblem . Unclassified , pbArguments , pbArguments , Error , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ) , unit ) ; if ( ! result . hasBeenAccepted ) { this . requestor . acceptResult ( result . tagAsAccepted ( ) ) ; needToPrint = false ; } } if ( needToPrint ) { internalException . printStackTrace ( ) ; } } protected void handleInternalException ( AbortCompilation abortException , CompilationUnitDeclaration unit ) { if ( abortException . isSilent ) { if ( abortException . silentException == null ) { return ; } throw abortException . silentException ; } CompilationResult result = abortException . compilationResult ; if ( result == null && unit != null ) { result = unit . compilationResult ; } if ( result == null && this . lookupEnvironment . unitBeingCompleted != null ) { result = this . lookupEnvironment . unitBeingCompleted . compilationResult ; } if ( result == null ) { synchronized ( this ) { if ( this . unitsToProcess != null && this . totalUnits > <NUM_LIT:0> ) result = this . unitsToProcess [ this . totalUnits - <NUM_LIT:1> ] . compilationResult ; } } if ( result != null && ! result . hasBeenAccepted ) { if ( abortException . problem != null ) { recordDistantProblem : { CategorizedProblem distantProblem = abortException . problem ; CategorizedProblem [ ] knownProblems = result . problems ; for ( int i = <NUM_LIT:0> ; i < result . problemCount ; i ++ ) { if ( knownProblems [ i ] == distantProblem ) { break recordDistantProblem ; } } if ( distantProblem instanceof DefaultProblem ) { ( ( DefaultProblem ) distantProblem ) . setOriginatingFileName ( result . getFileName ( ) ) ; } result . record ( distantProblem , unit ) ; } } else { if ( abortException . exception != null ) { this . handleInternalException ( abortException . exception , null , result ) ; return ; } } if ( ! result . hasBeenAccepted ) { this . requestor . acceptResult ( result . tagAsAccepted ( ) ) ; } } else { abortException . printStackTrace ( ) ; } } public void initializeParser ( ) { this . parser = LanguageSupportFactory . getParser ( this , this . lookupEnvironment == null ? null : this . lookupEnvironment . globalOptions , this . problemReporter , this . options . parseLiteralExpressionsAsConstants , <NUM_LIT:1> ) ; } protected void internalBeginToCompile ( ICompilationUnit [ ] sourceUnits , int maxUnits ) { if ( ! this . useSingleThread && maxUnits >= ReadManager . THRESHOLD ) this . parser . readManager = new ReadManager ( sourceUnits , maxUnits ) ; for ( int i = <NUM_LIT:0> ; i < maxUnits ; i ++ ) { try { if ( this . options . verbose ) { this . out . println ( Messages . bind ( Messages . compilation_request , new String [ ] { String . valueOf ( i + <NUM_LIT:1> ) , String . valueOf ( maxUnits ) , new String ( sourceUnits [ i ] . getFileName ( ) ) } ) ) ; } CompilationUnitDeclaration parsedUnit ; CompilationResult unitResult = new CompilationResult ( sourceUnits [ i ] , i , maxUnits , this . options . maxProblemsPerUnit ) ; long parseStart = System . currentTimeMillis ( ) ; if ( this . totalUnits < this . parseThreshold ) { parsedUnit = this . parser . parse ( sourceUnits [ i ] , unitResult ) ; } else { parsedUnit = this . parser . dietParse ( sourceUnits [ i ] , unitResult ) ; } long resolveStart = System . currentTimeMillis ( ) ; this . stats . parseTime += resolveStart - parseStart ; this . lookupEnvironment . buildTypeBindings ( parsedUnit , null ) ; this . stats . resolveTime += System . currentTimeMillis ( ) - resolveStart ; addCompilationUnit ( sourceUnits [ i ] , parsedUnit ) ; ImportReference currentPackage = parsedUnit . currentPackage ; if ( currentPackage != null ) { unitResult . recordPackageName ( currentPackage . tokens ) ; } } finally { sourceUnits [ i ] = null ; } } if ( this . parser . readManager != null ) { this . parser . readManager . shutdown ( ) ; this . parser . readManager = null ; } this . lookupEnvironment . completeTypeBindings ( ) ; } public void process ( CompilationUnitDeclaration unit , int i ) { this . lookupEnvironment . unitBeingCompleted = unit ; long parseStart = System . currentTimeMillis ( ) ; this . parser . getMethodBodies ( unit ) ; long resolveStart = System . currentTimeMillis ( ) ; this . stats . parseTime += resolveStart - parseStart ; if ( unit . scope != null ) unit . scope . faultInTypes ( ) ; if ( unit . scope != null ) unit . scope . verifyMethods ( this . lookupEnvironment . methodVerifier ( ) ) ; unit . resolve ( ) ; long analyzeStart = System . currentTimeMillis ( ) ; this . stats . resolveTime += analyzeStart - resolveStart ; if ( ! this . options . ignoreMethodBodies ) unit . analyseCode ( ) ; long generateStart = System . currentTimeMillis ( ) ; this . stats . analyzeTime += generateStart - analyzeStart ; if ( ! this . options . ignoreMethodBodies ) unit . generateCode ( ) ; if ( this . options . produceReferenceInfo && unit . scope != null ) unit . scope . storeDependencyInfo ( ) ; unit . finalizeProblems ( ) ; this . stats . generateTime += System . currentTimeMillis ( ) - generateStart ; unit . compilationResult . totalUnitsKnown = this . totalUnits ; this . lookupEnvironment . unitBeingCompleted = null ; } protected void processAnnotations ( ) { int newUnitSize = <NUM_LIT:0> ; int newClassFilesSize = <NUM_LIT:0> ; int bottom = this . annotationProcessorStartIndex ; int top = this . totalUnits ; ReferenceBinding [ ] binaryTypeBindingsTemp = this . referenceBindings ; if ( top == <NUM_LIT:0> && binaryTypeBindingsTemp == null ) return ; this . referenceBindings = null ; do { int length = top - bottom ; CompilationUnitDeclaration [ ] currentUnits = new CompilationUnitDeclaration [ length ] ; int index = <NUM_LIT:0> ; for ( int i = bottom ; i < top ; i ++ ) { CompilationUnitDeclaration currentUnit = this . unitsToProcess [ i ] ; if ( ( currentUnit . bits & ASTNode . IsImplicitUnit ) == <NUM_LIT:0> ) { currentUnits [ index ++ ] = currentUnit ; } } if ( index != length ) { System . arraycopy ( currentUnits , <NUM_LIT:0> , ( currentUnits = new CompilationUnitDeclaration [ index ] ) , <NUM_LIT:0> , index ) ; } this . annotationProcessorManager . processAnnotations ( currentUnits , binaryTypeBindingsTemp , false ) ; ICompilationUnit [ ] newUnits = this . annotationProcessorManager . getNewUnits ( ) ; newUnitSize = newUnits . length ; ReferenceBinding [ ] newClassFiles = this . annotationProcessorManager . getNewClassFiles ( ) ; binaryTypeBindingsTemp = newClassFiles ; newClassFilesSize = newClassFiles . length ; if ( newUnitSize != <NUM_LIT:0> ) { ICompilationUnit [ ] newProcessedUnits = ( ICompilationUnit [ ] ) newUnits . clone ( ) ; try { this . lookupEnvironment . isProcessingAnnotations = true ; internalBeginToCompile ( newUnits , newUnitSize ) ; } catch ( SourceTypeCollisionException e ) { e . newAnnotationProcessorUnits = newProcessedUnits ; throw e ; } finally { this . lookupEnvironment . isProcessingAnnotations = false ; this . annotationProcessorManager . reset ( ) ; } bottom = top ; top = this . totalUnits ; } else { bottom = top ; this . annotationProcessorManager . reset ( ) ; } } while ( newUnitSize != <NUM_LIT:0> || newClassFilesSize != <NUM_LIT:0> ) ; this . annotationProcessorManager . processAnnotations ( null , null , true ) ; ICompilationUnit [ ] newUnits = this . annotationProcessorManager . getNewUnits ( ) ; newUnitSize = newUnits . length ; if ( newUnitSize != <NUM_LIT:0> ) { ICompilationUnit [ ] newProcessedUnits = ( ICompilationUnit [ ] ) newUnits . clone ( ) ; try { this . lookupEnvironment . isProcessingAnnotations = true ; internalBeginToCompile ( newUnits , newUnitSize ) ; } catch ( SourceTypeCollisionException e ) { e . newAnnotationProcessorUnits = newProcessedUnits ; throw e ; } finally { this . lookupEnvironment . isProcessingAnnotations = false ; this . annotationProcessorManager . reset ( ) ; } } else { this . annotationProcessorManager . reset ( ) ; } } public void reset ( ) { this . lookupEnvironment . reset ( ) ; this . parser . reset ( ) ; this . parser . scanner . source = null ; this . unitsToProcess = null ; if ( DebugRequestor != null ) DebugRequestor . reset ( ) ; this . problemReporter . reset ( ) ; } public CompilationUnitDeclaration resolve ( CompilationUnitDeclaration unit , ICompilationUnit sourceUnit , boolean verifyMethods , boolean analyzeCode , boolean generateCode ) { try { if ( unit == null ) { this . parseThreshold = <NUM_LIT:0> ; beginToCompile ( new ICompilationUnit [ ] { sourceUnit } ) ; for ( int i = <NUM_LIT:0> ; i < this . totalUnits ; i ++ ) { if ( this . unitsToProcess [ i ] != null && this . unitsToProcess [ i ] . compilationResult . compilationUnit == sourceUnit ) { unit = this . unitsToProcess [ i ] ; break ; } } if ( unit == null ) unit = this . unitsToProcess [ <NUM_LIT:0> ] ; } else { this . lookupEnvironment . buildTypeBindings ( unit , null ) ; this . lookupEnvironment . completeTypeBindings ( ) ; } this . lookupEnvironment . unitBeingCompleted = unit ; this . parser . getMethodBodies ( unit ) ; if ( unit . scope != null ) { unit . scope . faultInTypes ( ) ; if ( unit . scope != null && verifyMethods ) { unit . scope . verifyMethods ( this . lookupEnvironment . methodVerifier ( ) ) ; } unit . resolve ( ) ; if ( analyzeCode ) unit . analyseCode ( ) ; if ( generateCode ) unit . generateCode ( ) ; unit . finalizeProblems ( ) ; } if ( this . unitsToProcess != null ) this . unitsToProcess [ <NUM_LIT:0> ] = null ; this . requestor . acceptResult ( unit . compilationResult . tagAsAccepted ( ) ) ; return unit ; } catch ( AbortCompilation e ) { this . handleInternalException ( e , unit ) ; return unit == null ? this . unitsToProcess [ <NUM_LIT:0> ] : unit ; } catch ( Error e ) { this . handleInternalException ( e , unit , null ) ; throw e ; } catch ( RuntimeException e ) { this . handleInternalException ( e , unit , null ) ; throw e ; } finally { } } public CompilationUnitDeclaration resolve ( ICompilationUnit sourceUnit , boolean verifyMethods , boolean analyzeCode , boolean generateCode ) { return resolve ( null , sourceUnit , verifyMethods , analyzeCode , generateCode ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . codegen ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ClassFile ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . lookup . TagBits ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . TypeConstants ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; import org . eclipse . jdt . internal . compiler . util . HashtableOfObject ; import org . eclipse . jdt . internal . compiler . util . Util ; public class ConstantPool implements ClassFileConstants , TypeIds { public static final int DOUBLE_INITIAL_SIZE = <NUM_LIT:5> ; public static final int FLOAT_INITIAL_SIZE = <NUM_LIT:3> ; public static final int INT_INITIAL_SIZE = <NUM_LIT> ; public static final int LONG_INITIAL_SIZE = <NUM_LIT:5> ; public static final int UTF8_INITIAL_SIZE = <NUM_LIT> ; public static final int STRING_INITIAL_SIZE = <NUM_LIT> ; public static final int METHODS_AND_FIELDS_INITIAL_SIZE = <NUM_LIT> ; public static final int CLASS_INITIAL_SIZE = <NUM_LIT> ; public static final int NAMEANDTYPE_INITIAL_SIZE = <NUM_LIT> ; public static final int CONSTANTPOOL_INITIAL_SIZE = <NUM_LIT> ; public static final int CONSTANTPOOL_GROW_SIZE = <NUM_LIT> ; protected DoubleCache doubleCache ; protected FloatCache floatCache ; protected IntegerCache intCache ; protected LongCache longCache ; public CharArrayCache UTF8Cache ; protected CharArrayCache stringCache ; protected HashtableOfObject methodsAndFieldsCache ; protected CharArrayCache classCache ; protected HashtableOfObject nameAndTypeCacheForFieldsAndMethods ; public byte [ ] poolContent ; public int currentIndex = <NUM_LIT:1> ; public int currentOffset ; public int [ ] offsets ; public ClassFile classFile ; public static final char [ ] Append = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ARRAY_NEWINSTANCE_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ARRAY_NEWINSTANCE_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ArrayCopy = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ArrayCopySignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ArrayJavaLangClassConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ArrayJavaLangObjectConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] booleanBooleanSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] BooleanConstrSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] BOOLEANVALUE_BOOLEAN_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] BOOLEANVALUE_BOOLEAN_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] byteByteSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ByteConstrSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] BYTEVALUE_BYTE_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] BYTEVALUE_BYTE_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] charCharacterSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] CharConstrSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] CHARVALUE_CHARACTER_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] CHARVALUE_CHARACTER_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] Clinit = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] DefaultConstructorSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ClinitSignature = DefaultConstructorSignature ; public static final char [ ] Close = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] CloseSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] DesiredAssertionStatus = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] DesiredAssertionStatusSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] DoubleConstrSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] doubleDoubleSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] DOUBLEVALUE_DOUBLE_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] DOUBLEVALUE_DOUBLE_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] Exit = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ExitIntSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] FloatConstrSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] floatFloatSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] FLOATVALUE_FLOAT_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] FLOATVALUE_FLOAT_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ForName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ForNameSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_BOOLEAN_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_BOOLEAN_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_BYTE_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_BYTE_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_CHAR_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_CHAR_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_DOUBLE_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_DOUBLE_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_FLOAT_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_FLOAT_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_INT_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_INT_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_LONG_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_LONG_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_OBJECT_METHOD_NAME = "<STR_LIT:get>" . toCharArray ( ) ; public static final char [ ] GET_OBJECT_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_SHORT_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_SHORT_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GetClass = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GetClassSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GetComponentType = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GetComponentTypeSignature = GetClassSignature ; public static final char [ ] GetConstructor = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GetConstructorSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GETDECLAREDCONSTRUCTOR_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GETDECLAREDCONSTRUCTOR_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GETDECLAREDFIELD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GETDECLAREDFIELD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GETDECLAREDMETHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GETDECLAREDMETHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GetMessage = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GetMessageSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] HasNext = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] HasNextSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] Init = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] IntConstrSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ITERATOR_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ITERATOR_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] Intern = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] InternSignature = GetMessageSignature ; public static final char [ ] IntIntegerSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] INTVALUE_INTEGER_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] INTVALUE_INTEGER_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] INVOKE_METHOD_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] INVOKE_METHOD_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] [ ] JAVA_LANG_REFLECT_ACCESSIBLEOBJECT = new char [ ] [ ] { TypeConstants . JAVA , TypeConstants . LANG , TypeConstants . REFLECT , "<STR_LIT>" . toCharArray ( ) } ; public static final char [ ] [ ] JAVA_LANG_REFLECT_ARRAY = new char [ ] [ ] { TypeConstants . JAVA , TypeConstants . LANG , TypeConstants . REFLECT , "<STR_LIT>" . toCharArray ( ) } ; public static final char [ ] JavaIoPrintStreamSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangAssertionErrorConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangBooleanConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangByteConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangCharacterConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangClassConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangClassNotFoundExceptionConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangClassSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangDoubleConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangEnumConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangErrorConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangExceptionConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangFloatConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangIntegerConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangLongConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangNoClassDefFoundErrorConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangNoSuchFieldErrorConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangObjectConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVALANGREFLECTACCESSIBLEOBJECT_CONSTANTPOOLNAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVALANGREFLECTARRAY_CONSTANTPOOLNAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangReflectConstructorConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangReflectConstructorNewInstanceSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVALANGREFLECTFIELD_CONSTANTPOOLNAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVALANGREFLECTMETHOD_CONSTANTPOOLNAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangShortConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangStringBufferConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangStringBuilderConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangStringConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangStringSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangObjectSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangSystemConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangThrowableConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangVoidConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaUtilIteratorConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] LongConstrSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] longLongSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] LONGVALUE_LONG_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] LONGVALUE_LONG_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] NewInstance = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] NewInstanceSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] Next = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] NextSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ObjectConstrSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ObjectSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] Ordinal = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] OrdinalSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] Out = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_BOOLEAN_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_BOOLEAN_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_BYTE_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_BYTE_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_CHAR_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_CHAR_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_DOUBLE_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_DOUBLE_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_FLOAT_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_FLOAT_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_INT_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_INT_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_LONG_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_LONG_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_OBJECT_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_OBJECT_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_SHORT_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_SHORT_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SETACCESSIBLE_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SETACCESSIBLE_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ShortConstrSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] shortShortSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SHORTVALUE_SHORT_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SHORTVALUE_SHORT_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBufferAppendBooleanSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBufferAppendCharSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBufferAppendDoubleSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBufferAppendFloatSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBufferAppendIntSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBufferAppendLongSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBufferAppendObjectSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBufferAppendStringSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendBooleanSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendCharSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendDoubleSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendFloatSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendIntSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendLongSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendObjectSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendStringSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringConstructorSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] This = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ToString = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ToStringSignature = GetMessageSignature ; public static final char [ ] TYPE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ValueOf = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ValueOfBooleanSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ValueOfCharSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ValueOfDoubleSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ValueOfFloatSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ValueOfIntSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ValueOfLongSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ValueOfObjectSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ValueOfStringClassSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVA_LANG_ANNOTATION_DOCUMENTED = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVA_LANG_ANNOTATION_ELEMENTTYPE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVA_LANG_ANNOTATION_RETENTION = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVA_LANG_ANNOTATION_RETENTIONPOLICY = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVA_LANG_ANNOTATION_TARGET = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVA_LANG_DEPRECATED = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVA_LANG_ANNOTATION_INHERITED = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVA_LANG_SAFEVARARGS = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVA_LANG_INVOKE_METHODHANDLE_POLYMORPHICSIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] HashCode = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] HashCodeSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] Equals = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] EqualsSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] AddSuppressed = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] AddSuppressedSignature = "<STR_LIT>" . toCharArray ( ) ; public ConstantPool ( ClassFile classFile ) { this . UTF8Cache = new CharArrayCache ( UTF8_INITIAL_SIZE ) ; this . stringCache = new CharArrayCache ( STRING_INITIAL_SIZE ) ; this . methodsAndFieldsCache = new HashtableOfObject ( METHODS_AND_FIELDS_INITIAL_SIZE ) ; this . classCache = new CharArrayCache ( CLASS_INITIAL_SIZE ) ; this . nameAndTypeCacheForFieldsAndMethods = new HashtableOfObject ( NAMEANDTYPE_INITIAL_SIZE ) ; this . offsets = new int [ <NUM_LIT:5> ] ; initialize ( classFile ) ; } public void initialize ( ClassFile givenClassFile ) { this . poolContent = givenClassFile . header ; this . currentOffset = givenClassFile . headerOffset ; this . currentIndex = <NUM_LIT:1> ; this . classFile = givenClassFile ; } public byte [ ] dumpBytes ( ) { System . arraycopy ( this . poolContent , <NUM_LIT:0> , ( this . poolContent = new byte [ this . currentOffset ] ) , <NUM_LIT:0> , this . currentOffset ) ; return this . poolContent ; } public int literalIndex ( byte [ ] utf8encoding , char [ ] stringCharArray ) { int index ; if ( ( index = this . UTF8Cache . putIfAbsent ( stringCharArray , this . currentIndex ) ) < <NUM_LIT:0> ) { if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } this . currentIndex ++ ; int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( Utf8Tag ) ; int utf8encodingLength = utf8encoding . length ; if ( this . currentOffset + <NUM_LIT:2> + utf8encodingLength >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:2> + utf8encodingLength ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) ( utf8encodingLength > > <NUM_LIT:8> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) utf8encodingLength ; System . arraycopy ( utf8encoding , <NUM_LIT:0> , this . poolContent , this . currentOffset , utf8encodingLength ) ; this . currentOffset += utf8encodingLength ; } return index ; } public int literalIndex ( TypeBinding binding ) { TypeBinding typeBinding = binding . leafComponentType ( ) ; if ( ( typeBinding . tagBits & TagBits . ContainsNestedTypeReferences ) != <NUM_LIT:0> ) { Util . recordNestedType ( this . classFile , typeBinding ) ; } return literalIndex ( binding . signature ( ) ) ; } public int literalIndex ( char [ ] utf8Constant ) { int index ; if ( ( index = this . UTF8Cache . putIfAbsent ( utf8Constant , this . currentIndex ) ) < <NUM_LIT:0> ) { if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( Utf8Tag ) ; int savedCurrentOffset = this . currentOffset ; if ( this . currentOffset + <NUM_LIT:2> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:2> ) ; } this . currentOffset += <NUM_LIT:2> ; length = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < utf8Constant . length ; i ++ ) { char current = utf8Constant [ i ] ; if ( ( current >= <NUM_LIT> ) && ( current <= <NUM_LIT> ) ) { writeU1 ( current ) ; length ++ ; } else { if ( current > <NUM_LIT> ) { length += <NUM_LIT:3> ; writeU1 ( <NUM_LIT> | ( ( current > > <NUM_LIT:12> ) & <NUM_LIT> ) ) ; writeU1 ( <NUM_LIT> | ( ( current > > <NUM_LIT:6> ) & <NUM_LIT> ) ) ; writeU1 ( <NUM_LIT> | ( current & <NUM_LIT> ) ) ; } else { length += <NUM_LIT:2> ; writeU1 ( <NUM_LIT> | ( ( current > > <NUM_LIT:6> ) & <NUM_LIT> ) ) ; writeU1 ( <NUM_LIT> | ( current & <NUM_LIT> ) ) ; } } } if ( length >= <NUM_LIT> ) { this . currentOffset = savedCurrentOffset - <NUM_LIT:1> ; this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceForConstant ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } if ( index > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } this . currentIndex ++ ; this . poolContent [ savedCurrentOffset ] = ( byte ) ( length > > <NUM_LIT:8> ) ; this . poolContent [ savedCurrentOffset + <NUM_LIT:1> ] = ( byte ) length ; } return index ; } public int literalIndex ( char [ ] stringCharArray , byte [ ] utf8encoding ) { int index ; if ( ( index = this . stringCache . putIfAbsent ( stringCharArray , this . currentIndex ) ) < <NUM_LIT:0> ) { this . currentIndex ++ ; if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( StringTag ) ; int stringIndexOffset = this . currentOffset ; if ( this . currentOffset + <NUM_LIT:2> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:2> ) ; } this . currentOffset += <NUM_LIT:2> ; final int stringIndex = literalIndex ( utf8encoding , stringCharArray ) ; this . poolContent [ stringIndexOffset ++ ] = ( byte ) ( stringIndex > > <NUM_LIT:8> ) ; this . poolContent [ stringIndexOffset ] = ( byte ) stringIndex ; } return index ; } public int literalIndex ( double key ) { int index ; if ( this . doubleCache == null ) { this . doubleCache = new DoubleCache ( DOUBLE_INITIAL_SIZE ) ; } if ( ( index = this . doubleCache . putIfAbsent ( key , this . currentIndex ) ) < <NUM_LIT:0> ) { if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } this . currentIndex += <NUM_LIT:2> ; int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( DoubleTag ) ; long temp = java . lang . Double . doubleToLongBits ( key ) ; length = this . poolContent . length ; if ( this . currentOffset + <NUM_LIT:8> >= length ) { resizePoolContents ( <NUM_LIT:8> ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp > > > <NUM_LIT> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp > > > <NUM_LIT> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp > > > <NUM_LIT> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp > > > <NUM_LIT:32> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp > > > <NUM_LIT:24> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp > > > <NUM_LIT:16> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp > > > <NUM_LIT:8> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) temp ; } return index ; } public int literalIndex ( float key ) { int index ; if ( this . floatCache == null ) { this . floatCache = new FloatCache ( FLOAT_INITIAL_SIZE ) ; } if ( ( index = this . floatCache . putIfAbsent ( key , this . currentIndex ) ) < <NUM_LIT:0> ) { if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } this . currentIndex ++ ; int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( FloatTag ) ; int temp = java . lang . Float . floatToIntBits ( key ) ; if ( this . currentOffset + <NUM_LIT:4> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:4> ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp > > > <NUM_LIT:24> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp > > > <NUM_LIT:16> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp > > > <NUM_LIT:8> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) temp ; } return index ; } public int literalIndex ( int key ) { int index ; if ( this . intCache == null ) { this . intCache = new IntegerCache ( INT_INITIAL_SIZE ) ; } if ( ( index = this . intCache . putIfAbsent ( key , this . currentIndex ) ) < <NUM_LIT:0> ) { this . currentIndex ++ ; if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( IntegerTag ) ; if ( this . currentOffset + <NUM_LIT:4> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:4> ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key > > > <NUM_LIT:24> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key > > > <NUM_LIT:16> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key > > > <NUM_LIT:8> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) key ; } return index ; } public int literalIndex ( long key ) { int index ; if ( this . longCache == null ) { this . longCache = new LongCache ( LONG_INITIAL_SIZE ) ; } if ( ( index = this . longCache . putIfAbsent ( key , this . currentIndex ) ) < <NUM_LIT:0> ) { if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } this . currentIndex += <NUM_LIT:2> ; int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( LongTag ) ; if ( this . currentOffset + <NUM_LIT:8> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:8> ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key > > > <NUM_LIT> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key > > > <NUM_LIT> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key > > > <NUM_LIT> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key > > > <NUM_LIT:32> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key > > > <NUM_LIT:24> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key > > > <NUM_LIT:16> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key > > > <NUM_LIT:8> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) key ; } return index ; } public int literalIndex ( String stringConstant ) { int index ; char [ ] stringCharArray = stringConstant . toCharArray ( ) ; if ( ( index = this . stringCache . putIfAbsent ( stringCharArray , this . currentIndex ) ) < <NUM_LIT:0> ) { this . currentIndex ++ ; if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( StringTag ) ; int stringIndexOffset = this . currentOffset ; if ( this . currentOffset + <NUM_LIT:2> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:2> ) ; } this . currentOffset += <NUM_LIT:2> ; final int stringIndex = literalIndex ( stringCharArray ) ; this . poolContent [ stringIndexOffset ++ ] = ( byte ) ( stringIndex > > <NUM_LIT:8> ) ; this . poolContent [ stringIndexOffset ] = ( byte ) stringIndex ; } return index ; } public int literalIndexForType ( final char [ ] constantPoolName ) { int index ; if ( ( index = this . classCache . putIfAbsent ( constantPoolName , this . currentIndex ) ) < <NUM_LIT:0> ) { this . currentIndex ++ ; if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( ClassTag ) ; int nameIndexOffset = this . currentOffset ; if ( this . currentOffset + <NUM_LIT:2> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:2> ) ; } this . currentOffset += <NUM_LIT:2> ; final int nameIndex = literalIndex ( constantPoolName ) ; this . poolContent [ nameIndexOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . poolContent [ nameIndexOffset ] = ( byte ) nameIndex ; } return index ; } public int literalIndexForType ( final TypeBinding binding ) { TypeBinding typeBinding = binding . leafComponentType ( ) ; if ( ( typeBinding . tagBits & TagBits . ContainsNestedTypeReferences ) != <NUM_LIT:0> ) { Util . recordNestedType ( this . classFile , typeBinding ) ; } return this . literalIndexForType ( binding . constantPoolName ( ) ) ; } public int literalIndexForMethod ( char [ ] declaringClass , char [ ] selector , char [ ] signature , boolean isInterface ) { int index ; if ( ( index = putInCacheIfAbsent ( declaringClass , selector , signature , this . currentIndex ) ) < <NUM_LIT:0> ) { this . currentIndex ++ ; if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( isInterface ? InterfaceMethodRefTag : MethodRefTag ) ; int classIndexOffset = this . currentOffset ; if ( this . currentOffset + <NUM_LIT:4> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:4> ) ; } this . currentOffset += <NUM_LIT:4> ; final int classIndex = literalIndexForType ( declaringClass ) ; final int nameAndTypeIndex = literalIndexForNameAndType ( selector , signature ) ; this . poolContent [ classIndexOffset ++ ] = ( byte ) ( classIndex > > <NUM_LIT:8> ) ; this . poolContent [ classIndexOffset ++ ] = ( byte ) classIndex ; this . poolContent [ classIndexOffset ++ ] = ( byte ) ( nameAndTypeIndex > > <NUM_LIT:8> ) ; this . poolContent [ classIndexOffset ] = ( byte ) nameAndTypeIndex ; } return index ; } public int literalIndexForMethod ( TypeBinding declaringClass , char [ ] selector , char [ ] signature , boolean isInterface ) { if ( ( declaringClass . tagBits & TagBits . ContainsNestedTypeReferences ) != <NUM_LIT:0> ) { Util . recordNestedType ( this . classFile , declaringClass ) ; } return this . literalIndexForMethod ( declaringClass . constantPoolName ( ) , selector , signature , isInterface ) ; } public int literalIndexForNameAndType ( char [ ] name , char [ ] signature ) { int index ; if ( ( index = putInNameAndTypeCacheIfAbsent ( name , signature , this . currentIndex ) ) < <NUM_LIT:0> ) { this . currentIndex ++ ; if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( NameAndTypeTag ) ; int nameIndexOffset = this . currentOffset ; if ( this . currentOffset + <NUM_LIT:4> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:4> ) ; } this . currentOffset += <NUM_LIT:4> ; final int nameIndex = literalIndex ( name ) ; final int typeIndex = literalIndex ( signature ) ; this . poolContent [ nameIndexOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . poolContent [ nameIndexOffset ++ ] = ( byte ) nameIndex ; this . poolContent [ nameIndexOffset ++ ] = ( byte ) ( typeIndex > > <NUM_LIT:8> ) ; this . poolContent [ nameIndexOffset ] = ( byte ) typeIndex ; } return index ; } public int literalIndexForField ( char [ ] declaringClass , char [ ] name , char [ ] signature ) { int index ; if ( ( index = putInCacheIfAbsent ( declaringClass , name , signature , this . currentIndex ) ) < <NUM_LIT:0> ) { this . currentIndex ++ ; if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( FieldRefTag ) ; int classIndexOffset = this . currentOffset ; if ( this . currentOffset + <NUM_LIT:4> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:4> ) ; } this . currentOffset += <NUM_LIT:4> ; final int classIndex = literalIndexForType ( declaringClass ) ; final int nameAndTypeIndex = literalIndexForNameAndType ( name , signature ) ; this . poolContent [ classIndexOffset ++ ] = ( byte ) ( classIndex > > <NUM_LIT:8> ) ; this . poolContent [ classIndexOffset ++ ] = ( byte ) classIndex ; this . poolContent [ classIndexOffset ++ ] = ( byte ) ( nameAndTypeIndex > > <NUM_LIT:8> ) ; this . poolContent [ classIndexOffset ] = ( byte ) nameAndTypeIndex ; } return index ; } public int literalIndexForLdc ( char [ ] stringCharArray ) { int savedCurrentIndex = this . currentIndex ; int savedCurrentOffset = this . currentOffset ; int index ; if ( ( index = this . stringCache . putIfAbsent ( stringCharArray , this . currentIndex ) ) < <NUM_LIT:0> ) { if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } this . currentIndex ++ ; int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( StringTag ) ; int stringIndexOffset = this . currentOffset ; if ( this . currentOffset + <NUM_LIT:2> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:2> ) ; } this . currentOffset += <NUM_LIT:2> ; int stringIndex ; if ( ( stringIndex = this . UTF8Cache . putIfAbsent ( stringCharArray , this . currentIndex ) ) < <NUM_LIT:0> ) { if ( ( stringIndex = - stringIndex ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } this . currentIndex ++ ; length = this . offsets . length ; if ( length <= stringIndex ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ stringIndex * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ stringIndex ] = this . currentOffset ; writeU1 ( Utf8Tag ) ; int lengthOffset = this . currentOffset ; if ( this . currentOffset + <NUM_LIT:2> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:2> ) ; } this . currentOffset += <NUM_LIT:2> ; length = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < stringCharArray . length ; i ++ ) { char current = stringCharArray [ i ] ; if ( ( current >= <NUM_LIT> ) && ( current <= <NUM_LIT> ) ) { length ++ ; if ( this . currentOffset + <NUM_LIT:1> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:1> ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) ( current ) ; } else if ( current > <NUM_LIT> ) { length += <NUM_LIT:3> ; if ( this . currentOffset + <NUM_LIT:3> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:3> ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) ( <NUM_LIT> | ( ( current > > <NUM_LIT:12> ) & <NUM_LIT> ) ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( <NUM_LIT> | ( ( current > > <NUM_LIT:6> ) & <NUM_LIT> ) ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( <NUM_LIT> | ( current & <NUM_LIT> ) ) ; } else { if ( this . currentOffset + <NUM_LIT:2> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:2> ) ; } length += <NUM_LIT:2> ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( <NUM_LIT> | ( ( current > > <NUM_LIT:6> ) & <NUM_LIT> ) ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( <NUM_LIT> | ( current & <NUM_LIT> ) ) ; } } if ( length >= <NUM_LIT> ) { this . currentOffset = savedCurrentOffset ; this . currentIndex = savedCurrentIndex ; this . stringCache . remove ( stringCharArray ) ; this . UTF8Cache . remove ( stringCharArray ) ; return <NUM_LIT:0> ; } this . poolContent [ lengthOffset ++ ] = ( byte ) ( length > > <NUM_LIT:8> ) ; this . poolContent [ lengthOffset ] = ( byte ) length ; } this . poolContent [ stringIndexOffset ++ ] = ( byte ) ( stringIndex > > <NUM_LIT:8> ) ; this . poolContent [ stringIndexOffset ] = ( byte ) stringIndex ; } return index ; } private int putInNameAndTypeCacheIfAbsent ( final char [ ] key1 , final char [ ] key2 , int value ) { int index ; Object key1Value = this . nameAndTypeCacheForFieldsAndMethods . get ( key1 ) ; if ( key1Value == null ) { CachedIndexEntry cachedIndexEntry = new CachedIndexEntry ( key2 , value ) ; index = - value ; this . nameAndTypeCacheForFieldsAndMethods . put ( key1 , cachedIndexEntry ) ; } else if ( key1Value instanceof CachedIndexEntry ) { CachedIndexEntry entry = ( CachedIndexEntry ) key1Value ; if ( CharOperation . equals ( key2 , entry . signature ) ) { index = entry . index ; } else { CharArrayCache charArrayCache = new CharArrayCache ( ) ; charArrayCache . putIfAbsent ( entry . signature , entry . index ) ; index = charArrayCache . putIfAbsent ( key2 , value ) ; this . nameAndTypeCacheForFieldsAndMethods . put ( key1 , charArrayCache ) ; } } else { CharArrayCache charArrayCache = ( CharArrayCache ) key1Value ; index = charArrayCache . putIfAbsent ( key2 , value ) ; } return index ; } private int putInCacheIfAbsent ( final char [ ] key1 , final char [ ] key2 , final char [ ] key3 , int value ) { int index ; HashtableOfObject key1Value = ( HashtableOfObject ) this . methodsAndFieldsCache . get ( key1 ) ; if ( key1Value == null ) { key1Value = new HashtableOfObject ( ) ; this . methodsAndFieldsCache . put ( key1 , key1Value ) ; CachedIndexEntry cachedIndexEntry = new CachedIndexEntry ( key3 , value ) ; index = - value ; key1Value . put ( key2 , cachedIndexEntry ) ; } else { Object key2Value = key1Value . get ( key2 ) ; if ( key2Value == null ) { CachedIndexEntry cachedIndexEntry = new CachedIndexEntry ( key3 , value ) ; index = - value ; key1Value . put ( key2 , cachedIndexEntry ) ; } else if ( key2Value instanceof CachedIndexEntry ) { CachedIndexEntry entry = ( CachedIndexEntry ) key2Value ; if ( CharOperation . equals ( key3 , entry . signature ) ) { index = entry . index ; } else { CharArrayCache charArrayCache = new CharArrayCache ( ) ; charArrayCache . putIfAbsent ( entry . signature , entry . index ) ; index = charArrayCache . putIfAbsent ( key3 , value ) ; key1Value . put ( key2 , charArrayCache ) ; } } else { CharArrayCache charArrayCache = ( CharArrayCache ) key2Value ; index = charArrayCache . putIfAbsent ( key3 , value ) ; } } return index ; } public void resetForClinit ( int constantPoolIndex , int constantPoolOffset ) { this . currentIndex = constantPoolIndex ; this . currentOffset = constantPoolOffset ; if ( this . UTF8Cache . get ( AttributeNamesConstants . CodeName ) >= constantPoolIndex ) { this . UTF8Cache . remove ( AttributeNamesConstants . CodeName ) ; } if ( this . UTF8Cache . get ( ConstantPool . ClinitSignature ) >= constantPoolIndex ) { this . UTF8Cache . remove ( ConstantPool . ClinitSignature ) ; } if ( this . UTF8Cache . get ( ConstantPool . Clinit ) >= constantPoolIndex ) { this . UTF8Cache . remove ( ConstantPool . Clinit ) ; } } private final void resizePoolContents ( int minimalSize ) { int length = this . poolContent . length ; int toAdd = length ; if ( toAdd < minimalSize ) toAdd = minimalSize ; System . arraycopy ( this . poolContent , <NUM_LIT:0> , this . poolContent = new byte [ length + toAdd ] , <NUM_LIT:0> , length ) ; } protected final void writeU1 ( int value ) { if ( this . currentOffset + <NUM_LIT:1> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:1> ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) value ; } protected final void writeU2 ( int value ) { if ( this . currentOffset + <NUM_LIT:2> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:2> ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) ( value > > > <NUM_LIT:8> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) value ; } public void reset ( ) { if ( this . doubleCache != null ) this . doubleCache . clear ( ) ; if ( this . floatCache != null ) this . floatCache . clear ( ) ; if ( this . intCache != null ) this . intCache . clear ( ) ; if ( this . longCache != null ) this . longCache . clear ( ) ; this . UTF8Cache . clear ( ) ; this . stringCache . clear ( ) ; this . methodsAndFieldsCache . clear ( ) ; this . classCache . clear ( ) ; this . nameAndTypeCacheForFieldsAndMethods . clear ( ) ; this . currentIndex = <NUM_LIT:1> ; this . currentOffset = <NUM_LIT:0> ; } public void resetForAttributeName ( char [ ] attributeName , int constantPoolIndex , int constantPoolOffset ) { this . currentIndex = constantPoolIndex ; this . currentOffset = constantPoolOffset ; if ( this . UTF8Cache . get ( attributeName ) >= constantPoolIndex ) { this . UTF8Cache . remove ( attributeName ) ; } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . codegen ; public class IntegerCache { public int keyTable [ ] ; public int valueTable [ ] ; int elementSize ; int threshold ; public IntegerCache ( ) { this ( <NUM_LIT> ) ; } public IntegerCache ( int initialCapacity ) { this . elementSize = <NUM_LIT:0> ; this . threshold = ( int ) ( initialCapacity * <NUM_LIT> ) ; this . keyTable = new int [ initialCapacity ] ; this . valueTable = new int [ initialCapacity ] ; } public void clear ( ) { for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) { this . keyTable [ i ] = <NUM_LIT:0> ; this . valueTable [ i ] = <NUM_LIT:0> ; } this . elementSize = <NUM_LIT:0> ; } public boolean containsKey ( int key ) { int index = hash ( key ) , length = this . keyTable . length ; while ( ( this . keyTable [ index ] != <NUM_LIT:0> ) || ( ( this . keyTable [ index ] == <NUM_LIT:0> ) && ( this . valueTable [ index ] != <NUM_LIT:0> ) ) ) { if ( this . keyTable [ index ] == key ) return true ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return false ; } public int hash ( int key ) { return ( key & <NUM_LIT> ) % this . keyTable . length ; } public int put ( int key , int value ) { int index = hash ( key ) , length = this . keyTable . length ; while ( ( this . keyTable [ index ] != <NUM_LIT:0> ) || ( ( this . keyTable [ index ] == <NUM_LIT:0> ) && ( this . valueTable [ index ] != <NUM_LIT:0> ) ) ) { if ( this . keyTable [ index ] == key ) return this . valueTable [ index ] = value ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } this . keyTable [ index ] = key ; this . valueTable [ index ] = value ; if ( ++ this . elementSize > this . threshold ) { rehash ( ) ; } return value ; } public int putIfAbsent ( int key , int value ) { int index = hash ( key ) , length = this . keyTable . length ; while ( ( this . keyTable [ index ] != <NUM_LIT:0> ) || ( ( this . keyTable [ index ] == <NUM_LIT:0> ) && ( this . valueTable [ index ] != <NUM_LIT:0> ) ) ) { if ( this . keyTable [ index ] == key ) return this . valueTable [ index ] ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } this . keyTable [ index ] = key ; this . valueTable [ index ] = value ; if ( ++ this . elementSize > this . threshold ) { rehash ( ) ; } return - value ; } private void rehash ( ) { IntegerCache newHashtable = new IntegerCache ( this . keyTable . length * <NUM_LIT:2> ) ; for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) { int key = this . keyTable [ i ] ; int value = this . valueTable [ i ] ; if ( ( key != <NUM_LIT:0> ) || ( ( key == <NUM_LIT:0> ) && ( value != <NUM_LIT:0> ) ) ) { newHashtable . put ( key , value ) ; } } this . keyTable = newHashtable . keyTable ; this . valueTable = newHashtable . valueTable ; this . threshold = newHashtable . threshold ; } public int size ( ) { return this . elementSize ; } public String toString ( ) { int max = size ( ) ; StringBuffer buf = new StringBuffer ( ) ; buf . append ( "<STR_LIT:{>" ) ; for ( int i = <NUM_LIT:0> ; i < max ; ++ i ) { if ( ( this . keyTable [ i ] != <NUM_LIT:0> ) || ( ( this . keyTable [ i ] == <NUM_LIT:0> ) && ( this . valueTable [ i ] != <NUM_LIT:0> ) ) ) { buf . append ( this . keyTable [ i ] ) . append ( "<STR_LIT>" ) . append ( this . valueTable [ i ] ) ; } if ( i < max ) { buf . append ( "<STR_LIT:U+002CU+0020>" ) ; } } buf . append ( "<STR_LIT:}>" ) ; return buf . toString ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . codegen ; import java . text . MessageFormat ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; public class StackMapFrame { public static final int USED = <NUM_LIT:1> ; public static final int SAME_FRAME = <NUM_LIT:0> ; public static final int CHOP_FRAME = <NUM_LIT:1> ; public static final int APPEND_FRAME = <NUM_LIT:2> ; public static final int SAME_FRAME_EXTENDED = <NUM_LIT:3> ; public static final int FULL_FRAME = <NUM_LIT:4> ; public static final int SAME_LOCALS_1_STACK_ITEMS = <NUM_LIT:5> ; public static final int SAME_LOCALS_1_STACK_ITEMS_EXTENDED = <NUM_LIT:6> ; public int pc ; public int numberOfStackItems ; private int numberOfLocals ; public int localIndex ; public VerificationTypeInfo [ ] locals ; public VerificationTypeInfo [ ] stackItems ; private int numberOfDifferentLocals = - <NUM_LIT:1> ; public int tagBits ; public StackMapFrame ( int initialLocalSize ) { this . locals = new VerificationTypeInfo [ initialLocalSize ] ; this . numberOfLocals = - <NUM_LIT:1> ; this . numberOfDifferentLocals = - <NUM_LIT:1> ; } public int getFrameType ( StackMapFrame prevFrame ) { final int offsetDelta = getOffsetDelta ( prevFrame ) ; switch ( this . numberOfStackItems ) { case <NUM_LIT:0> : switch ( numberOfDifferentLocals ( prevFrame ) ) { case <NUM_LIT:0> : return offsetDelta <= <NUM_LIT> ? SAME_FRAME : SAME_FRAME_EXTENDED ; case <NUM_LIT:1> : case <NUM_LIT:2> : case <NUM_LIT:3> : return APPEND_FRAME ; case - <NUM_LIT:1> : case - <NUM_LIT:2> : case - <NUM_LIT:3> : return CHOP_FRAME ; } break ; case <NUM_LIT:1> : switch ( numberOfDifferentLocals ( prevFrame ) ) { case <NUM_LIT:0> : return offsetDelta <= <NUM_LIT> ? SAME_LOCALS_1_STACK_ITEMS : SAME_LOCALS_1_STACK_ITEMS_EXTENDED ; } } return FULL_FRAME ; } public void addLocal ( int resolvedPosition , VerificationTypeInfo info ) { if ( this . locals == null ) { this . locals = new VerificationTypeInfo [ resolvedPosition + <NUM_LIT:1> ] ; this . locals [ resolvedPosition ] = info ; } else { final int length = this . locals . length ; if ( resolvedPosition >= length ) { System . arraycopy ( this . locals , <NUM_LIT:0> , this . locals = new VerificationTypeInfo [ resolvedPosition + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; } this . locals [ resolvedPosition ] = info ; } } public void addStackItem ( VerificationTypeInfo info ) { if ( info == null ) { throw new IllegalArgumentException ( "<STR_LIT>" ) ; } if ( this . stackItems == null ) { this . stackItems = new VerificationTypeInfo [ <NUM_LIT:1> ] ; this . stackItems [ <NUM_LIT:0> ] = info ; this . numberOfStackItems = <NUM_LIT:1> ; } else { final int length = this . stackItems . length ; if ( this . numberOfStackItems == length ) { System . arraycopy ( this . stackItems , <NUM_LIT:0> , this . stackItems = new VerificationTypeInfo [ length + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; } this . stackItems [ this . numberOfStackItems ++ ] = info ; } } public void addStackItem ( TypeBinding binding ) { if ( this . stackItems == null ) { this . stackItems = new VerificationTypeInfo [ <NUM_LIT:1> ] ; this . stackItems [ <NUM_LIT:0> ] = new VerificationTypeInfo ( binding ) ; this . numberOfStackItems = <NUM_LIT:1> ; } else { final int length = this . stackItems . length ; if ( this . numberOfStackItems == length ) { System . arraycopy ( this . stackItems , <NUM_LIT:0> , this . stackItems = new VerificationTypeInfo [ length + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; } this . stackItems [ this . numberOfStackItems ++ ] = new VerificationTypeInfo ( binding ) ; } } public StackMapFrame duplicate ( ) { int length = this . locals . length ; StackMapFrame result = new StackMapFrame ( length ) ; result . numberOfLocals = - <NUM_LIT:1> ; result . numberOfDifferentLocals = - <NUM_LIT:1> ; result . pc = this . pc ; result . numberOfStackItems = this . numberOfStackItems ; if ( length != <NUM_LIT:0> ) { result . locals = new VerificationTypeInfo [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { final VerificationTypeInfo verificationTypeInfo = this . locals [ i ] ; if ( verificationTypeInfo != null ) { result . locals [ i ] = verificationTypeInfo . duplicate ( ) ; } } } length = this . numberOfStackItems ; if ( length != <NUM_LIT:0> ) { result . stackItems = new VerificationTypeInfo [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { result . stackItems [ i ] = this . stackItems [ i ] . duplicate ( ) ; } } return result ; } public int numberOfDifferentLocals ( StackMapFrame prevFrame ) { if ( this . numberOfDifferentLocals != - <NUM_LIT:1> ) return this . numberOfDifferentLocals ; if ( prevFrame == null ) { this . numberOfDifferentLocals = <NUM_LIT:0> ; return <NUM_LIT:0> ; } VerificationTypeInfo [ ] prevLocals = prevFrame . locals ; VerificationTypeInfo [ ] currentLocals = this . locals ; int prevLocalsLength = prevLocals == null ? <NUM_LIT:0> : prevLocals . length ; int currentLocalsLength = currentLocals == null ? <NUM_LIT:0> : currentLocals . length ; int prevNumberOfLocals = prevFrame . getNumberOfLocals ( ) ; int currentNumberOfLocals = getNumberOfLocals ( ) ; int result = <NUM_LIT:0> ; if ( prevNumberOfLocals == <NUM_LIT:0> ) { if ( currentNumberOfLocals != <NUM_LIT:0> ) { result = currentNumberOfLocals ; int counter = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < currentLocalsLength && counter < currentNumberOfLocals ; i ++ ) { if ( currentLocals [ i ] != null ) { switch ( currentLocals [ i ] . id ( ) ) { case TypeIds . T_double : case TypeIds . T_long : i ++ ; } counter ++ ; } else { result = Integer . MAX_VALUE ; this . numberOfDifferentLocals = result ; return result ; } } } } else if ( currentNumberOfLocals == <NUM_LIT:0> ) { int counter = <NUM_LIT:0> ; result = - prevNumberOfLocals ; for ( int i = <NUM_LIT:0> ; i < prevLocalsLength && counter < prevNumberOfLocals ; i ++ ) { if ( prevLocals [ i ] != null ) { switch ( prevLocals [ i ] . id ( ) ) { case TypeIds . T_double : case TypeIds . T_long : i ++ ; } counter ++ ; } else { result = Integer . MAX_VALUE ; this . numberOfDifferentLocals = result ; return result ; } } } else { int indexInPrevLocals = <NUM_LIT:0> ; int indexInCurrentLocals = <NUM_LIT:0> ; int currentLocalsCounter = <NUM_LIT:0> ; int prevLocalsCounter = <NUM_LIT:0> ; currentLocalsLoop : for ( ; indexInCurrentLocals < currentLocalsLength && currentLocalsCounter < currentNumberOfLocals ; indexInCurrentLocals ++ ) { VerificationTypeInfo currentLocal = currentLocals [ indexInCurrentLocals ] ; if ( currentLocal != null ) { currentLocalsCounter ++ ; switch ( currentLocal . id ( ) ) { case TypeIds . T_double : case TypeIds . T_long : indexInCurrentLocals ++ ; } } if ( indexInPrevLocals < prevLocalsLength && prevLocalsCounter < prevNumberOfLocals ) { VerificationTypeInfo prevLocal = prevLocals [ indexInPrevLocals ] ; if ( prevLocal != null ) { prevLocalsCounter ++ ; switch ( prevLocal . id ( ) ) { case TypeIds . T_double : case TypeIds . T_long : indexInPrevLocals ++ ; } } if ( equals ( prevLocal , currentLocal ) && indexInPrevLocals == indexInCurrentLocals ) { if ( result != <NUM_LIT:0> ) { result = Integer . MAX_VALUE ; this . numberOfDifferentLocals = result ; return result ; } } else { result = Integer . MAX_VALUE ; this . numberOfDifferentLocals = result ; return result ; } indexInPrevLocals ++ ; continue currentLocalsLoop ; } if ( currentLocal != null ) { result ++ ; } else { result = Integer . MAX_VALUE ; this . numberOfDifferentLocals = result ; return result ; } indexInCurrentLocals ++ ; break currentLocalsLoop ; } if ( currentLocalsCounter < currentNumberOfLocals ) { for ( ; indexInCurrentLocals < currentLocalsLength && currentLocalsCounter < currentNumberOfLocals ; indexInCurrentLocals ++ ) { VerificationTypeInfo currentLocal = currentLocals [ indexInCurrentLocals ] ; if ( currentLocal == null ) { result = Integer . MAX_VALUE ; this . numberOfDifferentLocals = result ; return result ; } result ++ ; currentLocalsCounter ++ ; switch ( currentLocal . id ( ) ) { case TypeIds . T_double : case TypeIds . T_long : indexInCurrentLocals ++ ; } } } else if ( prevLocalsCounter < prevNumberOfLocals ) { result = - result ; for ( ; indexInPrevLocals < prevLocalsLength && prevLocalsCounter < prevNumberOfLocals ; indexInPrevLocals ++ ) { VerificationTypeInfo prevLocal = prevLocals [ indexInPrevLocals ] ; if ( prevLocal == null ) { result = Integer . MAX_VALUE ; this . numberOfDifferentLocals = result ; return result ; } result -- ; prevLocalsCounter ++ ; switch ( prevLocal . id ( ) ) { case TypeIds . T_double : case TypeIds . T_long : indexInPrevLocals ++ ; } } } } this . numberOfDifferentLocals = result ; return result ; } public int getNumberOfLocals ( ) { if ( this . numberOfLocals != - <NUM_LIT:1> ) { return this . numberOfLocals ; } int result = <NUM_LIT:0> ; final int length = this . locals == null ? <NUM_LIT:0> : this . locals . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( this . locals [ i ] != null ) { switch ( this . locals [ i ] . id ( ) ) { case TypeIds . T_double : case TypeIds . T_long : i ++ ; } result ++ ; } } this . numberOfLocals = result ; return result ; } public int getOffsetDelta ( StackMapFrame prevFrame ) { if ( prevFrame == null ) return this . pc ; return prevFrame . pc == - <NUM_LIT:1> ? this . pc : this . pc - prevFrame . pc - <NUM_LIT:1> ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; printFrame ( buffer , this ) ; return String . valueOf ( buffer ) ; } private void printFrame ( StringBuffer buffer , StackMapFrame frame ) { String pattern = "<STR_LIT>" ; int localsLength = frame . locals == null ? <NUM_LIT:0> : frame . locals . length ; buffer . append ( MessageFormat . format ( pattern , new String [ ] { Integer . toString ( frame . pc ) , Integer . toString ( frame . getNumberOfLocals ( ) ) , Integer . toString ( frame . numberOfStackItems ) , print ( frame . locals , localsLength ) , print ( frame . stackItems , frame . numberOfStackItems ) } ) ) ; } private String print ( VerificationTypeInfo [ ] infos , int length ) { StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( '<CHAR_LIT:[>' ) ; if ( infos != null ) { for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( i != <NUM_LIT:0> ) buffer . append ( '<CHAR_LIT:U+002C>' ) ; VerificationTypeInfo verificationTypeInfo = infos [ i ] ; if ( verificationTypeInfo == null ) { buffer . append ( "<STR_LIT>" ) ; continue ; } buffer . append ( verificationTypeInfo ) ; } } buffer . append ( '<CHAR_LIT:]>' ) ; return String . valueOf ( buffer ) ; } public void putLocal ( int resolvedPosition , VerificationTypeInfo info ) { if ( this . locals == null ) { this . locals = new VerificationTypeInfo [ resolvedPosition + <NUM_LIT:1> ] ; this . locals [ resolvedPosition ] = info ; } else { final int length = this . locals . length ; if ( resolvedPosition >= length ) { System . arraycopy ( this . locals , <NUM_LIT:0> , this . locals = new VerificationTypeInfo [ resolvedPosition + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; } this . locals [ resolvedPosition ] = info ; } } public void replaceWithElementType ( ) { VerificationTypeInfo info = this . stackItems [ this . numberOfStackItems - <NUM_LIT:1> ] ; VerificationTypeInfo info2 = info . duplicate ( ) ; info2 . replaceWithElementType ( ) ; this . stackItems [ this . numberOfStackItems - <NUM_LIT:1> ] = info2 ; } public int getIndexOfDifferentLocals ( int differentLocalsCount ) { for ( int i = this . locals . length - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) { VerificationTypeInfo currentLocal = this . locals [ i ] ; if ( currentLocal == null ) { continue ; } else { differentLocalsCount -- ; } if ( differentLocalsCount == <NUM_LIT:0> ) { return i ; } } return <NUM_LIT:0> ; } private boolean equals ( VerificationTypeInfo info , VerificationTypeInfo info2 ) { if ( info == null ) { return info2 == null ; } if ( info2 == null ) return false ; return info . equals ( info2 ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . codegen ; public class DoubleCache { private double keyTable [ ] ; private int valueTable [ ] ; private int elementSize ; public DoubleCache ( ) { this ( <NUM_LIT> ) ; } public DoubleCache ( int initialCapacity ) { this . elementSize = <NUM_LIT:0> ; this . keyTable = new double [ initialCapacity ] ; this . valueTable = new int [ initialCapacity ] ; } public void clear ( ) { for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) { this . keyTable [ i ] = <NUM_LIT:0.0> ; this . valueTable [ i ] = <NUM_LIT:0> ; } this . elementSize = <NUM_LIT:0> ; } public boolean containsKey ( double key ) { if ( key == <NUM_LIT:0.0> ) { for ( int i = <NUM_LIT:0> , max = this . elementSize ; i < max ; i ++ ) { if ( this . keyTable [ i ] == <NUM_LIT:0.0> ) { long value1 = Double . doubleToLongBits ( key ) ; long value2 = Double . doubleToLongBits ( this . keyTable [ i ] ) ; if ( value1 == - <NUM_LIT> && value2 == - <NUM_LIT> ) return true ; if ( value1 == <NUM_LIT:0> && value2 == <NUM_LIT:0> ) return true ; } } } else { for ( int i = <NUM_LIT:0> , max = this . elementSize ; i < max ; i ++ ) { if ( this . keyTable [ i ] == key ) { return true ; } } } return false ; } public int put ( double key , int value ) { if ( this . elementSize == this . keyTable . length ) { System . arraycopy ( this . keyTable , <NUM_LIT:0> , ( this . keyTable = new double [ this . elementSize * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . elementSize ) ; System . arraycopy ( this . valueTable , <NUM_LIT:0> , ( this . valueTable = new int [ this . elementSize * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . elementSize ) ; } this . keyTable [ this . elementSize ] = key ; this . valueTable [ this . elementSize ] = value ; this . elementSize ++ ; return value ; } public int putIfAbsent ( double key , int value ) { if ( key == <NUM_LIT:0.0> ) { for ( int i = <NUM_LIT:0> , max = this . elementSize ; i < max ; i ++ ) { if ( this . keyTable [ i ] == <NUM_LIT:0.0> ) { long value1 = Double . doubleToLongBits ( key ) ; long value2 = Double . doubleToLongBits ( this . keyTable [ i ] ) ; if ( value1 == - <NUM_LIT> && value2 == - <NUM_LIT> ) return this . valueTable [ i ] ; if ( value1 == <NUM_LIT:0> && value2 == <NUM_LIT:0> ) return this . valueTable [ i ] ; } } } else { for ( int i = <NUM_LIT:0> , max = this . elementSize ; i < max ; i ++ ) { if ( this . keyTable [ i ] == key ) { return this . valueTable [ i ] ; } } } if ( this . elementSize == this . keyTable . length ) { System . arraycopy ( this . keyTable , <NUM_LIT:0> , ( this . keyTable = new double [ this . elementSize * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . elementSize ) ; System . arraycopy ( this . valueTable , <NUM_LIT:0> , ( this . valueTable = new int [ this . elementSize * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . elementSize ) ; } this . keyTable [ this . elementSize ] = key ; this . valueTable [ this . elementSize ] = value ; this . elementSize ++ ; return - value ; } public String toString ( ) { int max = this . elementSize ; StringBuffer buf = new StringBuffer ( ) ; buf . append ( "<STR_LIT:{>" ) ; for ( int i = <NUM_LIT:0> ; i < max ; ++ i ) { if ( ( this . keyTable [ i ] != <NUM_LIT:0> ) || ( ( this . keyTable [ i ] == <NUM_LIT:0> ) && ( this . valueTable [ i ] != <NUM_LIT:0> ) ) ) { buf . append ( this . keyTable [ i ] ) . append ( "<STR_LIT>" ) . append ( this . valueTable [ i ] ) ; } if ( i < max ) { buf . append ( "<STR_LIT:U+002CU+0020>" ) ; } } buf . append ( "<STR_LIT:}>" ) ; return buf . toString ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . codegen ; public abstract class Label { public CodeStream codeStream ; public int position = POS_NOT_SET ; public final static int POS_NOT_SET = - <NUM_LIT:1> ; public Label ( ) { } public Label ( CodeStream codeStream ) { this . codeStream = codeStream ; } public abstract void place ( ) ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . codegen ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; public class VerificationTypeInfo { public static final int ITEM_TOP = <NUM_LIT:0> ; public static final int ITEM_INTEGER = <NUM_LIT:1> ; public static final int ITEM_FLOAT = <NUM_LIT:2> ; public static final int ITEM_DOUBLE = <NUM_LIT:3> ; public static final int ITEM_LONG = <NUM_LIT:4> ; public static final int ITEM_NULL = <NUM_LIT:5> ; public static final int ITEM_UNINITIALIZED_THIS = <NUM_LIT:6> ; public static final int ITEM_OBJECT = <NUM_LIT:7> ; public static final int ITEM_UNINITIALIZED = <NUM_LIT:8> ; public int tag ; private int id ; private char [ ] constantPoolName ; public int offset ; private VerificationTypeInfo ( ) { } public VerificationTypeInfo ( int id , char [ ] constantPoolName ) { this ( id , VerificationTypeInfo . ITEM_OBJECT , constantPoolName ) ; } public VerificationTypeInfo ( int id , int tag , char [ ] constantPoolName ) { this . id = id ; this . tag = tag ; this . constantPoolName = constantPoolName ; } public VerificationTypeInfo ( int tag , TypeBinding binding ) { this ( binding ) ; this . tag = tag ; } public VerificationTypeInfo ( TypeBinding binding ) { this . id = binding . id ; switch ( binding . id ) { case TypeIds . T_boolean : case TypeIds . T_byte : case TypeIds . T_char : case TypeIds . T_int : case TypeIds . T_short : this . tag = VerificationTypeInfo . ITEM_INTEGER ; break ; case TypeIds . T_float : this . tag = VerificationTypeInfo . ITEM_FLOAT ; break ; case TypeIds . T_long : this . tag = VerificationTypeInfo . ITEM_LONG ; break ; case TypeIds . T_double : this . tag = VerificationTypeInfo . ITEM_DOUBLE ; break ; case TypeIds . T_null : this . tag = VerificationTypeInfo . ITEM_NULL ; break ; default : this . tag = VerificationTypeInfo . ITEM_OBJECT ; this . constantPoolName = binding . constantPoolName ( ) ; } } public void setBinding ( TypeBinding binding ) { this . constantPoolName = binding . constantPoolName ( ) ; final int typeBindingId = binding . id ; this . id = typeBindingId ; switch ( typeBindingId ) { case TypeIds . T_boolean : case TypeIds . T_byte : case TypeIds . T_char : case TypeIds . T_int : case TypeIds . T_short : this . tag = VerificationTypeInfo . ITEM_INTEGER ; break ; case TypeIds . T_float : this . tag = VerificationTypeInfo . ITEM_FLOAT ; break ; case TypeIds . T_long : this . tag = VerificationTypeInfo . ITEM_LONG ; break ; case TypeIds . T_double : this . tag = VerificationTypeInfo . ITEM_DOUBLE ; break ; case TypeIds . T_null : this . tag = VerificationTypeInfo . ITEM_NULL ; break ; default : this . tag = VerificationTypeInfo . ITEM_OBJECT ; } } public int id ( ) { return this . id ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; switch ( this . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED_THIS : buffer . append ( "<STR_LIT>" ) . append ( readableName ( ) ) . append ( "<STR_LIT:)>" ) ; break ; case VerificationTypeInfo . ITEM_UNINITIALIZED : buffer . append ( "<STR_LIT>" ) . append ( readableName ( ) ) . append ( "<STR_LIT:)>" ) ; break ; case VerificationTypeInfo . ITEM_OBJECT : buffer . append ( readableName ( ) ) ; break ; case VerificationTypeInfo . ITEM_DOUBLE : buffer . append ( '<CHAR_LIT>' ) ; break ; case VerificationTypeInfo . ITEM_FLOAT : buffer . append ( '<CHAR_LIT>' ) ; break ; case VerificationTypeInfo . ITEM_INTEGER : buffer . append ( '<CHAR_LIT>' ) ; break ; case VerificationTypeInfo . ITEM_LONG : buffer . append ( '<CHAR_LIT>' ) ; break ; case VerificationTypeInfo . ITEM_NULL : buffer . append ( "<STR_LIT:null>" ) ; break ; case VerificationTypeInfo . ITEM_TOP : buffer . append ( "<STR_LIT>" ) ; break ; } return String . valueOf ( buffer ) ; } public VerificationTypeInfo duplicate ( ) { final VerificationTypeInfo verificationTypeInfo = new VerificationTypeInfo ( ) ; verificationTypeInfo . id = this . id ; verificationTypeInfo . tag = this . tag ; verificationTypeInfo . constantPoolName = this . constantPoolName ; verificationTypeInfo . offset = this . offset ; return verificationTypeInfo ; } public boolean equals ( Object obj ) { if ( obj instanceof VerificationTypeInfo ) { VerificationTypeInfo info1 = ( VerificationTypeInfo ) obj ; return info1 . tag == this . tag && CharOperation . equals ( info1 . constantPoolName ( ) , constantPoolName ( ) ) ; } return false ; } public int hashCode ( ) { return this . tag + this . id + this . constantPoolName . length + this . offset ; } public char [ ] constantPoolName ( ) { return this . constantPoolName ; } public char [ ] readableName ( ) { return this . constantPoolName ; } public void replaceWithElementType ( ) { if ( this . constantPoolName [ <NUM_LIT:1> ] == '<CHAR_LIT>' ) { this . constantPoolName = CharOperation . subarray ( this . constantPoolName , <NUM_LIT:2> , this . constantPoolName . length - <NUM_LIT:1> ) ; } else { this . constantPoolName = CharOperation . subarray ( this . constantPoolName , <NUM_LIT:1> , this . constantPoolName . length ) ; if ( this . constantPoolName . length == <NUM_LIT:1> ) { switch ( this . constantPoolName [ <NUM_LIT:0> ] ) { case '<CHAR_LIT>' : this . id = TypeIds . T_int ; break ; case '<CHAR_LIT>' : this . id = TypeIds . T_byte ; break ; case '<CHAR_LIT>' : this . id = TypeIds . T_short ; break ; case '<CHAR_LIT>' : this . id = TypeIds . T_char ; break ; case '<CHAR_LIT>' : this . id = TypeIds . T_long ; break ; case '<CHAR_LIT>' : this . id = TypeIds . T_float ; break ; case '<CHAR_LIT>' : this . id = TypeIds . T_double ; break ; case '<CHAR_LIT:Z>' : this . id = TypeIds . T_boolean ; break ; case '<CHAR_LIT>' : this . id = TypeIds . T_null ; break ; case '<CHAR_LIT>' : this . id = TypeIds . T_void ; break ; } } } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . codegen ; import org . eclipse . jdt . core . compiler . CharOperation ; public class CharArrayCache { public char [ ] keyTable [ ] ; public int valueTable [ ] ; int elementSize ; int threshold ; public CharArrayCache ( ) { this ( <NUM_LIT:9> ) ; } public CharArrayCache ( int initialCapacity ) { this . elementSize = <NUM_LIT:0> ; this . threshold = ( initialCapacity * <NUM_LIT:2> ) / <NUM_LIT:3> ; this . keyTable = new char [ initialCapacity ] [ ] ; this . valueTable = new int [ initialCapacity ] ; } public void clear ( ) { for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) { this . keyTable [ i ] = null ; this . valueTable [ i ] = <NUM_LIT:0> ; } this . elementSize = <NUM_LIT:0> ; } public boolean containsKey ( char [ ] key ) { int length = this . keyTable . length , index = CharOperation . hashCode ( key ) % length ; while ( this . keyTable [ index ] != null ) { if ( CharOperation . equals ( this . keyTable [ index ] , key ) ) return true ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return false ; } public int get ( char [ ] key ) { int length = this . keyTable . length , index = CharOperation . hashCode ( key ) % length ; while ( this . keyTable [ index ] != null ) { if ( CharOperation . equals ( this . keyTable [ index ] , key ) ) return this . valueTable [ index ] ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return - <NUM_LIT:1> ; } public int putIfAbsent ( char [ ] key , int value ) { int length = this . keyTable . length , index = CharOperation . hashCode ( key ) % length ; while ( this . keyTable [ index ] != null ) { if ( CharOperation . equals ( this . keyTable [ index ] , key ) ) return this . valueTable [ index ] ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } this . keyTable [ index ] = key ; this . valueTable [ index ] = value ; if ( ++ this . elementSize > this . threshold ) rehash ( ) ; return - value ; } private int put ( char [ ] key , int value ) { int length = this . keyTable . length , index = CharOperation . hashCode ( key ) % length ; while ( this . keyTable [ index ] != null ) { if ( CharOperation . equals ( this . keyTable [ index ] , key ) ) return this . valueTable [ index ] = value ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } this . keyTable [ index ] = key ; this . valueTable [ index ] = value ; if ( ++ this . elementSize > this . threshold ) rehash ( ) ; return value ; } private void rehash ( ) { CharArrayCache newHashtable = new CharArrayCache ( this . keyTable . length * <NUM_LIT:2> ) ; for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) if ( this . keyTable [ i ] != null ) newHashtable . put ( this . keyTable [ i ] , this . valueTable [ i ] ) ; this . keyTable = newHashtable . keyTable ; this . valueTable = newHashtable . valueTable ; this . threshold = newHashtable . threshold ; } public void remove ( char [ ] key ) { int length = this . keyTable . length , index = CharOperation . hashCode ( key ) % length ; while ( this . keyTable [ index ] != null ) { if ( CharOperation . equals ( this . keyTable [ index ] , key ) ) { this . valueTable [ index ] = <NUM_LIT:0> ; this . keyTable [ index ] = null ; return ; } if ( ++ index == length ) { index = <NUM_LIT:0> ; } } } public char [ ] returnKeyFor ( int value ) { for ( int i = this . keyTable . length ; i -- > <NUM_LIT:0> ; ) { if ( this . valueTable [ i ] == value ) { return this . keyTable [ i ] ; } } return null ; } public int size ( ) { return this . elementSize ; } public String toString ( ) { int max = size ( ) ; StringBuffer buf = new StringBuffer ( ) ; buf . append ( "<STR_LIT:{>" ) ; for ( int i = <NUM_LIT:0> ; i < max ; ++ i ) { if ( this . keyTable [ i ] != null ) { buf . append ( this . keyTable [ i ] ) . append ( "<STR_LIT>" ) . append ( this . valueTable [ i ] ) ; } if ( i < max ) { buf . append ( "<STR_LIT:U+002CU+0020>" ) ; } } buf . append ( "<STR_LIT:}>" ) ; return buf . toString ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . codegen ; public class LongCache { public long keyTable [ ] ; public int valueTable [ ] ; int elementSize ; int threshold ; public LongCache ( ) { this ( <NUM_LIT> ) ; } public LongCache ( int initialCapacity ) { this . elementSize = <NUM_LIT:0> ; this . threshold = ( int ) ( initialCapacity * <NUM_LIT> ) ; this . keyTable = new long [ initialCapacity ] ; this . valueTable = new int [ initialCapacity ] ; } public void clear ( ) { for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) { this . keyTable [ i ] = <NUM_LIT:0> ; this . valueTable [ i ] = <NUM_LIT:0> ; } this . elementSize = <NUM_LIT:0> ; } public boolean containsKey ( long key ) { int index = hash ( key ) , length = this . keyTable . length ; while ( ( this . keyTable [ index ] != <NUM_LIT:0> ) || ( ( this . keyTable [ index ] == <NUM_LIT:0> ) && ( this . valueTable [ index ] != <NUM_LIT:0> ) ) ) { if ( this . keyTable [ index ] == key ) return true ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return false ; } public int hash ( long key ) { return ( ( int ) key & <NUM_LIT> ) % this . keyTable . length ; } public int put ( long key , int value ) { int index = hash ( key ) , length = this . keyTable . length ; while ( ( this . keyTable [ index ] != <NUM_LIT:0> ) || ( ( this . keyTable [ index ] == <NUM_LIT:0> ) && ( this . valueTable [ index ] != <NUM_LIT:0> ) ) ) { if ( this . keyTable [ index ] == key ) return this . valueTable [ index ] = value ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } this . keyTable [ index ] = key ; this . valueTable [ index ] = value ; if ( ++ this . elementSize > this . threshold ) { rehash ( ) ; } return value ; } public int putIfAbsent ( long key , int value ) { int index = hash ( key ) , length = this . keyTable . length ; while ( ( this . keyTable [ index ] != <NUM_LIT:0> ) || ( ( this . keyTable [ index ] == <NUM_LIT:0> ) && ( this . valueTable [ index ] != <NUM_LIT:0> ) ) ) { if ( this . keyTable [ index ] == key ) return this . valueTable [ index ] ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } this . keyTable [ index ] = key ; this . valueTable [ index ] = value ; if ( ++ this . elementSize > this . threshold ) { rehash ( ) ; } return - value ; } private void rehash ( ) { LongCache newHashtable = new LongCache ( this . keyTable . length * <NUM_LIT:2> ) ; for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) { long key = this . keyTable [ i ] ; int value = this . valueTable [ i ] ; if ( ( key != <NUM_LIT:0> ) || ( ( key == <NUM_LIT:0> ) && ( value != <NUM_LIT:0> ) ) ) { newHashtable . put ( key , value ) ; } } this . keyTable = newHashtable . keyTable ; this . valueTable = newHashtable . valueTable ; this . threshold = newHashtable . threshold ; } public int size ( ) { return this . elementSize ; } public String toString ( ) { int max = size ( ) ; StringBuffer buf = new StringBuffer ( ) ; buf . append ( "<STR_LIT:{>" ) ; for ( int i = <NUM_LIT:0> ; i < max ; ++ i ) { if ( ( this . keyTable [ i ] != <NUM_LIT:0> ) || ( ( this . keyTable [ i ] == <NUM_LIT:0> ) && ( this . valueTable [ i ] != <NUM_LIT:0> ) ) ) { buf . append ( this . keyTable [ i ] ) . append ( "<STR_LIT>" ) . append ( this . valueTable [ i ] ) ; } if ( i < max ) { buf . append ( "<STR_LIT:U+002CU+0020>" ) ; } } buf . append ( "<STR_LIT:}>" ) ; return buf . toString ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . codegen ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ClassFile ; import org . eclipse . jdt . internal . compiler . CompilationResult ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . AbstractMethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . AbstractVariableDeclaration ; import org . eclipse . jdt . internal . compiler . ast . AllocationExpression ; import org . eclipse . jdt . internal . compiler . ast . ExplicitConstructorCall ; import org . eclipse . jdt . internal . compiler . ast . Expression ; import org . eclipse . jdt . internal . compiler . ast . FieldDeclaration ; import org . eclipse . jdt . internal . compiler . ast . OperatorIds ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . flow . UnconditionalFlowInfo ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . * ; import org . eclipse . jdt . internal . compiler . problem . AbortMethod ; import org . eclipse . jdt . internal . compiler . util . Util ; public class CodeStream { public static FieldBinding [ ] ImplicitThis = new FieldBinding [ ] { } ; public static final int LABELS_INCREMENT = <NUM_LIT:5> ; public static final int LOCALS_INCREMENT = <NUM_LIT:10> ; static ExceptionLabel [ ] noExceptionHandlers = new ExceptionLabel [ LABELS_INCREMENT ] ; static BranchLabel [ ] noLabels = new BranchLabel [ LABELS_INCREMENT ] ; static LocalVariableBinding [ ] noLocals = new LocalVariableBinding [ LOCALS_INCREMENT ] ; static LocalVariableBinding [ ] noVisibleLocals = new LocalVariableBinding [ LOCALS_INCREMENT ] ; public static final CompilationResult RESTART_IN_WIDE_MODE = new CompilationResult ( ( char [ ] ) null , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ) ; public static final CompilationResult RESTART_CODE_GEN_FOR_UNUSED_LOCALS_MODE = new CompilationResult ( ( char [ ] ) null , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ) ; public int allLocalsCounter ; public byte [ ] bCodeStream ; public ClassFile classFile ; public int classFileOffset ; public ConstantPool constantPool ; public int countLabels ; public ExceptionLabel [ ] exceptionLabels = new ExceptionLabel [ LABELS_INCREMENT ] ; public int exceptionLabelsCounter ; public int generateAttributes ; static final int L_UNKNOWN = <NUM_LIT:0> , L_OPTIMIZABLE = <NUM_LIT:2> , L_CANNOT_OPTIMIZE = <NUM_LIT:4> ; public BranchLabel [ ] labels = new BranchLabel [ LABELS_INCREMENT ] ; public int lastEntryPC ; public int lastAbruptCompletion ; public int [ ] lineSeparatorPositions ; public int lineNumberStart ; public int lineNumberEnd ; public LocalVariableBinding [ ] locals = new LocalVariableBinding [ LOCALS_INCREMENT ] ; public int maxFieldCount ; public int maxLocals ; public AbstractMethodDeclaration methodDeclaration ; public int [ ] pcToSourceMap = new int [ <NUM_LIT:24> ] ; public int pcToSourceMapSize ; public int position ; public boolean preserveUnusedLocals ; public int stackDepth ; public int stackMax ; public int startingClassFileOffset ; protected long targetLevel ; public LocalVariableBinding [ ] visibleLocals = new LocalVariableBinding [ LOCALS_INCREMENT ] ; int visibleLocalsCount ; public boolean wideMode = false ; public CodeStream ( ClassFile givenClassFile ) { this . targetLevel = givenClassFile . targetJDK ; this . generateAttributes = givenClassFile . produceAttributes ; if ( ( givenClassFile . produceAttributes & ClassFileConstants . ATTR_LINES ) != <NUM_LIT:0> ) { this . lineSeparatorPositions = givenClassFile . referenceBinding . scope . referenceCompilationUnit ( ) . compilationResult . getLineSeparatorPositions ( ) ; } } public static int insertionIndex ( int [ ] pcToSourceMap , int length , int pc ) { int g = <NUM_LIT:0> ; int d = length - <NUM_LIT:2> ; int m = <NUM_LIT:0> ; while ( g <= d ) { m = ( g + d ) / <NUM_LIT:2> ; if ( ( m & <NUM_LIT:1> ) != <NUM_LIT:0> ) m -- ; int currentPC = pcToSourceMap [ m ] ; if ( pc < currentPC ) { d = m - <NUM_LIT:2> ; } else if ( pc > currentPC ) { g = m + <NUM_LIT:2> ; } else { return - <NUM_LIT:1> ; } } if ( pc < pcToSourceMap [ m ] ) return m ; return m + <NUM_LIT:2> ; } public static final void sort ( int [ ] tab , int lo0 , int hi0 , int [ ] result ) { int lo = lo0 ; int hi = hi0 ; int mid ; if ( hi0 > lo0 ) { mid = tab [ lo0 + ( hi0 - lo0 ) / <NUM_LIT:2> ] ; while ( lo <= hi ) { while ( ( lo < hi0 ) && ( tab [ lo ] < mid ) ) ++ lo ; while ( ( hi > lo0 ) && ( tab [ hi ] > mid ) ) -- hi ; if ( lo <= hi ) { swap ( tab , lo , hi , result ) ; ++ lo ; -- hi ; } } if ( lo0 < hi ) sort ( tab , lo0 , hi , result ) ; if ( lo < hi0 ) sort ( tab , lo , hi0 , result ) ; } } private static final void swap ( int a [ ] , int i , int j , int result [ ] ) { int T ; T = a [ i ] ; a [ i ] = a [ j ] ; a [ j ] = T ; T = result [ j ] ; result [ j ] = result [ i ] ; result [ i ] = T ; } public void aaload ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_aaload ; } public void aastore ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:3> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_aastore ; } public void aconst_null ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) { this . stackMax = this . stackDepth ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_aconst_null ; } public void addDefinitelyAssignedVariables ( Scope scope , int initStateIndex ) { if ( ( this . generateAttributes & ( ClassFileConstants . ATTR_VARS | ClassFileConstants . ATTR_STACK_MAP_TABLE | ClassFileConstants . ATTR_STACK_MAP ) ) == <NUM_LIT:0> ) return ; for ( int i = <NUM_LIT:0> ; i < this . visibleLocalsCount ; i ++ ) { LocalVariableBinding localBinding = this . visibleLocals [ i ] ; if ( localBinding != null ) { if ( isDefinitelyAssigned ( scope , initStateIndex , localBinding ) ) { if ( ( localBinding . initializationCount == <NUM_LIT:0> ) || ( localBinding . initializationPCs [ ( ( localBinding . initializationCount - <NUM_LIT:1> ) << <NUM_LIT:1> ) + <NUM_LIT:1> ] != - <NUM_LIT:1> ) ) { localBinding . recordInitializationStartPC ( this . position ) ; } } } } } public void addLabel ( BranchLabel aLabel ) { if ( this . countLabels == this . labels . length ) System . arraycopy ( this . labels , <NUM_LIT:0> , this . labels = new BranchLabel [ this . countLabels + LABELS_INCREMENT ] , <NUM_LIT:0> , this . countLabels ) ; this . labels [ this . countLabels ++ ] = aLabel ; } public void addVariable ( LocalVariableBinding localBinding ) { } public void addVisibleLocalVariable ( LocalVariableBinding localBinding ) { if ( ( this . generateAttributes & ( ClassFileConstants . ATTR_VARS | ClassFileConstants . ATTR_STACK_MAP_TABLE | ClassFileConstants . ATTR_STACK_MAP ) ) == <NUM_LIT:0> ) return ; if ( this . visibleLocalsCount >= this . visibleLocals . length ) System . arraycopy ( this . visibleLocals , <NUM_LIT:0> , this . visibleLocals = new LocalVariableBinding [ this . visibleLocalsCount * <NUM_LIT:2> ] , <NUM_LIT:0> , this . visibleLocalsCount ) ; this . visibleLocals [ this . visibleLocalsCount ++ ] = localBinding ; } public void aload ( int iArg ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . maxLocals <= iArg ) { this . maxLocals = iArg + <NUM_LIT:1> ; } if ( iArg > <NUM_LIT:255> ) { if ( this . classFileOffset + <NUM_LIT:3> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_wide ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_aload ; writeUnsignedShort ( iArg ) ; } else { if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_aload ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) iArg ; } } public void aload_0 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) { this . stackMax = this . stackDepth ; } if ( this . maxLocals == <NUM_LIT:0> ) { this . maxLocals = <NUM_LIT:1> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_aload_0 ; } public void aload_1 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . maxLocals <= <NUM_LIT:1> ) { this . maxLocals = <NUM_LIT:2> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_aload_1 ; } public void aload_2 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . maxLocals <= <NUM_LIT:2> ) { this . maxLocals = <NUM_LIT:3> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_aload_2 ; } public void aload_3 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . maxLocals <= <NUM_LIT:3> ) { this . maxLocals = <NUM_LIT:4> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_aload_3 ; } public void anewarray ( TypeBinding typeBinding ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_anewarray ; writeUnsignedShort ( this . constantPool . literalIndexForType ( typeBinding ) ) ; } public void areturn ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_areturn ; this . lastAbruptCompletion = this . position ; } public void arrayAt ( int typeBindingID ) { switch ( typeBindingID ) { case TypeIds . T_int : iaload ( ) ; break ; case TypeIds . T_byte : case TypeIds . T_boolean : baload ( ) ; break ; case TypeIds . T_short : saload ( ) ; break ; case TypeIds . T_char : caload ( ) ; break ; case TypeIds . T_long : laload ( ) ; break ; case TypeIds . T_float : faload ( ) ; break ; case TypeIds . T_double : daload ( ) ; break ; default : aaload ( ) ; } } public void arrayAtPut ( int elementTypeID , boolean valueRequired ) { switch ( elementTypeID ) { case TypeIds . T_int : if ( valueRequired ) dup_x2 ( ) ; iastore ( ) ; break ; case TypeIds . T_byte : case TypeIds . T_boolean : if ( valueRequired ) dup_x2 ( ) ; bastore ( ) ; break ; case TypeIds . T_short : if ( valueRequired ) dup_x2 ( ) ; sastore ( ) ; break ; case TypeIds . T_char : if ( valueRequired ) dup_x2 ( ) ; castore ( ) ; break ; case TypeIds . T_long : if ( valueRequired ) dup2_x2 ( ) ; lastore ( ) ; break ; case TypeIds . T_float : if ( valueRequired ) dup_x2 ( ) ; fastore ( ) ; break ; case TypeIds . T_double : if ( valueRequired ) dup2_x2 ( ) ; dastore ( ) ; break ; default : if ( valueRequired ) dup_x2 ( ) ; aastore ( ) ; } } public void arraylength ( ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_arraylength ; } public void astore ( int iArg ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . maxLocals <= iArg ) { this . maxLocals = iArg + <NUM_LIT:1> ; } if ( iArg > <NUM_LIT:255> ) { if ( this . classFileOffset + <NUM_LIT:3> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_wide ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_astore ; writeUnsignedShort ( iArg ) ; } else { if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_astore ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) iArg ; } } public void astore_0 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . maxLocals == <NUM_LIT:0> ) { this . maxLocals = <NUM_LIT:1> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_astore_0 ; } public void astore_1 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . maxLocals <= <NUM_LIT:1> ) { this . maxLocals = <NUM_LIT:2> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_astore_1 ; } public void astore_2 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . maxLocals <= <NUM_LIT:2> ) { this . maxLocals = <NUM_LIT:3> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_astore_2 ; } public void astore_3 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . maxLocals <= <NUM_LIT:3> ) { this . maxLocals = <NUM_LIT:4> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_astore_3 ; } public void athrow ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_athrow ; this . lastAbruptCompletion = this . position ; } public void baload ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_baload ; } public void bastore ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:3> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_bastore ; } public void bipush ( byte b ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_bipush ; this . bCodeStream [ this . classFileOffset ++ ] = b ; } public void caload ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_caload ; } public void castore ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:3> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_castore ; } public void checkcast ( int baseId ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_checkcast ; switch ( baseId ) { case TypeIds . T_byte : writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangByteConstantPoolName ) ) ; break ; case TypeIds . T_short : writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangShortConstantPoolName ) ) ; break ; case TypeIds . T_char : writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangCharacterConstantPoolName ) ) ; break ; case TypeIds . T_int : writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangIntegerConstantPoolName ) ) ; break ; case TypeIds . T_long : writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangLongConstantPoolName ) ) ; break ; case TypeIds . T_float : writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangFloatConstantPoolName ) ) ; break ; case TypeIds . T_double : writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangDoubleConstantPoolName ) ) ; break ; case TypeIds . T_boolean : writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangBooleanConstantPoolName ) ) ; } } public void checkcast ( TypeBinding typeBinding ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_checkcast ; writeUnsignedShort ( this . constantPool . literalIndexForType ( typeBinding ) ) ; } public void d2f ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_d2f ; } public void d2i ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_d2i ; } public void d2l ( ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_d2l ; } public void dadd ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dadd ; } public void daload ( ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_daload ; } public void dastore ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:4> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dastore ; } public void dcmpg ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:3> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dcmpg ; } public void dcmpl ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:3> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dcmpl ; } public void dconst_0 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += <NUM_LIT:2> ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dconst_0 ; } public void dconst_1 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += <NUM_LIT:2> ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dconst_1 ; } public void ddiv ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ddiv ; } public void decrStackSize ( int offset ) { this . stackDepth -= offset ; } public void dload ( int iArg ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += <NUM_LIT:2> ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . maxLocals < iArg + <NUM_LIT:2> ) { this . maxLocals = iArg + <NUM_LIT:2> ; } if ( iArg > <NUM_LIT:255> ) { if ( this . classFileOffset + <NUM_LIT:3> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_wide ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dload ; writeUnsignedShort ( iArg ) ; } else { if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dload ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) iArg ; } } public void dload_0 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += <NUM_LIT:2> ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . maxLocals < <NUM_LIT:2> ) { this . maxLocals = <NUM_LIT:2> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dload_0 ; } public void dload_1 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += <NUM_LIT:2> ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . maxLocals < <NUM_LIT:3> ) { this . maxLocals = <NUM_LIT:3> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dload_1 ; } public void dload_2 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += <NUM_LIT:2> ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . maxLocals < <NUM_LIT:4> ) { this . maxLocals = <NUM_LIT:4> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dload_2 ; } public void dload_3 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += <NUM_LIT:2> ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . maxLocals < <NUM_LIT:5> ) { this . maxLocals = <NUM_LIT:5> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dload_3 ; } public void dmul ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dmul ; } public void dneg ( ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dneg ; } public void drem ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_drem ; } public void dreturn ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dreturn ; this . lastAbruptCompletion = this . position ; } public void dstore ( int iArg ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . maxLocals <= iArg + <NUM_LIT:1> ) { this . maxLocals = iArg + <NUM_LIT:2> ; } if ( iArg > <NUM_LIT:255> ) { if ( this . classFileOffset + <NUM_LIT:3> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_wide ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dstore ; writeUnsignedShort ( iArg ) ; } else { if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dstore ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) iArg ; } } public void dstore_0 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . maxLocals < <NUM_LIT:2> ) { this . maxLocals = <NUM_LIT:2> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dstore_0 ; } public void dstore_1 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . maxLocals < <NUM_LIT:3> ) { this . maxLocals = <NUM_LIT:3> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dstore_1 ; } public void dstore_2 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . maxLocals < <NUM_LIT:4> ) { this . maxLocals = <NUM_LIT:4> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dstore_2 ; } public void dstore_3 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . maxLocals < <NUM_LIT:5> ) { this . maxLocals = <NUM_LIT:5> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dstore_3 ; } public void dsub ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dsub ; } public void dup ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) { this . stackMax = this . stackDepth ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dup ; } public void dup_x1 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dup_x1 ; } public void dup_x2 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dup_x2 ; } public void dup2 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += <NUM_LIT:2> ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dup2 ; } public void dup2_x1 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += <NUM_LIT:2> ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dup2_x1 ; } public void dup2_x2 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += <NUM_LIT:2> ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_dup2_x2 ; } public void exitUserScope ( BlockScope currentScope ) { if ( ( this . generateAttributes & ( ClassFileConstants . ATTR_VARS | ClassFileConstants . ATTR_STACK_MAP_TABLE | ClassFileConstants . ATTR_STACK_MAP ) ) == <NUM_LIT:0> ) return ; int index = this . visibleLocalsCount - <NUM_LIT:1> ; while ( index >= <NUM_LIT:0> ) { LocalVariableBinding visibleLocal = this . visibleLocals [ index ] ; if ( visibleLocal == null || visibleLocal . declaringScope != currentScope ) { index -- ; continue ; } if ( visibleLocal . initializationCount > <NUM_LIT:0> ) { visibleLocal . recordInitializationEndPC ( this . position ) ; } this . visibleLocals [ index -- ] = null ; } } public void exitUserScope ( BlockScope currentScope , LocalVariableBinding binding ) { if ( ( this . generateAttributes & ( ClassFileConstants . ATTR_VARS | ClassFileConstants . ATTR_STACK_MAP_TABLE | ClassFileConstants . ATTR_STACK_MAP ) ) == <NUM_LIT:0> ) return ; int index = this . visibleLocalsCount - <NUM_LIT:1> ; while ( index >= <NUM_LIT:0> ) { LocalVariableBinding visibleLocal = this . visibleLocals [ index ] ; if ( visibleLocal == null || visibleLocal . declaringScope != currentScope || visibleLocal == binding ) { index -- ; continue ; } if ( visibleLocal . initializationCount > <NUM_LIT:0> ) { visibleLocal . recordInitializationEndPC ( this . position ) ; } this . visibleLocals [ index -- ] = null ; } } public void f2d ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_f2d ; } public void f2i ( ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_f2i ; } public void f2l ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_f2l ; } public void fadd ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fadd ; } public void faload ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_faload ; } public void fastore ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:3> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fastore ; } public void fcmpg ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fcmpg ; } public void fcmpl ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fcmpl ; } public void fconst_0 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fconst_0 ; } public void fconst_1 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fconst_1 ; } public void fconst_2 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fconst_2 ; } public void fdiv ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fdiv ; } public void fieldAccess ( byte opcode , FieldBinding fieldBinding , TypeBinding declaringClass ) { if ( declaringClass == null ) declaringClass = fieldBinding . declaringClass ; if ( ( declaringClass . tagBits & TagBits . ContainsNestedTypeReferences ) != <NUM_LIT:0> ) { Util . recordNestedType ( this . classFile , declaringClass ) ; } TypeBinding returnType = fieldBinding . type ; int returnTypeSize ; switch ( returnType . id ) { case TypeIds . T_long : case TypeIds . T_double : returnTypeSize = <NUM_LIT:2> ; break ; default : returnTypeSize = <NUM_LIT:1> ; break ; } this . fieldAccess ( opcode , returnTypeSize , declaringClass . constantPoolName ( ) , fieldBinding . name , returnType . signature ( ) ) ; } private void fieldAccess ( byte opcode , int returnTypeSize , char [ ] declaringClass , char [ ] fieldName , char [ ] signature ) { this . countLabels = <NUM_LIT:0> ; switch ( opcode ) { case Opcodes . OPC_getfield : if ( returnTypeSize == <NUM_LIT:2> ) { this . stackDepth ++ ; } break ; case Opcodes . OPC_getstatic : if ( returnTypeSize == <NUM_LIT:2> ) { this . stackDepth += <NUM_LIT:2> ; } else { this . stackDepth ++ ; } break ; case Opcodes . OPC_putfield : if ( returnTypeSize == <NUM_LIT:2> ) { this . stackDepth -= <NUM_LIT:3> ; } else { this . stackDepth -= <NUM_LIT:2> ; } break ; case Opcodes . OPC_putstatic : if ( returnTypeSize == <NUM_LIT:2> ) { this . stackDepth -= <NUM_LIT:2> ; } else { this . stackDepth -- ; } } if ( this . stackDepth > this . stackMax ) { this . stackMax = this . stackDepth ; } if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = opcode ; writeUnsignedShort ( this . constantPool . literalIndexForField ( declaringClass , fieldName , signature ) ) ; } public void fload ( int iArg ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . maxLocals <= iArg ) { this . maxLocals = iArg + <NUM_LIT:1> ; } if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( iArg > <NUM_LIT:255> ) { if ( this . classFileOffset + <NUM_LIT:3> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_wide ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fload ; writeUnsignedShort ( iArg ) ; } else { if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fload ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) iArg ; } } public void fload_0 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . maxLocals == <NUM_LIT:0> ) { this . maxLocals = <NUM_LIT:1> ; } if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fload_0 ; } public void fload_1 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . maxLocals <= <NUM_LIT:1> ) { this . maxLocals = <NUM_LIT:2> ; } if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fload_1 ; } public void fload_2 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . maxLocals <= <NUM_LIT:2> ) { this . maxLocals = <NUM_LIT:3> ; } if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fload_2 ; } public void fload_3 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . maxLocals <= <NUM_LIT:3> ) { this . maxLocals = <NUM_LIT:4> ; } if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fload_3 ; } public void fmul ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fmul ; } public void fneg ( ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fneg ; } public void frem ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_frem ; } public void freturn ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_freturn ; this . lastAbruptCompletion = this . position ; } public void fstore ( int iArg ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . maxLocals <= iArg ) { this . maxLocals = iArg + <NUM_LIT:1> ; } if ( iArg > <NUM_LIT:255> ) { if ( this . classFileOffset + <NUM_LIT:3> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_wide ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fstore ; writeUnsignedShort ( iArg ) ; } else { if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fstore ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) iArg ; } } public void fstore_0 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . maxLocals == <NUM_LIT:0> ) { this . maxLocals = <NUM_LIT:1> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fstore_0 ; } public void fstore_1 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . maxLocals <= <NUM_LIT:1> ) { this . maxLocals = <NUM_LIT:2> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fstore_1 ; } public void fstore_2 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . maxLocals <= <NUM_LIT:2> ) { this . maxLocals = <NUM_LIT:3> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fstore_2 ; } public void fstore_3 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . maxLocals <= <NUM_LIT:3> ) { this . maxLocals = <NUM_LIT:4> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fstore_3 ; } public void fsub ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_fsub ; } public void generateBoxingConversion ( int unboxedTypeID ) { switch ( unboxedTypeID ) { case TypeIds . T_byte : if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { invoke ( Opcodes . OPC_invokestatic , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangByteConstantPoolName , ConstantPool . ValueOf , ConstantPool . byteByteSignature ) ; } else { newWrapperFor ( unboxedTypeID ) ; dup_x1 ( ) ; swap ( ) ; invoke ( Opcodes . OPC_invokespecial , <NUM_LIT:2> , <NUM_LIT:0> , ConstantPool . JavaLangByteConstantPoolName , ConstantPool . Init , ConstantPool . ByteConstrSignature ) ; } break ; case TypeIds . T_short : if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { invoke ( Opcodes . OPC_invokestatic , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangShortConstantPoolName , ConstantPool . ValueOf , ConstantPool . shortShortSignature ) ; } else { newWrapperFor ( unboxedTypeID ) ; dup_x1 ( ) ; swap ( ) ; invoke ( Opcodes . OPC_invokespecial , <NUM_LIT:2> , <NUM_LIT:0> , ConstantPool . JavaLangShortConstantPoolName , ConstantPool . Init , ConstantPool . ShortConstrSignature ) ; } break ; case TypeIds . T_char : if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { invoke ( Opcodes . OPC_invokestatic , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangCharacterConstantPoolName , ConstantPool . ValueOf , ConstantPool . charCharacterSignature ) ; } else { newWrapperFor ( unboxedTypeID ) ; dup_x1 ( ) ; swap ( ) ; invoke ( Opcodes . OPC_invokespecial , <NUM_LIT:2> , <NUM_LIT:0> , ConstantPool . JavaLangCharacterConstantPoolName , ConstantPool . Init , ConstantPool . CharConstrSignature ) ; } break ; case TypeIds . T_int : if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { invoke ( Opcodes . OPC_invokestatic , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangIntegerConstantPoolName , ConstantPool . ValueOf , ConstantPool . IntIntegerSignature ) ; } else { newWrapperFor ( unboxedTypeID ) ; dup_x1 ( ) ; swap ( ) ; invoke ( Opcodes . OPC_invokespecial , <NUM_LIT:2> , <NUM_LIT:0> , ConstantPool . JavaLangIntegerConstantPoolName , ConstantPool . Init , ConstantPool . IntConstrSignature ) ; } break ; case TypeIds . T_long : if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { invoke ( Opcodes . OPC_invokestatic , <NUM_LIT:2> , <NUM_LIT:1> , ConstantPool . JavaLangLongConstantPoolName , ConstantPool . ValueOf , ConstantPool . longLongSignature ) ; } else { newWrapperFor ( unboxedTypeID ) ; dup_x2 ( ) ; dup_x2 ( ) ; pop ( ) ; invoke ( Opcodes . OPC_invokespecial , <NUM_LIT:3> , <NUM_LIT:0> , ConstantPool . JavaLangLongConstantPoolName , ConstantPool . Init , ConstantPool . LongConstrSignature ) ; } break ; case TypeIds . T_float : if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { invoke ( Opcodes . OPC_invokestatic , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangFloatConstantPoolName , ConstantPool . ValueOf , ConstantPool . floatFloatSignature ) ; } else { newWrapperFor ( unboxedTypeID ) ; dup_x1 ( ) ; swap ( ) ; invoke ( Opcodes . OPC_invokespecial , <NUM_LIT:2> , <NUM_LIT:0> , ConstantPool . JavaLangFloatConstantPoolName , ConstantPool . Init , ConstantPool . FloatConstrSignature ) ; } break ; case TypeIds . T_double : if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { invoke ( Opcodes . OPC_invokestatic , <NUM_LIT:2> , <NUM_LIT:1> , ConstantPool . JavaLangDoubleConstantPoolName , ConstantPool . ValueOf , ConstantPool . doubleDoubleSignature ) ; } else { newWrapperFor ( unboxedTypeID ) ; dup_x2 ( ) ; dup_x2 ( ) ; pop ( ) ; invoke ( Opcodes . OPC_invokespecial , <NUM_LIT:3> , <NUM_LIT:0> , ConstantPool . JavaLangDoubleConstantPoolName , ConstantPool . Init , ConstantPool . DoubleConstrSignature ) ; } break ; case TypeIds . T_boolean : if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { invoke ( Opcodes . OPC_invokestatic , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangBooleanConstantPoolName , ConstantPool . ValueOf , ConstantPool . booleanBooleanSignature ) ; } else { newWrapperFor ( unboxedTypeID ) ; dup_x1 ( ) ; swap ( ) ; invoke ( Opcodes . OPC_invokespecial , <NUM_LIT:2> , <NUM_LIT:0> , ConstantPool . JavaLangBooleanConstantPoolName , ConstantPool . Init , ConstantPool . BooleanConstrSignature ) ; } } } public void generateClassLiteralAccessForType ( TypeBinding accessedType , FieldBinding syntheticFieldBinding ) { if ( accessedType . isBaseType ( ) && accessedType != TypeBinding . NULL ) { getTYPE ( accessedType . id ) ; return ; } if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { this . ldc ( accessedType ) ; } else { BranchLabel endLabel = new BranchLabel ( this ) ; if ( syntheticFieldBinding != null ) { fieldAccess ( Opcodes . OPC_getstatic , syntheticFieldBinding , null ) ; dup ( ) ; ifnonnull ( endLabel ) ; pop ( ) ; } ExceptionLabel classNotFoundExceptionHandler = new ExceptionLabel ( this , TypeBinding . NULL ) ; classNotFoundExceptionHandler . placeStart ( ) ; this . ldc ( accessedType == TypeBinding . NULL ? "<STR_LIT>" : String . valueOf ( accessedType . constantPoolName ( ) ) . replace ( '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ) ; invokeClassForName ( ) ; classNotFoundExceptionHandler . placeEnd ( ) ; if ( syntheticFieldBinding != null ) { dup ( ) ; fieldAccess ( Opcodes . OPC_putstatic , syntheticFieldBinding , null ) ; } goto_ ( endLabel ) ; int savedStackDepth = this . stackDepth ; pushExceptionOnStack ( TypeBinding . NULL ) ; classNotFoundExceptionHandler . place ( ) ; newNoClassDefFoundError ( ) ; dup_x1 ( ) ; this . swap ( ) ; invokeThrowableGetMessage ( ) ; invokeNoClassDefFoundErrorStringConstructor ( ) ; athrow ( ) ; endLabel . place ( ) ; this . stackDepth = savedStackDepth ; } } final public void generateCodeAttributeForProblemMethod ( String problemMessage ) { newJavaLangError ( ) ; dup ( ) ; ldc ( problemMessage ) ; invokeJavaLangErrorConstructor ( ) ; athrow ( ) ; } public void generateConstant ( Constant constant , int implicitConversionCode ) { int targetTypeID = ( implicitConversionCode & TypeIds . IMPLICIT_CONVERSION_MASK ) > > <NUM_LIT:4> ; if ( targetTypeID == <NUM_LIT:0> ) targetTypeID = constant . typeID ( ) ; switch ( targetTypeID ) { case TypeIds . T_boolean : generateInlinedValue ( constant . booleanValue ( ) ) ; break ; case TypeIds . T_char : generateInlinedValue ( constant . charValue ( ) ) ; break ; case TypeIds . T_byte : generateInlinedValue ( constant . byteValue ( ) ) ; break ; case TypeIds . T_short : generateInlinedValue ( constant . shortValue ( ) ) ; break ; case TypeIds . T_int : generateInlinedValue ( constant . intValue ( ) ) ; break ; case TypeIds . T_long : generateInlinedValue ( constant . longValue ( ) ) ; break ; case TypeIds . T_float : generateInlinedValue ( constant . floatValue ( ) ) ; break ; case TypeIds . T_double : generateInlinedValue ( constant . doubleValue ( ) ) ; break ; case TypeIds . T_JavaLangString : ldc ( constant . stringValue ( ) ) ; } if ( ( implicitConversionCode & TypeIds . BOXING ) != <NUM_LIT:0> ) { generateBoxingConversion ( targetTypeID ) ; } } public void generateEmulatedReadAccessForField ( FieldBinding fieldBinding ) { generateEmulationForField ( fieldBinding ) ; this . swap ( ) ; invokeJavaLangReflectFieldGetter ( fieldBinding . type . id ) ; if ( ! fieldBinding . type . isBaseType ( ) ) { this . checkcast ( fieldBinding . type ) ; } } public void generateEmulatedWriteAccessForField ( FieldBinding fieldBinding ) { invokeJavaLangReflectFieldSetter ( fieldBinding . type . id ) ; } public void generateEmulationForConstructor ( Scope scope , MethodBinding methodBinding ) { this . ldc ( String . valueOf ( methodBinding . declaringClass . constantPoolName ( ) ) . replace ( '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ) ; invokeClassForName ( ) ; int paramLength = methodBinding . parameters . length ; this . generateInlinedValue ( paramLength ) ; newArray ( scope . createArrayType ( scope . getType ( TypeConstants . JAVA_LANG_CLASS , <NUM_LIT:3> ) , <NUM_LIT:1> ) ) ; if ( paramLength > <NUM_LIT:0> ) { dup ( ) ; for ( int i = <NUM_LIT:0> ; i < paramLength ; i ++ ) { this . generateInlinedValue ( i ) ; TypeBinding parameter = methodBinding . parameters [ i ] ; if ( parameter . isBaseType ( ) ) { getTYPE ( parameter . id ) ; } else if ( parameter . isArrayType ( ) ) { ArrayBinding array = ( ArrayBinding ) parameter ; if ( array . leafComponentType . isBaseType ( ) ) { getTYPE ( array . leafComponentType . id ) ; } else { this . ldc ( String . valueOf ( array . leafComponentType . constantPoolName ( ) ) . replace ( '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ) ; invokeClassForName ( ) ; } int dimensions = array . dimensions ; this . generateInlinedValue ( dimensions ) ; newarray ( TypeIds . T_int ) ; invokeArrayNewInstance ( ) ; invokeObjectGetClass ( ) ; } else { this . ldc ( String . valueOf ( methodBinding . declaringClass . constantPoolName ( ) ) . replace ( '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ) ; invokeClassForName ( ) ; } aastore ( ) ; if ( i < paramLength - <NUM_LIT:1> ) { dup ( ) ; } } } invokeClassGetDeclaredConstructor ( ) ; dup ( ) ; iconst_1 ( ) ; invokeAccessibleObjectSetAccessible ( ) ; } public void generateEmulationForField ( FieldBinding fieldBinding ) { this . ldc ( String . valueOf ( fieldBinding . declaringClass . constantPoolName ( ) ) . replace ( '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ) ; invokeClassForName ( ) ; this . ldc ( String . valueOf ( fieldBinding . name ) ) ; invokeClassGetDeclaredField ( ) ; dup ( ) ; iconst_1 ( ) ; invokeAccessibleObjectSetAccessible ( ) ; } public void generateEmulationForMethod ( Scope scope , MethodBinding methodBinding ) { this . ldc ( String . valueOf ( methodBinding . declaringClass . constantPoolName ( ) ) . replace ( '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ) ; invokeClassForName ( ) ; this . ldc ( String . valueOf ( methodBinding . selector ) ) ; int paramLength = methodBinding . parameters . length ; this . generateInlinedValue ( paramLength ) ; newArray ( scope . createArrayType ( scope . getType ( TypeConstants . JAVA_LANG_CLASS , <NUM_LIT:3> ) , <NUM_LIT:1> ) ) ; if ( paramLength > <NUM_LIT:0> ) { dup ( ) ; for ( int i = <NUM_LIT:0> ; i < paramLength ; i ++ ) { this . generateInlinedValue ( i ) ; TypeBinding parameter = methodBinding . parameters [ i ] ; if ( parameter . isBaseType ( ) ) { getTYPE ( parameter . id ) ; } else if ( parameter . isArrayType ( ) ) { ArrayBinding array = ( ArrayBinding ) parameter ; if ( array . leafComponentType . isBaseType ( ) ) { getTYPE ( array . leafComponentType . id ) ; } else { this . ldc ( String . valueOf ( array . leafComponentType . constantPoolName ( ) ) . replace ( '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ) ; invokeClassForName ( ) ; } int dimensions = array . dimensions ; this . generateInlinedValue ( dimensions ) ; newarray ( TypeIds . T_int ) ; invokeArrayNewInstance ( ) ; invokeObjectGetClass ( ) ; } else { this . ldc ( String . valueOf ( methodBinding . declaringClass . constantPoolName ( ) ) . replace ( '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ) ; invokeClassForName ( ) ; } aastore ( ) ; if ( i < paramLength - <NUM_LIT:1> ) { dup ( ) ; } } } invokeClassGetDeclaredMethod ( ) ; dup ( ) ; iconst_1 ( ) ; invokeAccessibleObjectSetAccessible ( ) ; } public void generateImplicitConversion ( int implicitConversionCode ) { if ( ( implicitConversionCode & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { final int typeId = implicitConversionCode & TypeIds . COMPILE_TYPE_MASK ; generateUnboxingConversion ( typeId ) ; } switch ( implicitConversionCode & TypeIds . IMPLICIT_CONVERSION_MASK ) { case TypeIds . Float2Char : f2i ( ) ; i2c ( ) ; break ; case TypeIds . Double2Char : d2i ( ) ; i2c ( ) ; break ; case TypeIds . Int2Char : case TypeIds . Short2Char : case TypeIds . Byte2Char : i2c ( ) ; break ; case TypeIds . Long2Char : l2i ( ) ; i2c ( ) ; break ; case TypeIds . Char2Float : case TypeIds . Short2Float : case TypeIds . Int2Float : case TypeIds . Byte2Float : i2f ( ) ; break ; case TypeIds . Double2Float : d2f ( ) ; break ; case TypeIds . Long2Float : l2f ( ) ; break ; case TypeIds . Float2Byte : f2i ( ) ; i2b ( ) ; break ; case TypeIds . Double2Byte : d2i ( ) ; i2b ( ) ; break ; case TypeIds . Int2Byte : case TypeIds . Short2Byte : case TypeIds . Char2Byte : i2b ( ) ; break ; case TypeIds . Long2Byte : l2i ( ) ; i2b ( ) ; break ; case TypeIds . Byte2Double : case TypeIds . Char2Double : case TypeIds . Short2Double : case TypeIds . Int2Double : i2d ( ) ; break ; case TypeIds . Float2Double : f2d ( ) ; break ; case TypeIds . Long2Double : l2d ( ) ; break ; case TypeIds . Byte2Short : case TypeIds . Char2Short : case TypeIds . Int2Short : i2s ( ) ; break ; case TypeIds . Double2Short : d2i ( ) ; i2s ( ) ; break ; case TypeIds . Long2Short : l2i ( ) ; i2s ( ) ; break ; case TypeIds . Float2Short : f2i ( ) ; i2s ( ) ; break ; case TypeIds . Double2Int : d2i ( ) ; break ; case TypeIds . Float2Int : f2i ( ) ; break ; case TypeIds . Long2Int : l2i ( ) ; break ; case TypeIds . Int2Long : case TypeIds . Char2Long : case TypeIds . Byte2Long : case TypeIds . Short2Long : i2l ( ) ; break ; case TypeIds . Double2Long : d2l ( ) ; break ; case TypeIds . Float2Long : f2l ( ) ; break ; case TypeIds . Object2boolean : case TypeIds . Object2byte : case TypeIds . Object2short : case TypeIds . Object2int : case TypeIds . Object2long : case TypeIds . Object2float : case TypeIds . Object2char : case TypeIds . Object2double : int runtimeType = ( implicitConversionCode & TypeIds . IMPLICIT_CONVERSION_MASK ) > > <NUM_LIT:4> ; checkcast ( runtimeType ) ; generateUnboxingConversion ( runtimeType ) ; break ; } if ( ( implicitConversionCode & TypeIds . BOXING ) != <NUM_LIT:0> ) { final int typeId = ( implicitConversionCode & TypeIds . IMPLICIT_CONVERSION_MASK ) > > <NUM_LIT:4> ; generateBoxingConversion ( typeId ) ; } } public void generateInlinedValue ( boolean inlinedValue ) { if ( inlinedValue ) iconst_1 ( ) ; else iconst_0 ( ) ; } public void generateInlinedValue ( byte inlinedValue ) { switch ( inlinedValue ) { case - <NUM_LIT:1> : iconst_m1 ( ) ; break ; case <NUM_LIT:0> : iconst_0 ( ) ; break ; case <NUM_LIT:1> : iconst_1 ( ) ; break ; case <NUM_LIT:2> : iconst_2 ( ) ; break ; case <NUM_LIT:3> : iconst_3 ( ) ; break ; case <NUM_LIT:4> : iconst_4 ( ) ; break ; case <NUM_LIT:5> : iconst_5 ( ) ; break ; default : if ( ( - <NUM_LIT> <= inlinedValue ) && ( inlinedValue <= <NUM_LIT> ) ) { bipush ( inlinedValue ) ; return ; } } } public void generateInlinedValue ( char inlinedValue ) { switch ( inlinedValue ) { case <NUM_LIT:0> : iconst_0 ( ) ; break ; case <NUM_LIT:1> : iconst_1 ( ) ; break ; case <NUM_LIT:2> : iconst_2 ( ) ; break ; case <NUM_LIT:3> : iconst_3 ( ) ; break ; case <NUM_LIT:4> : iconst_4 ( ) ; break ; case <NUM_LIT:5> : iconst_5 ( ) ; break ; default : if ( ( <NUM_LIT:6> <= inlinedValue ) && ( inlinedValue <= <NUM_LIT> ) ) { bipush ( ( byte ) inlinedValue ) ; return ; } if ( ( <NUM_LIT> <= inlinedValue ) && ( inlinedValue <= <NUM_LIT> ) ) { sipush ( inlinedValue ) ; return ; } this . ldc ( inlinedValue ) ; } } public void generateInlinedValue ( double inlinedValue ) { if ( inlinedValue == <NUM_LIT:0.0> ) { if ( Double . doubleToLongBits ( inlinedValue ) != <NUM_LIT> ) this . ldc2_w ( inlinedValue ) ; else dconst_0 ( ) ; return ; } if ( inlinedValue == <NUM_LIT:1.0> ) { dconst_1 ( ) ; return ; } this . ldc2_w ( inlinedValue ) ; } public void generateInlinedValue ( float inlinedValue ) { if ( inlinedValue == <NUM_LIT:0.0f> ) { if ( Float . floatToIntBits ( inlinedValue ) != <NUM_LIT:0> ) this . ldc ( inlinedValue ) ; else fconst_0 ( ) ; return ; } if ( inlinedValue == <NUM_LIT:1.0f> ) { fconst_1 ( ) ; return ; } if ( inlinedValue == <NUM_LIT> ) { fconst_2 ( ) ; return ; } this . ldc ( inlinedValue ) ; } public void generateInlinedValue ( int inlinedValue ) { switch ( inlinedValue ) { case - <NUM_LIT:1> : iconst_m1 ( ) ; break ; case <NUM_LIT:0> : iconst_0 ( ) ; break ; case <NUM_LIT:1> : iconst_1 ( ) ; break ; case <NUM_LIT:2> : iconst_2 ( ) ; break ; case <NUM_LIT:3> : iconst_3 ( ) ; break ; case <NUM_LIT:4> : iconst_4 ( ) ; break ; case <NUM_LIT:5> : iconst_5 ( ) ; break ; default : if ( ( - <NUM_LIT> <= inlinedValue ) && ( inlinedValue <= <NUM_LIT> ) ) { bipush ( ( byte ) inlinedValue ) ; return ; } if ( ( - <NUM_LIT> <= inlinedValue ) && ( inlinedValue <= <NUM_LIT> ) ) { sipush ( inlinedValue ) ; return ; } this . ldc ( inlinedValue ) ; } } public void generateInlinedValue ( long inlinedValue ) { if ( inlinedValue == <NUM_LIT:0> ) { lconst_0 ( ) ; return ; } if ( inlinedValue == <NUM_LIT:1> ) { lconst_1 ( ) ; return ; } this . ldc2_w ( inlinedValue ) ; } public void generateInlinedValue ( short inlinedValue ) { switch ( inlinedValue ) { case - <NUM_LIT:1> : iconst_m1 ( ) ; break ; case <NUM_LIT:0> : iconst_0 ( ) ; break ; case <NUM_LIT:1> : iconst_1 ( ) ; break ; case <NUM_LIT:2> : iconst_2 ( ) ; break ; case <NUM_LIT:3> : iconst_3 ( ) ; break ; case <NUM_LIT:4> : iconst_4 ( ) ; break ; case <NUM_LIT:5> : iconst_5 ( ) ; break ; default : if ( ( - <NUM_LIT> <= inlinedValue ) && ( inlinedValue <= <NUM_LIT> ) ) { bipush ( ( byte ) inlinedValue ) ; return ; } sipush ( inlinedValue ) ; } } public void generateOuterAccess ( Object [ ] mappingSequence , ASTNode invocationSite , Binding target , Scope scope ) { if ( mappingSequence == null ) { if ( target instanceof LocalVariableBinding ) { scope . problemReporter ( ) . needImplementation ( invocationSite ) ; } else { scope . problemReporter ( ) . noSuchEnclosingInstance ( ( ReferenceBinding ) target , invocationSite , false ) ; } return ; } if ( mappingSequence == BlockScope . NoEnclosingInstanceInConstructorCall ) { scope . problemReporter ( ) . noSuchEnclosingInstance ( ( ReferenceBinding ) target , invocationSite , true ) ; return ; } else if ( mappingSequence == BlockScope . NoEnclosingInstanceInStaticContext ) { scope . problemReporter ( ) . noSuchEnclosingInstance ( ( ReferenceBinding ) target , invocationSite , false ) ; return ; } if ( mappingSequence == BlockScope . EmulationPathToImplicitThis ) { aload_0 ( ) ; return ; } else if ( mappingSequence [ <NUM_LIT:0> ] instanceof FieldBinding ) { FieldBinding fieldBinding = ( FieldBinding ) mappingSequence [ <NUM_LIT:0> ] ; aload_0 ( ) ; fieldAccess ( Opcodes . OPC_getfield , fieldBinding , null ) ; } else { load ( ( LocalVariableBinding ) mappingSequence [ <NUM_LIT:0> ] ) ; } for ( int i = <NUM_LIT:1> , length = mappingSequence . length ; i < length ; i ++ ) { if ( mappingSequence [ i ] instanceof FieldBinding ) { FieldBinding fieldBinding = ( FieldBinding ) mappingSequence [ i ] ; fieldAccess ( Opcodes . OPC_getfield , fieldBinding , null ) ; } else { invoke ( Opcodes . OPC_invokestatic , ( MethodBinding ) mappingSequence [ i ] , null ) ; } } } public void generateReturnBytecode ( Expression expression ) { if ( expression == null ) { return_ ( ) ; } else { final int implicitConversion = expression . implicitConversion ; if ( ( implicitConversion & TypeIds . BOXING ) != <NUM_LIT:0> ) { areturn ( ) ; return ; } int runtimeType = ( implicitConversion & TypeIds . IMPLICIT_CONVERSION_MASK ) > > <NUM_LIT:4> ; switch ( runtimeType ) { case TypeIds . T_boolean : case TypeIds . T_int : ireturn ( ) ; break ; case TypeIds . T_float : freturn ( ) ; break ; case TypeIds . T_long : lreturn ( ) ; break ; case TypeIds . T_double : dreturn ( ) ; break ; default : areturn ( ) ; } } } public void generateStringConcatenationAppend ( BlockScope blockScope , Expression oper1 , Expression oper2 ) { int pc ; if ( oper1 == null ) { newStringContatenation ( ) ; dup_x1 ( ) ; this . swap ( ) ; invokeStringValueOf ( TypeIds . T_JavaLangObject ) ; invokeStringConcatenationStringConstructor ( ) ; } else { pc = this . position ; oper1 . generateOptimizedStringConcatenationCreation ( blockScope , this , oper1 . implicitConversion & TypeIds . COMPILE_TYPE_MASK ) ; this . recordPositionsFrom ( pc , oper1 . sourceStart ) ; } pc = this . position ; oper2 . generateOptimizedStringConcatenation ( blockScope , this , oper2 . implicitConversion & TypeIds . COMPILE_TYPE_MASK ) ; this . recordPositionsFrom ( pc , oper2 . sourceStart ) ; invokeStringConcatenationToString ( ) ; } public void generateSyntheticBodyForConstructorAccess ( SyntheticMethodBinding accessBinding ) { initializeMaxLocals ( accessBinding ) ; MethodBinding constructorBinding = accessBinding . targetMethod ; TypeBinding [ ] parameters = constructorBinding . parameters ; int length = parameters . length ; int resolvedPosition = <NUM_LIT:1> ; aload_0 ( ) ; TypeBinding declaringClass = constructorBinding . declaringClass ; if ( declaringClass . erasure ( ) . id == TypeIds . T_JavaLangEnum || declaringClass . isEnum ( ) ) { aload_1 ( ) ; iload_2 ( ) ; resolvedPosition += <NUM_LIT:2> ; } if ( declaringClass . isNestedType ( ) ) { NestedTypeBinding nestedType = ( NestedTypeBinding ) declaringClass ; SyntheticArgumentBinding [ ] syntheticArguments = nestedType . syntheticEnclosingInstances ( ) ; for ( int i = <NUM_LIT:0> ; i < ( syntheticArguments == null ? <NUM_LIT:0> : syntheticArguments . length ) ; i ++ ) { TypeBinding type ; load ( ( type = syntheticArguments [ i ] . type ) , resolvedPosition ) ; switch ( type . id ) { case TypeIds . T_long : case TypeIds . T_double : resolvedPosition += <NUM_LIT:2> ; break ; default : resolvedPosition ++ ; break ; } } } for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeBinding parameter ; load ( parameter = parameters [ i ] , resolvedPosition ) ; switch ( parameter . id ) { case TypeIds . T_long : case TypeIds . T_double : resolvedPosition += <NUM_LIT:2> ; break ; default : resolvedPosition ++ ; break ; } } if ( declaringClass . isNestedType ( ) ) { NestedTypeBinding nestedType = ( NestedTypeBinding ) declaringClass ; SyntheticArgumentBinding [ ] syntheticArguments = nestedType . syntheticOuterLocalVariables ( ) ; for ( int i = <NUM_LIT:0> ; i < ( syntheticArguments == null ? <NUM_LIT:0> : syntheticArguments . length ) ; i ++ ) { TypeBinding type ; load ( type = syntheticArguments [ i ] . type , resolvedPosition ) ; switch ( type . id ) { case TypeIds . T_long : case TypeIds . T_double : resolvedPosition += <NUM_LIT:2> ; break ; default : resolvedPosition ++ ; break ; } } } invoke ( Opcodes . OPC_invokespecial , constructorBinding , null ) ; return_ ( ) ; } public void generateSyntheticBodyForEnumValueOf ( SyntheticMethodBinding methodBinding ) { initializeMaxLocals ( methodBinding ) ; final ReferenceBinding declaringClass = methodBinding . declaringClass ; generateClassLiteralAccessForType ( declaringClass , null ) ; aload_0 ( ) ; invokeJavaLangEnumvalueOf ( declaringClass ) ; this . checkcast ( declaringClass ) ; areturn ( ) ; } public void generateSyntheticBodyForEnumValues ( SyntheticMethodBinding methodBinding ) { ClassScope scope = ( ( SourceTypeBinding ) methodBinding . declaringClass ) . scope ; initializeMaxLocals ( methodBinding ) ; TypeBinding enumArray = methodBinding . returnType ; fieldAccess ( Opcodes . OPC_getstatic , scope . referenceContext . enumValuesSyntheticfield , null ) ; dup ( ) ; astore_0 ( ) ; iconst_0 ( ) ; aload_0 ( ) ; arraylength ( ) ; dup ( ) ; istore_1 ( ) ; newArray ( ( ArrayBinding ) enumArray ) ; dup ( ) ; astore_2 ( ) ; iconst_0 ( ) ; iload_1 ( ) ; invokeSystemArraycopy ( ) ; aload_2 ( ) ; areturn ( ) ; } public void generateSyntheticBodyForEnumInitializationMethod ( SyntheticMethodBinding methodBinding ) { this . maxLocals = <NUM_LIT:0> ; SourceTypeBinding sourceTypeBinding = ( SourceTypeBinding ) methodBinding . declaringClass ; TypeDeclaration typeDeclaration = sourceTypeBinding . scope . referenceContext ; BlockScope staticInitializerScope = typeDeclaration . staticInitializerScope ; FieldDeclaration [ ] fieldDeclarations = typeDeclaration . fields ; for ( int i = methodBinding . startIndex , max = methodBinding . endIndex ; i < max ; i ++ ) { FieldDeclaration fieldDecl = fieldDeclarations [ i ] ; if ( fieldDecl . isStatic ( ) ) { if ( fieldDecl . getKind ( ) == AbstractVariableDeclaration . ENUM_CONSTANT ) { fieldDecl . generateCode ( staticInitializerScope , this ) ; } } } return_ ( ) ; } public void generateSyntheticBodyForFieldReadAccess ( SyntheticMethodBinding accessMethod ) { initializeMaxLocals ( accessMethod ) ; FieldBinding fieldBinding = accessMethod . targetReadField ; TypeBinding declaringClass = accessMethod . purpose == SyntheticMethodBinding . SuperFieldReadAccess ? accessMethod . declaringClass . superclass ( ) : accessMethod . declaringClass ; if ( fieldBinding . isStatic ( ) ) { fieldAccess ( Opcodes . OPC_getstatic , fieldBinding , declaringClass ) ; } else { aload_0 ( ) ; fieldAccess ( Opcodes . OPC_getfield , fieldBinding , declaringClass ) ; } switch ( fieldBinding . type . id ) { case TypeIds . T_boolean : case TypeIds . T_byte : case TypeIds . T_char : case TypeIds . T_short : case TypeIds . T_int : ireturn ( ) ; break ; case TypeIds . T_long : lreturn ( ) ; break ; case TypeIds . T_float : freturn ( ) ; break ; case TypeIds . T_double : dreturn ( ) ; break ; default : areturn ( ) ; } } public void generateSyntheticBodyForFieldWriteAccess ( SyntheticMethodBinding accessMethod ) { initializeMaxLocals ( accessMethod ) ; FieldBinding fieldBinding = accessMethod . targetWriteField ; TypeBinding declaringClass = accessMethod . purpose == SyntheticMethodBinding . SuperFieldWriteAccess ? accessMethod . declaringClass . superclass ( ) : accessMethod . declaringClass ; if ( fieldBinding . isStatic ( ) ) { load ( fieldBinding . type , <NUM_LIT:0> ) ; fieldAccess ( Opcodes . OPC_putstatic , fieldBinding , declaringClass ) ; } else { aload_0 ( ) ; load ( fieldBinding . type , <NUM_LIT:1> ) ; fieldAccess ( Opcodes . OPC_putfield , fieldBinding , declaringClass ) ; } return_ ( ) ; } public void generateSyntheticBodyForMethodAccess ( SyntheticMethodBinding accessMethod ) { initializeMaxLocals ( accessMethod ) ; MethodBinding targetMethod = accessMethod . targetMethod ; TypeBinding [ ] parameters = targetMethod . parameters ; int length = parameters . length ; TypeBinding [ ] arguments = accessMethod . purpose == SyntheticMethodBinding . BridgeMethod ? accessMethod . parameters : null ; int resolvedPosition ; if ( targetMethod . isStatic ( ) ) resolvedPosition = <NUM_LIT:0> ; else { aload_0 ( ) ; resolvedPosition = <NUM_LIT:1> ; } for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeBinding parameter = parameters [ i ] ; if ( arguments != null ) { TypeBinding argument = arguments [ i ] ; load ( argument , resolvedPosition ) ; if ( argument != parameter ) checkcast ( parameter ) ; } else { load ( parameter , resolvedPosition ) ; } switch ( parameter . id ) { case TypeIds . T_long : case TypeIds . T_double : resolvedPosition += <NUM_LIT:2> ; break ; default : resolvedPosition ++ ; break ; } } if ( targetMethod . isStatic ( ) ) invoke ( Opcodes . OPC_invokestatic , targetMethod , accessMethod . declaringClass ) ; else { if ( targetMethod . isConstructor ( ) || targetMethod . isPrivate ( ) || accessMethod . purpose == SyntheticMethodBinding . SuperMethodAccess ) { TypeBinding declaringClass = accessMethod . purpose == SyntheticMethodBinding . SuperMethodAccess ? accessMethod . declaringClass . superclass ( ) : accessMethod . declaringClass ; invoke ( Opcodes . OPC_invokespecial , targetMethod , declaringClass ) ; } else { if ( targetMethod . declaringClass . isInterface ( ) ) { invoke ( Opcodes . OPC_invokeinterface , targetMethod , null ) ; } else { invoke ( Opcodes . OPC_invokevirtual , targetMethod , accessMethod . declaringClass ) ; } } } switch ( targetMethod . returnType . id ) { case TypeIds . T_void : return_ ( ) ; break ; case TypeIds . T_boolean : case TypeIds . T_byte : case TypeIds . T_char : case TypeIds . T_short : case TypeIds . T_int : ireturn ( ) ; break ; case TypeIds . T_long : lreturn ( ) ; break ; case TypeIds . T_float : freturn ( ) ; break ; case TypeIds . T_double : dreturn ( ) ; break ; default : TypeBinding accessErasure = accessMethod . returnType . erasure ( ) ; TypeBinding match = targetMethod . returnType . findSuperTypeOriginatingFrom ( accessErasure ) ; if ( match == null ) { this . checkcast ( accessErasure ) ; } areturn ( ) ; } } public void generateSyntheticBodyForSwitchTable ( SyntheticMethodBinding methodBinding ) { ClassScope scope = ( ( SourceTypeBinding ) methodBinding . declaringClass ) . scope ; initializeMaxLocals ( methodBinding ) ; final BranchLabel nullLabel = new BranchLabel ( this ) ; FieldBinding syntheticFieldBinding = methodBinding . targetReadField ; fieldAccess ( Opcodes . OPC_getstatic , syntheticFieldBinding , null ) ; dup ( ) ; ifnull ( nullLabel ) ; areturn ( ) ; pushOnStack ( syntheticFieldBinding . type ) ; nullLabel . place ( ) ; pop ( ) ; ReferenceBinding enumBinding = ( ReferenceBinding ) methodBinding . targetEnumType ; ArrayBinding arrayBinding = scope . createArrayType ( enumBinding , <NUM_LIT:1> ) ; invokeJavaLangEnumValues ( enumBinding , arrayBinding ) ; arraylength ( ) ; newarray ( ClassFileConstants . INT_ARRAY ) ; astore_0 ( ) ; LocalVariableBinding localVariableBinding = new LocalVariableBinding ( "<STR_LIT>" . toCharArray ( ) , scope . createArrayType ( TypeBinding . INT , <NUM_LIT:1> ) , <NUM_LIT:0> , false ) ; addVariable ( localVariableBinding ) ; final FieldBinding [ ] fields = enumBinding . fields ( ) ; if ( fields != null ) { for ( int i = <NUM_LIT:0> , max = fields . length ; i < max ; i ++ ) { FieldBinding fieldBinding = fields [ i ] ; if ( ( fieldBinding . getAccessFlags ( ) & ClassFileConstants . AccEnum ) != <NUM_LIT:0> ) { final BranchLabel endLabel = new BranchLabel ( this ) ; final ExceptionLabel anyExceptionHandler = new ExceptionLabel ( this , TypeBinding . LONG ) ; anyExceptionHandler . placeStart ( ) ; aload_0 ( ) ; fieldAccess ( Opcodes . OPC_getstatic , fieldBinding , null ) ; invokeEnumOrdinal ( enumBinding . constantPoolName ( ) ) ; this . generateInlinedValue ( fieldBinding . id + <NUM_LIT:1> ) ; iastore ( ) ; anyExceptionHandler . placeEnd ( ) ; goto_ ( endLabel ) ; pushExceptionOnStack ( TypeBinding . LONG ) ; anyExceptionHandler . place ( ) ; pop ( ) ; endLabel . place ( ) ; } } } aload_0 ( ) ; dup ( ) ; fieldAccess ( Opcodes . OPC_putstatic , syntheticFieldBinding , null ) ; areturn ( ) ; removeVariable ( localVariableBinding ) ; } public void generateSyntheticEnclosingInstanceValues ( BlockScope currentScope , ReferenceBinding targetType , Expression enclosingInstance , ASTNode invocationSite ) { ReferenceBinding checkedTargetType = targetType . isAnonymousType ( ) ? ( ReferenceBinding ) targetType . superclass ( ) . erasure ( ) : targetType ; boolean hasExtraEnclosingInstance = enclosingInstance != null ; if ( hasExtraEnclosingInstance && ( ! checkedTargetType . isNestedType ( ) || checkedTargetType . isStatic ( ) ) ) { currentScope . problemReporter ( ) . unnecessaryEnclosingInstanceSpecification ( enclosingInstance , checkedTargetType ) ; return ; } ReferenceBinding [ ] syntheticArgumentTypes ; if ( ( syntheticArgumentTypes = targetType . syntheticEnclosingInstanceTypes ( ) ) != null ) { ReferenceBinding targetEnclosingType = checkedTargetType . enclosingType ( ) ; long compliance = currentScope . compilerOptions ( ) . complianceLevel ; boolean denyEnclosingArgInConstructorCall ; if ( compliance <= ClassFileConstants . JDK1_3 ) { denyEnclosingArgInConstructorCall = invocationSite instanceof AllocationExpression ; } else if ( compliance == ClassFileConstants . JDK1_4 ) { denyEnclosingArgInConstructorCall = invocationSite instanceof AllocationExpression || invocationSite instanceof ExplicitConstructorCall && ( ( ExplicitConstructorCall ) invocationSite ) . isSuperAccess ( ) ; } else { denyEnclosingArgInConstructorCall = ( invocationSite instanceof AllocationExpression || invocationSite instanceof ExplicitConstructorCall && ( ( ExplicitConstructorCall ) invocationSite ) . isSuperAccess ( ) ) && ! targetType . isLocalType ( ) ; } boolean complyTo14 = compliance >= ClassFileConstants . JDK1_4 ; for ( int i = <NUM_LIT:0> , max = syntheticArgumentTypes . length ; i < max ; i ++ ) { ReferenceBinding syntheticArgType = syntheticArgumentTypes [ i ] ; if ( hasExtraEnclosingInstance && syntheticArgType == targetEnclosingType ) { hasExtraEnclosingInstance = false ; enclosingInstance . generateCode ( currentScope , this , true ) ; if ( complyTo14 ) { dup ( ) ; invokeObjectGetClass ( ) ; pop ( ) ; } } else { Object [ ] emulationPath = currentScope . getEmulationPath ( syntheticArgType , false , denyEnclosingArgInConstructorCall ) ; generateOuterAccess ( emulationPath , invocationSite , syntheticArgType , currentScope ) ; } } if ( hasExtraEnclosingInstance ) { currentScope . problemReporter ( ) . unnecessaryEnclosingInstanceSpecification ( enclosingInstance , checkedTargetType ) ; } } } public void generateSyntheticOuterArgumentValues ( BlockScope currentScope , ReferenceBinding targetType , ASTNode invocationSite ) { SyntheticArgumentBinding syntheticArguments [ ] ; if ( ( syntheticArguments = targetType . syntheticOuterLocalVariables ( ) ) != null ) { for ( int i = <NUM_LIT:0> , max = syntheticArguments . length ; i < max ; i ++ ) { LocalVariableBinding targetVariable = syntheticArguments [ i ] . actualOuterLocalVariable ; VariableBinding [ ] emulationPath = currentScope . getEmulationPath ( targetVariable ) ; generateOuterAccess ( emulationPath , invocationSite , targetVariable , currentScope ) ; } } } public void generateUnboxingConversion ( int unboxedTypeID ) { switch ( unboxedTypeID ) { case TypeIds . T_byte : invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangByteConstantPoolName , ConstantPool . BYTEVALUE_BYTE_METHOD_NAME , ConstantPool . BYTEVALUE_BYTE_METHOD_SIGNATURE ) ; break ; case TypeIds . T_short : invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangShortConstantPoolName , ConstantPool . SHORTVALUE_SHORT_METHOD_NAME , ConstantPool . SHORTVALUE_SHORT_METHOD_SIGNATURE ) ; break ; case TypeIds . T_char : invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangCharacterConstantPoolName , ConstantPool . CHARVALUE_CHARACTER_METHOD_NAME , ConstantPool . CHARVALUE_CHARACTER_METHOD_SIGNATURE ) ; break ; case TypeIds . T_int : invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangIntegerConstantPoolName , ConstantPool . INTVALUE_INTEGER_METHOD_NAME , ConstantPool . INTVALUE_INTEGER_METHOD_SIGNATURE ) ; break ; case TypeIds . T_long : invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:2> , ConstantPool . JavaLangLongConstantPoolName , ConstantPool . LONGVALUE_LONG_METHOD_NAME , ConstantPool . LONGVALUE_LONG_METHOD_SIGNATURE ) ; break ; case TypeIds . T_float : invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangFloatConstantPoolName , ConstantPool . FLOATVALUE_FLOAT_METHOD_NAME , ConstantPool . FLOATVALUE_FLOAT_METHOD_SIGNATURE ) ; break ; case TypeIds . T_double : invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:2> , ConstantPool . JavaLangDoubleConstantPoolName , ConstantPool . DOUBLEVALUE_DOUBLE_METHOD_NAME , ConstantPool . DOUBLEVALUE_DOUBLE_METHOD_SIGNATURE ) ; break ; case TypeIds . T_boolean : invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangBooleanConstantPoolName , ConstantPool . BOOLEANVALUE_BOOLEAN_METHOD_NAME , ConstantPool . BOOLEANVALUE_BOOLEAN_METHOD_SIGNATURE ) ; } } public void generateWideRevertedConditionalBranch ( byte revertedOpcode , BranchLabel wideTarget ) { BranchLabel intermediate = new BranchLabel ( this ) ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = revertedOpcode ; intermediate . branch ( ) ; goto_w ( wideTarget ) ; intermediate . place ( ) ; } public void getBaseTypeValue ( int baseTypeID ) { switch ( baseTypeID ) { case TypeIds . T_byte : invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangByteConstantPoolName , ConstantPool . BYTEVALUE_BYTE_METHOD_NAME , ConstantPool . BYTEVALUE_BYTE_METHOD_SIGNATURE ) ; break ; case TypeIds . T_short : invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangShortConstantPoolName , ConstantPool . SHORTVALUE_SHORT_METHOD_NAME , ConstantPool . SHORTVALUE_SHORT_METHOD_SIGNATURE ) ; break ; case TypeIds . T_char : invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangCharacterConstantPoolName , ConstantPool . CHARVALUE_CHARACTER_METHOD_NAME , ConstantPool . CHARVALUE_CHARACTER_METHOD_SIGNATURE ) ; break ; case TypeIds . T_int : invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangIntegerConstantPoolName , ConstantPool . INTVALUE_INTEGER_METHOD_NAME , ConstantPool . INTVALUE_INTEGER_METHOD_SIGNATURE ) ; break ; case TypeIds . T_long : invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:2> , ConstantPool . JavaLangLongConstantPoolName , ConstantPool . LONGVALUE_LONG_METHOD_NAME , ConstantPool . LONGVALUE_LONG_METHOD_SIGNATURE ) ; break ; case TypeIds . T_float : invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangFloatConstantPoolName , ConstantPool . FLOATVALUE_FLOAT_METHOD_NAME , ConstantPool . FLOATVALUE_FLOAT_METHOD_SIGNATURE ) ; break ; case TypeIds . T_double : invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:2> , ConstantPool . JavaLangDoubleConstantPoolName , ConstantPool . DOUBLEVALUE_DOUBLE_METHOD_NAME , ConstantPool . DOUBLEVALUE_DOUBLE_METHOD_SIGNATURE ) ; break ; case TypeIds . T_boolean : invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangBooleanConstantPoolName , ConstantPool . BOOLEANVALUE_BOOLEAN_METHOD_NAME , ConstantPool . BOOLEANVALUE_BOOLEAN_METHOD_SIGNATURE ) ; } } final public byte [ ] getContents ( ) { byte [ ] contents ; System . arraycopy ( this . bCodeStream , <NUM_LIT:0> , contents = new byte [ this . position ] , <NUM_LIT:0> , this . position ) ; return contents ; } public static TypeBinding getConstantPoolDeclaringClass ( Scope currentScope , FieldBinding codegenBinding , TypeBinding actualReceiverType , boolean isImplicitThisReceiver ) { ReferenceBinding constantPoolDeclaringClass = codegenBinding . declaringClass ; if ( constantPoolDeclaringClass != actualReceiverType . erasure ( ) && ! actualReceiverType . isArrayType ( ) && constantPoolDeclaringClass != null && codegenBinding . constant ( ) == Constant . NotAConstant ) { CompilerOptions options = currentScope . compilerOptions ( ) ; if ( ( options . targetJDK >= ClassFileConstants . JDK1_2 && ( options . complianceLevel >= ClassFileConstants . JDK1_4 || ! ( isImplicitThisReceiver && codegenBinding . isStatic ( ) ) ) && constantPoolDeclaringClass . id != TypeIds . T_JavaLangObject ) || ! constantPoolDeclaringClass . canBeSeenBy ( currentScope ) ) { return actualReceiverType . erasure ( ) ; } } return constantPoolDeclaringClass ; } public static TypeBinding getConstantPoolDeclaringClass ( Scope currentScope , MethodBinding codegenBinding , TypeBinding actualReceiverType , boolean isImplicitThisReceiver ) { TypeBinding constantPoolDeclaringClass = codegenBinding . declaringClass ; if ( codegenBinding == currentScope . environment ( ) . arrayClone ) { CompilerOptions options = currentScope . compilerOptions ( ) ; if ( options . sourceLevel > ClassFileConstants . JDK1_4 ) { constantPoolDeclaringClass = actualReceiverType . erasure ( ) ; } } else { if ( constantPoolDeclaringClass != actualReceiverType . erasure ( ) && ! actualReceiverType . isArrayType ( ) ) { CompilerOptions options = currentScope . compilerOptions ( ) ; if ( ( options . targetJDK >= ClassFileConstants . JDK1_2 && ( options . complianceLevel >= ClassFileConstants . JDK1_4 || ! ( isImplicitThisReceiver && codegenBinding . isStatic ( ) ) ) && codegenBinding . declaringClass . id != TypeIds . T_JavaLangObject ) || ! codegenBinding . declaringClass . canBeSeenBy ( currentScope ) ) { constantPoolDeclaringClass = actualReceiverType . erasure ( ) ; } } } return constantPoolDeclaringClass ; } protected int getPosition ( ) { return this . position ; } public void getTYPE ( int baseTypeID ) { this . countLabels = <NUM_LIT:0> ; switch ( baseTypeID ) { case TypeIds . T_byte : fieldAccess ( Opcodes . OPC_getstatic , <NUM_LIT:1> , ConstantPool . JavaLangByteConstantPoolName , ConstantPool . TYPE , ConstantPool . JavaLangClassSignature ) ; break ; case TypeIds . T_short : fieldAccess ( Opcodes . OPC_getstatic , <NUM_LIT:1> , ConstantPool . JavaLangShortConstantPoolName , ConstantPool . TYPE , ConstantPool . JavaLangClassSignature ) ; break ; case TypeIds . T_char : fieldAccess ( Opcodes . OPC_getstatic , <NUM_LIT:1> , ConstantPool . JavaLangCharacterConstantPoolName , ConstantPool . TYPE , ConstantPool . JavaLangClassSignature ) ; break ; case TypeIds . T_int : fieldAccess ( Opcodes . OPC_getstatic , <NUM_LIT:1> , ConstantPool . JavaLangIntegerConstantPoolName , ConstantPool . TYPE , ConstantPool . JavaLangClassSignature ) ; break ; case TypeIds . T_long : fieldAccess ( Opcodes . OPC_getstatic , <NUM_LIT:1> , ConstantPool . JavaLangLongConstantPoolName , ConstantPool . TYPE , ConstantPool . JavaLangClassSignature ) ; break ; case TypeIds . T_float : fieldAccess ( Opcodes . OPC_getstatic , <NUM_LIT:1> , ConstantPool . JavaLangFloatConstantPoolName , ConstantPool . TYPE , ConstantPool . JavaLangClassSignature ) ; break ; case TypeIds . T_double : fieldAccess ( Opcodes . OPC_getstatic , <NUM_LIT:1> , ConstantPool . JavaLangDoubleConstantPoolName , ConstantPool . TYPE , ConstantPool . JavaLangClassSignature ) ; break ; case TypeIds . T_boolean : fieldAccess ( Opcodes . OPC_getstatic , <NUM_LIT:1> , ConstantPool . JavaLangBooleanConstantPoolName , ConstantPool . TYPE , ConstantPool . JavaLangClassSignature ) ; break ; case TypeIds . T_void : fieldAccess ( Opcodes . OPC_getstatic , <NUM_LIT:1> , ConstantPool . JavaLangVoidConstantPoolName , ConstantPool . TYPE , ConstantPool . JavaLangClassSignature ) ; break ; } } public void goto_ ( BranchLabel label ) { if ( this . wideMode ) { goto_w ( label ) ; return ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } boolean chained = inlineForwardReferencesFromLabelsTargeting ( label , this . position ) ; if ( chained && this . lastAbruptCompletion == this . position ) { if ( label . position != Label . POS_NOT_SET ) { int [ ] forwardRefs = label . forwardReferences ( ) ; for ( int i = <NUM_LIT:0> , max = label . forwardReferenceCount ( ) ; i < max ; i ++ ) { this . writePosition ( label , forwardRefs [ i ] ) ; } this . countLabels = <NUM_LIT:0> ; } return ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_goto ; label . branch ( ) ; this . lastAbruptCompletion = this . position ; } public void goto_w ( BranchLabel label ) { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_goto_w ; label . branchWide ( ) ; this . lastAbruptCompletion = this . position ; } public void i2b ( ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_i2b ; } public void i2c ( ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_i2c ; } public void i2d ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_i2d ; } public void i2f ( ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_i2f ; } public void i2l ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_i2l ; } public void i2s ( ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_i2s ; } public void iadd ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iadd ; } public void iaload ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iaload ; } public void iand ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iand ; } public void iastore ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:3> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iastore ; } public void iconst_0 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iconst_0 ; } public void iconst_1 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iconst_1 ; } public void iconst_2 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iconst_2 ; } public void iconst_3 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iconst_3 ; } public void iconst_4 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iconst_4 ; } public void iconst_5 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iconst_5 ; } public void iconst_m1 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iconst_m1 ; } public void idiv ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_idiv ; } public void if_acmpeq ( BranchLabel lbl ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . wideMode ) { generateWideRevertedConditionalBranch ( Opcodes . OPC_if_acmpne , lbl ) ; } else { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_if_acmpeq ; lbl . branch ( ) ; } } public void if_acmpne ( BranchLabel lbl ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . wideMode ) { generateWideRevertedConditionalBranch ( Opcodes . OPC_if_acmpeq , lbl ) ; } else { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_if_acmpne ; lbl . branch ( ) ; } } public void if_icmpeq ( BranchLabel lbl ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . wideMode ) { generateWideRevertedConditionalBranch ( Opcodes . OPC_if_icmpne , lbl ) ; } else { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_if_icmpeq ; lbl . branch ( ) ; } } public void if_icmpge ( BranchLabel lbl ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . wideMode ) { generateWideRevertedConditionalBranch ( Opcodes . OPC_if_icmplt , lbl ) ; } else { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_if_icmpge ; lbl . branch ( ) ; } } public void if_icmpgt ( BranchLabel lbl ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . wideMode ) { generateWideRevertedConditionalBranch ( Opcodes . OPC_if_icmple , lbl ) ; } else { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_if_icmpgt ; lbl . branch ( ) ; } } public void if_icmple ( BranchLabel lbl ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . wideMode ) { generateWideRevertedConditionalBranch ( Opcodes . OPC_if_icmpgt , lbl ) ; } else { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_if_icmple ; lbl . branch ( ) ; } } public void if_icmplt ( BranchLabel lbl ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . wideMode ) { generateWideRevertedConditionalBranch ( Opcodes . OPC_if_icmpge , lbl ) ; } else { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_if_icmplt ; lbl . branch ( ) ; } } public void if_icmpne ( BranchLabel lbl ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . wideMode ) { generateWideRevertedConditionalBranch ( Opcodes . OPC_if_icmpeq , lbl ) ; } else { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_if_icmpne ; lbl . branch ( ) ; } } public void ifeq ( BranchLabel lbl ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . wideMode ) { generateWideRevertedConditionalBranch ( Opcodes . OPC_ifne , lbl ) ; } else { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ifeq ; lbl . branch ( ) ; } } public void ifge ( BranchLabel lbl ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . wideMode ) { generateWideRevertedConditionalBranch ( Opcodes . OPC_iflt , lbl ) ; } else { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ifge ; lbl . branch ( ) ; } } public void ifgt ( BranchLabel lbl ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . wideMode ) { generateWideRevertedConditionalBranch ( Opcodes . OPC_ifle , lbl ) ; } else { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ifgt ; lbl . branch ( ) ; } } public void ifle ( BranchLabel lbl ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . wideMode ) { generateWideRevertedConditionalBranch ( Opcodes . OPC_ifgt , lbl ) ; } else { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ifle ; lbl . branch ( ) ; } } public void iflt ( BranchLabel lbl ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . wideMode ) { generateWideRevertedConditionalBranch ( Opcodes . OPC_ifge , lbl ) ; } else { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iflt ; lbl . branch ( ) ; } } public void ifne ( BranchLabel lbl ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . wideMode ) { generateWideRevertedConditionalBranch ( Opcodes . OPC_ifeq , lbl ) ; } else { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ifne ; lbl . branch ( ) ; } } public void ifnonnull ( BranchLabel lbl ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . wideMode ) { generateWideRevertedConditionalBranch ( Opcodes . OPC_ifnull , lbl ) ; } else { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ifnonnull ; lbl . branch ( ) ; } } public void ifnull ( BranchLabel lbl ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . wideMode ) { generateWideRevertedConditionalBranch ( Opcodes . OPC_ifnonnull , lbl ) ; } else { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ifnull ; lbl . branch ( ) ; } } final public void iinc ( int index , int value ) { this . countLabels = <NUM_LIT:0> ; if ( ( index > <NUM_LIT:255> ) || ( value < - <NUM_LIT> || value > <NUM_LIT> ) ) { if ( this . classFileOffset + <NUM_LIT:3> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_wide ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iinc ; writeUnsignedShort ( index ) ; writeSignedShort ( value ) ; } else { if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:3> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iinc ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) index ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) value ; } } public void iload ( int iArg ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . maxLocals <= iArg ) { this . maxLocals = iArg + <NUM_LIT:1> ; } if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( iArg > <NUM_LIT:255> ) { if ( this . classFileOffset + <NUM_LIT:3> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_wide ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iload ; writeUnsignedShort ( iArg ) ; } else { if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iload ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) iArg ; } } public void iload_0 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . maxLocals <= <NUM_LIT:0> ) { this . maxLocals = <NUM_LIT:1> ; } if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iload_0 ; } public void iload_1 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . maxLocals <= <NUM_LIT:1> ) { this . maxLocals = <NUM_LIT:2> ; } if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iload_1 ; } public void iload_2 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . maxLocals <= <NUM_LIT:2> ) { this . maxLocals = <NUM_LIT:3> ; } if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iload_2 ; } public void iload_3 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . maxLocals <= <NUM_LIT:3> ) { this . maxLocals = <NUM_LIT:4> ; } if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iload_3 ; } public void imul ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_imul ; } public int indexOfSameLineEntrySincePC ( int pc , int line ) { for ( int index = pc , max = this . pcToSourceMapSize ; index < max ; index += <NUM_LIT:2> ) { if ( this . pcToSourceMap [ index + <NUM_LIT:1> ] == line ) return index ; } return - <NUM_LIT:1> ; } public void ineg ( ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ineg ; } public void init ( ClassFile targetClassFile ) { this . classFile = targetClassFile ; this . constantPool = targetClassFile . constantPool ; this . bCodeStream = targetClassFile . contents ; this . classFileOffset = targetClassFile . contentsOffset ; this . startingClassFileOffset = this . classFileOffset ; this . pcToSourceMapSize = <NUM_LIT:0> ; this . lastEntryPC = <NUM_LIT:0> ; int length = this . visibleLocals . length ; if ( noVisibleLocals . length < length ) { noVisibleLocals = new LocalVariableBinding [ length ] ; } System . arraycopy ( noVisibleLocals , <NUM_LIT:0> , this . visibleLocals , <NUM_LIT:0> , length ) ; this . visibleLocalsCount = <NUM_LIT:0> ; length = this . locals . length ; if ( noLocals . length < length ) { noLocals = new LocalVariableBinding [ length ] ; } System . arraycopy ( noLocals , <NUM_LIT:0> , this . locals , <NUM_LIT:0> , length ) ; this . allLocalsCounter = <NUM_LIT:0> ; length = this . exceptionLabels . length ; if ( noExceptionHandlers . length < length ) { noExceptionHandlers = new ExceptionLabel [ length ] ; } System . arraycopy ( noExceptionHandlers , <NUM_LIT:0> , this . exceptionLabels , <NUM_LIT:0> , length ) ; this . exceptionLabelsCounter = <NUM_LIT:0> ; length = this . labels . length ; if ( noLabels . length < length ) { noLabels = new BranchLabel [ length ] ; } System . arraycopy ( noLabels , <NUM_LIT:0> , this . labels , <NUM_LIT:0> , length ) ; this . countLabels = <NUM_LIT:0> ; this . lastAbruptCompletion = - <NUM_LIT:1> ; this . stackMax = <NUM_LIT:0> ; this . stackDepth = <NUM_LIT:0> ; this . maxLocals = <NUM_LIT:0> ; this . position = <NUM_LIT:0> ; } public void initializeMaxLocals ( MethodBinding methodBinding ) { if ( methodBinding == null ) { this . maxLocals = <NUM_LIT:0> ; return ; } this . maxLocals = methodBinding . isStatic ( ) ? <NUM_LIT:0> : <NUM_LIT:1> ; ReferenceBinding declaringClass = methodBinding . declaringClass ; if ( methodBinding . isConstructor ( ) && declaringClass . isEnum ( ) ) { this . maxLocals += <NUM_LIT:2> ; } if ( methodBinding . isConstructor ( ) && declaringClass . isNestedType ( ) ) { this . maxLocals += declaringClass . getEnclosingInstancesSlotSize ( ) ; this . maxLocals += declaringClass . getOuterLocalVariablesSlotSize ( ) ; } TypeBinding [ ] parameterTypes ; if ( ( parameterTypes = methodBinding . parameters ) != null ) { for ( int i = <NUM_LIT:0> , max = parameterTypes . length ; i < max ; i ++ ) { switch ( parameterTypes [ i ] . id ) { case TypeIds . T_long : case TypeIds . T_double : this . maxLocals += <NUM_LIT:2> ; break ; default : this . maxLocals ++ ; } } } } public boolean inlineForwardReferencesFromLabelsTargeting ( BranchLabel targetLabel , int gotoLocation ) { if ( targetLabel . delegate != null ) return false ; int chaining = L_UNKNOWN ; for ( int i = this . countLabels - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) { BranchLabel currentLabel = this . labels [ i ] ; if ( currentLabel . position != gotoLocation ) break ; if ( currentLabel == targetLabel ) { chaining |= L_CANNOT_OPTIMIZE ; continue ; } if ( currentLabel . isStandardLabel ( ) ) { if ( currentLabel . delegate != null ) continue ; targetLabel . becomeDelegateFor ( currentLabel ) ; chaining |= L_OPTIMIZABLE ; continue ; } chaining |= L_CANNOT_OPTIMIZE ; } return ( chaining & ( L_OPTIMIZABLE | L_CANNOT_OPTIMIZE ) ) == L_OPTIMIZABLE ; } public void instance_of ( TypeBinding typeBinding ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_instanceof ; writeUnsignedShort ( this . constantPool . literalIndexForType ( typeBinding ) ) ; } protected void invoke ( byte opcode , int receiverAndArgsSize , int returnTypeSize , char [ ] declaringClass , char [ ] selector , char [ ] signature ) { this . countLabels = <NUM_LIT:0> ; if ( opcode == Opcodes . OPC_invokeinterface ) { if ( this . classFileOffset + <NUM_LIT:4> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:3> ; this . bCodeStream [ this . classFileOffset ++ ] = opcode ; writeUnsignedShort ( this . constantPool . literalIndexForMethod ( declaringClass , selector , signature , true ) ) ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) receiverAndArgsSize ; this . bCodeStream [ this . classFileOffset ++ ] = <NUM_LIT:0> ; } else { if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = opcode ; writeUnsignedShort ( this . constantPool . literalIndexForMethod ( declaringClass , selector , signature , false ) ) ; } this . stackDepth += returnTypeSize - receiverAndArgsSize ; if ( this . stackDepth > this . stackMax ) { this . stackMax = this . stackDepth ; } } public void invoke ( byte opcode , MethodBinding methodBinding , TypeBinding declaringClass ) { if ( declaringClass == null ) declaringClass = methodBinding . declaringClass ; if ( ( declaringClass . tagBits & TagBits . ContainsNestedTypeReferences ) != <NUM_LIT:0> ) { Util . recordNestedType ( this . classFile , declaringClass ) ; } int receiverAndArgsSize ; switch ( opcode ) { case Opcodes . OPC_invokestatic : receiverAndArgsSize = <NUM_LIT:0> ; break ; case Opcodes . OPC_invokeinterface : case Opcodes . OPC_invokevirtual : receiverAndArgsSize = <NUM_LIT:1> ; break ; case Opcodes . OPC_invokespecial : receiverAndArgsSize = <NUM_LIT:1> ; if ( methodBinding . isConstructor ( ) ) { if ( declaringClass . isNestedType ( ) ) { ReferenceBinding nestedType = ( ReferenceBinding ) declaringClass ; receiverAndArgsSize += nestedType . getEnclosingInstancesSlotSize ( ) ; SyntheticArgumentBinding [ ] syntheticArguments = nestedType . syntheticOuterLocalVariables ( ) ; if ( syntheticArguments != null ) { for ( int i = <NUM_LIT:0> , max = syntheticArguments . length ; i < max ; i ++ ) { switch ( syntheticArguments [ i ] . id ) { case TypeIds . T_double : case TypeIds . T_long : receiverAndArgsSize += <NUM_LIT:2> ; break ; default : receiverAndArgsSize ++ ; break ; } } } } if ( declaringClass . isEnum ( ) ) { receiverAndArgsSize += <NUM_LIT:2> ; } } break ; default : return ; } for ( int i = methodBinding . parameters . length - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) { switch ( methodBinding . parameters [ i ] . id ) { case TypeIds . T_double : case TypeIds . T_long : receiverAndArgsSize += <NUM_LIT:2> ; break ; default : receiverAndArgsSize ++ ; break ; } } int returnTypeSize ; switch ( methodBinding . returnType . id ) { case TypeIds . T_double : case TypeIds . T_long : returnTypeSize = <NUM_LIT:2> ; break ; case TypeIds . T_void : returnTypeSize = <NUM_LIT:0> ; break ; default : returnTypeSize = <NUM_LIT:1> ; break ; } invoke ( opcode , receiverAndArgsSize , returnTypeSize , declaringClass . constantPoolName ( ) , methodBinding . selector , methodBinding . signature ( this . classFile ) ) ; } protected void invokeAccessibleObjectSetAccessible ( ) { invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:2> , <NUM_LIT:0> , ConstantPool . JAVALANGREFLECTACCESSIBLEOBJECT_CONSTANTPOOLNAME , ConstantPool . SETACCESSIBLE_NAME , ConstantPool . SETACCESSIBLE_SIGNATURE ) ; } protected void invokeArrayNewInstance ( ) { invoke ( Opcodes . OPC_invokestatic , <NUM_LIT:2> , <NUM_LIT:1> , ConstantPool . JAVALANGREFLECTARRAY_CONSTANTPOOLNAME , ConstantPool . NewInstance , ConstantPool . NewInstanceSignature ) ; } public void invokeClassForName ( ) { invoke ( Opcodes . OPC_invokestatic , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangClassConstantPoolName , ConstantPool . ForName , ConstantPool . ForNameSignature ) ; } protected void invokeClassGetDeclaredConstructor ( ) { invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:2> , <NUM_LIT:1> , ConstantPool . JavaLangClassConstantPoolName , ConstantPool . GETDECLAREDCONSTRUCTOR_NAME , ConstantPool . GETDECLAREDCONSTRUCTOR_SIGNATURE ) ; } protected void invokeClassGetDeclaredField ( ) { invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:2> , <NUM_LIT:1> , ConstantPool . JavaLangClassConstantPoolName , ConstantPool . GETDECLAREDFIELD_NAME , ConstantPool . GETDECLAREDFIELD_SIGNATURE ) ; } protected void invokeClassGetDeclaredMethod ( ) { invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:3> , <NUM_LIT:1> , ConstantPool . JavaLangClassConstantPoolName , ConstantPool . GETDECLAREDMETHOD_NAME , ConstantPool . GETDECLAREDMETHOD_SIGNATURE ) ; } public void invokeEnumOrdinal ( char [ ] enumTypeConstantPoolName ) { invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , enumTypeConstantPoolName , ConstantPool . Ordinal , ConstantPool . OrdinalSignature ) ; } public void invokeIterableIterator ( TypeBinding iterableReceiverType ) { if ( ( iterableReceiverType . tagBits & TagBits . ContainsNestedTypeReferences ) != <NUM_LIT:0> ) { Util . recordNestedType ( this . classFile , iterableReceiverType ) ; } invoke ( iterableReceiverType . isInterface ( ) ? Opcodes . OPC_invokeinterface : Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , iterableReceiverType . constantPoolName ( ) , ConstantPool . ITERATOR_NAME , ConstantPool . ITERATOR_SIGNATURE ) ; } public void invokeAutoCloseableClose ( TypeBinding resourceType ) { invoke ( resourceType . isInterface ( ) ? Opcodes . OPC_invokeinterface : Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:0> , resourceType . constantPoolName ( ) , ConstantPool . Close , ConstantPool . CloseSignature ) ; } public void invokeThrowableAddSuppressed ( ) { invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:2> , <NUM_LIT:0> , ConstantPool . JavaLangThrowableConstantPoolName , ConstantPool . AddSuppressed , ConstantPool . AddSuppressedSignature ) ; } public void invokeJavaLangAssertionErrorConstructor ( int typeBindingID ) { int receiverAndArgsSize ; char [ ] signature ; switch ( typeBindingID ) { case TypeIds . T_int : case TypeIds . T_byte : case TypeIds . T_short : signature = ConstantPool . IntConstrSignature ; receiverAndArgsSize = <NUM_LIT:2> ; break ; case TypeIds . T_long : signature = ConstantPool . LongConstrSignature ; receiverAndArgsSize = <NUM_LIT:3> ; break ; case TypeIds . T_float : signature = ConstantPool . FloatConstrSignature ; receiverAndArgsSize = <NUM_LIT:2> ; break ; case TypeIds . T_double : signature = ConstantPool . DoubleConstrSignature ; receiverAndArgsSize = <NUM_LIT:3> ; break ; case TypeIds . T_char : signature = ConstantPool . CharConstrSignature ; receiverAndArgsSize = <NUM_LIT:2> ; break ; case TypeIds . T_boolean : signature = ConstantPool . BooleanConstrSignature ; receiverAndArgsSize = <NUM_LIT:2> ; break ; case TypeIds . T_JavaLangObject : case TypeIds . T_JavaLangString : case TypeIds . T_null : signature = ConstantPool . ObjectConstrSignature ; receiverAndArgsSize = <NUM_LIT:2> ; break ; default : return ; } invoke ( Opcodes . OPC_invokespecial , receiverAndArgsSize , <NUM_LIT:0> , ConstantPool . JavaLangAssertionErrorConstantPoolName , ConstantPool . Init , signature ) ; } public void invokeJavaLangAssertionErrorDefaultConstructor ( ) { invoke ( Opcodes . OPC_invokespecial , <NUM_LIT:1> , <NUM_LIT:0> , ConstantPool . JavaLangAssertionErrorConstantPoolName , ConstantPool . Init , ConstantPool . DefaultConstructorSignature ) ; } public void invokeJavaLangClassDesiredAssertionStatus ( ) { invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangClassConstantPoolName , ConstantPool . DesiredAssertionStatus , ConstantPool . DesiredAssertionStatusSignature ) ; } public void invokeJavaLangEnumvalueOf ( ReferenceBinding binding ) { invoke ( Opcodes . OPC_invokestatic , <NUM_LIT:2> , <NUM_LIT:1> , ConstantPool . JavaLangEnumConstantPoolName , ConstantPool . ValueOf , ConstantPool . ValueOfStringClassSignature ) ; } public void invokeJavaLangEnumValues ( TypeBinding enumBinding , ArrayBinding arrayBinding ) { char [ ] signature = "<STR_LIT>" . toCharArray ( ) ; signature = CharOperation . concat ( signature , arrayBinding . constantPoolName ( ) ) ; invoke ( Opcodes . OPC_invokestatic , <NUM_LIT:0> , <NUM_LIT:1> , enumBinding . constantPoolName ( ) , TypeConstants . VALUES , signature ) ; } public void invokeJavaLangErrorConstructor ( ) { invoke ( Opcodes . OPC_invokespecial , <NUM_LIT:2> , <NUM_LIT:0> , ConstantPool . JavaLangErrorConstantPoolName , ConstantPool . Init , ConstantPool . StringConstructorSignature ) ; } public void invokeJavaLangReflectConstructorNewInstance ( ) { invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:2> , <NUM_LIT:1> , ConstantPool . JavaLangReflectConstructorConstantPoolName , ConstantPool . NewInstance , ConstantPool . JavaLangReflectConstructorNewInstanceSignature ) ; } protected void invokeJavaLangReflectFieldGetter ( int typeID ) { char [ ] selector ; char [ ] signature ; int returnTypeSize ; switch ( typeID ) { case TypeIds . T_int : selector = ConstantPool . GET_INT_METHOD_NAME ; signature = ConstantPool . GET_INT_METHOD_SIGNATURE ; returnTypeSize = <NUM_LIT:1> ; break ; case TypeIds . T_byte : selector = ConstantPool . GET_BYTE_METHOD_NAME ; signature = ConstantPool . GET_BYTE_METHOD_SIGNATURE ; returnTypeSize = <NUM_LIT:1> ; break ; case TypeIds . T_short : selector = ConstantPool . GET_SHORT_METHOD_NAME ; signature = ConstantPool . GET_SHORT_METHOD_SIGNATURE ; returnTypeSize = <NUM_LIT:1> ; break ; case TypeIds . T_long : selector = ConstantPool . GET_LONG_METHOD_NAME ; signature = ConstantPool . GET_LONG_METHOD_SIGNATURE ; returnTypeSize = <NUM_LIT:2> ; break ; case TypeIds . T_float : selector = ConstantPool . GET_FLOAT_METHOD_NAME ; signature = ConstantPool . GET_FLOAT_METHOD_SIGNATURE ; returnTypeSize = <NUM_LIT:1> ; break ; case TypeIds . T_double : selector = ConstantPool . GET_DOUBLE_METHOD_NAME ; signature = ConstantPool . GET_DOUBLE_METHOD_SIGNATURE ; returnTypeSize = <NUM_LIT:2> ; break ; case TypeIds . T_char : selector = ConstantPool . GET_CHAR_METHOD_NAME ; signature = ConstantPool . GET_CHAR_METHOD_SIGNATURE ; returnTypeSize = <NUM_LIT:1> ; break ; case TypeIds . T_boolean : selector = ConstantPool . GET_BOOLEAN_METHOD_NAME ; signature = ConstantPool . GET_BOOLEAN_METHOD_SIGNATURE ; returnTypeSize = <NUM_LIT:1> ; break ; default : selector = ConstantPool . GET_OBJECT_METHOD_NAME ; signature = ConstantPool . GET_OBJECT_METHOD_SIGNATURE ; returnTypeSize = <NUM_LIT:1> ; break ; } invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:2> , returnTypeSize , ConstantPool . JAVALANGREFLECTFIELD_CONSTANTPOOLNAME , selector , signature ) ; } protected void invokeJavaLangReflectFieldSetter ( int typeID ) { char [ ] selector ; char [ ] signature ; int receiverAndArgsSize ; switch ( typeID ) { case TypeIds . T_int : selector = ConstantPool . SET_INT_METHOD_NAME ; signature = ConstantPool . SET_INT_METHOD_SIGNATURE ; receiverAndArgsSize = <NUM_LIT:3> ; break ; case TypeIds . T_byte : selector = ConstantPool . SET_BYTE_METHOD_NAME ; signature = ConstantPool . SET_BYTE_METHOD_SIGNATURE ; receiverAndArgsSize = <NUM_LIT:3> ; break ; case TypeIds . T_short : selector = ConstantPool . SET_SHORT_METHOD_NAME ; signature = ConstantPool . SET_SHORT_METHOD_SIGNATURE ; receiverAndArgsSize = <NUM_LIT:3> ; break ; case TypeIds . T_long : selector = ConstantPool . SET_LONG_METHOD_NAME ; signature = ConstantPool . SET_LONG_METHOD_SIGNATURE ; receiverAndArgsSize = <NUM_LIT:4> ; break ; case TypeIds . T_float : selector = ConstantPool . SET_FLOAT_METHOD_NAME ; signature = ConstantPool . SET_FLOAT_METHOD_SIGNATURE ; receiverAndArgsSize = <NUM_LIT:3> ; break ; case TypeIds . T_double : selector = ConstantPool . SET_DOUBLE_METHOD_NAME ; signature = ConstantPool . SET_DOUBLE_METHOD_SIGNATURE ; receiverAndArgsSize = <NUM_LIT:4> ; break ; case TypeIds . T_char : selector = ConstantPool . SET_CHAR_METHOD_NAME ; signature = ConstantPool . SET_CHAR_METHOD_SIGNATURE ; receiverAndArgsSize = <NUM_LIT:3> ; break ; case TypeIds . T_boolean : selector = ConstantPool . SET_BOOLEAN_METHOD_NAME ; signature = ConstantPool . SET_BOOLEAN_METHOD_SIGNATURE ; receiverAndArgsSize = <NUM_LIT:3> ; break ; default : selector = ConstantPool . SET_OBJECT_METHOD_NAME ; signature = ConstantPool . SET_OBJECT_METHOD_SIGNATURE ; receiverAndArgsSize = <NUM_LIT:3> ; break ; } invoke ( Opcodes . OPC_invokevirtual , receiverAndArgsSize , <NUM_LIT:0> , ConstantPool . JAVALANGREFLECTFIELD_CONSTANTPOOLNAME , selector , signature ) ; } public void invokeJavaLangReflectMethodInvoke ( ) { invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:3> , <NUM_LIT:1> , ConstantPool . JAVALANGREFLECTMETHOD_CONSTANTPOOLNAME , ConstantPool . INVOKE_METHOD_METHOD_NAME , ConstantPool . INVOKE_METHOD_METHOD_SIGNATURE ) ; } public void invokeJavaUtilIteratorHasNext ( ) { invoke ( Opcodes . OPC_invokeinterface , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaUtilIteratorConstantPoolName , ConstantPool . HasNext , ConstantPool . HasNextSignature ) ; } public void invokeJavaUtilIteratorNext ( ) { invoke ( Opcodes . OPC_invokeinterface , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaUtilIteratorConstantPoolName , ConstantPool . Next , ConstantPool . NextSignature ) ; } public void invokeNoClassDefFoundErrorStringConstructor ( ) { invoke ( Opcodes . OPC_invokespecial , <NUM_LIT:2> , <NUM_LIT:0> , ConstantPool . JavaLangNoClassDefFoundErrorConstantPoolName , ConstantPool . Init , ConstantPool . StringConstructorSignature ) ; } public void invokeObjectGetClass ( ) { invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangObjectConstantPoolName , ConstantPool . GetClass , ConstantPool . GetClassSignature ) ; } public void invokeStringConcatenationAppendForType ( int typeID ) { int receiverAndArgsSize ; char [ ] declaringClass = null ; char [ ] selector = ConstantPool . Append ; char [ ] signature = null ; switch ( typeID ) { case TypeIds . T_int : case TypeIds . T_byte : case TypeIds . T_short : if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { declaringClass = ConstantPool . JavaLangStringBuilderConstantPoolName ; signature = ConstantPool . StringBuilderAppendIntSignature ; } else { declaringClass = ConstantPool . JavaLangStringBufferConstantPoolName ; signature = ConstantPool . StringBufferAppendIntSignature ; } receiverAndArgsSize = <NUM_LIT:2> ; break ; case TypeIds . T_long : if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { declaringClass = ConstantPool . JavaLangStringBuilderConstantPoolName ; signature = ConstantPool . StringBuilderAppendLongSignature ; } else { declaringClass = ConstantPool . JavaLangStringBufferConstantPoolName ; signature = ConstantPool . StringBufferAppendLongSignature ; } receiverAndArgsSize = <NUM_LIT:3> ; break ; case TypeIds . T_float : if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { declaringClass = ConstantPool . JavaLangStringBuilderConstantPoolName ; signature = ConstantPool . StringBuilderAppendFloatSignature ; } else { declaringClass = ConstantPool . JavaLangStringBufferConstantPoolName ; signature = ConstantPool . StringBufferAppendFloatSignature ; } receiverAndArgsSize = <NUM_LIT:2> ; break ; case TypeIds . T_double : if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { declaringClass = ConstantPool . JavaLangStringBuilderConstantPoolName ; signature = ConstantPool . StringBuilderAppendDoubleSignature ; } else { declaringClass = ConstantPool . JavaLangStringBufferConstantPoolName ; signature = ConstantPool . StringBufferAppendDoubleSignature ; } receiverAndArgsSize = <NUM_LIT:3> ; break ; case TypeIds . T_char : if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { declaringClass = ConstantPool . JavaLangStringBuilderConstantPoolName ; signature = ConstantPool . StringBuilderAppendCharSignature ; } else { declaringClass = ConstantPool . JavaLangStringBufferConstantPoolName ; signature = ConstantPool . StringBufferAppendCharSignature ; } receiverAndArgsSize = <NUM_LIT:2> ; break ; case TypeIds . T_boolean : if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { declaringClass = ConstantPool . JavaLangStringBuilderConstantPoolName ; signature = ConstantPool . StringBuilderAppendBooleanSignature ; } else { declaringClass = ConstantPool . JavaLangStringBufferConstantPoolName ; signature = ConstantPool . StringBufferAppendBooleanSignature ; } receiverAndArgsSize = <NUM_LIT:2> ; break ; case TypeIds . T_JavaLangString : if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { declaringClass = ConstantPool . JavaLangStringBuilderConstantPoolName ; signature = ConstantPool . StringBuilderAppendStringSignature ; } else { declaringClass = ConstantPool . JavaLangStringBufferConstantPoolName ; signature = ConstantPool . StringBufferAppendStringSignature ; } receiverAndArgsSize = <NUM_LIT:2> ; break ; default : if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { declaringClass = ConstantPool . JavaLangStringBuilderConstantPoolName ; signature = ConstantPool . StringBuilderAppendObjectSignature ; } else { declaringClass = ConstantPool . JavaLangStringBufferConstantPoolName ; signature = ConstantPool . StringBufferAppendObjectSignature ; } receiverAndArgsSize = <NUM_LIT:2> ; break ; } invoke ( Opcodes . OPC_invokevirtual , receiverAndArgsSize , <NUM_LIT:1> , declaringClass , selector , signature ) ; } public void invokeStringConcatenationDefaultConstructor ( ) { char [ ] declaringClass ; if ( this . targetLevel < ClassFileConstants . JDK1_5 ) { declaringClass = ConstantPool . JavaLangStringBufferConstantPoolName ; } else { declaringClass = ConstantPool . JavaLangStringBuilderConstantPoolName ; } invoke ( Opcodes . OPC_invokespecial , <NUM_LIT:1> , <NUM_LIT:0> , declaringClass , ConstantPool . Init , ConstantPool . DefaultConstructorSignature ) ; } public void invokeStringConcatenationStringConstructor ( ) { char [ ] declaringClass ; if ( this . targetLevel < ClassFileConstants . JDK1_5 ) { declaringClass = ConstantPool . JavaLangStringBufferConstantPoolName ; } else { declaringClass = ConstantPool . JavaLangStringBuilderConstantPoolName ; } invoke ( Opcodes . OPC_invokespecial , <NUM_LIT:2> , <NUM_LIT:0> , declaringClass , ConstantPool . Init , ConstantPool . StringConstructorSignature ) ; } public void invokeStringConcatenationToString ( ) { char [ ] declaringClass ; if ( this . targetLevel < ClassFileConstants . JDK1_5 ) { declaringClass = ConstantPool . JavaLangStringBufferConstantPoolName ; } else { declaringClass = ConstantPool . JavaLangStringBuilderConstantPoolName ; } invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , declaringClass , ConstantPool . ToString , ConstantPool . ToStringSignature ) ; } public void invokeStringEquals ( ) { invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:2> , <NUM_LIT:1> , ConstantPool . JavaLangStringConstantPoolName , ConstantPool . Equals , ConstantPool . EqualsSignature ) ; } public void invokeStringHashCode ( ) { invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangStringConstantPoolName , ConstantPool . HashCode , ConstantPool . HashCodeSignature ) ; } public void invokeStringIntern ( ) { invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangStringConstantPoolName , ConstantPool . Intern , ConstantPool . InternSignature ) ; } public void invokeStringValueOf ( int typeID ) { char [ ] signature ; int receiverAndArgsSize ; switch ( typeID ) { case TypeIds . T_int : case TypeIds . T_byte : case TypeIds . T_short : signature = ConstantPool . ValueOfIntSignature ; receiverAndArgsSize = <NUM_LIT:1> ; break ; case TypeIds . T_long : signature = ConstantPool . ValueOfLongSignature ; receiverAndArgsSize = <NUM_LIT:2> ; break ; case TypeIds . T_float : signature = ConstantPool . ValueOfFloatSignature ; receiverAndArgsSize = <NUM_LIT:1> ; break ; case TypeIds . T_double : signature = ConstantPool . ValueOfDoubleSignature ; receiverAndArgsSize = <NUM_LIT:2> ; break ; case TypeIds . T_char : signature = ConstantPool . ValueOfCharSignature ; receiverAndArgsSize = <NUM_LIT:1> ; break ; case TypeIds . T_boolean : signature = ConstantPool . ValueOfBooleanSignature ; receiverAndArgsSize = <NUM_LIT:1> ; break ; case TypeIds . T_JavaLangObject : case TypeIds . T_JavaLangString : case TypeIds . T_null : case TypeIds . T_undefined : signature = ConstantPool . ValueOfObjectSignature ; receiverAndArgsSize = <NUM_LIT:1> ; break ; default : return ; } invoke ( Opcodes . OPC_invokestatic , receiverAndArgsSize , <NUM_LIT:1> , ConstantPool . JavaLangStringConstantPoolName , ConstantPool . ValueOf , signature ) ; } public void invokeSystemArraycopy ( ) { invoke ( Opcodes . OPC_invokestatic , <NUM_LIT:5> , <NUM_LIT:0> , ConstantPool . JavaLangSystemConstantPoolName , ConstantPool . ArrayCopy , ConstantPool . ArrayCopySignature ) ; } public void invokeThrowableGetMessage ( ) { invoke ( Opcodes . OPC_invokevirtual , <NUM_LIT:1> , <NUM_LIT:1> , ConstantPool . JavaLangThrowableConstantPoolName , ConstantPool . GetMessage , ConstantPool . GetMessageSignature ) ; } public void ior ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ior ; } public void irem ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_irem ; } public void ireturn ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ireturn ; this . lastAbruptCompletion = this . position ; } public boolean isDefinitelyAssigned ( Scope scope , int initStateIndex , LocalVariableBinding local ) { if ( ( local . tagBits & TagBits . IsArgument ) != <NUM_LIT:0> ) { return true ; } if ( initStateIndex == - <NUM_LIT:1> ) return false ; int localPosition = local . id + this . maxFieldCount ; MethodScope methodScope = scope . methodScope ( ) ; if ( localPosition < UnconditionalFlowInfo . BitCacheSize ) { return ( methodScope . definiteInits [ initStateIndex ] & ( <NUM_LIT:1L> << localPosition ) ) != <NUM_LIT:0> ; } long [ ] extraInits = methodScope . extraDefiniteInits [ initStateIndex ] ; if ( extraInits == null ) return false ; int vectorIndex ; if ( ( vectorIndex = ( localPosition / UnconditionalFlowInfo . BitCacheSize ) - <NUM_LIT:1> ) >= extraInits . length ) return false ; return ( ( extraInits [ vectorIndex ] ) & ( <NUM_LIT:1L> << ( localPosition % UnconditionalFlowInfo . BitCacheSize ) ) ) != <NUM_LIT:0> ; } public void ishl ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ishl ; } public void ishr ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ishr ; } public void istore ( int iArg ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . maxLocals <= iArg ) { this . maxLocals = iArg + <NUM_LIT:1> ; } if ( iArg > <NUM_LIT:255> ) { if ( this . classFileOffset + <NUM_LIT:3> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_wide ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_istore ; writeUnsignedShort ( iArg ) ; } else { if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_istore ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) iArg ; } } public void istore_0 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . maxLocals == <NUM_LIT:0> ) { this . maxLocals = <NUM_LIT:1> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_istore_0 ; } public void istore_1 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . maxLocals <= <NUM_LIT:1> ) { this . maxLocals = <NUM_LIT:2> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_istore_1 ; } public void istore_2 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . maxLocals <= <NUM_LIT:2> ) { this . maxLocals = <NUM_LIT:3> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_istore_2 ; } public void istore_3 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . maxLocals <= <NUM_LIT:3> ) { this . maxLocals = <NUM_LIT:4> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_istore_3 ; } public void isub ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_isub ; } public void iushr ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_iushr ; } public void ixor ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ixor ; } final public void jsr ( BranchLabel lbl ) { if ( this . wideMode ) { jsr_w ( lbl ) ; return ; } this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_jsr ; lbl . branch ( ) ; } final public void jsr_w ( BranchLabel lbl ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_jsr_w ; lbl . branchWide ( ) ; } public void l2d ( ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_l2d ; } public void l2f ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_l2f ; } public void l2i ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_l2i ; } public void ladd ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ladd ; } public void laload ( ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_laload ; } public void land ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_land ; } public void lastore ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:4> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lastore ; } public void lcmp ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:3> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lcmp ; } public void lconst_0 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += <NUM_LIT:2> ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lconst_0 ; } public void lconst_1 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += <NUM_LIT:2> ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lconst_1 ; } public void ldc ( float constant ) { this . countLabels = <NUM_LIT:0> ; int index = this . constantPool . literalIndex ( constant ) ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( index > <NUM_LIT:255> ) { if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ldc_w ; writeUnsignedShort ( index ) ; } else { if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ldc ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) index ; } } public void ldc ( int constant ) { this . countLabels = <NUM_LIT:0> ; int index = this . constantPool . literalIndex ( constant ) ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( index > <NUM_LIT:255> ) { if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ldc_w ; writeUnsignedShort ( index ) ; } else { if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ldc ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) index ; } } public void ldc ( String constant ) { this . countLabels = <NUM_LIT:0> ; int currentCodeStreamPosition = this . position ; char [ ] constantChars = constant . toCharArray ( ) ; int index = this . constantPool . literalIndexForLdc ( constantChars ) ; if ( index > <NUM_LIT:0> ) { ldcForIndex ( index ) ; } else { this . position = currentCodeStreamPosition ; int i = <NUM_LIT:0> ; int length = <NUM_LIT:0> ; int constantLength = constant . length ( ) ; byte [ ] utf8encoding = new byte [ Math . min ( constantLength + <NUM_LIT:100> , <NUM_LIT> ) ] ; int utf8encodingLength = <NUM_LIT:0> ; while ( ( length < <NUM_LIT> ) && ( i < constantLength ) ) { char current = constantChars [ i ] ; if ( length + <NUM_LIT:3> > ( utf8encodingLength = utf8encoding . length ) ) { System . arraycopy ( utf8encoding , <NUM_LIT:0> , utf8encoding = new byte [ Math . min ( utf8encodingLength + <NUM_LIT:100> , <NUM_LIT> ) ] , <NUM_LIT:0> , length ) ; } if ( ( current >= <NUM_LIT> ) && ( current <= <NUM_LIT> ) ) { utf8encoding [ length ++ ] = ( byte ) current ; } else { if ( current > <NUM_LIT> ) { utf8encoding [ length ++ ] = ( byte ) ( <NUM_LIT> | ( ( current > > <NUM_LIT:12> ) & <NUM_LIT> ) ) ; utf8encoding [ length ++ ] = ( byte ) ( <NUM_LIT> | ( ( current > > <NUM_LIT:6> ) & <NUM_LIT> ) ) ; utf8encoding [ length ++ ] = ( byte ) ( <NUM_LIT> | ( current & <NUM_LIT> ) ) ; } else { utf8encoding [ length ++ ] = ( byte ) ( <NUM_LIT> | ( ( current > > <NUM_LIT:6> ) & <NUM_LIT> ) ) ; utf8encoding [ length ++ ] = ( byte ) ( <NUM_LIT> | ( current & <NUM_LIT> ) ) ; } } i ++ ; } newStringContatenation ( ) ; dup ( ) ; char [ ] subChars = new char [ i ] ; System . arraycopy ( constantChars , <NUM_LIT:0> , subChars , <NUM_LIT:0> , i ) ; System . arraycopy ( utf8encoding , <NUM_LIT:0> , utf8encoding = new byte [ length ] , <NUM_LIT:0> , length ) ; index = this . constantPool . literalIndex ( subChars , utf8encoding ) ; ldcForIndex ( index ) ; invokeStringConcatenationStringConstructor ( ) ; while ( i < constantLength ) { length = <NUM_LIT:0> ; utf8encoding = new byte [ Math . min ( constantLength - i + <NUM_LIT:100> , <NUM_LIT> ) ] ; int startIndex = i ; while ( ( length < <NUM_LIT> ) && ( i < constantLength ) ) { char current = constantChars [ i ] ; if ( length + <NUM_LIT:3> > ( utf8encodingLength = utf8encoding . length ) ) { System . arraycopy ( utf8encoding , <NUM_LIT:0> , utf8encoding = new byte [ Math . min ( utf8encodingLength + <NUM_LIT:100> , <NUM_LIT> ) ] , <NUM_LIT:0> , length ) ; } if ( ( current >= <NUM_LIT> ) && ( current <= <NUM_LIT> ) ) { utf8encoding [ length ++ ] = ( byte ) current ; } else { if ( current > <NUM_LIT> ) { utf8encoding [ length ++ ] = ( byte ) ( <NUM_LIT> | ( ( current > > <NUM_LIT:12> ) & <NUM_LIT> ) ) ; utf8encoding [ length ++ ] = ( byte ) ( <NUM_LIT> | ( ( current > > <NUM_LIT:6> ) & <NUM_LIT> ) ) ; utf8encoding [ length ++ ] = ( byte ) ( <NUM_LIT> | ( current & <NUM_LIT> ) ) ; } else { utf8encoding [ length ++ ] = ( byte ) ( <NUM_LIT> | ( ( current > > <NUM_LIT:6> ) & <NUM_LIT> ) ) ; utf8encoding [ length ++ ] = ( byte ) ( <NUM_LIT> | ( current & <NUM_LIT> ) ) ; } } i ++ ; } int newCharLength = i - startIndex ; subChars = new char [ newCharLength ] ; System . arraycopy ( constantChars , startIndex , subChars , <NUM_LIT:0> , newCharLength ) ; System . arraycopy ( utf8encoding , <NUM_LIT:0> , utf8encoding = new byte [ length ] , <NUM_LIT:0> , length ) ; index = this . constantPool . literalIndex ( subChars , utf8encoding ) ; ldcForIndex ( index ) ; invokeStringConcatenationAppendForType ( TypeIds . T_JavaLangString ) ; } invokeStringConcatenationToString ( ) ; invokeStringIntern ( ) ; } } public void ldc ( TypeBinding typeBinding ) { this . countLabels = <NUM_LIT:0> ; int index = this . constantPool . literalIndexForType ( typeBinding ) ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( index > <NUM_LIT:255> ) { if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ldc_w ; writeUnsignedShort ( index ) ; } else { if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ldc ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) index ; } } public void ldc2_w ( double constant ) { this . countLabels = <NUM_LIT:0> ; int index = this . constantPool . literalIndex ( constant ) ; this . stackDepth += <NUM_LIT:2> ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ldc2_w ; writeUnsignedShort ( index ) ; } public void ldc2_w ( long constant ) { this . countLabels = <NUM_LIT:0> ; int index = this . constantPool . literalIndex ( constant ) ; this . stackDepth += <NUM_LIT:2> ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ldc2_w ; writeUnsignedShort ( index ) ; } public void ldcForIndex ( int index ) { this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) { this . stackMax = this . stackDepth ; } if ( index > <NUM_LIT:255> ) { if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ldc_w ; writeUnsignedShort ( index ) ; } else { if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ldc ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) index ; } } public void ldiv ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ldiv ; } public void lload ( int iArg ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += <NUM_LIT:2> ; if ( this . maxLocals <= iArg + <NUM_LIT:1> ) { this . maxLocals = iArg + <NUM_LIT:2> ; } if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( iArg > <NUM_LIT:255> ) { if ( this . classFileOffset + <NUM_LIT:3> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_wide ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lload ; writeUnsignedShort ( iArg ) ; } else { if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lload ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) iArg ; } } public void lload_0 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += <NUM_LIT:2> ; if ( this . maxLocals < <NUM_LIT:2> ) { this . maxLocals = <NUM_LIT:2> ; } if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lload_0 ; } public void lload_1 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += <NUM_LIT:2> ; if ( this . maxLocals < <NUM_LIT:3> ) { this . maxLocals = <NUM_LIT:3> ; } if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lload_1 ; } public void lload_2 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += <NUM_LIT:2> ; if ( this . maxLocals < <NUM_LIT:4> ) { this . maxLocals = <NUM_LIT:4> ; } if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lload_2 ; } public void lload_3 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += <NUM_LIT:2> ; if ( this . maxLocals < <NUM_LIT:5> ) { this . maxLocals = <NUM_LIT:5> ; } if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lload_3 ; } public void lmul ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lmul ; } public void lneg ( ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lneg ; } public final void load ( LocalVariableBinding localBinding ) { load ( localBinding . type , localBinding . resolvedPosition ) ; } protected final void load ( TypeBinding typeBinding , int resolvedPosition ) { this . countLabels = <NUM_LIT:0> ; switch ( typeBinding . id ) { case TypeIds . T_int : case TypeIds . T_byte : case TypeIds . T_char : case TypeIds . T_boolean : case TypeIds . T_short : switch ( resolvedPosition ) { case <NUM_LIT:0> : iload_0 ( ) ; break ; case <NUM_LIT:1> : iload_1 ( ) ; break ; case <NUM_LIT:2> : iload_2 ( ) ; break ; case <NUM_LIT:3> : iload_3 ( ) ; break ; default : iload ( resolvedPosition ) ; } break ; case TypeIds . T_float : switch ( resolvedPosition ) { case <NUM_LIT:0> : fload_0 ( ) ; break ; case <NUM_LIT:1> : fload_1 ( ) ; break ; case <NUM_LIT:2> : fload_2 ( ) ; break ; case <NUM_LIT:3> : fload_3 ( ) ; break ; default : fload ( resolvedPosition ) ; } break ; case TypeIds . T_long : switch ( resolvedPosition ) { case <NUM_LIT:0> : lload_0 ( ) ; break ; case <NUM_LIT:1> : lload_1 ( ) ; break ; case <NUM_LIT:2> : lload_2 ( ) ; break ; case <NUM_LIT:3> : lload_3 ( ) ; break ; default : lload ( resolvedPosition ) ; } break ; case TypeIds . T_double : switch ( resolvedPosition ) { case <NUM_LIT:0> : dload_0 ( ) ; break ; case <NUM_LIT:1> : dload_1 ( ) ; break ; case <NUM_LIT:2> : dload_2 ( ) ; break ; case <NUM_LIT:3> : dload_3 ( ) ; break ; default : dload ( resolvedPosition ) ; } break ; default : switch ( resolvedPosition ) { case <NUM_LIT:0> : aload_0 ( ) ; break ; case <NUM_LIT:1> : aload_1 ( ) ; break ; case <NUM_LIT:2> : aload_2 ( ) ; break ; case <NUM_LIT:3> : aload_3 ( ) ; break ; default : aload ( resolvedPosition ) ; } } } public void lookupswitch ( CaseLabel defaultLabel , int [ ] keys , int [ ] sortedIndexes , CaseLabel [ ] casesLabel ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; int length = keys . length ; int pos = this . position ; defaultLabel . placeInstruction ( ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { casesLabel [ i ] . placeInstruction ( ) ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lookupswitch ; for ( int i = ( <NUM_LIT:3> - ( pos & <NUM_LIT:3> ) ) ; i > <NUM_LIT:0> ; i -- ) { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = <NUM_LIT:0> ; } defaultLabel . branch ( ) ; writeSignedWord ( length ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { writeSignedWord ( keys [ sortedIndexes [ i ] ] ) ; casesLabel [ sortedIndexes [ i ] ] . branch ( ) ; } } public void lor ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lor ; } public void lrem ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lrem ; } public void lreturn ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lreturn ; this . lastAbruptCompletion = this . position ; } public void lshl ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lshl ; } public void lshr ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lshr ; } public void lstore ( int iArg ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . maxLocals <= iArg + <NUM_LIT:1> ) { this . maxLocals = iArg + <NUM_LIT:2> ; } if ( iArg > <NUM_LIT:255> ) { if ( this . classFileOffset + <NUM_LIT:3> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_wide ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lstore ; writeUnsignedShort ( iArg ) ; } else { if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lstore ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) iArg ; } } public void lstore_0 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . maxLocals < <NUM_LIT:2> ) { this . maxLocals = <NUM_LIT:2> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lstore_0 ; } public void lstore_1 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . maxLocals < <NUM_LIT:3> ) { this . maxLocals = <NUM_LIT:3> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lstore_1 ; } public void lstore_2 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . maxLocals < <NUM_LIT:4> ) { this . maxLocals = <NUM_LIT:4> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lstore_2 ; } public void lstore_3 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . maxLocals < <NUM_LIT:5> ) { this . maxLocals = <NUM_LIT:5> ; } if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lstore_3 ; } public void lsub ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lsub ; } public void lushr ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lushr ; } public void lxor ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_lxor ; } public void monitorenter ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_monitorenter ; } public void monitorexit ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_monitorexit ; } public void multianewarray ( TypeBinding typeBinding , int dimensions ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth += ( <NUM_LIT:1> - dimensions ) ; if ( this . classFileOffset + <NUM_LIT:3> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_multianewarray ; writeUnsignedShort ( this . constantPool . literalIndexForType ( typeBinding ) ) ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) dimensions ; } public void new_ ( TypeBinding typeBinding ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_new ; writeUnsignedShort ( this . constantPool . literalIndexForType ( typeBinding ) ) ; } public void newarray ( int array_Type ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_newarray ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) array_Type ; } public void newArray ( ArrayBinding arrayBinding ) { TypeBinding component = arrayBinding . elementsType ( ) ; switch ( component . id ) { case TypeIds . T_int : newarray ( ClassFileConstants . INT_ARRAY ) ; break ; case TypeIds . T_byte : newarray ( ClassFileConstants . BYTE_ARRAY ) ; break ; case TypeIds . T_boolean : newarray ( ClassFileConstants . BOOLEAN_ARRAY ) ; break ; case TypeIds . T_short : newarray ( ClassFileConstants . SHORT_ARRAY ) ; break ; case TypeIds . T_char : newarray ( ClassFileConstants . CHAR_ARRAY ) ; break ; case TypeIds . T_long : newarray ( ClassFileConstants . LONG_ARRAY ) ; break ; case TypeIds . T_float : newarray ( ClassFileConstants . FLOAT_ARRAY ) ; break ; case TypeIds . T_double : newarray ( ClassFileConstants . DOUBLE_ARRAY ) ; break ; default : anewarray ( component ) ; } } public void newJavaLangAssertionError ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_new ; writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangAssertionErrorConstantPoolName ) ) ; } public void newJavaLangError ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_new ; writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangErrorConstantPoolName ) ) ; } public void newNoClassDefFoundError ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_new ; writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangNoClassDefFoundErrorConstantPoolName ) ) ; } public void newStringContatenation ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) { this . stackMax = this . stackDepth ; } if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_new ; if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangStringBuilderConstantPoolName ) ) ; } else { writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangStringBufferConstantPoolName ) ) ; } } public void newWrapperFor ( int typeID ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset + <NUM_LIT:2> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_new ; switch ( typeID ) { case TypeIds . T_int : writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangIntegerConstantPoolName ) ) ; break ; case TypeIds . T_boolean : writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangBooleanConstantPoolName ) ) ; break ; case TypeIds . T_byte : writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangByteConstantPoolName ) ) ; break ; case TypeIds . T_char : writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangCharacterConstantPoolName ) ) ; break ; case TypeIds . T_float : writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangFloatConstantPoolName ) ) ; break ; case TypeIds . T_double : writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangDoubleConstantPoolName ) ) ; break ; case TypeIds . T_short : writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangShortConstantPoolName ) ) ; break ; case TypeIds . T_long : writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangLongConstantPoolName ) ) ; break ; case TypeIds . T_void : writeUnsignedShort ( this . constantPool . literalIndexForType ( ConstantPool . JavaLangVoidConstantPoolName ) ) ; } } public void nop ( ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_nop ; } public void optimizeBranch ( int oldPosition , BranchLabel lbl ) { for ( int i = <NUM_LIT:0> ; i < this . countLabels ; i ++ ) { BranchLabel label = this . labels [ i ] ; if ( oldPosition == label . position ) { label . position = this . position ; if ( label instanceof CaseLabel ) { int offset = this . position - ( ( CaseLabel ) label ) . instructionPosition ; int [ ] forwardRefs = label . forwardReferences ( ) ; for ( int j = <NUM_LIT:0> , length = label . forwardReferenceCount ( ) ; j < length ; j ++ ) { int forwardRef = forwardRefs [ j ] ; this . writeSignedWord ( forwardRef , offset ) ; } } else { int [ ] forwardRefs = label . forwardReferences ( ) ; for ( int j = <NUM_LIT:0> , length = label . forwardReferenceCount ( ) ; j < length ; j ++ ) { final int forwardRef = forwardRefs [ j ] ; this . writePosition ( lbl , forwardRef ) ; } } } } } public void pop ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_pop ; } public void pop2 ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:2> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_pop2 ; } public void pushExceptionOnStack ( TypeBinding binding ) { this . stackDepth = <NUM_LIT:1> ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; } public void pushOnStack ( TypeBinding binding ) { if ( ++ this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; } public void record ( LocalVariableBinding local ) { if ( ( this . generateAttributes & ( ClassFileConstants . ATTR_VARS | ClassFileConstants . ATTR_STACK_MAP_TABLE | ClassFileConstants . ATTR_STACK_MAP ) ) == <NUM_LIT:0> ) return ; if ( this . allLocalsCounter == this . locals . length ) { System . arraycopy ( this . locals , <NUM_LIT:0> , this . locals = new LocalVariableBinding [ this . allLocalsCounter + LOCALS_INCREMENT ] , <NUM_LIT:0> , this . allLocalsCounter ) ; } this . locals [ this . allLocalsCounter ++ ] = local ; local . initializationPCs = new int [ <NUM_LIT:4> ] ; local . initializationCount = <NUM_LIT:0> ; } public void recordExpressionType ( TypeBinding typeBinding ) { } public void recordPositionsFrom ( int startPC , int sourcePos ) { this . recordPositionsFrom ( startPC , sourcePos , false ) ; } public void recordPositionsFrom ( int startPC , int sourcePos , boolean widen ) { if ( ( this . generateAttributes & ClassFileConstants . ATTR_LINES ) == <NUM_LIT:0> || sourcePos == <NUM_LIT:0> || ( startPC == this . position && ! widen ) ) return ; if ( this . pcToSourceMapSize + <NUM_LIT:4> > this . pcToSourceMap . length ) { System . arraycopy ( this . pcToSourceMap , <NUM_LIT:0> , this . pcToSourceMap = new int [ this . pcToSourceMapSize << <NUM_LIT:1> ] , <NUM_LIT:0> , this . pcToSourceMapSize ) ; } if ( this . pcToSourceMapSize > <NUM_LIT:0> ) { int lineNumber ; int previousLineNumber = this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:1> ] ; if ( this . lineNumberStart == this . lineNumberEnd ) { lineNumber = this . lineNumberStart ; } else { int [ ] lineSeparatorPositions2 = this . lineSeparatorPositions ; int length = lineSeparatorPositions2 . length ; if ( previousLineNumber == <NUM_LIT:1> ) { if ( sourcePos < lineSeparatorPositions2 [ <NUM_LIT:0> ] ) { lineNumber = <NUM_LIT:1> ; if ( startPC < this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:2> ] ) { int insertionIndex = insertionIndex ( this . pcToSourceMap , this . pcToSourceMapSize , startPC ) ; if ( insertionIndex != - <NUM_LIT:1> ) { if ( ! ( ( insertionIndex > <NUM_LIT:1> ) && ( this . pcToSourceMap [ insertionIndex - <NUM_LIT:1> ] == lineNumber ) ) ) { if ( ( this . pcToSourceMapSize > <NUM_LIT:4> ) && ( this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:4> ] > startPC ) ) { System . arraycopy ( this . pcToSourceMap , insertionIndex , this . pcToSourceMap , insertionIndex + <NUM_LIT:2> , this . pcToSourceMapSize - <NUM_LIT:2> - insertionIndex ) ; this . pcToSourceMap [ insertionIndex ++ ] = startPC ; this . pcToSourceMap [ insertionIndex ] = lineNumber ; } else { this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:2> ] = startPC ; } } } } this . lastEntryPC = this . position ; return ; } else if ( length == <NUM_LIT:1> || sourcePos < lineSeparatorPositions2 [ <NUM_LIT:1> ] ) { lineNumber = <NUM_LIT:2> ; if ( startPC <= this . lastEntryPC ) { int insertionIndex = insertionIndex ( this . pcToSourceMap , this . pcToSourceMapSize , startPC ) ; if ( insertionIndex != - <NUM_LIT:1> ) { int existingEntryIndex = indexOfSameLineEntrySincePC ( startPC , lineNumber ) ; if ( existingEntryIndex != - <NUM_LIT:1> ) { this . pcToSourceMap [ existingEntryIndex ] = startPC ; } else if ( insertionIndex < <NUM_LIT:1> || this . pcToSourceMap [ insertionIndex - <NUM_LIT:1> ] != lineNumber ) { System . arraycopy ( this . pcToSourceMap , insertionIndex , this . pcToSourceMap , insertionIndex + <NUM_LIT:2> , this . pcToSourceMapSize - insertionIndex ) ; this . pcToSourceMap [ insertionIndex ++ ] = startPC ; this . pcToSourceMap [ insertionIndex ] = lineNumber ; this . pcToSourceMapSize += <NUM_LIT:2> ; } } else if ( this . position != this . lastEntryPC ) { if ( this . lastEntryPC == startPC || this . lastEntryPC == this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:2> ] ) { this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:1> ] = lineNumber ; } else { this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = this . lastEntryPC ; this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = lineNumber ; } } else if ( this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:1> ] < lineNumber && widen ) { this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:1> ] = lineNumber ; } } else { this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = startPC ; this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = lineNumber ; } this . lastEntryPC = this . position ; return ; } else { lineNumber = Util . getLineNumber ( sourcePos , this . lineSeparatorPositions , this . lineNumberStart - <NUM_LIT:1> , this . lineNumberEnd - <NUM_LIT:1> ) ; } } else if ( previousLineNumber < length ) { if ( lineSeparatorPositions2 [ previousLineNumber - <NUM_LIT:2> ] < sourcePos ) { if ( sourcePos < lineSeparatorPositions2 [ previousLineNumber - <NUM_LIT:1> ] ) { lineNumber = previousLineNumber ; if ( startPC < this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:2> ] ) { int insertionIndex = insertionIndex ( this . pcToSourceMap , this . pcToSourceMapSize , startPC ) ; if ( insertionIndex != - <NUM_LIT:1> ) { if ( ! ( ( insertionIndex > <NUM_LIT:1> ) && ( this . pcToSourceMap [ insertionIndex - <NUM_LIT:1> ] == lineNumber ) ) ) { if ( ( this . pcToSourceMapSize > <NUM_LIT:4> ) && ( this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:4> ] > startPC ) ) { System . arraycopy ( this . pcToSourceMap , insertionIndex , this . pcToSourceMap , insertionIndex + <NUM_LIT:2> , this . pcToSourceMapSize - <NUM_LIT:2> - insertionIndex ) ; this . pcToSourceMap [ insertionIndex ++ ] = startPC ; this . pcToSourceMap [ insertionIndex ] = lineNumber ; } else { this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:2> ] = startPC ; } } } } this . lastEntryPC = this . position ; return ; } else if ( sourcePos < lineSeparatorPositions2 [ previousLineNumber ] ) { lineNumber = previousLineNumber + <NUM_LIT:1> ; if ( startPC <= this . lastEntryPC ) { int insertionIndex = insertionIndex ( this . pcToSourceMap , this . pcToSourceMapSize , startPC ) ; if ( insertionIndex != - <NUM_LIT:1> ) { int existingEntryIndex = indexOfSameLineEntrySincePC ( startPC , lineNumber ) ; if ( existingEntryIndex != - <NUM_LIT:1> ) { this . pcToSourceMap [ existingEntryIndex ] = startPC ; } else if ( insertionIndex < <NUM_LIT:1> || this . pcToSourceMap [ insertionIndex - <NUM_LIT:1> ] != lineNumber ) { System . arraycopy ( this . pcToSourceMap , insertionIndex , this . pcToSourceMap , insertionIndex + <NUM_LIT:2> , this . pcToSourceMapSize - insertionIndex ) ; this . pcToSourceMap [ insertionIndex ++ ] = startPC ; this . pcToSourceMap [ insertionIndex ] = lineNumber ; this . pcToSourceMapSize += <NUM_LIT:2> ; } } else if ( this . position != this . lastEntryPC ) { if ( this . lastEntryPC == startPC || this . lastEntryPC == this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:2> ] ) { this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:1> ] = lineNumber ; } else { this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = this . lastEntryPC ; this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = lineNumber ; } } else if ( this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:1> ] < lineNumber && widen ) { this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:1> ] = lineNumber ; } } else { this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = startPC ; this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = lineNumber ; } this . lastEntryPC = this . position ; return ; } else { lineNumber = Util . getLineNumber ( sourcePos , this . lineSeparatorPositions , this . lineNumberStart - <NUM_LIT:1> , this . lineNumberEnd - <NUM_LIT:1> ) ; } } else { lineNumber = Util . getLineNumber ( sourcePos , this . lineSeparatorPositions , this . lineNumberStart - <NUM_LIT:1> , this . lineNumberEnd - <NUM_LIT:1> ) ; } } else if ( lineSeparatorPositions2 [ length - <NUM_LIT:1> ] < sourcePos ) { lineNumber = length + <NUM_LIT:1> ; if ( startPC <= this . lastEntryPC ) { int insertionIndex = insertionIndex ( this . pcToSourceMap , this . pcToSourceMapSize , startPC ) ; if ( insertionIndex != - <NUM_LIT:1> ) { int existingEntryIndex = indexOfSameLineEntrySincePC ( startPC , lineNumber ) ; if ( existingEntryIndex != - <NUM_LIT:1> ) { this . pcToSourceMap [ existingEntryIndex ] = startPC ; } else if ( insertionIndex < <NUM_LIT:1> || this . pcToSourceMap [ insertionIndex - <NUM_LIT:1> ] != lineNumber ) { System . arraycopy ( this . pcToSourceMap , insertionIndex , this . pcToSourceMap , insertionIndex + <NUM_LIT:2> , this . pcToSourceMapSize - insertionIndex ) ; this . pcToSourceMap [ insertionIndex ++ ] = startPC ; this . pcToSourceMap [ insertionIndex ] = lineNumber ; this . pcToSourceMapSize += <NUM_LIT:2> ; } } else if ( this . position != this . lastEntryPC ) { if ( this . lastEntryPC == startPC || this . lastEntryPC == this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:2> ] ) { this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:1> ] = lineNumber ; } else { this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = this . lastEntryPC ; this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = lineNumber ; } } else if ( this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:1> ] < lineNumber && widen ) { this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:1> ] = lineNumber ; } } else { this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = startPC ; this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = lineNumber ; } this . lastEntryPC = this . position ; return ; } else { lineNumber = Util . getLineNumber ( sourcePos , this . lineSeparatorPositions , this . lineNumberStart - <NUM_LIT:1> , this . lineNumberEnd - <NUM_LIT:1> ) ; } } if ( previousLineNumber != lineNumber ) { if ( startPC <= this . lastEntryPC ) { int insertionIndex = insertionIndex ( this . pcToSourceMap , this . pcToSourceMapSize , startPC ) ; if ( insertionIndex != - <NUM_LIT:1> ) { int existingEntryIndex = indexOfSameLineEntrySincePC ( startPC , lineNumber ) ; if ( existingEntryIndex != - <NUM_LIT:1> ) { this . pcToSourceMap [ existingEntryIndex ] = startPC ; } else if ( insertionIndex < <NUM_LIT:1> || this . pcToSourceMap [ insertionIndex - <NUM_LIT:1> ] != lineNumber ) { System . arraycopy ( this . pcToSourceMap , insertionIndex , this . pcToSourceMap , insertionIndex + <NUM_LIT:2> , this . pcToSourceMapSize - insertionIndex ) ; this . pcToSourceMap [ insertionIndex ++ ] = startPC ; this . pcToSourceMap [ insertionIndex ] = lineNumber ; this . pcToSourceMapSize += <NUM_LIT:2> ; } } else if ( this . position != this . lastEntryPC ) { if ( this . lastEntryPC == startPC || this . lastEntryPC == this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:2> ] ) { this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:1> ] = lineNumber ; } else { this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = this . lastEntryPC ; this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = lineNumber ; } } else if ( this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:1> ] < lineNumber && widen ) { this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:1> ] = lineNumber ; } } else { this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = startPC ; this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = lineNumber ; } } else { if ( startPC < this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:2> ] ) { int insertionIndex = insertionIndex ( this . pcToSourceMap , this . pcToSourceMapSize , startPC ) ; if ( insertionIndex != - <NUM_LIT:1> ) { if ( ! ( ( insertionIndex > <NUM_LIT:1> ) && ( this . pcToSourceMap [ insertionIndex - <NUM_LIT:1> ] == lineNumber ) ) ) { if ( ( this . pcToSourceMapSize > <NUM_LIT:4> ) && ( this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:4> ] > startPC ) ) { System . arraycopy ( this . pcToSourceMap , insertionIndex , this . pcToSourceMap , insertionIndex + <NUM_LIT:2> , this . pcToSourceMapSize - <NUM_LIT:2> - insertionIndex ) ; this . pcToSourceMap [ insertionIndex ++ ] = startPC ; this . pcToSourceMap [ insertionIndex ] = lineNumber ; } else { this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:2> ] = startPC ; } } } } } this . lastEntryPC = this . position ; } else { int lineNumber = <NUM_LIT:0> ; if ( this . lineNumberStart == this . lineNumberEnd ) { lineNumber = this . lineNumberStart ; } else { lineNumber = Util . getLineNumber ( sourcePos , this . lineSeparatorPositions , this . lineNumberStart - <NUM_LIT:1> , this . lineNumberEnd - <NUM_LIT:1> ) ; } this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = startPC ; this . pcToSourceMap [ this . pcToSourceMapSize ++ ] = lineNumber ; this . lastEntryPC = this . position ; } } public void registerExceptionHandler ( ExceptionLabel anExceptionLabel ) { int length ; if ( this . exceptionLabelsCounter == ( length = this . exceptionLabels . length ) ) { System . arraycopy ( this . exceptionLabels , <NUM_LIT:0> , this . exceptionLabels = new ExceptionLabel [ length + LABELS_INCREMENT ] , <NUM_LIT:0> , length ) ; } this . exceptionLabels [ this . exceptionLabelsCounter ++ ] = anExceptionLabel ; } public void removeNotDefinitelyAssignedVariables ( Scope scope , int initStateIndex ) { if ( ( this . generateAttributes & ( ClassFileConstants . ATTR_VARS | ClassFileConstants . ATTR_STACK_MAP_TABLE | ClassFileConstants . ATTR_STACK_MAP ) ) == <NUM_LIT:0> ) return ; for ( int i = <NUM_LIT:0> ; i < this . visibleLocalsCount ; i ++ ) { LocalVariableBinding localBinding = this . visibleLocals [ i ] ; if ( localBinding != null && ! isDefinitelyAssigned ( scope , initStateIndex , localBinding ) && localBinding . initializationCount > <NUM_LIT:0> ) { localBinding . recordInitializationEndPC ( this . position ) ; } } } public void removeUnusedPcToSourceMapEntries ( ) { if ( this . pcToSourceMapSize != <NUM_LIT:0> ) { while ( this . pcToSourceMapSize >= <NUM_LIT:2> && this . pcToSourceMap [ this . pcToSourceMapSize - <NUM_LIT:2> ] > this . position ) { this . pcToSourceMapSize -= <NUM_LIT:2> ; } } } public void removeVariable ( LocalVariableBinding localBinding ) { if ( localBinding == null ) return ; if ( localBinding . initializationCount > <NUM_LIT:0> ) { localBinding . recordInitializationEndPC ( this . position ) ; } for ( int i = this . visibleLocalsCount - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) { LocalVariableBinding visibleLocal = this . visibleLocals [ i ] ; if ( visibleLocal == localBinding ) { this . visibleLocals [ i ] = null ; return ; } } } public void reset ( AbstractMethodDeclaration referenceMethod , ClassFile targetClassFile ) { init ( targetClassFile ) ; this . methodDeclaration = referenceMethod ; int [ ] lineSeparatorPositions2 = this . lineSeparatorPositions ; if ( lineSeparatorPositions2 != null ) { int length = lineSeparatorPositions2 . length ; int lineSeparatorPositionsEnd = length - <NUM_LIT:1> ; if ( referenceMethod . isClinit ( ) || referenceMethod . isConstructor ( ) ) { this . lineNumberStart = <NUM_LIT:1> ; this . lineNumberEnd = length == <NUM_LIT:0> ? <NUM_LIT:1> : length ; } else { int start = Util . getLineNumber ( referenceMethod . bodyStart , lineSeparatorPositions2 , <NUM_LIT:0> , lineSeparatorPositionsEnd ) ; this . lineNumberStart = start ; if ( start > lineSeparatorPositionsEnd ) { this . lineNumberEnd = start ; } else { int end = Util . getLineNumber ( referenceMethod . bodyEnd , lineSeparatorPositions2 , start - <NUM_LIT:1> , lineSeparatorPositionsEnd ) ; if ( end >= lineSeparatorPositionsEnd ) { end = length ; } this . lineNumberEnd = end == <NUM_LIT:0> ? <NUM_LIT:1> : end ; } } } this . preserveUnusedLocals = referenceMethod . scope . compilerOptions ( ) . preserveAllLocalVariables ; initializeMaxLocals ( referenceMethod . binding ) ; } public void reset ( ClassFile givenClassFile ) { this . targetLevel = givenClassFile . targetJDK ; int produceAttributes = givenClassFile . produceAttributes ; this . generateAttributes = produceAttributes ; if ( ( produceAttributes & ClassFileConstants . ATTR_LINES ) != <NUM_LIT:0> ) { this . lineSeparatorPositions = givenClassFile . referenceBinding . scope . referenceCompilationUnit ( ) . compilationResult . getLineSeparatorPositions ( ) ; } else { this . lineSeparatorPositions = null ; } } public void resetForProblemClinit ( ClassFile targetClassFile ) { init ( targetClassFile ) ; initializeMaxLocals ( null ) ; } public void resetInWideMode ( ) { this . wideMode = true ; } public void resetForCodeGenUnusedLocals ( ) { } private final void resizeByteArray ( ) { int length = this . bCodeStream . length ; int requiredSize = length + length ; if ( this . classFileOffset >= requiredSize ) { requiredSize = this . classFileOffset + length ; } System . arraycopy ( this . bCodeStream , <NUM_LIT:0> , this . bCodeStream = new byte [ requiredSize ] , <NUM_LIT:0> , length ) ; } final public void ret ( int index ) { this . countLabels = <NUM_LIT:0> ; if ( index > <NUM_LIT:255> ) { if ( this . classFileOffset + <NUM_LIT:3> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_wide ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ret ; writeUnsignedShort ( index ) ; } else { if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_ret ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) index ; } } public void return_ ( ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_return ; this . lastAbruptCompletion = this . position ; } public void saload ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_saload ; } public void sastore ( ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -= <NUM_LIT:3> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_sastore ; } public void sendOperator ( int operatorConstant , int type_ID ) { switch ( type_ID ) { case TypeIds . T_int : case TypeIds . T_boolean : case TypeIds . T_char : case TypeIds . T_byte : case TypeIds . T_short : switch ( operatorConstant ) { case OperatorIds . PLUS : iadd ( ) ; break ; case OperatorIds . MINUS : isub ( ) ; break ; case OperatorIds . MULTIPLY : imul ( ) ; break ; case OperatorIds . DIVIDE : idiv ( ) ; break ; case OperatorIds . REMAINDER : irem ( ) ; break ; case OperatorIds . LEFT_SHIFT : ishl ( ) ; break ; case OperatorIds . RIGHT_SHIFT : ishr ( ) ; break ; case OperatorIds . UNSIGNED_RIGHT_SHIFT : iushr ( ) ; break ; case OperatorIds . AND : iand ( ) ; break ; case OperatorIds . OR : ior ( ) ; break ; case OperatorIds . XOR : ixor ( ) ; break ; } break ; case TypeIds . T_long : switch ( operatorConstant ) { case OperatorIds . PLUS : ladd ( ) ; break ; case OperatorIds . MINUS : lsub ( ) ; break ; case OperatorIds . MULTIPLY : lmul ( ) ; break ; case OperatorIds . DIVIDE : ldiv ( ) ; break ; case OperatorIds . REMAINDER : lrem ( ) ; break ; case OperatorIds . LEFT_SHIFT : lshl ( ) ; break ; case OperatorIds . RIGHT_SHIFT : lshr ( ) ; break ; case OperatorIds . UNSIGNED_RIGHT_SHIFT : lushr ( ) ; break ; case OperatorIds . AND : land ( ) ; break ; case OperatorIds . OR : lor ( ) ; break ; case OperatorIds . XOR : lxor ( ) ; break ; } break ; case TypeIds . T_float : switch ( operatorConstant ) { case OperatorIds . PLUS : fadd ( ) ; break ; case OperatorIds . MINUS : fsub ( ) ; break ; case OperatorIds . MULTIPLY : fmul ( ) ; break ; case OperatorIds . DIVIDE : fdiv ( ) ; break ; case OperatorIds . REMAINDER : frem ( ) ; } break ; case TypeIds . T_double : switch ( operatorConstant ) { case OperatorIds . PLUS : dadd ( ) ; break ; case OperatorIds . MINUS : dsub ( ) ; break ; case OperatorIds . MULTIPLY : dmul ( ) ; break ; case OperatorIds . DIVIDE : ddiv ( ) ; break ; case OperatorIds . REMAINDER : drem ( ) ; } } } public void sipush ( int s ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth ++ ; if ( this . stackDepth > this . stackMax ) this . stackMax = this . stackDepth ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_sipush ; writeSignedShort ( s ) ; } public void store ( LocalVariableBinding localBinding , boolean valueRequired ) { int localPosition = localBinding . resolvedPosition ; switch ( localBinding . type . id ) { case TypeIds . T_int : case TypeIds . T_char : case TypeIds . T_byte : case TypeIds . T_short : case TypeIds . T_boolean : if ( valueRequired ) dup ( ) ; switch ( localPosition ) { case <NUM_LIT:0> : istore_0 ( ) ; break ; case <NUM_LIT:1> : istore_1 ( ) ; break ; case <NUM_LIT:2> : istore_2 ( ) ; break ; case <NUM_LIT:3> : istore_3 ( ) ; break ; default : istore ( localPosition ) ; } break ; case TypeIds . T_float : if ( valueRequired ) dup ( ) ; switch ( localPosition ) { case <NUM_LIT:0> : fstore_0 ( ) ; break ; case <NUM_LIT:1> : fstore_1 ( ) ; break ; case <NUM_LIT:2> : fstore_2 ( ) ; break ; case <NUM_LIT:3> : fstore_3 ( ) ; break ; default : fstore ( localPosition ) ; } break ; case TypeIds . T_double : if ( valueRequired ) dup2 ( ) ; switch ( localPosition ) { case <NUM_LIT:0> : dstore_0 ( ) ; break ; case <NUM_LIT:1> : dstore_1 ( ) ; break ; case <NUM_LIT:2> : dstore_2 ( ) ; break ; case <NUM_LIT:3> : dstore_3 ( ) ; break ; default : dstore ( localPosition ) ; } break ; case TypeIds . T_long : if ( valueRequired ) dup2 ( ) ; switch ( localPosition ) { case <NUM_LIT:0> : lstore_0 ( ) ; break ; case <NUM_LIT:1> : lstore_1 ( ) ; break ; case <NUM_LIT:2> : lstore_2 ( ) ; break ; case <NUM_LIT:3> : lstore_3 ( ) ; break ; default : lstore ( localPosition ) ; } break ; default : if ( valueRequired ) dup ( ) ; switch ( localPosition ) { case <NUM_LIT:0> : astore_0 ( ) ; break ; case <NUM_LIT:1> : astore_1 ( ) ; break ; case <NUM_LIT:2> : astore_2 ( ) ; break ; case <NUM_LIT:3> : astore_3 ( ) ; break ; default : astore ( localPosition ) ; } } } public void swap ( ) { this . countLabels = <NUM_LIT:0> ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_swap ; } public void tableswitch ( CaseLabel defaultLabel , int low , int high , int [ ] keys , int [ ] sortedIndexes , CaseLabel [ ] casesLabel ) { this . countLabels = <NUM_LIT:0> ; this . stackDepth -- ; int length = casesLabel . length ; int pos = this . position ; defaultLabel . placeInstruction ( ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) casesLabel [ i ] . placeInstruction ( ) ; if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = Opcodes . OPC_tableswitch ; for ( int i = ( <NUM_LIT:3> - ( pos & <NUM_LIT:3> ) ) ; i > <NUM_LIT:0> ; i -- ) { if ( this . classFileOffset >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position ++ ; this . bCodeStream [ this . classFileOffset ++ ] = <NUM_LIT:0> ; } defaultLabel . branch ( ) ; writeSignedWord ( low ) ; writeSignedWord ( high ) ; int i = low , j = low ; while ( true ) { int index ; int key = keys [ index = sortedIndexes [ j - low ] ] ; if ( key == i ) { casesLabel [ index ] . branch ( ) ; j ++ ; if ( i == high ) break ; } else { defaultLabel . branch ( ) ; } i ++ ; } } public void throwAnyException ( LocalVariableBinding anyExceptionVariable ) { this . load ( anyExceptionVariable ) ; athrow ( ) ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( "<STR_LIT>" ) ; buffer . append ( this . position ) ; buffer . append ( "<STR_LIT>" ) ; buffer . append ( this . stackDepth ) ; buffer . append ( "<STR_LIT>" ) ; buffer . append ( this . stackMax ) ; buffer . append ( "<STR_LIT>" ) ; buffer . append ( this . maxLocals ) ; buffer . append ( "<STR_LIT:)>" ) ; return buffer . toString ( ) ; } public void updateLastRecordedEndPC ( Scope scope , int pos ) { if ( ( this . generateAttributes & ClassFileConstants . ATTR_LINES ) != <NUM_LIT:0> ) { this . lastEntryPC = pos ; } if ( ( this . generateAttributes & ( ClassFileConstants . ATTR_VARS | ClassFileConstants . ATTR_STACK_MAP_TABLE | ClassFileConstants . ATTR_STACK_MAP ) ) != <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> , max = this . locals . length ; i < max ; i ++ ) { LocalVariableBinding local = this . locals [ i ] ; if ( local != null && local . declaringScope == scope && local . initializationCount > <NUM_LIT:0> ) { if ( local . initializationPCs [ ( ( local . initializationCount - <NUM_LIT:1> ) << <NUM_LIT:1> ) + <NUM_LIT:1> ] == pos ) { local . initializationPCs [ ( ( local . initializationCount - <NUM_LIT:1> ) << <NUM_LIT:1> ) + <NUM_LIT:1> ] = this . position ; } } } } } protected void writePosition ( BranchLabel label ) { int offset = label . position - this . position + <NUM_LIT:1> ; if ( Math . abs ( offset ) > <NUM_LIT> && ! this . wideMode ) { throw new AbortMethod ( CodeStream . RESTART_IN_WIDE_MODE , null ) ; } this . writeSignedShort ( offset ) ; int [ ] forwardRefs = label . forwardReferences ( ) ; for ( int i = <NUM_LIT:0> , max = label . forwardReferenceCount ( ) ; i < max ; i ++ ) { this . writePosition ( label , forwardRefs [ i ] ) ; } } protected void writePosition ( BranchLabel label , int forwardReference ) { final int offset = label . position - forwardReference + <NUM_LIT:1> ; if ( Math . abs ( offset ) > <NUM_LIT> && ! this . wideMode ) { throw new AbortMethod ( CodeStream . RESTART_IN_WIDE_MODE , null ) ; } if ( this . wideMode ) { if ( ( label . tagBits & BranchLabel . WIDE ) != <NUM_LIT:0> ) { this . writeSignedWord ( forwardReference , offset ) ; } else { this . writeSignedShort ( forwardReference , offset ) ; } } else { this . writeSignedShort ( forwardReference , offset ) ; } } private final void writeSignedShort ( int value ) { if ( this . classFileOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) ( value > > <NUM_LIT:8> ) ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) value ; } private final void writeSignedShort ( int pos , int value ) { int currentOffset = this . startingClassFileOffset + pos ; if ( currentOffset + <NUM_LIT:1> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . bCodeStream [ currentOffset ] = ( byte ) ( value > > <NUM_LIT:8> ) ; this . bCodeStream [ currentOffset + <NUM_LIT:1> ] = ( byte ) value ; } protected final void writeSignedWord ( int value ) { if ( this . classFileOffset + <NUM_LIT:3> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . position += <NUM_LIT:4> ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) ( ( value & <NUM_LIT> ) > > <NUM_LIT:24> ) ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) ( ( value & <NUM_LIT> ) > > <NUM_LIT:16> ) ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) ( ( value & <NUM_LIT> ) > > <NUM_LIT:8> ) ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) ( value & <NUM_LIT> ) ; } protected void writeSignedWord ( int pos , int value ) { int currentOffset = this . startingClassFileOffset + pos ; if ( currentOffset + <NUM_LIT:3> >= this . bCodeStream . length ) { resizeByteArray ( ) ; } this . bCodeStream [ currentOffset ++ ] = ( byte ) ( ( value & <NUM_LIT> ) > > <NUM_LIT:24> ) ; this . bCodeStream [ currentOffset ++ ] = ( byte ) ( ( value & <NUM_LIT> ) > > <NUM_LIT:16> ) ; this . bCodeStream [ currentOffset ++ ] = ( byte ) ( ( value & <NUM_LIT> ) > > <NUM_LIT:8> ) ; this . bCodeStream [ currentOffset ++ ] = ( byte ) ( value & <NUM_LIT> ) ; } private final void writeUnsignedShort ( int value ) { this . position += <NUM_LIT:2> ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) ( value > > > <NUM_LIT:8> ) ; this . bCodeStream [ this . classFileOffset ++ ] = ( byte ) value ; } protected void writeWidePosition ( BranchLabel label ) { int labelPos = label . position ; int offset = labelPos - this . position + <NUM_LIT:1> ; this . writeSignedWord ( offset ) ; int [ ] forwardRefs = label . forwardReferences ( ) ; for ( int i = <NUM_LIT:0> , max = label . forwardReferenceCount ( ) ; i < max ; i ++ ) { int forward = forwardRefs [ i ] ; offset = labelPos - forward + <NUM_LIT:1> ; this . writeSignedWord ( forward , offset ) ; } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . codegen ; public class ObjectCache { public Object keyTable [ ] ; public int valueTable [ ] ; int elementSize ; int threshold ; public ObjectCache ( ) { this ( <NUM_LIT> ) ; } public ObjectCache ( int initialCapacity ) { this . elementSize = <NUM_LIT:0> ; this . threshold = ( int ) ( initialCapacity * <NUM_LIT> ) ; this . keyTable = new Object [ initialCapacity ] ; this . valueTable = new int [ initialCapacity ] ; } public void clear ( ) { for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) { this . keyTable [ i ] = null ; this . valueTable [ i ] = <NUM_LIT:0> ; } this . elementSize = <NUM_LIT:0> ; } public boolean containsKey ( Object key ) { int index = hashCode ( key ) , length = this . keyTable . length ; while ( this . keyTable [ index ] != null ) { if ( this . keyTable [ index ] == key ) return true ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return false ; } public int get ( Object key ) { int index = hashCode ( key ) , length = this . keyTable . length ; while ( this . keyTable [ index ] != null ) { if ( this . keyTable [ index ] == key ) return this . valueTable [ index ] ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return - <NUM_LIT:1> ; } public int hashCode ( Object key ) { return ( key . hashCode ( ) & <NUM_LIT> ) % this . keyTable . length ; } public int put ( Object key , int value ) { int index = hashCode ( key ) , length = this . keyTable . length ; while ( this . keyTable [ index ] != null ) { if ( this . keyTable [ index ] == key ) return this . valueTable [ index ] = value ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } this . keyTable [ index ] = key ; this . valueTable [ index ] = value ; if ( ++ this . elementSize > this . threshold ) rehash ( ) ; return value ; } private void rehash ( ) { ObjectCache newHashtable = new ObjectCache ( this . keyTable . length * <NUM_LIT:2> ) ; for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) if ( this . keyTable [ i ] != null ) newHashtable . put ( this . keyTable [ i ] , this . valueTable [ i ] ) ; this . keyTable = newHashtable . keyTable ; this . valueTable = newHashtable . valueTable ; this . threshold = newHashtable . threshold ; } public int size ( ) { return this . elementSize ; } public String toString ( ) { int max = size ( ) ; StringBuffer buf = new StringBuffer ( ) ; buf . append ( "<STR_LIT:{>" ) ; for ( int i = <NUM_LIT:0> ; i < max ; ++ i ) { if ( this . keyTable [ i ] != null ) { buf . append ( this . keyTable [ i ] ) . append ( "<STR_LIT>" ) . append ( this . valueTable [ i ] ) ; } if ( i < max ) { buf . append ( "<STR_LIT:U+002CU+0020>" ) ; } } buf . append ( "<STR_LIT:}>" ) ; return buf . toString ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . codegen ; public class FloatCache { private float keyTable [ ] ; private int valueTable [ ] ; private int elementSize ; public FloatCache ( ) { this ( <NUM_LIT> ) ; } public FloatCache ( int initialCapacity ) { this . elementSize = <NUM_LIT:0> ; this . keyTable = new float [ initialCapacity ] ; this . valueTable = new int [ initialCapacity ] ; } public void clear ( ) { for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) { this . keyTable [ i ] = <NUM_LIT:0.0f> ; this . valueTable [ i ] = <NUM_LIT:0> ; } this . elementSize = <NUM_LIT:0> ; } public boolean containsKey ( float key ) { if ( key == <NUM_LIT:0.0f> ) { for ( int i = <NUM_LIT:0> , max = this . elementSize ; i < max ; i ++ ) { if ( this . keyTable [ i ] == <NUM_LIT:0.0f> ) { int value1 = Float . floatToIntBits ( key ) ; int value2 = Float . floatToIntBits ( this . keyTable [ i ] ) ; if ( value1 == - <NUM_LIT> && value2 == - <NUM_LIT> ) return true ; if ( value1 == <NUM_LIT:0> && value2 == <NUM_LIT:0> ) return true ; } } } else { for ( int i = <NUM_LIT:0> , max = this . elementSize ; i < max ; i ++ ) { if ( this . keyTable [ i ] == key ) { return true ; } } } return false ; } public int put ( float key , int value ) { if ( this . elementSize == this . keyTable . length ) { System . arraycopy ( this . keyTable , <NUM_LIT:0> , ( this . keyTable = new float [ this . elementSize * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . elementSize ) ; System . arraycopy ( this . valueTable , <NUM_LIT:0> , ( this . valueTable = new int [ this . elementSize * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . elementSize ) ; } this . keyTable [ this . elementSize ] = key ; this . valueTable [ this . elementSize ] = value ; this . elementSize ++ ; return value ; } public int putIfAbsent ( float key , int value ) { if ( key == <NUM_LIT:0.0f> ) { for ( int i = <NUM_LIT:0> , max = this . elementSize ; i < max ; i ++ ) { if ( this . keyTable [ i ] == <NUM_LIT:0.0f> ) { int value1 = Float . floatToIntBits ( key ) ; int value2 = Float . floatToIntBits ( this . keyTable [ i ] ) ; if ( value1 == - <NUM_LIT> && value2 == - <NUM_LIT> ) return this . valueTable [ i ] ; if ( value1 == <NUM_LIT:0> && value2 == <NUM_LIT:0> ) return this . valueTable [ i ] ; } } } else { for ( int i = <NUM_LIT:0> , max = this . elementSize ; i < max ; i ++ ) { if ( this . keyTable [ i ] == key ) { return this . valueTable [ i ] ; } } } if ( this . elementSize == this . keyTable . length ) { System . arraycopy ( this . keyTable , <NUM_LIT:0> , ( this . keyTable = new float [ this . elementSize * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . elementSize ) ; System . arraycopy ( this . valueTable , <NUM_LIT:0> , ( this . valueTable = new int [ this . elementSize * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . elementSize ) ; } this . keyTable [ this . elementSize ] = key ; this . valueTable [ this . elementSize ] = value ; this . elementSize ++ ; return - value ; } public String toString ( ) { int max = this . elementSize ; StringBuffer buf = new StringBuffer ( ) ; buf . append ( "<STR_LIT:{>" ) ; for ( int i = <NUM_LIT:0> ; i < max ; ++ i ) { if ( ( this . keyTable [ i ] != <NUM_LIT:0> ) || ( ( this . keyTable [ i ] == <NUM_LIT:0> ) && ( this . valueTable [ i ] != <NUM_LIT:0> ) ) ) { buf . append ( this . keyTable [ i ] ) . append ( "<STR_LIT>" ) . append ( this . valueTable [ i ] ) ; } if ( i < max ) { buf . append ( "<STR_LIT:U+002CU+0020>" ) ; } } buf . append ( "<STR_LIT:}>" ) ; return buf . toString ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . codegen ; public interface AttributeNamesConstants { final char [ ] SyntheticName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] ConstantValueName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] LineNumberTableName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] LocalVariableTableName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] InnerClassName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] CodeName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] ExceptionsName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] SourceName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] DeprecatedName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] SignatureName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] LocalVariableTypeTableName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] EnclosingMethodName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] AnnotationDefaultName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] RuntimeInvisibleAnnotationsName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] RuntimeVisibleAnnotationsName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] RuntimeInvisibleParameterAnnotationsName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] RuntimeVisibleParameterAnnotationsName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] StackMapTableName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] InconsistentHierarchy = "<STR_LIT>" . toCharArray ( ) ; final char [ ] VarargsName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] StackMapName = "<STR_LIT>" . toCharArray ( ) ; final char [ ] MissingTypesName = "<STR_LIT>" . toCharArray ( ) ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . codegen ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . HashMap ; import java . util . HashSet ; import java . util . Iterator ; import java . util . Set ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ClassFile ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . lookup . Binding ; import org . eclipse . jdt . internal . compiler . lookup . FieldBinding ; import org . eclipse . jdt . internal . compiler . lookup . LocalVariableBinding ; import org . eclipse . jdt . internal . compiler . lookup . MethodBinding ; import org . eclipse . jdt . internal . compiler . lookup . Scope ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; import org . eclipse . jdt . internal . compiler . problem . AbortMethod ; public class StackMapFrameCodeStream extends CodeStream { public static class ExceptionMarker implements Comparable { public char [ ] constantPoolName ; public int pc ; public ExceptionMarker ( int pc , char [ ] constantPoolName ) { this . pc = pc ; this . constantPoolName = constantPoolName ; } public int compareTo ( Object o ) { if ( o instanceof ExceptionMarker ) { return this . pc - ( ( ExceptionMarker ) o ) . pc ; } return <NUM_LIT:0> ; } public boolean equals ( Object obj ) { if ( obj instanceof ExceptionMarker ) { ExceptionMarker marker = ( ExceptionMarker ) obj ; return this . pc == marker . pc && CharOperation . equals ( this . constantPoolName , marker . constantPoolName ) ; } return false ; } public int hashCode ( ) { return this . pc + this . constantPoolName . hashCode ( ) ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( '<CHAR_LIT:(>' ) . append ( this . pc ) . append ( '<CHAR_LIT:U+002C>' ) . append ( this . constantPoolName ) . append ( '<CHAR_LIT:)>' ) ; return String . valueOf ( buffer ) ; } } public static class StackDepthMarker { public int pc ; public int delta ; public TypeBinding typeBinding ; public StackDepthMarker ( int pc , int delta , TypeBinding typeBinding ) { this . pc = pc ; this . typeBinding = typeBinding ; this . delta = delta ; } public StackDepthMarker ( int pc , int delta ) { this . pc = pc ; this . delta = delta ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( '<CHAR_LIT:(>' ) . append ( this . pc ) . append ( '<CHAR_LIT:U+002C>' ) . append ( this . delta ) ; if ( this . typeBinding != null ) { buffer . append ( '<CHAR_LIT:U+002C>' ) . append ( this . typeBinding . qualifiedPackageName ( ) ) . append ( this . typeBinding . qualifiedSourceName ( ) ) ; } buffer . append ( '<CHAR_LIT:)>' ) ; return String . valueOf ( buffer ) ; } } public static class StackMarker { public int pc ; public int destinationPC ; public VerificationTypeInfo [ ] infos ; public StackMarker ( int pc , int destinationPC ) { this . pc = pc ; this . destinationPC = destinationPC ; } public void setInfos ( VerificationTypeInfo [ ] infos ) { this . infos = infos ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( "<STR_LIT>" ) . append ( this . pc ) . append ( "<STR_LIT:U+0020toU+0020>" ) . append ( this . destinationPC ) ; if ( this . infos != null ) { for ( int i = <NUM_LIT:0> , max = this . infos . length ; i < max ; i ++ ) { if ( i > <NUM_LIT:0> ) buffer . append ( '<CHAR_LIT:U+002C>' ) ; buffer . append ( this . infos [ i ] ) ; } } buffer . append ( '<CHAR_LIT:]>' ) ; return String . valueOf ( buffer ) ; } } static class FramePosition { int counter ; } public int [ ] stateIndexes ; public int stateIndexesCounter ; private HashMap framePositions ; public Set exceptionMarkers ; public ArrayList stackDepthMarkers ; public ArrayList stackMarkers ; public StackMapFrameCodeStream ( ClassFile givenClassFile ) { super ( givenClassFile ) ; this . generateAttributes |= ClassFileConstants . ATTR_STACK_MAP ; } public void addDefinitelyAssignedVariables ( Scope scope , int initStateIndex ) { loop : for ( int i = <NUM_LIT:0> ; i < this . visibleLocalsCount ; i ++ ) { LocalVariableBinding localBinding = this . visibleLocals [ i ] ; if ( localBinding != null ) { boolean isDefinitelyAssigned = isDefinitelyAssigned ( scope , initStateIndex , localBinding ) ; if ( ! isDefinitelyAssigned ) { if ( this . stateIndexes != null ) { for ( int j = <NUM_LIT:0> , max = this . stateIndexesCounter ; j < max ; j ++ ) { if ( isDefinitelyAssigned ( scope , this . stateIndexes [ j ] , localBinding ) ) { if ( ( localBinding . initializationCount == <NUM_LIT:0> ) || ( localBinding . initializationPCs [ ( ( localBinding . initializationCount - <NUM_LIT:1> ) << <NUM_LIT:1> ) + <NUM_LIT:1> ] != - <NUM_LIT:1> ) ) { localBinding . recordInitializationStartPC ( this . position ) ; } continue loop ; } } } } else { if ( ( localBinding . initializationCount == <NUM_LIT:0> ) || ( localBinding . initializationPCs [ ( ( localBinding . initializationCount - <NUM_LIT:1> ) << <NUM_LIT:1> ) + <NUM_LIT:1> ] != - <NUM_LIT:1> ) ) { localBinding . recordInitializationStartPC ( this . position ) ; } } } } } public void addExceptionMarker ( int pc , TypeBinding typeBinding ) { if ( this . exceptionMarkers == null ) { this . exceptionMarkers = new HashSet ( ) ; } if ( typeBinding == null ) { this . exceptionMarkers . add ( new ExceptionMarker ( pc , ConstantPool . JavaLangThrowableConstantPoolName ) ) ; } else { switch ( typeBinding . id ) { case TypeIds . T_null : this . exceptionMarkers . add ( new ExceptionMarker ( pc , ConstantPool . JavaLangClassNotFoundExceptionConstantPoolName ) ) ; break ; case TypeIds . T_long : this . exceptionMarkers . add ( new ExceptionMarker ( pc , ConstantPool . JavaLangNoSuchFieldErrorConstantPoolName ) ) ; break ; default : this . exceptionMarkers . add ( new ExceptionMarker ( pc , typeBinding . constantPoolName ( ) ) ) ; } } } public void addFramePosition ( int pc ) { Integer newEntry = new Integer ( pc ) ; FramePosition value ; if ( ( value = ( FramePosition ) this . framePositions . get ( newEntry ) ) != null ) { value . counter ++ ; } else { this . framePositions . put ( newEntry , new FramePosition ( ) ) ; } } public void optimizeBranch ( int oldPosition , BranchLabel lbl ) { super . optimizeBranch ( oldPosition , lbl ) ; removeFramePosition ( oldPosition ) ; } public void removeFramePosition ( int pc ) { Integer entry = new Integer ( pc ) ; FramePosition value ; if ( ( value = ( FramePosition ) this . framePositions . get ( entry ) ) != null ) { value . counter -- ; if ( value . counter <= <NUM_LIT:0> ) { this . framePositions . remove ( entry ) ; } } } public void addVariable ( LocalVariableBinding localBinding ) { if ( localBinding . initializationPCs == null ) { record ( localBinding ) ; } localBinding . recordInitializationStartPC ( this . position ) ; } private void addStackMarker ( int pc , int destinationPC ) { if ( this . stackMarkers == null ) { this . stackMarkers = new ArrayList ( ) ; this . stackMarkers . add ( new StackMarker ( pc , destinationPC ) ) ; } else { int size = this . stackMarkers . size ( ) ; if ( size == <NUM_LIT:0> || ( ( StackMarker ) this . stackMarkers . get ( size - <NUM_LIT:1> ) ) . pc != this . position ) { this . stackMarkers . add ( new StackMarker ( pc , destinationPC ) ) ; } } } private void addStackDepthMarker ( int pc , int delta , TypeBinding typeBinding ) { if ( this . stackDepthMarkers == null ) { this . stackDepthMarkers = new ArrayList ( ) ; this . stackDepthMarkers . add ( new StackDepthMarker ( pc , delta , typeBinding ) ) ; } else { int size = this . stackDepthMarkers . size ( ) ; if ( size == <NUM_LIT:0> ) { this . stackDepthMarkers . add ( new StackDepthMarker ( pc , delta , typeBinding ) ) ; } else { StackDepthMarker stackDepthMarker = ( StackDepthMarker ) this . stackDepthMarkers . get ( size - <NUM_LIT:1> ) ; if ( stackDepthMarker . pc != this . position ) { this . stackDepthMarkers . add ( new StackDepthMarker ( pc , delta , typeBinding ) ) ; } else { this . stackDepthMarkers . set ( size - <NUM_LIT:1> , new StackDepthMarker ( pc , delta , typeBinding ) ) ; } } } } public void decrStackSize ( int offset ) { super . decrStackSize ( offset ) ; addStackDepthMarker ( this . position , - <NUM_LIT:1> , null ) ; } public void recordExpressionType ( TypeBinding typeBinding ) { addStackDepthMarker ( this . position , <NUM_LIT:0> , typeBinding ) ; } public void generateClassLiteralAccessForType ( TypeBinding accessedType , FieldBinding syntheticFieldBinding ) { if ( accessedType . isBaseType ( ) && accessedType != TypeBinding . NULL ) { getTYPE ( accessedType . id ) ; return ; } if ( this . targetLevel >= ClassFileConstants . JDK1_5 ) { this . ldc ( accessedType ) ; } else { BranchLabel endLabel = new BranchLabel ( this ) ; if ( syntheticFieldBinding != null ) { fieldAccess ( Opcodes . OPC_getstatic , syntheticFieldBinding , null ) ; dup ( ) ; ifnonnull ( endLabel ) ; pop ( ) ; } ExceptionLabel classNotFoundExceptionHandler = new ExceptionLabel ( this , TypeBinding . NULL ) ; classNotFoundExceptionHandler . placeStart ( ) ; this . ldc ( accessedType == TypeBinding . NULL ? "<STR_LIT>" : String . valueOf ( accessedType . constantPoolName ( ) ) . replace ( '<CHAR_LIT:/>' , '<CHAR_LIT:.>' ) ) ; invokeClassForName ( ) ; classNotFoundExceptionHandler . placeEnd ( ) ; if ( syntheticFieldBinding != null ) { dup ( ) ; fieldAccess ( Opcodes . OPC_putstatic , syntheticFieldBinding , null ) ; } int fromPC = this . position ; goto_ ( endLabel ) ; int savedStackDepth = this . stackDepth ; pushExceptionOnStack ( TypeBinding . NULL ) ; classNotFoundExceptionHandler . place ( ) ; newNoClassDefFoundError ( ) ; dup_x1 ( ) ; swap ( ) ; invokeThrowableGetMessage ( ) ; invokeNoClassDefFoundErrorStringConstructor ( ) ; athrow ( ) ; endLabel . place ( ) ; addStackMarker ( fromPC , this . position ) ; this . stackDepth = savedStackDepth ; } } public void generateOuterAccess ( Object [ ] mappingSequence , ASTNode invocationSite , Binding target , Scope scope ) { int currentPosition = this . position ; super . generateOuterAccess ( mappingSequence , invocationSite , target , scope ) ; if ( currentPosition == this . position ) { throw new AbortMethod ( scope . referenceCompilationUnit ( ) . compilationResult , null ) ; } } public ExceptionMarker [ ] getExceptionMarkers ( ) { Set exceptionMarkerSet = this . exceptionMarkers ; if ( this . exceptionMarkers == null ) return null ; int size = exceptionMarkerSet . size ( ) ; ExceptionMarker [ ] markers = new ExceptionMarker [ size ] ; int n = <NUM_LIT:0> ; for ( Iterator iterator = exceptionMarkerSet . iterator ( ) ; iterator . hasNext ( ) ; ) { markers [ n ++ ] = ( ExceptionMarker ) iterator . next ( ) ; } Arrays . sort ( markers ) ; return markers ; } public int [ ] getFramePositions ( ) { Set set = this . framePositions . keySet ( ) ; int size = set . size ( ) ; int [ ] positions = new int [ size ] ; int n = <NUM_LIT:0> ; for ( Iterator iterator = set . iterator ( ) ; iterator . hasNext ( ) ; ) { positions [ n ++ ] = ( ( Integer ) iterator . next ( ) ) . intValue ( ) ; } Arrays . sort ( positions ) ; return positions ; } public StackDepthMarker [ ] getStackDepthMarkers ( ) { if ( this . stackDepthMarkers == null ) return null ; int length = this . stackDepthMarkers . size ( ) ; if ( length == <NUM_LIT:0> ) return null ; StackDepthMarker [ ] result = new StackDepthMarker [ length ] ; this . stackDepthMarkers . toArray ( result ) ; return result ; } public StackMarker [ ] getStackMarkers ( ) { if ( this . stackMarkers == null ) return null ; int length = this . stackMarkers . size ( ) ; if ( length == <NUM_LIT:0> ) return null ; StackMarker [ ] result = new StackMarker [ length ] ; this . stackMarkers . toArray ( result ) ; return result ; } public boolean hasFramePositions ( ) { return this . framePositions . size ( ) != <NUM_LIT:0> ; } public void init ( ClassFile targetClassFile ) { super . init ( targetClassFile ) ; this . stateIndexesCounter = <NUM_LIT:0> ; if ( this . framePositions != null ) { this . framePositions . clear ( ) ; } if ( this . exceptionMarkers != null ) { this . exceptionMarkers . clear ( ) ; } if ( this . stackDepthMarkers != null ) { this . stackDepthMarkers . clear ( ) ; } if ( this . stackMarkers != null ) { this . stackMarkers . clear ( ) ; } } public void initializeMaxLocals ( MethodBinding methodBinding ) { super . initializeMaxLocals ( methodBinding ) ; if ( this . framePositions == null ) { this . framePositions = new HashMap ( ) ; } else { this . framePositions . clear ( ) ; } } public void popStateIndex ( ) { this . stateIndexesCounter -- ; } public void pushStateIndex ( int naturalExitMergeInitStateIndex ) { if ( this . stateIndexes == null ) { this . stateIndexes = new int [ <NUM_LIT:3> ] ; } int length = this . stateIndexes . length ; if ( length == this . stateIndexesCounter ) { System . arraycopy ( this . stateIndexes , <NUM_LIT:0> , ( this . stateIndexes = new int [ length * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . stateIndexes [ this . stateIndexesCounter ++ ] = naturalExitMergeInitStateIndex ; } public void removeNotDefinitelyAssignedVariables ( Scope scope , int initStateIndex ) { int index = this . visibleLocalsCount ; loop : for ( int i = <NUM_LIT:0> ; i < index ; i ++ ) { LocalVariableBinding localBinding = this . visibleLocals [ i ] ; if ( localBinding != null && localBinding . initializationCount > <NUM_LIT:0> ) { boolean isDefinitelyAssigned = isDefinitelyAssigned ( scope , initStateIndex , localBinding ) ; if ( ! isDefinitelyAssigned ) { if ( this . stateIndexes != null ) { for ( int j = <NUM_LIT:0> , max = this . stateIndexesCounter ; j < max ; j ++ ) { if ( isDefinitelyAssigned ( scope , this . stateIndexes [ j ] , localBinding ) ) { continue loop ; } } } localBinding . recordInitializationEndPC ( this . position ) ; } } } } public void reset ( ClassFile givenClassFile ) { super . reset ( givenClassFile ) ; this . stateIndexesCounter = <NUM_LIT:0> ; if ( this . framePositions != null ) { this . framePositions . clear ( ) ; } if ( this . exceptionMarkers != null ) { this . exceptionMarkers . clear ( ) ; } if ( this . stackDepthMarkers != null ) { this . stackDepthMarkers . clear ( ) ; } if ( this . stackMarkers != null ) { this . stackMarkers . clear ( ) ; } } protected void writePosition ( BranchLabel label ) { super . writePosition ( label ) ; addFramePosition ( label . position ) ; } protected void writePosition ( BranchLabel label , int forwardReference ) { super . writePosition ( label , forwardReference ) ; addFramePosition ( label . position ) ; } protected void writeSignedWord ( int pos , int value ) { super . writeSignedWord ( pos , value ) ; addFramePosition ( this . position ) ; } protected void writeWidePosition ( BranchLabel label ) { super . writeWidePosition ( label ) ; addFramePosition ( label . position ) ; } public void areturn ( ) { super . areturn ( ) ; addFramePosition ( this . position ) ; } public void ireturn ( ) { super . ireturn ( ) ; addFramePosition ( this . position ) ; } public void lreturn ( ) { super . lreturn ( ) ; addFramePosition ( this . position ) ; } public void freturn ( ) { super . freturn ( ) ; addFramePosition ( this . position ) ; } public void dreturn ( ) { super . dreturn ( ) ; addFramePosition ( this . position ) ; } public void return_ ( ) { super . return_ ( ) ; addFramePosition ( this . position ) ; } public void athrow ( ) { super . athrow ( ) ; addFramePosition ( this . position ) ; } public void pushOnStack ( TypeBinding binding ) { super . pushOnStack ( binding ) ; addStackDepthMarker ( this . position , <NUM_LIT:1> , binding ) ; } public void pushExceptionOnStack ( TypeBinding binding ) { super . pushExceptionOnStack ( binding ) ; addExceptionMarker ( this . position , binding ) ; } public void goto_ ( BranchLabel label ) { super . goto_ ( label ) ; addFramePosition ( this . position ) ; } public void goto_w ( BranchLabel label ) { super . goto_w ( label ) ; addFramePosition ( this . position ) ; } public void resetInWideMode ( ) { this . resetSecretLocals ( ) ; super . resetInWideMode ( ) ; } public void resetForCodeGenUnusedLocals ( ) { this . resetSecretLocals ( ) ; super . resetForCodeGenUnusedLocals ( ) ; } public void resetSecretLocals ( ) { for ( int i = <NUM_LIT:0> , max = this . locals . length ; i < max ; i ++ ) { LocalVariableBinding localVariableBinding = this . locals [ i ] ; if ( localVariableBinding != null && localVariableBinding . isSecret ( ) ) { localVariableBinding . resetInitializations ( ) ; } } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . codegen ; public class CachedIndexEntry { public char [ ] signature ; public int index ; public CachedIndexEntry ( char [ ] signature , int index ) { this . signature = signature ; this . index = index ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . codegen ; import java . util . Arrays ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . lookup . LocalVariableBinding ; public class BranchLabel extends Label { private int [ ] forwardReferences = new int [ <NUM_LIT:10> ] ; private int forwardReferenceCount = <NUM_LIT:0> ; BranchLabel delegate ; public int tagBits ; public final static int WIDE = <NUM_LIT:1> ; public final static int USED = <NUM_LIT:2> ; public BranchLabel ( ) { } public BranchLabel ( CodeStream codeStream ) { super ( codeStream ) ; } void addForwardReference ( int pos ) { if ( this . delegate != null ) { this . delegate . addForwardReference ( pos ) ; return ; } final int count = this . forwardReferenceCount ; if ( count >= <NUM_LIT:1> ) { int previousValue = this . forwardReferences [ count - <NUM_LIT:1> ] ; if ( previousValue < pos ) { int length ; if ( count >= ( length = this . forwardReferences . length ) ) System . arraycopy ( this . forwardReferences , <NUM_LIT:0> , ( this . forwardReferences = new int [ <NUM_LIT:2> * length ] ) , <NUM_LIT:0> , length ) ; this . forwardReferences [ this . forwardReferenceCount ++ ] = pos ; } else if ( previousValue > pos ) { int [ ] refs = this . forwardReferences ; for ( int i = <NUM_LIT:0> , max = this . forwardReferenceCount ; i < max ; i ++ ) { if ( refs [ i ] == pos ) return ; } int length ; if ( count >= ( length = refs . length ) ) System . arraycopy ( refs , <NUM_LIT:0> , ( this . forwardReferences = new int [ <NUM_LIT:2> * length ] ) , <NUM_LIT:0> , length ) ; this . forwardReferences [ this . forwardReferenceCount ++ ] = pos ; Arrays . sort ( this . forwardReferences , <NUM_LIT:0> , this . forwardReferenceCount ) ; } } else { int length ; if ( count >= ( length = this . forwardReferences . length ) ) System . arraycopy ( this . forwardReferences , <NUM_LIT:0> , ( this . forwardReferences = new int [ <NUM_LIT:2> * length ] ) , <NUM_LIT:0> , length ) ; this . forwardReferences [ this . forwardReferenceCount ++ ] = pos ; } } public void becomeDelegateFor ( BranchLabel otherLabel ) { otherLabel . delegate = this ; final int otherCount = otherLabel . forwardReferenceCount ; if ( otherCount == <NUM_LIT:0> ) return ; int [ ] mergedForwardReferences = new int [ this . forwardReferenceCount + otherCount ] ; int indexInMerge = <NUM_LIT:0> ; int j = <NUM_LIT:0> ; int i = <NUM_LIT:0> ; int max = this . forwardReferenceCount ; int max2 = otherLabel . forwardReferenceCount ; loop1 : for ( ; i < max ; i ++ ) { final int value1 = this . forwardReferences [ i ] ; for ( ; j < max2 ; j ++ ) { final int value2 = otherLabel . forwardReferences [ j ] ; if ( value1 < value2 ) { mergedForwardReferences [ indexInMerge ++ ] = value1 ; continue loop1 ; } else if ( value1 == value2 ) { mergedForwardReferences [ indexInMerge ++ ] = value1 ; j ++ ; continue loop1 ; } else { mergedForwardReferences [ indexInMerge ++ ] = value2 ; } } mergedForwardReferences [ indexInMerge ++ ] = value1 ; } for ( ; j < max2 ; j ++ ) { mergedForwardReferences [ indexInMerge ++ ] = otherLabel . forwardReferences [ j ] ; } this . forwardReferences = mergedForwardReferences ; this . forwardReferenceCount = indexInMerge ; } void branch ( ) { this . tagBits |= BranchLabel . USED ; if ( this . delegate != null ) { this . delegate . branch ( ) ; return ; } if ( this . position == Label . POS_NOT_SET ) { addForwardReference ( this . codeStream . position ) ; this . codeStream . position += <NUM_LIT:2> ; this . codeStream . classFileOffset += <NUM_LIT:2> ; } else { this . codeStream . writePosition ( this ) ; } } void branchWide ( ) { this . tagBits |= BranchLabel . USED ; if ( this . delegate != null ) { this . delegate . branchWide ( ) ; return ; } if ( this . position == Label . POS_NOT_SET ) { addForwardReference ( this . codeStream . position ) ; this . tagBits |= BranchLabel . WIDE ; this . codeStream . position += <NUM_LIT:4> ; this . codeStream . classFileOffset += <NUM_LIT:4> ; } else { this . codeStream . writeWidePosition ( this ) ; } } public int forwardReferenceCount ( ) { if ( this . delegate != null ) this . delegate . forwardReferenceCount ( ) ; return this . forwardReferenceCount ; } public int [ ] forwardReferences ( ) { if ( this . delegate != null ) this . delegate . forwardReferences ( ) ; return this . forwardReferences ; } public void initialize ( CodeStream stream ) { this . codeStream = stream ; this . position = Label . POS_NOT_SET ; this . forwardReferenceCount = <NUM_LIT:0> ; this . delegate = null ; } public boolean isCaseLabel ( ) { return false ; } public boolean isStandardLabel ( ) { return true ; } public void place ( ) { if ( this . position == Label . POS_NOT_SET ) { this . position = this . codeStream . position ; this . codeStream . addLabel ( this ) ; int oldPosition = this . position ; boolean isOptimizedBranch = false ; if ( this . forwardReferenceCount != <NUM_LIT:0> ) { isOptimizedBranch = ( this . forwardReferences [ this . forwardReferenceCount - <NUM_LIT:1> ] + <NUM_LIT:2> == this . position ) && ( this . codeStream . bCodeStream [ this . codeStream . classFileOffset - <NUM_LIT:3> ] == Opcodes . OPC_goto ) ; if ( isOptimizedBranch ) { if ( this . codeStream . lastAbruptCompletion == this . position ) { this . codeStream . lastAbruptCompletion = - <NUM_LIT:1> ; } this . codeStream . position = ( this . position -= <NUM_LIT:3> ) ; this . codeStream . classFileOffset -= <NUM_LIT:3> ; this . forwardReferenceCount -- ; if ( this . codeStream . lastEntryPC == oldPosition ) { this . codeStream . lastEntryPC = this . position ; } if ( ( this . codeStream . generateAttributes & ( ClassFileConstants . ATTR_VARS | ClassFileConstants . ATTR_STACK_MAP_TABLE | ClassFileConstants . ATTR_STACK_MAP ) ) != <NUM_LIT:0> ) { LocalVariableBinding locals [ ] = this . codeStream . locals ; for ( int i = <NUM_LIT:0> , max = locals . length ; i < max ; i ++ ) { LocalVariableBinding local = locals [ i ] ; if ( ( local != null ) && ( local . initializationCount > <NUM_LIT:0> ) ) { if ( local . initializationPCs [ ( ( local . initializationCount - <NUM_LIT:1> ) << <NUM_LIT:1> ) + <NUM_LIT:1> ] == oldPosition ) { local . initializationPCs [ ( ( local . initializationCount - <NUM_LIT:1> ) << <NUM_LIT:1> ) + <NUM_LIT:1> ] = this . position ; } if ( local . initializationPCs [ ( local . initializationCount - <NUM_LIT:1> ) << <NUM_LIT:1> ] == oldPosition ) { local . initializationPCs [ ( local . initializationCount - <NUM_LIT:1> ) << <NUM_LIT:1> ] = this . position ; } } } } if ( ( this . codeStream . generateAttributes & ClassFileConstants . ATTR_LINES ) != <NUM_LIT:0> ) { this . codeStream . removeUnusedPcToSourceMapEntries ( ) ; } } } for ( int i = <NUM_LIT:0> ; i < this . forwardReferenceCount ; i ++ ) { this . codeStream . writePosition ( this , this . forwardReferences [ i ] ) ; } if ( isOptimizedBranch ) { this . codeStream . optimizeBranch ( oldPosition , this ) ; } } } public String toString ( ) { String basic = getClass ( ) . getName ( ) ; basic = basic . substring ( basic . lastIndexOf ( '<CHAR_LIT:.>' ) + <NUM_LIT:1> ) ; StringBuffer buffer = new StringBuffer ( basic ) ; buffer . append ( '<CHAR_LIT>' ) . append ( Integer . toHexString ( hashCode ( ) ) ) ; buffer . append ( "<STR_LIT>" ) . append ( this . position ) ; if ( this . delegate != null ) buffer . append ( "<STR_LIT>" ) . append ( this . delegate ) ; buffer . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> ; i < this . forwardReferenceCount - <NUM_LIT:1> ; i ++ ) buffer . append ( this . forwardReferences [ i ] + "<STR_LIT:U+002CU+0020>" ) ; if ( this . forwardReferenceCount >= <NUM_LIT:1> ) buffer . append ( this . forwardReferences [ this . forwardReferenceCount - <NUM_LIT:1> ] ) ; buffer . append ( "<STR_LIT>" ) ; return buffer . toString ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . codegen ; import org . eclipse . jdt . internal . compiler . ast . UnionTypeReference ; import org . eclipse . jdt . internal . compiler . ast . TypeReference ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; public class MultiCatchExceptionLabel extends ExceptionLabel { ExceptionLabel [ ] exceptionLabels ; public MultiCatchExceptionLabel ( CodeStream codeStream , TypeBinding exceptionType ) { super ( codeStream , exceptionType ) ; } public void initialize ( UnionTypeReference typeReference ) { TypeReference [ ] typeReferences = typeReference . typeReferences ; int length = typeReferences . length ; this . exceptionLabels = new ExceptionLabel [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { this . exceptionLabels [ i ] = new ExceptionLabel ( this . codeStream , typeReferences [ i ] . resolvedType ) ; } } public void place ( ) { for ( int i = <NUM_LIT:0> , max = this . exceptionLabels . length ; i < max ; i ++ ) { this . exceptionLabels [ i ] . place ( ) ; } } public void placeEnd ( ) { for ( int i = <NUM_LIT:0> , max = this . exceptionLabels . length ; i < max ; i ++ ) { this . exceptionLabels [ i ] . placeEnd ( ) ; } } public void placeStart ( ) { for ( int i = <NUM_LIT:0> , max = this . exceptionLabels . length ; i < max ; i ++ ) { this . exceptionLabels [ i ] . placeStart ( ) ; } } public int getCount ( ) { int temp = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> , max = this . exceptionLabels . length ; i < max ; i ++ ) { temp += this . exceptionLabels [ i ] . getCount ( ) ; } return temp ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . codegen ; public class CaseLabel extends BranchLabel { public int instructionPosition = POS_NOT_SET ; public CaseLabel ( CodeStream codeStream ) { super ( codeStream ) ; } void branch ( ) { if ( this . position == POS_NOT_SET ) { addForwardReference ( this . codeStream . position ) ; this . codeStream . position += <NUM_LIT:4> ; this . codeStream . classFileOffset += <NUM_LIT:4> ; } else { this . codeStream . writeSignedWord ( this . position - this . instructionPosition ) ; } } void branchWide ( ) { branch ( ) ; } public boolean isCaseLabel ( ) { return true ; } public boolean isStandardLabel ( ) { return false ; } public void place ( ) { if ( ( this . tagBits & USED ) != <NUM_LIT:0> ) { this . position = this . codeStream . getPosition ( ) ; } else { this . position = this . codeStream . position ; } if ( this . instructionPosition != POS_NOT_SET ) { int offset = this . position - this . instructionPosition ; int [ ] forwardRefs = forwardReferences ( ) ; for ( int i = <NUM_LIT:0> , length = forwardReferenceCount ( ) ; i < length ; i ++ ) { this . codeStream . writeSignedWord ( forwardRefs [ i ] , offset ) ; } this . codeStream . addLabel ( this ) ; } } void placeInstruction ( ) { if ( this . instructionPosition == POS_NOT_SET ) { this . instructionPosition = this . codeStream . position ; } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . codegen ; public interface Opcodes { public static final byte OPC_nop = <NUM_LIT:0> ; public static final byte OPC_aconst_null = <NUM_LIT:1> ; public static final byte OPC_iconst_m1 = <NUM_LIT:2> ; public static final byte OPC_iconst_0 = <NUM_LIT:3> ; public static final byte OPC_iconst_1 = <NUM_LIT:4> ; public static final byte OPC_iconst_2 = <NUM_LIT:5> ; public static final byte OPC_iconst_3 = <NUM_LIT:6> ; public static final byte OPC_iconst_4 = <NUM_LIT:7> ; public static final byte OPC_iconst_5 = <NUM_LIT:8> ; public static final byte OPC_lconst_0 = <NUM_LIT:9> ; public static final byte OPC_lconst_1 = <NUM_LIT:10> ; public static final byte OPC_fconst_0 = <NUM_LIT:11> ; public static final byte OPC_fconst_1 = <NUM_LIT:12> ; public static final byte OPC_fconst_2 = <NUM_LIT> ; public static final byte OPC_dconst_0 = <NUM_LIT> ; public static final byte OPC_dconst_1 = <NUM_LIT:15> ; public static final byte OPC_bipush = <NUM_LIT:16> ; public static final byte OPC_sipush = <NUM_LIT> ; public static final byte OPC_ldc = <NUM_LIT> ; public static final byte OPC_ldc_w = <NUM_LIT> ; public static final byte OPC_ldc2_w = <NUM_LIT:20> ; public static final byte OPC_iload = <NUM_LIT> ; public static final byte OPC_lload = <NUM_LIT> ; public static final byte OPC_fload = <NUM_LIT> ; public static final byte OPC_dload = <NUM_LIT:24> ; public static final byte OPC_aload = <NUM_LIT> ; public static final byte OPC_iload_0 = <NUM_LIT> ; public static final byte OPC_iload_1 = <NUM_LIT> ; public static final byte OPC_iload_2 = <NUM_LIT> ; public static final byte OPC_iload_3 = <NUM_LIT> ; public static final byte OPC_lload_0 = <NUM_LIT:30> ; public static final byte OPC_lload_1 = <NUM_LIT:31> ; public static final byte OPC_lload_2 = <NUM_LIT:32> ; public static final byte OPC_lload_3 = <NUM_LIT> ; public static final byte OPC_fload_0 = <NUM_LIT> ; public static final byte OPC_fload_1 = <NUM_LIT> ; public static final byte OPC_fload_2 = <NUM_LIT> ; public static final byte OPC_fload_3 = <NUM_LIT> ; public static final byte OPC_dload_0 = <NUM_LIT> ; public static final byte OPC_dload_1 = <NUM_LIT> ; public static final byte OPC_dload_2 = <NUM_LIT> ; public static final byte OPC_dload_3 = <NUM_LIT> ; public static final byte OPC_aload_0 = <NUM_LIT> ; public static final byte OPC_aload_1 = <NUM_LIT> ; public static final byte OPC_aload_2 = <NUM_LIT> ; public static final byte OPC_aload_3 = <NUM_LIT> ; public static final byte OPC_iaload = <NUM_LIT> ; public static final byte OPC_laload = <NUM_LIT> ; public static final byte OPC_faload = <NUM_LIT> ; public static final byte OPC_daload = <NUM_LIT> ; public static final byte OPC_aaload = <NUM_LIT> ; public static final byte OPC_baload = <NUM_LIT> ; public static final byte OPC_caload = <NUM_LIT> ; public static final byte OPC_saload = <NUM_LIT> ; public static final byte OPC_istore = <NUM_LIT> ; public static final byte OPC_lstore = <NUM_LIT> ; public static final byte OPC_fstore = <NUM_LIT> ; public static final byte OPC_dstore = <NUM_LIT> ; public static final byte OPC_astore = <NUM_LIT> ; public static final byte OPC_istore_0 = <NUM_LIT> ; public static final byte OPC_istore_1 = <NUM_LIT> ; public static final byte OPC_istore_2 = <NUM_LIT> ; public static final byte OPC_istore_3 = <NUM_LIT> ; public static final byte OPC_lstore_0 = <NUM_LIT> ; public static final byte OPC_lstore_1 = <NUM_LIT> ; public static final byte OPC_lstore_2 = <NUM_LIT> ; public static final byte OPC_lstore_3 = <NUM_LIT> ; public static final byte OPC_fstore_0 = <NUM_LIT> ; public static final byte OPC_fstore_1 = <NUM_LIT> ; public static final byte OPC_fstore_2 = <NUM_LIT> ; public static final byte OPC_fstore_3 = <NUM_LIT> ; public static final byte OPC_dstore_0 = <NUM_LIT> ; public static final byte OPC_dstore_1 = <NUM_LIT> ; public static final byte OPC_dstore_2 = <NUM_LIT> ; public static final byte OPC_dstore_3 = <NUM_LIT> ; public static final byte OPC_astore_0 = <NUM_LIT> ; public static final byte OPC_astore_1 = <NUM_LIT> ; public static final byte OPC_astore_2 = <NUM_LIT> ; public static final byte OPC_astore_3 = <NUM_LIT> ; public static final byte OPC_iastore = <NUM_LIT> ; public static final byte OPC_lastore = <NUM_LIT> ; public static final byte OPC_fastore = <NUM_LIT> ; public static final byte OPC_dastore = <NUM_LIT> ; public static final byte OPC_aastore = <NUM_LIT> ; public static final byte OPC_bastore = <NUM_LIT> ; public static final byte OPC_castore = <NUM_LIT> ; public static final byte OPC_sastore = <NUM_LIT> ; public static final byte OPC_pop = <NUM_LIT> ; public static final byte OPC_pop2 = <NUM_LIT> ; public static final byte OPC_dup = <NUM_LIT> ; public static final byte OPC_dup_x1 = <NUM_LIT> ; public static final byte OPC_dup_x2 = <NUM_LIT> ; public static final byte OPC_dup2 = <NUM_LIT> ; public static final byte OPC_dup2_x1 = <NUM_LIT> ; public static final byte OPC_dup2_x2 = <NUM_LIT> ; public static final byte OPC_swap = <NUM_LIT> ; public static final byte OPC_iadd = <NUM_LIT> ; public static final byte OPC_ladd = <NUM_LIT> ; public static final byte OPC_fadd = <NUM_LIT> ; public static final byte OPC_dadd = <NUM_LIT> ; public static final byte OPC_isub = <NUM_LIT:100> ; public static final byte OPC_lsub = <NUM_LIT> ; public static final byte OPC_fsub = <NUM_LIT> ; public static final byte OPC_dsub = <NUM_LIT> ; public static final byte OPC_imul = <NUM_LIT> ; public static final byte OPC_lmul = <NUM_LIT> ; public static final byte OPC_fmul = <NUM_LIT> ; public static final byte OPC_dmul = <NUM_LIT> ; public static final byte OPC_idiv = <NUM_LIT> ; public static final byte OPC_ldiv = <NUM_LIT> ; public static final byte OPC_fdiv = <NUM_LIT> ; public static final byte OPC_ddiv = <NUM_LIT> ; public static final byte OPC_irem = <NUM_LIT> ; public static final byte OPC_lrem = <NUM_LIT> ; public static final byte OPC_frem = <NUM_LIT> ; public static final byte OPC_drem = <NUM_LIT> ; public static final byte OPC_ineg = <NUM_LIT> ; public static final byte OPC_lneg = <NUM_LIT> ; public static final byte OPC_fneg = <NUM_LIT> ; public static final byte OPC_dneg = <NUM_LIT> ; public static final byte OPC_ishl = <NUM_LIT> ; public static final byte OPC_lshl = <NUM_LIT> ; public static final byte OPC_ishr = <NUM_LIT> ; public static final byte OPC_lshr = <NUM_LIT> ; public static final byte OPC_iushr = <NUM_LIT> ; public static final byte OPC_lushr = <NUM_LIT> ; public static final byte OPC_iand = <NUM_LIT> ; public static final byte OPC_land = <NUM_LIT> ; public static final byte OPC_ior = ( byte ) <NUM_LIT> ; public static final byte OPC_lor = ( byte ) <NUM_LIT> ; public static final byte OPC_ixor = ( byte ) <NUM_LIT> ; public static final byte OPC_lxor = ( byte ) <NUM_LIT> ; public static final byte OPC_iinc = ( byte ) <NUM_LIT> ; public static final byte OPC_i2l = ( byte ) <NUM_LIT> ; public static final byte OPC_i2f = ( byte ) <NUM_LIT> ; public static final byte OPC_i2d = ( byte ) <NUM_LIT> ; public static final byte OPC_l2i = ( byte ) <NUM_LIT> ; public static final byte OPC_l2f = ( byte ) <NUM_LIT> ; public static final byte OPC_l2d = ( byte ) <NUM_LIT> ; public static final byte OPC_f2i = ( byte ) <NUM_LIT> ; public static final byte OPC_f2l = ( byte ) <NUM_LIT> ; public static final byte OPC_f2d = ( byte ) <NUM_LIT> ; public static final byte OPC_d2i = ( byte ) <NUM_LIT> ; public static final byte OPC_d2l = ( byte ) <NUM_LIT> ; public static final byte OPC_d2f = ( byte ) <NUM_LIT> ; public static final byte OPC_i2b = ( byte ) <NUM_LIT> ; public static final byte OPC_i2c = ( byte ) <NUM_LIT> ; public static final byte OPC_i2s = ( byte ) <NUM_LIT> ; public static final byte OPC_lcmp = ( byte ) <NUM_LIT> ; public static final byte OPC_fcmpl = ( byte ) <NUM_LIT> ; public static final byte OPC_fcmpg = ( byte ) <NUM_LIT> ; public static final byte OPC_dcmpl = ( byte ) <NUM_LIT> ; public static final byte OPC_dcmpg = ( byte ) <NUM_LIT> ; public static final byte OPC_ifeq = ( byte ) <NUM_LIT> ; public static final byte OPC_ifne = ( byte ) <NUM_LIT> ; public static final byte OPC_iflt = ( byte ) <NUM_LIT> ; public static final byte OPC_ifge = ( byte ) <NUM_LIT> ; public static final byte OPC_ifgt = ( byte ) <NUM_LIT> ; public static final byte OPC_ifle = ( byte ) <NUM_LIT> ; public static final byte OPC_if_icmpeq = ( byte ) <NUM_LIT> ; public static final byte OPC_if_icmpne = ( byte ) <NUM_LIT> ; public static final byte OPC_if_icmplt = ( byte ) <NUM_LIT> ; public static final byte OPC_if_icmpge = ( byte ) <NUM_LIT> ; public static final byte OPC_if_icmpgt = ( byte ) <NUM_LIT> ; public static final byte OPC_if_icmple = ( byte ) <NUM_LIT> ; public static final byte OPC_if_acmpeq = ( byte ) <NUM_LIT> ; public static final byte OPC_if_acmpne = ( byte ) <NUM_LIT> ; public static final byte OPC_goto = ( byte ) <NUM_LIT> ; public static final byte OPC_jsr = ( byte ) <NUM_LIT> ; public static final byte OPC_ret = ( byte ) <NUM_LIT> ; public static final byte OPC_tableswitch = ( byte ) <NUM_LIT> ; public static final byte OPC_lookupswitch = ( byte ) <NUM_LIT> ; public static final byte OPC_ireturn = ( byte ) <NUM_LIT> ; public static final byte OPC_lreturn = ( byte ) <NUM_LIT> ; public static final byte OPC_freturn = ( byte ) <NUM_LIT> ; public static final byte OPC_dreturn = ( byte ) <NUM_LIT> ; public static final byte OPC_areturn = ( byte ) <NUM_LIT> ; public static final byte OPC_return = ( byte ) <NUM_LIT> ; public static final byte OPC_getstatic = ( byte ) <NUM_LIT> ; public static final byte OPC_putstatic = ( byte ) <NUM_LIT> ; public static final byte OPC_getfield = ( byte ) <NUM_LIT> ; public static final byte OPC_putfield = ( byte ) <NUM_LIT> ; public static final byte OPC_invokevirtual = ( byte ) <NUM_LIT> ; public static final byte OPC_invokespecial = ( byte ) <NUM_LIT> ; public static final byte OPC_invokestatic = ( byte ) <NUM_LIT> ; public static final byte OPC_invokeinterface = ( byte ) <NUM_LIT> ; public static final byte OPC_new = ( byte ) <NUM_LIT> ; public static final byte OPC_newarray = ( byte ) <NUM_LIT> ; public static final byte OPC_anewarray = ( byte ) <NUM_LIT> ; public static final byte OPC_arraylength = ( byte ) <NUM_LIT> ; public static final byte OPC_athrow = ( byte ) <NUM_LIT> ; public static final byte OPC_checkcast = ( byte ) <NUM_LIT> ; public static final byte OPC_instanceof = ( byte ) <NUM_LIT> ; public static final byte OPC_monitorenter = ( byte ) <NUM_LIT> ; public static final byte OPC_monitorexit = ( byte ) <NUM_LIT> ; public static final byte OPC_wide = ( byte ) <NUM_LIT> ; public static final byte OPC_multianewarray = ( byte ) <NUM_LIT> ; public static final byte OPC_ifnull = ( byte ) <NUM_LIT> ; public static final byte OPC_ifnonnull = ( byte ) <NUM_LIT> ; public static final byte OPC_goto_w = ( byte ) <NUM_LIT> ; public static final byte OPC_jsr_w = ( byte ) <NUM_LIT> ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . codegen ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; public class ExceptionLabel extends Label { public int ranges [ ] = { POS_NOT_SET , POS_NOT_SET } ; private int count = <NUM_LIT:0> ; public TypeBinding exceptionType ; public ExceptionLabel ( CodeStream codeStream , TypeBinding exceptionType ) { super ( codeStream ) ; this . exceptionType = exceptionType ; } public int getCount ( ) { return this . count ; } public void place ( ) { this . codeStream . registerExceptionHandler ( this ) ; this . position = this . codeStream . getPosition ( ) ; } public void placeEnd ( ) { int endPosition = this . codeStream . position ; if ( this . ranges [ this . count - <NUM_LIT:1> ] == endPosition ) { this . count -- ; } else { this . ranges [ this . count ++ ] = endPosition ; } } public void placeStart ( ) { int startPosition = this . codeStream . position ; if ( this . count > <NUM_LIT:0> && this . ranges [ this . count - <NUM_LIT:1> ] == startPosition ) { this . count -- ; return ; } int length ; if ( this . count == ( length = this . ranges . length ) ) { System . arraycopy ( this . ranges , <NUM_LIT:0> , this . ranges = new int [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; } this . ranges [ this . count ++ ] = startPosition ; } public String toString ( ) { String basic = getClass ( ) . getName ( ) ; basic = basic . substring ( basic . lastIndexOf ( '<CHAR_LIT:.>' ) + <NUM_LIT:1> ) ; StringBuffer buffer = new StringBuffer ( basic ) ; buffer . append ( '<CHAR_LIT>' ) . append ( Integer . toHexString ( hashCode ( ) ) ) ; buffer . append ( "<STR_LIT>" ) . append ( this . exceptionType == null ? CharOperation . NO_CHAR : this . exceptionType . readableName ( ) ) ; buffer . append ( "<STR_LIT>" ) . append ( this . position ) ; buffer . append ( "<STR_LIT>" ) ; if ( this . count == <NUM_LIT:0> ) { buffer . append ( "<STR_LIT:[]>" ) ; } else { for ( int i = <NUM_LIT:0> ; i < this . count ; i ++ ) { if ( ( i & <NUM_LIT:1> ) == <NUM_LIT:0> ) { buffer . append ( "<STR_LIT:[>" ) . append ( this . ranges [ i ] ) ; } else { buffer . append ( "<STR_LIT:U+002C>" ) . append ( this . ranges [ i ] ) . append ( "<STR_LIT:]>" ) ; } } if ( ( this . count & <NUM_LIT:1> ) == <NUM_LIT:1> ) { buffer . append ( "<STR_LIT>" ) ; } } buffer . append ( '<CHAR_LIT:)>' ) ; return buffer . toString ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; public class UnresolvedReferenceBinding extends ReferenceBinding { ReferenceBinding resolvedType ; TypeBinding [ ] wrappers ; UnresolvedReferenceBinding ( char [ ] [ ] compoundName , PackageBinding packageBinding ) { this . compoundName = compoundName ; this . sourceName = compoundName [ compoundName . length - <NUM_LIT:1> ] ; this . fPackage = packageBinding ; this . wrappers = null ; } void addWrapper ( TypeBinding wrapper , LookupEnvironment environment ) { if ( this . resolvedType != null ) { wrapper . swapUnresolved ( this , this . resolvedType , environment ) ; return ; } if ( this . wrappers == null ) { this . wrappers = new TypeBinding [ ] { wrapper } ; } else { int length = this . wrappers . length ; System . arraycopy ( this . wrappers , <NUM_LIT:0> , this . wrappers = new TypeBinding [ length + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; this . wrappers [ length ] = wrapper ; } } public String debugName ( ) { return toString ( ) ; } ReferenceBinding resolve ( LookupEnvironment environment , boolean convertGenericToRawType ) { ReferenceBinding targetType = this . resolvedType ; if ( targetType == null ) { targetType = this . fPackage . getType0 ( this . compoundName [ this . compoundName . length - <NUM_LIT:1> ] ) ; if ( targetType == this ) { targetType = environment . askForType ( this . compoundName ) ; } if ( targetType == null || targetType == this ) { if ( ( this . tagBits & TagBits . HasMissingType ) == <NUM_LIT:0> ) { environment . problemReporter . isClassPathCorrect ( this . compoundName , environment . unitBeingCompleted , environment . missingClassFileLocation ) ; } targetType = environment . createMissingType ( null , this . compoundName ) ; } setResolvedType ( targetType , environment ) ; } if ( convertGenericToRawType ) { targetType = ( ReferenceBinding ) environment . convertUnresolvedBinaryToRawType ( targetType ) ; } return targetType ; } void setResolvedType ( ReferenceBinding targetType , LookupEnvironment environment ) { if ( this . resolvedType == targetType ) return ; this . resolvedType = targetType ; if ( this . wrappers != null ) for ( int i = <NUM_LIT:0> , l = this . wrappers . length ; i < l ; i ++ ) this . wrappers [ i ] . swapUnresolved ( this , targetType , environment ) ; environment . updateCaches ( this , targetType ) ; } public String toString ( ) { return "<STR_LIT>" + ( ( this . compoundName != null ) ? CharOperation . toString ( this . compoundName ) : "<STR_LIT>" ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . ast . Wildcard ; public class ParameterizedGenericMethodBinding extends ParameterizedMethodBinding implements Substitution { public TypeBinding [ ] typeArguments ; private LookupEnvironment environment ; public boolean inferredReturnType ; public boolean wasInferred ; public boolean isRaw ; private MethodBinding tiebreakMethod ; public static MethodBinding computeCompatibleMethod ( MethodBinding originalMethod , TypeBinding [ ] arguments , Scope scope , InvocationSite invocationSite ) { ParameterizedGenericMethodBinding methodSubstitute ; TypeVariableBinding [ ] typeVariables = originalMethod . typeVariables ; TypeBinding [ ] substitutes = invocationSite . genericTypeArguments ( ) ; InferenceContext inferenceContext = null ; TypeBinding [ ] uncheckedArguments = null ; computeSubstitutes : { if ( substitutes != null ) { if ( substitutes . length != typeVariables . length ) { return new ProblemMethodBinding ( originalMethod , originalMethod . selector , substitutes , ProblemReasons . TypeParameterArityMismatch ) ; } methodSubstitute = scope . environment ( ) . createParameterizedGenericMethod ( originalMethod , substitutes ) ; break computeSubstitutes ; } TypeBinding [ ] parameters = originalMethod . parameters ; inferenceContext = new InferenceContext ( originalMethod ) ; methodSubstitute = inferFromArgumentTypes ( scope , originalMethod , arguments , parameters , inferenceContext ) ; if ( methodSubstitute == null ) return null ; if ( inferenceContext . hasUnresolvedTypeArgument ( ) ) { if ( inferenceContext . isUnchecked ) { int length = inferenceContext . substitutes . length ; System . arraycopy ( inferenceContext . substitutes , <NUM_LIT:0> , uncheckedArguments = new TypeBinding [ length ] , <NUM_LIT:0> , length ) ; } if ( methodSubstitute . returnType != TypeBinding . VOID ) { TypeBinding expectedType = invocationSite . expectedType ( ) ; if ( expectedType != null ) { inferenceContext . hasExplicitExpectedType = true ; } else { expectedType = scope . getJavaLangObject ( ) ; } inferenceContext . expectedType = expectedType ; } methodSubstitute = methodSubstitute . inferFromExpectedType ( scope , inferenceContext ) ; if ( methodSubstitute == null ) return null ; } } Substitution substitution = null ; if ( inferenceContext != null ) { substitution = new LingeringTypeVariableEliminator ( typeVariables , inferenceContext . substitutes , scope ) ; } else { substitution = methodSubstitute ; } for ( int i = <NUM_LIT:0> , length = typeVariables . length ; i < length ; i ++ ) { TypeVariableBinding typeVariable = typeVariables [ i ] ; TypeBinding substitute = methodSubstitute . typeArguments [ i ] ; TypeBinding substituteForChecks = Scope . substitute ( new LingeringTypeVariableEliminator ( typeVariables , null , scope ) , substitute ) ; if ( uncheckedArguments != null && uncheckedArguments [ i ] == null ) continue ; switch ( typeVariable . boundCheck ( substitution , substituteForChecks ) ) { case TypeConstants . MISMATCH : int argLength = arguments . length ; TypeBinding [ ] augmentedArguments = new TypeBinding [ argLength + <NUM_LIT:2> ] ; System . arraycopy ( arguments , <NUM_LIT:0> , augmentedArguments , <NUM_LIT:0> , argLength ) ; augmentedArguments [ argLength ] = substitute ; augmentedArguments [ argLength + <NUM_LIT:1> ] = typeVariable ; return new ProblemMethodBinding ( methodSubstitute , originalMethod . selector , augmentedArguments , ProblemReasons . ParameterBoundMismatch ) ; case TypeConstants . UNCHECKED : methodSubstitute . tagBits |= TagBits . HasUncheckedTypeArgumentForBoundCheck ; break ; } } return methodSubstitute ; } private static ParameterizedGenericMethodBinding inferFromArgumentTypes ( Scope scope , MethodBinding originalMethod , TypeBinding [ ] arguments , TypeBinding [ ] parameters , InferenceContext inferenceContext ) { if ( originalMethod . isVarargs ( ) ) { int paramLength = parameters . length ; int minArgLength = paramLength - <NUM_LIT:1> ; int argLength = arguments . length ; for ( int i = <NUM_LIT:0> ; i < minArgLength ; i ++ ) { parameters [ i ] . collectSubstitutes ( scope , arguments [ i ] , inferenceContext , TypeConstants . CONSTRAINT_EXTENDS ) ; if ( inferenceContext . status == InferenceContext . FAILED ) return null ; } if ( minArgLength < argLength ) { TypeBinding varargType = parameters [ minArgLength ] ; TypeBinding lastArgument = arguments [ minArgLength ] ; checkVarargDimension : { if ( paramLength == argLength ) { if ( lastArgument == TypeBinding . NULL ) break checkVarargDimension ; switch ( lastArgument . dimensions ( ) ) { case <NUM_LIT:0> : break ; case <NUM_LIT:1> : if ( ! lastArgument . leafComponentType ( ) . isBaseType ( ) ) break checkVarargDimension ; break ; default : break checkVarargDimension ; } } varargType = ( ( ArrayBinding ) varargType ) . elementsType ( ) ; } for ( int i = minArgLength ; i < argLength ; i ++ ) { varargType . collectSubstitutes ( scope , arguments [ i ] , inferenceContext , TypeConstants . CONSTRAINT_EXTENDS ) ; if ( inferenceContext . status == InferenceContext . FAILED ) return null ; } } } else { int paramLength = parameters . length ; for ( int i = <NUM_LIT:0> ; i < paramLength ; i ++ ) { parameters [ i ] . collectSubstitutes ( scope , arguments [ i ] , inferenceContext , TypeConstants . CONSTRAINT_EXTENDS ) ; if ( inferenceContext . status == InferenceContext . FAILED ) return null ; } } TypeVariableBinding [ ] originalVariables = originalMethod . typeVariables ; if ( ! resolveSubstituteConstraints ( scope , originalVariables , inferenceContext , false ) ) return null ; TypeBinding [ ] inferredSustitutes = inferenceContext . substitutes ; TypeBinding [ ] actualSubstitutes = inferredSustitutes ; for ( int i = <NUM_LIT:0> , varLength = originalVariables . length ; i < varLength ; i ++ ) { if ( inferredSustitutes [ i ] == null ) { if ( actualSubstitutes == inferredSustitutes ) { System . arraycopy ( inferredSustitutes , <NUM_LIT:0> , actualSubstitutes = new TypeBinding [ varLength ] , <NUM_LIT:0> , i ) ; } actualSubstitutes [ i ] = originalVariables [ i ] ; } else if ( actualSubstitutes != inferredSustitutes ) { actualSubstitutes [ i ] = inferredSustitutes [ i ] ; } } ParameterizedGenericMethodBinding paramMethod = scope . environment ( ) . createParameterizedGenericMethod ( originalMethod , actualSubstitutes ) ; return paramMethod ; } private static boolean resolveSubstituteConstraints ( Scope scope , TypeVariableBinding [ ] typeVariables , InferenceContext inferenceContext , boolean considerEXTENDSConstraints ) { TypeBinding [ ] substitutes = inferenceContext . substitutes ; int varLength = typeVariables . length ; nextTypeParameter : for ( int i = <NUM_LIT:0> ; i < varLength ; i ++ ) { TypeVariableBinding current = typeVariables [ i ] ; TypeBinding substitute = substitutes [ i ] ; if ( substitute != null ) continue nextTypeParameter ; TypeBinding [ ] equalSubstitutes = inferenceContext . getSubstitutes ( current , TypeConstants . CONSTRAINT_EQUAL ) ; if ( equalSubstitutes != null ) { nextConstraint : for ( int j = <NUM_LIT:0> , equalLength = equalSubstitutes . length ; j < equalLength ; j ++ ) { TypeBinding equalSubstitute = equalSubstitutes [ j ] ; if ( equalSubstitute == null ) continue nextConstraint ; if ( equalSubstitute == current ) { for ( int k = j + <NUM_LIT:1> ; k < equalLength ; k ++ ) { equalSubstitute = equalSubstitutes [ k ] ; if ( equalSubstitute != current && equalSubstitute != null ) { substitutes [ i ] = equalSubstitute ; continue nextTypeParameter ; } } substitutes [ i ] = current ; continue nextTypeParameter ; } substitutes [ i ] = equalSubstitute ; continue nextTypeParameter ; } } } if ( inferenceContext . hasUnresolvedTypeArgument ( ) ) { nextTypeParameter : for ( int i = <NUM_LIT:0> ; i < varLength ; i ++ ) { TypeVariableBinding current = typeVariables [ i ] ; TypeBinding substitute = substitutes [ i ] ; if ( substitute != null ) continue nextTypeParameter ; TypeBinding [ ] bounds = inferenceContext . getSubstitutes ( current , TypeConstants . CONSTRAINT_SUPER ) ; if ( bounds == null ) continue nextTypeParameter ; TypeBinding mostSpecificSubstitute = scope . lowerUpperBound ( bounds ) ; if ( mostSpecificSubstitute == null ) { return false ; } if ( mostSpecificSubstitute != TypeBinding . VOID ) { substitutes [ i ] = mostSpecificSubstitute ; } } } if ( considerEXTENDSConstraints && inferenceContext . hasUnresolvedTypeArgument ( ) ) { nextTypeParameter : for ( int i = <NUM_LIT:0> ; i < varLength ; i ++ ) { TypeVariableBinding current = typeVariables [ i ] ; TypeBinding substitute = substitutes [ i ] ; if ( substitute != null ) continue nextTypeParameter ; TypeBinding [ ] bounds = inferenceContext . getSubstitutes ( current , TypeConstants . CONSTRAINT_EXTENDS ) ; if ( bounds == null ) continue nextTypeParameter ; TypeBinding [ ] glb = Scope . greaterLowerBound ( bounds ) ; TypeBinding mostSpecificSubstitute = null ; if ( glb != null ) { if ( glb . length == <NUM_LIT:1> ) { mostSpecificSubstitute = glb [ <NUM_LIT:0> ] ; } else { TypeBinding [ ] otherBounds = new TypeBinding [ glb . length - <NUM_LIT:1> ] ; System . arraycopy ( glb , <NUM_LIT:1> , otherBounds , <NUM_LIT:0> , glb . length - <NUM_LIT:1> ) ; mostSpecificSubstitute = scope . environment ( ) . createWildcard ( null , <NUM_LIT:0> , glb [ <NUM_LIT:0> ] , otherBounds , Wildcard . EXTENDS ) ; } } if ( mostSpecificSubstitute != null ) { substitutes [ i ] = mostSpecificSubstitute ; } } } return true ; } public ParameterizedGenericMethodBinding ( MethodBinding originalMethod , RawTypeBinding rawType , LookupEnvironment environment ) { TypeVariableBinding [ ] originalVariables = originalMethod . typeVariables ; int length = originalVariables . length ; TypeBinding [ ] rawArguments = new TypeBinding [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { rawArguments [ i ] = environment . convertToRawType ( originalVariables [ i ] . erasure ( ) , false ) ; } this . isRaw = true ; this . tagBits = originalMethod . tagBits ; this . environment = environment ; this . modifiers = originalMethod . modifiers ; this . selector = originalMethod . selector ; this . declaringClass = rawType == null ? originalMethod . declaringClass : rawType ; this . typeVariables = Binding . NO_TYPE_VARIABLES ; this . typeArguments = rawArguments ; this . originalMethod = originalMethod ; boolean ignoreRawTypeSubstitution = rawType == null || originalMethod . isStatic ( ) ; this . parameters = Scope . substitute ( this , ignoreRawTypeSubstitution ? originalMethod . parameters : Scope . substitute ( rawType , originalMethod . parameters ) ) ; this . thrownExceptions = Scope . substitute ( this , ignoreRawTypeSubstitution ? originalMethod . thrownExceptions : Scope . substitute ( rawType , originalMethod . thrownExceptions ) ) ; if ( this . thrownExceptions == null ) this . thrownExceptions = Binding . NO_EXCEPTIONS ; this . returnType = Scope . substitute ( this , ignoreRawTypeSubstitution ? originalMethod . returnType : Scope . substitute ( rawType , originalMethod . returnType ) ) ; this . wasInferred = false ; } public ParameterizedGenericMethodBinding ( MethodBinding originalMethod , TypeBinding [ ] typeArguments , LookupEnvironment environment ) { this . environment = environment ; this . modifiers = originalMethod . modifiers ; this . selector = originalMethod . selector ; this . declaringClass = originalMethod . declaringClass ; this . typeVariables = Binding . NO_TYPE_VARIABLES ; this . typeArguments = typeArguments ; this . isRaw = false ; this . tagBits = originalMethod . tagBits ; this . originalMethod = originalMethod ; this . parameters = Scope . substitute ( this , originalMethod . parameters ) ; this . returnType = Scope . substitute ( this , originalMethod . returnType ) ; this . thrownExceptions = Scope . substitute ( this , originalMethod . thrownExceptions ) ; if ( this . thrownExceptions == null ) this . thrownExceptions = Binding . NO_EXCEPTIONS ; checkMissingType : { if ( ( this . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) break checkMissingType ; if ( ( this . returnType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . HasMissingType ; break checkMissingType ; } for ( int i = <NUM_LIT:0> , max = this . parameters . length ; i < max ; i ++ ) { if ( ( this . parameters [ i ] . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . HasMissingType ; break checkMissingType ; } } for ( int i = <NUM_LIT:0> , max = this . thrownExceptions . length ; i < max ; i ++ ) { if ( ( this . thrownExceptions [ i ] . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . HasMissingType ; break checkMissingType ; } } } this . wasInferred = true ; } public char [ ] computeUniqueKey ( boolean isLeaf ) { StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( this . originalMethod . computeUniqueKey ( false ) ) ; buffer . append ( '<CHAR_LIT>' ) ; buffer . append ( '<CHAR_LIT>' ) ; if ( ! this . isRaw ) { int length = this . typeArguments . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeBinding typeArgument = this . typeArguments [ i ] ; buffer . append ( typeArgument . computeUniqueKey ( false ) ) ; } } buffer . append ( '<CHAR_LIT:>>' ) ; int resultLength = buffer . length ( ) ; char [ ] result = new char [ resultLength ] ; buffer . getChars ( <NUM_LIT:0> , resultLength , result , <NUM_LIT:0> ) ; return result ; } public LookupEnvironment environment ( ) { return this . environment ; } public boolean hasSubstitutedParameters ( ) { if ( this . wasInferred ) return this . originalMethod . hasSubstitutedParameters ( ) ; return super . hasSubstitutedParameters ( ) ; } public boolean hasSubstitutedReturnType ( ) { if ( this . inferredReturnType ) return this . originalMethod . hasSubstitutedReturnType ( ) ; return super . hasSubstitutedReturnType ( ) ; } private ParameterizedGenericMethodBinding inferFromExpectedType ( Scope scope , InferenceContext inferenceContext ) { TypeVariableBinding [ ] originalVariables = this . originalMethod . typeVariables ; int varLength = originalVariables . length ; if ( inferenceContext . expectedType != null ) { this . returnType . collectSubstitutes ( scope , inferenceContext . expectedType , inferenceContext , TypeConstants . CONSTRAINT_SUPER ) ; if ( inferenceContext . status == InferenceContext . FAILED ) return null ; } for ( int i = <NUM_LIT:0> ; i < varLength ; i ++ ) { TypeVariableBinding originalVariable = originalVariables [ i ] ; TypeBinding argument = this . typeArguments [ i ] ; boolean argAlreadyInferred = argument != originalVariable ; if ( originalVariable . firstBound == originalVariable . superclass ) { TypeBinding substitutedBound = Scope . substitute ( this , originalVariable . superclass ) ; argument . collectSubstitutes ( scope , substitutedBound , inferenceContext , TypeConstants . CONSTRAINT_SUPER ) ; if ( inferenceContext . status == InferenceContext . FAILED ) return null ; if ( argAlreadyInferred ) { substitutedBound . collectSubstitutes ( scope , argument , inferenceContext , TypeConstants . CONSTRAINT_EXTENDS ) ; if ( inferenceContext . status == InferenceContext . FAILED ) return null ; } } for ( int j = <NUM_LIT:0> , max = originalVariable . superInterfaces . length ; j < max ; j ++ ) { TypeBinding substitutedBound = Scope . substitute ( this , originalVariable . superInterfaces [ j ] ) ; argument . collectSubstitutes ( scope , substitutedBound , inferenceContext , TypeConstants . CONSTRAINT_SUPER ) ; if ( inferenceContext . status == InferenceContext . FAILED ) return null ; if ( argAlreadyInferred ) { substitutedBound . collectSubstitutes ( scope , argument , inferenceContext , TypeConstants . CONSTRAINT_EXTENDS ) ; if ( inferenceContext . status == InferenceContext . FAILED ) return null ; } } } if ( ! resolveSubstituteConstraints ( scope , originalVariables , inferenceContext , true ) ) return null ; for ( int i = <NUM_LIT:0> ; i < varLength ; i ++ ) { TypeBinding substitute = inferenceContext . substitutes [ i ] ; if ( substitute != null ) { this . typeArguments [ i ] = substitute ; } else { this . typeArguments [ i ] = inferenceContext . substitutes [ i ] = originalVariables [ i ] . upperBound ( ) ; } } this . typeArguments = Scope . substitute ( this , this . typeArguments ) ; TypeBinding oldReturnType = this . returnType ; this . returnType = Scope . substitute ( this , this . returnType ) ; this . inferredReturnType = inferenceContext . hasExplicitExpectedType && this . returnType != oldReturnType ; this . parameters = Scope . substitute ( this , this . parameters ) ; this . thrownExceptions = Scope . substitute ( this , this . thrownExceptions ) ; if ( this . thrownExceptions == null ) this . thrownExceptions = Binding . NO_EXCEPTIONS ; checkMissingType : { if ( ( this . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) break checkMissingType ; if ( ( this . returnType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . HasMissingType ; break checkMissingType ; } for ( int i = <NUM_LIT:0> , max = this . parameters . length ; i < max ; i ++ ) { if ( ( this . parameters [ i ] . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . HasMissingType ; break checkMissingType ; } } for ( int i = <NUM_LIT:0> , max = this . thrownExceptions . length ; i < max ; i ++ ) { if ( ( this . thrownExceptions [ i ] . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . HasMissingType ; break checkMissingType ; } } } return this ; } private static class LingeringTypeVariableEliminator implements Substitution { final private TypeVariableBinding [ ] variables ; final private TypeBinding [ ] substitutes ; final private Scope scope ; public LingeringTypeVariableEliminator ( TypeVariableBinding [ ] variables , TypeBinding [ ] substitutes , Scope scope ) { this . variables = variables ; this . substitutes = substitutes ; this . scope = scope ; } public TypeBinding substitute ( TypeVariableBinding typeVariable ) { if ( typeVariable . rank >= this . variables . length || this . variables [ typeVariable . rank ] != typeVariable ) { return typeVariable ; } if ( this . substitutes != null ) { return Scope . substitute ( new LingeringTypeVariableEliminator ( this . variables , null , this . scope ) , this . substitutes [ typeVariable . rank ] ) ; } ReferenceBinding genericType = ( ReferenceBinding ) ( typeVariable . declaringElement instanceof ReferenceBinding ? typeVariable . declaringElement : null ) ; return this . scope . environment ( ) . createWildcard ( genericType , typeVariable . rank , null , null , Wildcard . UNBOUND ) ; } public LookupEnvironment environment ( ) { return this . scope . environment ( ) ; } public boolean isRawSubstitution ( ) { return false ; } } public boolean isRawSubstitution ( ) { return this . isRaw ; } public TypeBinding substitute ( TypeVariableBinding originalVariable ) { TypeVariableBinding [ ] variables = this . originalMethod . typeVariables ; int length = variables . length ; if ( originalVariable . rank < length && variables [ originalVariable . rank ] == originalVariable ) { return this . typeArguments [ originalVariable . rank ] ; } return originalVariable ; } public MethodBinding tiebreakMethod ( ) { if ( this . tiebreakMethod == null ) this . tiebreakMethod = this . originalMethod . asRawMethod ( this . environment ) ; return this . tiebreakMethod ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; public class AnnotationHolder { AnnotationBinding [ ] annotations ; static AnnotationHolder storeAnnotations ( AnnotationBinding [ ] annotations , AnnotationBinding [ ] [ ] parameterAnnotations , Object defaultValue , LookupEnvironment optionalEnv ) { if ( parameterAnnotations != null ) { boolean isEmpty = true ; for ( int i = parameterAnnotations . length ; isEmpty && -- i >= <NUM_LIT:0> ; ) if ( parameterAnnotations [ i ] != null && parameterAnnotations [ i ] . length > <NUM_LIT:0> ) isEmpty = false ; if ( isEmpty ) parameterAnnotations = null ; } if ( defaultValue != null ) return new AnnotationMethodHolder ( annotations , parameterAnnotations , defaultValue , optionalEnv ) ; if ( parameterAnnotations != null ) return new MethodHolder ( annotations , parameterAnnotations ) ; return new AnnotationHolder ( ) . setAnnotations ( annotations ) ; } AnnotationBinding [ ] getAnnotations ( ) { return this . annotations ; } Object getDefaultValue ( ) { return null ; } public AnnotationBinding [ ] [ ] getParameterAnnotations ( ) { return null ; } AnnotationBinding [ ] getParameterAnnotations ( int paramIndex ) { return Binding . NO_ANNOTATIONS ; } AnnotationHolder setAnnotations ( AnnotationBinding [ ] annotations ) { if ( annotations == null || annotations . length == <NUM_LIT:0> ) return null ; this . annotations = annotations ; return this ; } static class MethodHolder extends AnnotationHolder { AnnotationBinding [ ] [ ] parameterAnnotations ; MethodHolder ( AnnotationBinding [ ] annotations , AnnotationBinding [ ] [ ] parameterAnnotations ) { super ( ) ; setAnnotations ( annotations ) ; this . parameterAnnotations = parameterAnnotations ; } public AnnotationBinding [ ] [ ] getParameterAnnotations ( ) { return this . parameterAnnotations ; } AnnotationBinding [ ] getParameterAnnotations ( int paramIndex ) { AnnotationBinding [ ] result = this . parameterAnnotations == null ? null : this . parameterAnnotations [ paramIndex ] ; return result == null ? Binding . NO_ANNOTATIONS : result ; } AnnotationHolder setAnnotations ( AnnotationBinding [ ] annotations ) { this . annotations = annotations == null || annotations . length == <NUM_LIT:0> ? Binding . NO_ANNOTATIONS : annotations ; return this ; } } static class AnnotationMethodHolder extends MethodHolder { Object defaultValue ; LookupEnvironment env ; AnnotationMethodHolder ( AnnotationBinding [ ] annotations , AnnotationBinding [ ] [ ] parameterAnnotations , Object defaultValue , LookupEnvironment optionalEnv ) { super ( annotations , parameterAnnotations ) ; this . defaultValue = defaultValue ; this . env = optionalEnv ; } Object getDefaultValue ( ) { if ( this . defaultValue instanceof UnresolvedReferenceBinding ) { if ( this . env == null ) throw new IllegalStateException ( ) ; this . defaultValue = ( ( UnresolvedReferenceBinding ) this . defaultValue ) . resolve ( this . env , false ) ; } return this . defaultValue ; } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . CompilationUnitDeclaration ; import org . eclipse . jdt . internal . compiler . ast . ImportReference ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; import org . eclipse . jdt . internal . compiler . ast . TypeReference ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . env . AccessRestriction ; import org . eclipse . jdt . internal . compiler . problem . ProblemReporter ; import org . eclipse . jdt . internal . compiler . util . CompoundNameVector ; import org . eclipse . jdt . internal . compiler . util . HashtableOfObject ; import org . eclipse . jdt . internal . compiler . util . HashtableOfType ; import org . eclipse . jdt . internal . compiler . util . ObjectVector ; import org . eclipse . jdt . internal . compiler . util . SimpleNameVector ; public class CompilationUnitScope extends Scope { public LookupEnvironment environment ; public CompilationUnitDeclaration referenceContext ; public char [ ] [ ] currentPackageName ; public PackageBinding fPackage ; public ImportBinding [ ] imports ; public HashtableOfObject typeOrPackageCache ; public SourceTypeBinding [ ] topLevelTypes ; private CompoundNameVector qualifiedReferences ; private SimpleNameVector simpleNameReferences ; private SimpleNameVector rootReferences ; private ObjectVector referencedTypes ; private ObjectVector referencedSuperTypes ; HashtableOfType constantPoolNameUsage ; private int captureID = <NUM_LIT:1> ; public CompilationUnitScope ( CompilationUnitDeclaration unit , LookupEnvironment environment ) { super ( COMPILATION_UNIT_SCOPE , null ) ; this . environment = environment ; this . referenceContext = unit ; unit . scope = this ; this . currentPackageName = unit . currentPackage == null ? CharOperation . NO_CHAR_CHAR : unit . currentPackage . tokens ; if ( compilerOptions ( ) . produceReferenceInfo ) { this . qualifiedReferences = new CompoundNameVector ( ) ; this . simpleNameReferences = new SimpleNameVector ( ) ; this . rootReferences = new SimpleNameVector ( ) ; this . referencedTypes = new ObjectVector ( ) ; this . referencedSuperTypes = new ObjectVector ( ) ; } else { this . qualifiedReferences = null ; this . simpleNameReferences = null ; this . rootReferences = null ; this . referencedTypes = null ; this . referencedSuperTypes = null ; } } void buildFieldsAndMethods ( ) { for ( int i = <NUM_LIT:0> , length = this . topLevelTypes . length ; i < length ; i ++ ) this . topLevelTypes [ i ] . scope . buildFieldsAndMethods ( ) ; } protected boolean reportPackageIsNotExpectedPackage ( CompilationUnitDeclaration referenceContext ) { problemReporter ( ) . packageIsNotExpectedPackage ( referenceContext ) ; return true ; } void buildTypeBindings ( AccessRestriction accessRestriction ) { this . topLevelTypes = new SourceTypeBinding [ <NUM_LIT:0> ] ; boolean firstIsSynthetic = false ; if ( this . referenceContext . compilationResult . compilationUnit != null ) { char [ ] [ ] expectedPackageName = this . referenceContext . compilationResult . compilationUnit . getPackageName ( ) ; if ( expectedPackageName != null && ! CharOperation . equals ( this . currentPackageName , expectedPackageName ) ) { boolean errorReported = true ; if ( this . referenceContext . currentPackage != null || this . referenceContext . types != null || this . referenceContext . imports != null ) { errorReported = reportPackageIsNotExpectedPackage ( this . referenceContext ) ; } if ( errorReported ) { this . currentPackageName = expectedPackageName . length == <NUM_LIT:0> ? CharOperation . NO_CHAR_CHAR : expectedPackageName ; } } } if ( this . currentPackageName == CharOperation . NO_CHAR_CHAR ) { this . fPackage = this . environment . defaultPackage ; } else { if ( ( this . fPackage = this . environment . createPackage ( this . currentPackageName ) ) == null ) { if ( this . referenceContext . currentPackage != null ) { problemReporter ( ) . packageCollidesWithType ( this . referenceContext ) ; } this . fPackage = this . environment . defaultPackage ; return ; } else if ( this . referenceContext . isPackageInfo ( ) ) { if ( this . referenceContext . types == null || this . referenceContext . types . length == <NUM_LIT:0> ) { this . referenceContext . types = new TypeDeclaration [ <NUM_LIT:1> ] ; this . referenceContext . createPackageInfoType ( ) ; firstIsSynthetic = true ; } if ( this . referenceContext . currentPackage != null ) this . referenceContext . types [ <NUM_LIT:0> ] . annotations = this . referenceContext . currentPackage . annotations ; } recordQualifiedReference ( this . currentPackageName ) ; } TypeDeclaration [ ] types = this . referenceContext . types ; int typeLength = ( types == null ) ? <NUM_LIT:0> : types . length ; this . topLevelTypes = new SourceTypeBinding [ typeLength ] ; int count = <NUM_LIT:0> ; nextType : for ( int i = <NUM_LIT:0> ; i < typeLength ; i ++ ) { TypeDeclaration typeDecl = types [ i ] ; if ( this . environment . isProcessingAnnotations && this . environment . isMissingType ( typeDecl . name ) ) throw new SourceTypeCollisionException ( ) ; ReferenceBinding typeBinding = this . fPackage . getType0 ( typeDecl . name ) ; recordSimpleReference ( typeDecl . name ) ; if ( typeBinding != null && typeBinding . isValidBinding ( ) && ! ( typeBinding instanceof UnresolvedReferenceBinding ) ) { if ( this . environment . isProcessingAnnotations ) throw new SourceTypeCollisionException ( ) ; problemReporter ( ) . duplicateTypes ( this . referenceContext , typeDecl ) ; continue nextType ; } if ( this . fPackage != this . environment . defaultPackage && this . fPackage . getPackage ( typeDecl . name ) != null ) { problemReporter ( ) . typeCollidesWithPackage ( this . referenceContext , typeDecl ) ; } checkPublicTypeNameMatchesFilename ( typeDecl ) ; ClassScope child = buildClassScope ( this , typeDecl ) ; SourceTypeBinding type = child . buildType ( null , this . fPackage , accessRestriction ) ; if ( firstIsSynthetic && i == <NUM_LIT:0> ) type . modifiers |= ClassFileConstants . AccSynthetic ; if ( type != null ) this . topLevelTypes [ count ++ ] = type ; } if ( count != this . topLevelTypes . length ) System . arraycopy ( this . topLevelTypes , <NUM_LIT:0> , this . topLevelTypes = new SourceTypeBinding [ count ] , <NUM_LIT:0> , count ) ; } protected void checkPublicTypeNameMatchesFilename ( TypeDeclaration typeDecl ) { if ( ( typeDecl . modifiers & ClassFileConstants . AccPublic ) != <NUM_LIT:0> ) { char [ ] mainTypeName ; if ( ( mainTypeName = this . referenceContext . getMainTypeName ( ) ) != null && ! CharOperation . equals ( mainTypeName , typeDecl . name ) ) { problemReporter ( ) . publicClassMustMatchFileName ( this . referenceContext , typeDecl ) ; } } } protected ClassScope buildClassScope ( Scope parent , TypeDeclaration typeDecl ) { return new ClassScope ( parent , typeDecl ) ; } void checkAndSetImports ( ) { if ( this . referenceContext . imports == null ) { this . imports = getDefaultImports ( ) ; return ; } int numberOfStatements = this . referenceContext . imports . length ; int numberOfImports = numberOfStatements + <NUM_LIT:1> ; for ( int i = <NUM_LIT:0> ; i < numberOfStatements ; i ++ ) { ImportReference importReference = this . referenceContext . imports [ i ] ; if ( ( ( importReference . bits & ASTNode . OnDemand ) != <NUM_LIT:0> ) && CharOperation . equals ( TypeConstants . JAVA_LANG , importReference . tokens ) && ! importReference . isStatic ( ) ) { numberOfImports -- ; break ; } } ImportBinding [ ] resolvedImports = null ; int index = - <NUM_LIT:1> ; ImportBinding [ ] defaultImportBindings = getDefaultImports ( ) ; if ( defaultImportBindings . length == <NUM_LIT:1> ) { resolvedImports = new ImportBinding [ numberOfImports ] ; resolvedImports [ <NUM_LIT:0> ] = getDefaultImports ( ) [ <NUM_LIT:0> ] ; index = <NUM_LIT:1> ; } else { resolvedImports = new ImportBinding [ numberOfImports + defaultImportBindings . length - <NUM_LIT:1> ] ; index = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < defaultImportBindings . length ; i ++ ) { resolvedImports [ index ++ ] = defaultImportBindings [ i ] ; } } nextImport : for ( int i = <NUM_LIT:0> ; i < numberOfStatements ; i ++ ) { ImportReference importReference = this . referenceContext . imports [ i ] ; char [ ] [ ] compoundName = importReference . tokens ; for ( int j = <NUM_LIT:0> ; j < index ; j ++ ) { ImportBinding resolved = resolvedImports [ j ] ; if ( resolved . onDemand == ( ( importReference . bits & ASTNode . OnDemand ) != <NUM_LIT:0> ) && resolved . isStatic ( ) == importReference . isStatic ( ) ) if ( CharOperation . equals ( compoundName , resolvedImports [ j ] . compoundName ) ) continue nextImport ; } if ( ( importReference . bits & ASTNode . OnDemand ) != <NUM_LIT:0> ) { if ( CharOperation . equals ( compoundName , this . currentPackageName ) ) continue nextImport ; Binding importBinding = findImport ( compoundName , compoundName . length ) ; if ( ! importBinding . isValidBinding ( ) || ( importReference . isStatic ( ) && importBinding instanceof PackageBinding ) ) continue nextImport ; resolvedImports [ index ++ ] = new ImportBinding ( compoundName , true , importBinding , importReference ) ; } else { resolvedImports [ index ++ ] = new ImportBinding ( compoundName , false , null , importReference ) ; } } if ( resolvedImports . length > index ) System . arraycopy ( resolvedImports , <NUM_LIT:0> , resolvedImports = new ImportBinding [ index ] , <NUM_LIT:0> , index ) ; this . imports = resolvedImports ; } protected void checkParameterizedTypes ( ) { if ( compilerOptions ( ) . sourceLevel < ClassFileConstants . JDK1_5 ) return ; for ( int i = <NUM_LIT:0> , length = this . topLevelTypes . length ; i < length ; i ++ ) { ClassScope scope = this . topLevelTypes [ i ] . scope ; scope . checkParameterizedTypeBounds ( ) ; scope . checkParameterizedSuperTypeCollisions ( ) ; } } public char [ ] computeConstantPoolName ( LocalTypeBinding localType ) { if ( localType . constantPoolName != null ) { return localType . constantPoolName ; } if ( this . constantPoolNameUsage == null ) this . constantPoolNameUsage = new HashtableOfType ( ) ; ReferenceBinding outerMostEnclosingType = localType . scope . outerMostClassScope ( ) . enclosingSourceType ( ) ; int index = <NUM_LIT:0> ; char [ ] candidateName ; boolean isCompliant15 = compilerOptions ( ) . complianceLevel >= ClassFileConstants . JDK1_5 ; while ( true ) { if ( localType . isMemberType ( ) ) { if ( index == <NUM_LIT:0> ) { candidateName = CharOperation . concat ( localType . enclosingType ( ) . constantPoolName ( ) , localType . sourceName , '<CHAR_LIT>' ) ; } else { candidateName = CharOperation . concat ( localType . enclosingType ( ) . constantPoolName ( ) , '<CHAR_LIT>' , String . valueOf ( index ) . toCharArray ( ) , '<CHAR_LIT>' , localType . sourceName ) ; } } else if ( localType . isAnonymousType ( ) ) { if ( isCompliant15 ) { candidateName = CharOperation . concat ( localType . enclosingType . constantPoolName ( ) , String . valueOf ( index + <NUM_LIT:1> ) . toCharArray ( ) , '<CHAR_LIT>' ) ; } else { candidateName = CharOperation . concat ( outerMostEnclosingType . constantPoolName ( ) , String . valueOf ( index + <NUM_LIT:1> ) . toCharArray ( ) , '<CHAR_LIT>' ) ; } } else { if ( isCompliant15 ) { candidateName = CharOperation . concat ( CharOperation . concat ( localType . enclosingType ( ) . constantPoolName ( ) , String . valueOf ( index + <NUM_LIT:1> ) . toCharArray ( ) , '<CHAR_LIT>' ) , localType . sourceName ) ; } else { candidateName = CharOperation . concat ( outerMostEnclosingType . constantPoolName ( ) , '<CHAR_LIT>' , String . valueOf ( index + <NUM_LIT:1> ) . toCharArray ( ) , '<CHAR_LIT>' , localType . sourceName ) ; } } if ( this . constantPoolNameUsage . get ( candidateName ) != null ) { index ++ ; } else { this . constantPoolNameUsage . put ( candidateName , localType ) ; break ; } } return candidateName ; } void connectTypeHierarchy ( ) { for ( int i = <NUM_LIT:0> , length = this . topLevelTypes . length ; i < length ; i ++ ) this . topLevelTypes [ i ] . scope . connectTypeHierarchy ( ) ; } protected void faultInImports ( ) { if ( this . typeOrPackageCache != null ) return ; if ( this . referenceContext . imports == null ) { this . typeOrPackageCache = new HashtableOfObject ( <NUM_LIT:1> ) ; return ; } int numberOfStatements = this . referenceContext . imports . length ; HashtableOfType typesBySimpleNames = null ; for ( int i = <NUM_LIT:0> ; i < numberOfStatements ; i ++ ) { if ( ( this . referenceContext . imports [ i ] . bits & ASTNode . OnDemand ) == <NUM_LIT:0> ) { typesBySimpleNames = new HashtableOfType ( this . topLevelTypes . length + numberOfStatements ) ; for ( int j = <NUM_LIT:0> , length = this . topLevelTypes . length ; j < length ; j ++ ) typesBySimpleNames . put ( this . topLevelTypes [ j ] . sourceName , this . topLevelTypes [ j ] ) ; break ; } } int numberOfImports = numberOfStatements + <NUM_LIT:1> ; for ( int i = <NUM_LIT:0> ; i < numberOfStatements ; i ++ ) { ImportReference importReference = this . referenceContext . imports [ i ] ; if ( ( ( importReference . bits & ASTNode . OnDemand ) != <NUM_LIT:0> ) && CharOperation . equals ( TypeConstants . JAVA_LANG , importReference . tokens ) && ! importReference . isStatic ( ) ) { numberOfImports -- ; break ; } } ImportBinding [ ] resolvedImports = null ; int index = - <NUM_LIT:1> ; ImportBinding [ ] defaultImportBindings = getDefaultImports ( ) ; if ( defaultImportBindings . length == <NUM_LIT:1> ) { resolvedImports = new ImportBinding [ numberOfImports ] ; resolvedImports [ <NUM_LIT:0> ] = getDefaultImports ( ) [ <NUM_LIT:0> ] ; index = <NUM_LIT:1> ; } else { resolvedImports = new ImportBinding [ numberOfImports + defaultImportBindings . length - <NUM_LIT:1> ] ; index = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < defaultImportBindings . length ; i ++ ) { resolvedImports [ index ++ ] = defaultImportBindings [ i ] ; } } nextImport : for ( int i = <NUM_LIT:0> ; i < numberOfStatements ; i ++ ) { ImportReference importReference = this . referenceContext . imports [ i ] ; char [ ] [ ] compoundName = importReference . tokens ; for ( int j = <NUM_LIT:0> ; j < index ; j ++ ) { ImportBinding resolved = resolvedImports [ j ] ; if ( resolved . onDemand == ( ( importReference . bits & ASTNode . OnDemand ) != <NUM_LIT:0> ) && resolved . isStatic ( ) == importReference . isStatic ( ) ) { if ( CharOperation . equals ( compoundName , resolved . compoundName ) ) { problemReporter ( ) . unusedImport ( importReference ) ; continue nextImport ; } } } if ( ( importReference . bits & ASTNode . OnDemand ) != <NUM_LIT:0> ) { if ( CharOperation . equals ( compoundName , this . currentPackageName ) ) { problemReporter ( ) . unusedImport ( importReference ) ; continue nextImport ; } Binding importBinding = findImport ( compoundName , compoundName . length ) ; if ( ! importBinding . isValidBinding ( ) ) { reportImportProblem ( importReference , importBinding ) ; continue nextImport ; } if ( importReference . isStatic ( ) && importBinding instanceof PackageBinding ) { problemReporter ( ) . cannotImportPackage ( importReference ) ; continue nextImport ; } resolvedImports [ index ++ ] = new ImportBinding ( compoundName , true , importBinding , importReference ) ; } else { Binding importBinding = findSingleImport ( compoundName , Binding . TYPE | Binding . FIELD | Binding . METHOD , importReference . isStatic ( ) ) ; if ( ! importBinding . isValidBinding ( ) ) { if ( importBinding . problemId ( ) == ProblemReasons . Ambiguous ) { } else { recordImportProblem ( importReference , importBinding ) ; continue nextImport ; } } if ( importBinding instanceof PackageBinding ) { problemReporter ( ) . cannotImportPackage ( importReference ) ; continue nextImport ; } ReferenceBinding conflictingType = null ; if ( importBinding instanceof MethodBinding ) { conflictingType = ( ReferenceBinding ) getType ( compoundName , compoundName . length ) ; if ( ! conflictingType . isValidBinding ( ) || ( importReference . isStatic ( ) && ! conflictingType . isStatic ( ) ) ) conflictingType = null ; } if ( importBinding instanceof ReferenceBinding || conflictingType != null ) { ReferenceBinding referenceBinding = conflictingType == null ? ( ReferenceBinding ) importBinding : conflictingType ; ReferenceBinding typeToCheck = referenceBinding . problemId ( ) == ProblemReasons . Ambiguous ? ( ( ProblemReferenceBinding ) referenceBinding ) . closestMatch : referenceBinding ; if ( importReference . isTypeUseDeprecated ( typeToCheck , this ) ) problemReporter ( ) . deprecatedType ( typeToCheck , importReference ) ; ReferenceBinding existingType = typesBySimpleNames . get ( importReference . getSimpleName ( ) ) ; if ( existingType != null ) { if ( existingType == referenceBinding ) { for ( int j = <NUM_LIT:0> ; j < index ; j ++ ) { ImportBinding resolved = resolvedImports [ j ] ; if ( resolved instanceof ImportConflictBinding ) { ImportConflictBinding importConflictBinding = ( ImportConflictBinding ) resolved ; if ( importConflictBinding . conflictingTypeBinding == referenceBinding ) { if ( ! importReference . isStatic ( ) ) { problemReporter ( ) . duplicateImport ( importReference ) ; resolvedImports [ index ++ ] = new ImportBinding ( compoundName , false , importBinding , importReference ) ; } } } else if ( resolved . resolvedImport == referenceBinding ) { if ( importReference . isStatic ( ) != resolved . isStatic ( ) ) { problemReporter ( ) . duplicateImport ( importReference ) ; resolvedImports [ index ++ ] = new ImportBinding ( compoundName , false , importBinding , importReference ) ; } } } continue nextImport ; } for ( int j = <NUM_LIT:0> , length = this . topLevelTypes . length ; j < length ; j ++ ) { if ( CharOperation . equals ( this . topLevelTypes [ j ] . sourceName , existingType . sourceName ) ) { problemReporter ( ) . conflictingImport ( importReference ) ; continue nextImport ; } } problemReporter ( ) . duplicateImport ( importReference ) ; continue nextImport ; } typesBySimpleNames . put ( importReference . getSimpleName ( ) , referenceBinding ) ; } else if ( importBinding instanceof FieldBinding ) { for ( int j = <NUM_LIT:0> ; j < index ; j ++ ) { ImportBinding resolved = resolvedImports [ j ] ; if ( resolved . isStatic ( ) && resolved . resolvedImport instanceof FieldBinding && importBinding != resolved . resolvedImport ) { if ( CharOperation . equals ( compoundName [ compoundName . length - <NUM_LIT:1> ] , resolved . compoundName [ resolved . compoundName . length - <NUM_LIT:1> ] ) ) { problemReporter ( ) . duplicateImport ( importReference ) ; continue nextImport ; } } } } resolvedImports [ index ++ ] = conflictingType == null ? new ImportBinding ( compoundName , false , importBinding , importReference ) : new ImportConflictBinding ( compoundName , importBinding , conflictingType , importReference ) ; } } if ( resolvedImports . length > index ) System . arraycopy ( resolvedImports , <NUM_LIT:0> , resolvedImports = new ImportBinding [ index ] , <NUM_LIT:0> , index ) ; this . imports = resolvedImports ; int length = this . imports . length ; this . typeOrPackageCache = new HashtableOfObject ( length ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { ImportBinding binding = this . imports [ i ] ; if ( ! binding . onDemand && binding . resolvedImport instanceof ReferenceBinding || binding instanceof ImportConflictBinding ) this . typeOrPackageCache . put ( getSimpleName ( binding ) , binding ) ; } } public void faultInTypes ( ) { faultInImports ( ) ; for ( int i = <NUM_LIT:0> , length = this . topLevelTypes . length ; i < length ; i ++ ) this . topLevelTypes [ i ] . faultInTypesForFieldsAndMethods ( ) ; } protected void recordImportProblem ( ImportReference importReference , Binding importBinding ) { problemReporter ( ) . importProblem ( importReference , importBinding ) ; } public Binding findImport ( char [ ] [ ] compoundName , boolean findStaticImports , boolean onDemand ) { if ( onDemand ) { return findImport ( compoundName , compoundName . length ) ; } else { return findSingleImport ( compoundName , Binding . TYPE | Binding . FIELD | Binding . METHOD , findStaticImports ) ; } } private Binding findImport ( char [ ] [ ] compoundName , int length ) { recordQualifiedReference ( compoundName ) ; Binding binding = this . environment . getTopLevelPackage ( compoundName [ <NUM_LIT:0> ] ) ; int i = <NUM_LIT:1> ; foundNothingOrType : if ( binding != null ) { PackageBinding packageBinding = ( PackageBinding ) binding ; while ( i < length ) { binding = packageBinding . getTypeOrPackage ( compoundName [ i ++ ] ) ; if ( binding == null || ! binding . isValidBinding ( ) ) { binding = null ; break foundNothingOrType ; } if ( ! ( binding instanceof PackageBinding ) ) break foundNothingOrType ; packageBinding = ( PackageBinding ) binding ; } return packageBinding ; } ReferenceBinding type ; if ( binding == null ) { if ( compilerOptions ( ) . complianceLevel >= ClassFileConstants . JDK1_4 ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , i ) , null , ProblemReasons . NotFound ) ; type = findType ( compoundName [ <NUM_LIT:0> ] , this . environment . defaultPackage , this . environment . defaultPackage ) ; if ( type == null || ! type . isValidBinding ( ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , i ) , null , ProblemReasons . NotFound ) ; i = <NUM_LIT:1> ; } else { type = ( ReferenceBinding ) binding ; } while ( i < length ) { type = ( ReferenceBinding ) this . environment . convertToRawType ( type , false ) ; if ( ! type . canBeSeenBy ( this . fPackage ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , i ) , type , ProblemReasons . NotVisible ) ; char [ ] name = compoundName [ i ++ ] ; type = type . getMemberType ( name ) ; if ( type == null ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , i ) , null , ProblemReasons . NotFound ) ; } if ( ! canBeSeenBy ( type , this . fPackage ) ) return new ProblemReferenceBinding ( compoundName , type , ProblemReasons . NotVisible ) ; return type ; } protected boolean canBeSeenBy ( ReferenceBinding type , PackageBinding pkg ) { return type . canBeSeenBy ( pkg ) ; } protected Binding findSingleImport ( char [ ] [ ] compoundName , int mask , boolean findStaticImports ) { if ( compoundName . length == <NUM_LIT:1> ) { if ( compilerOptions ( ) . complianceLevel >= ClassFileConstants . JDK1_4 ) return new ProblemReferenceBinding ( compoundName , null , ProblemReasons . NotFound ) ; ReferenceBinding typeBinding = findType ( compoundName [ <NUM_LIT:0> ] , this . environment . defaultPackage , this . fPackage ) ; if ( typeBinding == null ) return new ProblemReferenceBinding ( compoundName , null , ProblemReasons . NotFound ) ; return typeBinding ; } if ( findStaticImports ) return findSingleStaticImport ( compoundName , mask ) ; return findImport ( compoundName , compoundName . length ) ; } private Binding findSingleStaticImport ( char [ ] [ ] compoundName , int mask ) { Binding binding = findImport ( compoundName , compoundName . length - <NUM_LIT:1> ) ; if ( ! binding . isValidBinding ( ) ) return binding ; char [ ] name = compoundName [ compoundName . length - <NUM_LIT:1> ] ; if ( binding instanceof PackageBinding ) { Binding temp = ( ( PackageBinding ) binding ) . getTypeOrPackage ( name ) ; if ( temp != null && temp instanceof ReferenceBinding ) return new ProblemReferenceBinding ( compoundName , ( ReferenceBinding ) temp , ProblemReasons . InvalidTypeForStaticImport ) ; return binding ; } ReferenceBinding type = ( ReferenceBinding ) binding ; FieldBinding field = ( mask & Binding . FIELD ) != <NUM_LIT:0> ? findField ( type , name , null , true ) : null ; if ( field != null ) { if ( field . problemId ( ) == ProblemReasons . Ambiguous && ( ( ProblemFieldBinding ) field ) . closestMatch . isStatic ( ) ) return field ; if ( field . isValidBinding ( ) && field . isStatic ( ) && field . canBeSeenBy ( type , null , this ) ) return field ; } MethodBinding method = ( mask & Binding . METHOD ) != <NUM_LIT:0> ? findStaticMethod ( type , name ) : null ; if ( method != null ) return method ; type = findMemberType ( name , type ) ; if ( type == null || ! type . isStatic ( ) ) { if ( field != null && ! field . isValidBinding ( ) && field . problemId ( ) != ProblemReasons . NotFound ) return field ; return new ProblemReferenceBinding ( compoundName , type , ProblemReasons . NotFound ) ; } if ( type . isValidBinding ( ) && ! type . canBeSeenBy ( this . fPackage ) ) return new ProblemReferenceBinding ( compoundName , type , ProblemReasons . NotVisible ) ; if ( type . problemId ( ) == ProblemReasons . NotVisible ) return new ProblemReferenceBinding ( compoundName , ( ( ProblemReferenceBinding ) type ) . closestMatch , ProblemReasons . NotVisible ) ; return type ; } private MethodBinding findStaticMethod ( ReferenceBinding currentType , char [ ] selector ) { if ( ! currentType . canBeSeenBy ( this ) ) return null ; do { currentType . initializeForStaticImports ( ) ; MethodBinding [ ] methods = currentType . getMethods ( selector ) ; if ( methods != Binding . NO_METHODS ) { for ( int i = methods . length ; -- i >= <NUM_LIT:0> ; ) { MethodBinding method = methods [ i ] ; if ( method . isStatic ( ) && method . canBeSeenBy ( this . fPackage ) ) return method ; } } } while ( ( currentType = currentType . superclass ( ) ) != null ) ; return null ; } protected ImportBinding [ ] getDefaultImports ( ) { if ( this . environment . defaultImports != null ) return this . environment . defaultImports ; Binding importBinding = this . environment . getTopLevelPackage ( TypeConstants . JAVA ) ; if ( importBinding != null ) importBinding = ( ( PackageBinding ) importBinding ) . getTypeOrPackage ( TypeConstants . JAVA_LANG [ <NUM_LIT:1> ] ) ; if ( importBinding == null || ! importBinding . isValidBinding ( ) ) { problemReporter ( ) . isClassPathCorrect ( TypeConstants . JAVA_LANG_OBJECT , this . referenceContext , this . environment . missingClassFileLocation ) ; BinaryTypeBinding missingObject = this . environment . createMissingType ( null , TypeConstants . JAVA_LANG_OBJECT ) ; importBinding = missingObject . fPackage ; } return this . environment . defaultImports = new ImportBinding [ ] { new ImportBinding ( TypeConstants . JAVA_LANG , true , importBinding , null ) } ; } public final Binding getImport ( char [ ] [ ] compoundName , boolean onDemand , boolean isStaticImport ) { if ( onDemand ) return findImport ( compoundName , compoundName . length ) ; return findSingleImport ( compoundName , Binding . TYPE | Binding . FIELD | Binding . METHOD , isStaticImport ) ; } public int nextCaptureID ( ) { return this . captureID ++ ; } public ProblemReporter problemReporter ( ) { ProblemReporter problemReporter = this . referenceContext . problemReporter ; problemReporter . referenceContext = this . referenceContext ; return problemReporter ; } public void recordQualifiedReference ( char [ ] [ ] qualifiedName ) { if ( this . qualifiedReferences == null ) return ; int length = qualifiedName . length ; if ( length > <NUM_LIT:1> ) { recordRootReference ( qualifiedName [ <NUM_LIT:0> ] ) ; while ( ! this . qualifiedReferences . contains ( qualifiedName ) ) { this . qualifiedReferences . add ( qualifiedName ) ; if ( length == <NUM_LIT:2> ) { recordSimpleReference ( qualifiedName [ <NUM_LIT:0> ] ) ; recordSimpleReference ( qualifiedName [ <NUM_LIT:1> ] ) ; return ; } length -- ; recordSimpleReference ( qualifiedName [ length ] ) ; System . arraycopy ( qualifiedName , <NUM_LIT:0> , qualifiedName = new char [ length ] [ ] , <NUM_LIT:0> , length ) ; } } else if ( length == <NUM_LIT:1> ) { recordRootReference ( qualifiedName [ <NUM_LIT:0> ] ) ; recordSimpleReference ( qualifiedName [ <NUM_LIT:0> ] ) ; } } void recordReference ( char [ ] [ ] qualifiedEnclosingName , char [ ] simpleName ) { recordQualifiedReference ( qualifiedEnclosingName ) ; if ( qualifiedEnclosingName . length == <NUM_LIT:0> ) recordRootReference ( simpleName ) ; recordSimpleReference ( simpleName ) ; } void recordReference ( ReferenceBinding type , char [ ] simpleName ) { ReferenceBinding actualType = typeToRecord ( type ) ; if ( actualType != null ) recordReference ( actualType . compoundName , simpleName ) ; } void recordRootReference ( char [ ] simpleName ) { if ( this . rootReferences == null ) return ; if ( ! this . rootReferences . contains ( simpleName ) ) this . rootReferences . add ( simpleName ) ; } public void recordSimpleReference ( char [ ] simpleName ) { if ( this . simpleNameReferences == null ) return ; if ( ! this . simpleNameReferences . contains ( simpleName ) ) this . simpleNameReferences . add ( simpleName ) ; } void recordSuperTypeReference ( TypeBinding type ) { if ( this . referencedSuperTypes == null ) return ; ReferenceBinding actualType = typeToRecord ( type ) ; if ( actualType != null && ! this . referencedSuperTypes . containsIdentical ( actualType ) ) this . referencedSuperTypes . add ( actualType ) ; } public void recordTypeConversion ( TypeBinding superType , TypeBinding subType ) { recordSuperTypeReference ( subType ) ; } void recordTypeReference ( TypeBinding type ) { if ( this . referencedTypes == null ) return ; ReferenceBinding actualType = typeToRecord ( type ) ; if ( actualType != null && ! this . referencedTypes . containsIdentical ( actualType ) ) this . referencedTypes . add ( actualType ) ; } void recordTypeReferences ( TypeBinding [ ] types ) { if ( this . referencedTypes == null ) return ; if ( types == null || types . length == <NUM_LIT:0> ) return ; for ( int i = <NUM_LIT:0> , max = types . length ; i < max ; i ++ ) { ReferenceBinding actualType = typeToRecord ( types [ i ] ) ; if ( actualType != null && ! this . referencedTypes . containsIdentical ( actualType ) ) this . referencedTypes . add ( actualType ) ; } } Binding resolveSingleImport ( ImportBinding importBinding , int mask ) { if ( importBinding . resolvedImport == null ) { importBinding . resolvedImport = findSingleImport ( importBinding . compoundName , mask , importBinding . isStatic ( ) ) ; if ( ! importBinding . resolvedImport . isValidBinding ( ) || importBinding . resolvedImport instanceof PackageBinding ) { if ( importBinding . resolvedImport . problemId ( ) == ProblemReasons . Ambiguous ) return importBinding . resolvedImport ; if ( this . imports != null ) { ImportBinding [ ] newImports = new ImportBinding [ this . imports . length - <NUM_LIT:1> ] ; for ( int i = <NUM_LIT:0> , n = <NUM_LIT:0> , max = this . imports . length ; i < max ; i ++ ) if ( this . imports [ i ] != importBinding ) newImports [ n ++ ] = this . imports [ i ] ; this . imports = newImports ; } return null ; } } return importBinding . resolvedImport ; } public void storeDependencyInfo ( ) { for ( int i = <NUM_LIT:0> ; i < this . referencedSuperTypes . size ; i ++ ) { ReferenceBinding type = ( ReferenceBinding ) this . referencedSuperTypes . elementAt ( i ) ; if ( ! this . referencedTypes . containsIdentical ( type ) ) this . referencedTypes . add ( type ) ; if ( ! type . isLocalType ( ) ) { ReferenceBinding enclosing = type . enclosingType ( ) ; if ( enclosing != null ) recordSuperTypeReference ( enclosing ) ; } ReferenceBinding superclass = type . superclass ( ) ; if ( superclass != null ) recordSuperTypeReference ( superclass ) ; ReferenceBinding [ ] interfaces = type . superInterfaces ( ) ; if ( interfaces != null ) for ( int j = <NUM_LIT:0> , length = interfaces . length ; j < length ; j ++ ) recordSuperTypeReference ( interfaces [ j ] ) ; } for ( int i = <NUM_LIT:0> , l = this . referencedTypes . size ; i < l ; i ++ ) { ReferenceBinding type = ( ReferenceBinding ) this . referencedTypes . elementAt ( i ) ; if ( ! type . isLocalType ( ) ) recordQualifiedReference ( type . isMemberType ( ) ? CharOperation . splitOn ( '<CHAR_LIT:.>' , type . readableName ( ) ) : type . compoundName ) ; } int size = this . qualifiedReferences . size ; char [ ] [ ] [ ] qualifiedRefs = new char [ size ] [ ] [ ] ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) qualifiedRefs [ i ] = this . qualifiedReferences . elementAt ( i ) ; this . referenceContext . compilationResult . qualifiedReferences = qualifiedRefs ; size = this . simpleNameReferences . size ; char [ ] [ ] simpleRefs = new char [ size ] [ ] ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) simpleRefs [ i ] = this . simpleNameReferences . elementAt ( i ) ; this . referenceContext . compilationResult . simpleNameReferences = simpleRefs ; size = this . rootReferences . size ; char [ ] [ ] rootRefs = new char [ size ] [ ] ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) rootRefs [ i ] = this . rootReferences . elementAt ( i ) ; this . referenceContext . compilationResult . rootReferences = rootRefs ; } public String toString ( ) { return "<STR_LIT>" + new String ( this . referenceContext . getFileName ( ) ) ; } private ReferenceBinding typeToRecord ( TypeBinding type ) { if ( type . isArrayType ( ) ) type = ( ( ArrayBinding ) type ) . leafComponentType ; switch ( type . kind ( ) ) { case Binding . BASE_TYPE : case Binding . TYPE_PARAMETER : case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : return null ; case Binding . PARAMETERIZED_TYPE : case Binding . RAW_TYPE : type = type . erasure ( ) ; } ReferenceBinding refType = ( ReferenceBinding ) type ; if ( refType . isLocalType ( ) ) return null ; return refType ; } public void verifyMethods ( MethodVerifier verifier ) { for ( int i = <NUM_LIT:0> , length = this . topLevelTypes . length ; i < length ; i ++ ) this . topLevelTypes [ i ] . verifyMethods ( verifier ) ; } public void augmentTypeHierarchy ( ) { } public boolean checkTargetCompatibility ( ) { return true ; } public boolean scannerAvailable ( ) { return true ; } public boolean reportInvalidType ( TypeReference typeReference , TypeBinding resolvedType ) { return true ; } protected void reportImportProblem ( ImportReference importReference , Binding importBinding ) { problemReporter ( ) . importProblem ( importReference , importBinding ) ; } public boolean canSeeEverything ( ) { return false ; } public ReferenceBinding selectBinding ( ReferenceBinding temp , ReferenceBinding type , boolean isDeclaredImport ) { return null ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . * ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . codegen . CodeStream ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . problem . ProblemReporter ; public class BlockScope extends Scope { public LocalVariableBinding [ ] locals ; public int localIndex ; public int startIndex ; public int offset ; public int maxOffset ; public BlockScope [ ] shiftScopes ; public Scope [ ] subscopes = new Scope [ <NUM_LIT:1> ] ; public int subscopeCount = <NUM_LIT:0> ; public CaseStatement enclosingCase ; public final static VariableBinding [ ] EmulationPathToImplicitThis = { } ; public final static VariableBinding [ ] NoEnclosingInstanceInConstructorCall = { } ; public final static VariableBinding [ ] NoEnclosingInstanceInStaticContext = { } ; public BlockScope ( BlockScope parent ) { this ( parent , true ) ; } public BlockScope ( BlockScope parent , boolean addToParentScope ) { this ( Scope . BLOCK_SCOPE , parent ) ; this . locals = new LocalVariableBinding [ <NUM_LIT:5> ] ; if ( addToParentScope ) parent . addSubscope ( this ) ; this . startIndex = parent . localIndex ; } public BlockScope ( BlockScope parent , int variableCount ) { this ( Scope . BLOCK_SCOPE , parent ) ; this . locals = new LocalVariableBinding [ variableCount ] ; parent . addSubscope ( this ) ; this . startIndex = parent . localIndex ; } protected BlockScope ( int kind , Scope parent ) { super ( kind , parent ) ; } public final void addAnonymousType ( TypeDeclaration anonymousType , ReferenceBinding superBinding ) { ClassScope anonymousClassScope = new ClassScope ( this , anonymousType ) ; anonymousClassScope . buildAnonymousTypeBinding ( enclosingSourceType ( ) , superBinding ) ; } public final void addLocalType ( TypeDeclaration localType ) { ClassScope localTypeScope = new ClassScope ( this , localType ) ; addSubscope ( localTypeScope ) ; localTypeScope . buildLocalTypeBinding ( enclosingSourceType ( ) ) ; } public final void addLocalVariable ( LocalVariableBinding binding ) { checkAndSetModifiersForVariable ( binding ) ; if ( this . localIndex == this . locals . length ) System . arraycopy ( this . locals , <NUM_LIT:0> , ( this . locals = new LocalVariableBinding [ this . localIndex * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . localIndex ) ; this . locals [ this . localIndex ++ ] = binding ; binding . declaringScope = this ; binding . id = outerMostMethodScope ( ) . analysisIndex ++ ; } public void addSubscope ( Scope childScope ) { if ( this . subscopeCount == this . subscopes . length ) System . arraycopy ( this . subscopes , <NUM_LIT:0> , ( this . subscopes = new Scope [ this . subscopeCount * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . subscopeCount ) ; this . subscopes [ this . subscopeCount ++ ] = childScope ; } public final boolean allowBlankFinalFieldAssignment ( FieldBinding binding ) { if ( enclosingReceiverType ( ) != binding . declaringClass ) return false ; MethodScope methodScope = methodScope ( ) ; if ( methodScope . isStatic != binding . isStatic ( ) ) return false ; return methodScope . isInsideInitializer ( ) || ( ( AbstractMethodDeclaration ) methodScope . referenceContext ) . isInitializationMethod ( ) ; } String basicToString ( int tab ) { String newLine = "<STR_LIT:n>" ; for ( int i = tab ; -- i >= <NUM_LIT:0> ; ) newLine += "<STR_LIT:t>" ; String s = newLine + "<STR_LIT>" ; newLine += "<STR_LIT:t>" ; s += newLine + "<STR_LIT>" ; for ( int i = <NUM_LIT:0> ; i < this . localIndex ; i ++ ) s += newLine + "<STR_LIT:t>" + this . locals [ i ] . toString ( ) ; s += newLine + "<STR_LIT>" + this . startIndex ; return s ; } private void checkAndSetModifiersForVariable ( LocalVariableBinding varBinding ) { int modifiers = varBinding . modifiers ; if ( ( modifiers & ExtraCompilerModifiers . AccAlternateModifierProblem ) != <NUM_LIT:0> && varBinding . declaration != null ) { problemReporter ( ) . duplicateModifierForVariable ( varBinding . declaration , this instanceof MethodScope ) ; } int realModifiers = modifiers & ExtraCompilerModifiers . AccJustFlag ; int unexpectedModifiers = ~ ClassFileConstants . AccFinal ; if ( ( realModifiers & unexpectedModifiers ) != <NUM_LIT:0> && varBinding . declaration != null ) { problemReporter ( ) . illegalModifierForVariable ( varBinding . declaration , this instanceof MethodScope ) ; } varBinding . modifiers = modifiers ; } void computeLocalVariablePositions ( int ilocal , int initOffset , CodeStream codeStream ) { this . offset = initOffset ; this . maxOffset = initOffset ; int maxLocals = this . localIndex ; boolean hasMoreVariables = ilocal < maxLocals ; int iscope = <NUM_LIT:0> , maxScopes = this . subscopeCount ; boolean hasMoreScopes = maxScopes > <NUM_LIT:0> ; while ( hasMoreVariables || hasMoreScopes ) { if ( hasMoreScopes && ( ! hasMoreVariables || ( this . subscopes [ iscope ] . startIndex ( ) <= ilocal ) ) ) { if ( this . subscopes [ iscope ] instanceof BlockScope ) { BlockScope subscope = ( BlockScope ) this . subscopes [ iscope ] ; int subOffset = subscope . shiftScopes == null ? this . offset : subscope . maxShiftedOffset ( ) ; subscope . computeLocalVariablePositions ( <NUM_LIT:0> , subOffset , codeStream ) ; if ( subscope . maxOffset > this . maxOffset ) this . maxOffset = subscope . maxOffset ; } hasMoreScopes = ++ iscope < maxScopes ; } else { LocalVariableBinding local = this . locals [ ilocal ] ; boolean generateCurrentLocalVar = ( local . useFlag > LocalVariableBinding . UNUSED && local . constant ( ) == Constant . NotAConstant ) ; if ( local . useFlag == LocalVariableBinding . UNUSED && ( local . declaration != null ) && ( ( local . declaration . bits & ASTNode . IsLocalDeclarationReachable ) != <NUM_LIT:0> ) ) { if ( ! ( local . declaration instanceof Argument ) ) problemReporter ( ) . unusedLocalVariable ( local . declaration ) ; } if ( ! generateCurrentLocalVar ) { if ( local . declaration != null && compilerOptions ( ) . preserveAllLocalVariables ) { generateCurrentLocalVar = true ; if ( local . useFlag == LocalVariableBinding . UNUSED ) local . useFlag = LocalVariableBinding . USED ; } } if ( generateCurrentLocalVar ) { if ( local . declaration != null ) { codeStream . record ( local ) ; } local . resolvedPosition = this . offset ; if ( ( local . type == TypeBinding . LONG ) || ( local . type == TypeBinding . DOUBLE ) ) { this . offset += <NUM_LIT:2> ; } else { this . offset ++ ; } if ( this . offset > <NUM_LIT> ) { problemReporter ( ) . noMoreAvailableSpaceForLocal ( local , local . declaration == null ? ( ASTNode ) methodScope ( ) . referenceContext : local . declaration ) ; } } else { local . resolvedPosition = - <NUM_LIT:1> ; } hasMoreVariables = ++ ilocal < maxLocals ; } } if ( this . offset > this . maxOffset ) this . maxOffset = this . offset ; } public void emulateOuterAccess ( LocalVariableBinding outerLocalVariable ) { BlockScope outerVariableScope = outerLocalVariable . declaringScope ; if ( outerVariableScope == null ) return ; MethodScope currentMethodScope = methodScope ( ) ; if ( outerVariableScope . methodScope ( ) != currentMethodScope ) { NestedTypeBinding currentType = ( NestedTypeBinding ) enclosingSourceType ( ) ; if ( ! currentType . isLocalType ( ) ) { return ; } if ( ! currentMethodScope . isInsideInitializerOrConstructor ( ) ) { currentType . addSyntheticArgumentAndField ( outerLocalVariable ) ; } else { currentType . addSyntheticArgument ( outerLocalVariable ) ; } } } public final ReferenceBinding findLocalType ( char [ ] name ) { long compliance = compilerOptions ( ) . complianceLevel ; for ( int i = this . subscopeCount - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) { if ( this . subscopes [ i ] instanceof ClassScope ) { LocalTypeBinding sourceType = ( LocalTypeBinding ) ( ( ClassScope ) this . subscopes [ i ] ) . referenceContext . binding ; if ( compliance >= ClassFileConstants . JDK1_4 && sourceType . enclosingCase != null ) { if ( ! isInsideCase ( sourceType . enclosingCase ) ) { continue ; } } if ( CharOperation . equals ( sourceType . sourceName ( ) , name ) ) return sourceType ; } } return null ; } public LocalDeclaration [ ] findLocalVariableDeclarations ( int position ) { int ilocal = <NUM_LIT:0> , maxLocals = this . localIndex ; boolean hasMoreVariables = maxLocals > <NUM_LIT:0> ; LocalDeclaration [ ] localDeclarations = null ; int declPtr = <NUM_LIT:0> ; int iscope = <NUM_LIT:0> , maxScopes = this . subscopeCount ; boolean hasMoreScopes = maxScopes > <NUM_LIT:0> ; while ( hasMoreVariables || hasMoreScopes ) { if ( hasMoreScopes && ( ! hasMoreVariables || ( this . subscopes [ iscope ] . startIndex ( ) <= ilocal ) ) ) { Scope subscope = this . subscopes [ iscope ] ; if ( subscope . kind == Scope . BLOCK_SCOPE ) { localDeclarations = ( ( BlockScope ) subscope ) . findLocalVariableDeclarations ( position ) ; if ( localDeclarations != null ) { return localDeclarations ; } } hasMoreScopes = ++ iscope < maxScopes ; } else { LocalVariableBinding local = this . locals [ ilocal ] ; if ( local != null ) { LocalDeclaration localDecl = local . declaration ; if ( localDecl != null ) { if ( localDecl . declarationSourceStart <= position ) { if ( position <= localDecl . declarationSourceEnd ) { if ( localDeclarations == null ) { localDeclarations = new LocalDeclaration [ maxLocals ] ; } localDeclarations [ declPtr ++ ] = localDecl ; } } else { return localDeclarations ; } } } hasMoreVariables = ++ ilocal < maxLocals ; if ( ! hasMoreVariables && localDeclarations != null ) { return localDeclarations ; } } } return null ; } public LocalVariableBinding findVariable ( char [ ] variableName ) { int varLength = variableName . length ; for ( int i = this . localIndex - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) { LocalVariableBinding local ; char [ ] localName ; if ( ( localName = ( local = this . locals [ i ] ) . name ) . length == varLength && CharOperation . equals ( localName , variableName ) ) return local ; } return null ; } public Binding getBinding ( char [ ] [ ] compoundName , int mask , InvocationSite invocationSite , boolean needResolve ) { Binding binding = getBinding ( compoundName [ <NUM_LIT:0> ] , mask | Binding . TYPE | Binding . PACKAGE , invocationSite , needResolve ) ; invocationSite . setFieldIndex ( <NUM_LIT:1> ) ; if ( binding instanceof VariableBinding ) return binding ; CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( compoundName ) ; if ( ! binding . isValidBinding ( ) ) return binding ; int length = compoundName . length ; int currentIndex = <NUM_LIT:1> ; foundType : if ( binding instanceof PackageBinding ) { PackageBinding packageBinding = ( PackageBinding ) binding ; while ( currentIndex < length ) { unitScope . recordReference ( packageBinding . compoundName , compoundName [ currentIndex ] ) ; binding = packageBinding . getTypeOrPackage ( compoundName [ currentIndex ++ ] ) ; invocationSite . setFieldIndex ( currentIndex ) ; if ( binding == null ) { if ( currentIndex == length ) { return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , null , ProblemReasons . NotFound ) ; } return new ProblemBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , ProblemReasons . NotFound ) ; } if ( binding instanceof ReferenceBinding ) { if ( ! binding . isValidBinding ( ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , ( ReferenceBinding ) ( ( ReferenceBinding ) binding ) . closestMatch ( ) , binding . problemId ( ) ) ; if ( ! ( ( ReferenceBinding ) binding ) . canBeSeenBy ( this ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , ( ReferenceBinding ) binding , ProblemReasons . NotVisible ) ; break foundType ; } packageBinding = ( PackageBinding ) binding ; } return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , null , ProblemReasons . NotFound ) ; } ReferenceBinding referenceBinding = ( ReferenceBinding ) binding ; binding = environment ( ) . convertToRawType ( referenceBinding , false ) ; if ( invocationSite instanceof ASTNode ) { ASTNode invocationNode = ( ASTNode ) invocationSite ; if ( invocationNode . isTypeUseDeprecated ( referenceBinding , this ) ) { problemReporter ( ) . deprecatedType ( referenceBinding , invocationNode ) ; } } Binding problemFieldBinding = null ; while ( currentIndex < length ) { referenceBinding = ( ReferenceBinding ) binding ; char [ ] nextName = compoundName [ currentIndex ++ ] ; invocationSite . setFieldIndex ( currentIndex ) ; invocationSite . setActualReceiverType ( referenceBinding ) ; if ( ( mask & Binding . FIELD ) != <NUM_LIT:0> && ( binding = findField ( referenceBinding , nextName , invocationSite , true ) ) != null ) { if ( binding . isValidBinding ( ) ) { break ; } problemFieldBinding = new ProblemFieldBinding ( ( ( ProblemFieldBinding ) binding ) . closestMatch , ( ( ProblemFieldBinding ) binding ) . declaringClass , CharOperation . concatWith ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , '<CHAR_LIT:.>' ) , binding . problemId ( ) ) ; if ( binding . problemId ( ) != ProblemReasons . NotVisible ) { return problemFieldBinding ; } } if ( ( binding = findMemberType ( nextName , referenceBinding ) ) == null ) { if ( problemFieldBinding != null ) { return problemFieldBinding ; } if ( ( mask & Binding . FIELD ) != <NUM_LIT:0> ) { return new ProblemFieldBinding ( null , referenceBinding , nextName , ProblemReasons . NotFound ) ; } else if ( ( mask & Binding . VARIABLE ) != <NUM_LIT:0> ) { return new ProblemBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , referenceBinding , ProblemReasons . NotFound ) ; } return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , referenceBinding , ProblemReasons . NotFound ) ; } if ( ! binding . isValidBinding ( ) ) { if ( problemFieldBinding != null ) { return problemFieldBinding ; } return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , ( ReferenceBinding ) ( ( ReferenceBinding ) binding ) . closestMatch ( ) , binding . problemId ( ) ) ; } if ( invocationSite instanceof ASTNode ) { referenceBinding = ( ReferenceBinding ) binding ; ASTNode invocationNode = ( ASTNode ) invocationSite ; if ( invocationNode . isTypeUseDeprecated ( referenceBinding , this ) ) { problemReporter ( ) . deprecatedType ( referenceBinding , invocationNode ) ; } } } if ( ( mask & Binding . FIELD ) != <NUM_LIT:0> && ( binding instanceof FieldBinding ) ) { FieldBinding field = ( FieldBinding ) binding ; if ( ! field . isStatic ( ) ) return new ProblemFieldBinding ( field , field . declaringClass , CharOperation . concatWith ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , '<CHAR_LIT:.>' ) , ProblemReasons . NonStaticReferenceInStaticContext ) ; return binding ; } if ( ( mask & Binding . TYPE ) != <NUM_LIT:0> && ( binding instanceof ReferenceBinding ) ) { return binding ; } return new ProblemBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , ProblemReasons . NotFound ) ; } public final Binding getBinding ( char [ ] [ ] compoundName , InvocationSite invocationSite ) { int currentIndex = <NUM_LIT:0> ; int length = compoundName . length ; Binding binding = getBinding ( compoundName [ currentIndex ++ ] , Binding . VARIABLE | Binding . TYPE | Binding . PACKAGE , invocationSite , true ) ; if ( ! binding . isValidBinding ( ) ) return binding ; foundType : if ( binding instanceof PackageBinding ) { while ( currentIndex < length ) { PackageBinding packageBinding = ( PackageBinding ) binding ; binding = packageBinding . getTypeOrPackage ( compoundName [ currentIndex ++ ] ) ; if ( binding == null ) { if ( currentIndex == length ) { return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , null , ProblemReasons . NotFound ) ; } return new ProblemBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , ProblemReasons . NotFound ) ; } if ( binding instanceof ReferenceBinding ) { if ( ! binding . isValidBinding ( ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , ( ReferenceBinding ) ( ( ReferenceBinding ) binding ) . closestMatch ( ) , binding . problemId ( ) ) ; if ( ! ( ( ReferenceBinding ) binding ) . canBeSeenBy ( this ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , ( ReferenceBinding ) binding , ProblemReasons . NotVisible ) ; break foundType ; } } return binding ; } foundField : if ( binding instanceof ReferenceBinding ) { while ( currentIndex < length ) { ReferenceBinding typeBinding = ( ReferenceBinding ) binding ; char [ ] nextName = compoundName [ currentIndex ++ ] ; TypeBinding receiverType = typeBinding . capture ( this , invocationSite . sourceEnd ( ) ) ; if ( ( binding = findField ( receiverType , nextName , invocationSite , true ) ) != null ) { if ( ! binding . isValidBinding ( ) ) { return new ProblemFieldBinding ( ( FieldBinding ) binding , ( ( FieldBinding ) binding ) . declaringClass , CharOperation . concatWith ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , '<CHAR_LIT:.>' ) , binding . problemId ( ) ) ; } if ( ! ( ( FieldBinding ) binding ) . isStatic ( ) ) return new ProblemFieldBinding ( ( FieldBinding ) binding , ( ( FieldBinding ) binding ) . declaringClass , CharOperation . concatWith ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , '<CHAR_LIT:.>' ) , ProblemReasons . NonStaticReferenceInStaticContext ) ; break foundField ; } if ( ( binding = findMemberType ( nextName , typeBinding ) ) == null ) { return new ProblemBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , typeBinding , ProblemReasons . NotFound ) ; } if ( ! binding . isValidBinding ( ) ) { return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , ( ReferenceBinding ) ( ( ReferenceBinding ) binding ) . closestMatch ( ) , binding . problemId ( ) ) ; } } return binding ; } VariableBinding variableBinding = ( VariableBinding ) binding ; while ( currentIndex < length ) { TypeBinding typeBinding = variableBinding . type ; if ( typeBinding == null ) { return new ProblemFieldBinding ( null , null , CharOperation . concatWith ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , '<CHAR_LIT:.>' ) , ProblemReasons . NotFound ) ; } TypeBinding receiverType = typeBinding . capture ( this , invocationSite . sourceEnd ( ) ) ; variableBinding = findField ( receiverType , compoundName [ currentIndex ++ ] , invocationSite , true ) ; if ( variableBinding == null ) { return new ProblemFieldBinding ( null , receiverType instanceof ReferenceBinding ? ( ReferenceBinding ) receiverType : null , CharOperation . concatWith ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , '<CHAR_LIT:.>' ) , ProblemReasons . NotFound ) ; } if ( ! variableBinding . isValidBinding ( ) ) return variableBinding ; } return variableBinding ; } public VariableBinding [ ] getEmulationPath ( LocalVariableBinding outerLocalVariable ) { MethodScope currentMethodScope = methodScope ( ) ; SourceTypeBinding sourceType = currentMethodScope . enclosingSourceType ( ) ; BlockScope variableScope = outerLocalVariable . declaringScope ; if ( variableScope == null || currentMethodScope == variableScope . methodScope ( ) ) { return new VariableBinding [ ] { outerLocalVariable } ; } if ( currentMethodScope . isInsideInitializerOrConstructor ( ) && ( sourceType . isNestedType ( ) ) ) { SyntheticArgumentBinding syntheticArg ; if ( ( syntheticArg = ( ( NestedTypeBinding ) sourceType ) . getSyntheticArgument ( outerLocalVariable ) ) != null ) { return new VariableBinding [ ] { syntheticArg } ; } } if ( ! currentMethodScope . isStatic ) { FieldBinding syntheticField ; if ( ( syntheticField = sourceType . getSyntheticField ( outerLocalVariable ) ) != null ) { return new VariableBinding [ ] { syntheticField } ; } } return null ; } public Object [ ] getEmulationPath ( ReferenceBinding targetEnclosingType , boolean onlyExactMatch , boolean denyEnclosingArgInConstructorCall ) { MethodScope currentMethodScope = methodScope ( ) ; SourceTypeBinding sourceType = currentMethodScope . enclosingSourceType ( ) ; if ( ! currentMethodScope . isStatic && ! currentMethodScope . isConstructorCall ) { if ( sourceType == targetEnclosingType || ( ! onlyExactMatch && sourceType . findSuperTypeOriginatingFrom ( targetEnclosingType ) != null ) ) { return BlockScope . EmulationPathToImplicitThis ; } } if ( ! sourceType . isNestedType ( ) || sourceType . isStatic ( ) ) { if ( currentMethodScope . isConstructorCall ) { return BlockScope . NoEnclosingInstanceInConstructorCall ; } else if ( currentMethodScope . isStatic ) { return BlockScope . NoEnclosingInstanceInStaticContext ; } return null ; } boolean insideConstructor = currentMethodScope . isInsideInitializerOrConstructor ( ) ; if ( insideConstructor ) { SyntheticArgumentBinding syntheticArg ; if ( ( syntheticArg = ( ( NestedTypeBinding ) sourceType ) . getSyntheticArgument ( targetEnclosingType , onlyExactMatch ) ) != null ) { if ( denyEnclosingArgInConstructorCall && currentMethodScope . isConstructorCall && ( sourceType == targetEnclosingType || ( ! onlyExactMatch && sourceType . findSuperTypeOriginatingFrom ( targetEnclosingType ) != null ) ) ) { return BlockScope . NoEnclosingInstanceInConstructorCall ; } return new Object [ ] { syntheticArg } ; } } if ( currentMethodScope . isStatic ) { return BlockScope . NoEnclosingInstanceInStaticContext ; } if ( sourceType . isAnonymousType ( ) ) { ReferenceBinding enclosingType = sourceType . enclosingType ( ) ; if ( enclosingType . isNestedType ( ) ) { NestedTypeBinding nestedEnclosingType = ( NestedTypeBinding ) enclosingType ; SyntheticArgumentBinding enclosingArgument = nestedEnclosingType . getSyntheticArgument ( nestedEnclosingType . enclosingType ( ) , onlyExactMatch ) ; if ( enclosingArgument != null ) { FieldBinding syntheticField = sourceType . getSyntheticField ( enclosingArgument ) ; if ( syntheticField != null ) { if ( syntheticField . type == targetEnclosingType || ( ! onlyExactMatch && ( ( ReferenceBinding ) syntheticField . type ) . findSuperTypeOriginatingFrom ( targetEnclosingType ) != null ) ) return new Object [ ] { syntheticField } ; } } } } FieldBinding syntheticField = sourceType . getSyntheticField ( targetEnclosingType , onlyExactMatch ) ; if ( syntheticField != null ) { if ( currentMethodScope . isConstructorCall ) { return BlockScope . NoEnclosingInstanceInConstructorCall ; } return new Object [ ] { syntheticField } ; } Object [ ] path = new Object [ <NUM_LIT:2> ] ; ReferenceBinding currentType = sourceType . enclosingType ( ) ; if ( insideConstructor ) { path [ <NUM_LIT:0> ] = ( ( NestedTypeBinding ) sourceType ) . getSyntheticArgument ( currentType , onlyExactMatch ) ; } else { if ( currentMethodScope . isConstructorCall ) { return BlockScope . NoEnclosingInstanceInConstructorCall ; } path [ <NUM_LIT:0> ] = sourceType . getSyntheticField ( currentType , onlyExactMatch ) ; } if ( path [ <NUM_LIT:0> ] != null ) { int count = <NUM_LIT:1> ; ReferenceBinding currentEnclosingType ; while ( ( currentEnclosingType = currentType . enclosingType ( ) ) != null ) { if ( currentType == targetEnclosingType || ( ! onlyExactMatch && currentType . findSuperTypeOriginatingFrom ( targetEnclosingType ) != null ) ) break ; if ( currentMethodScope != null ) { currentMethodScope = currentMethodScope . enclosingMethodScope ( ) ; if ( currentMethodScope != null && currentMethodScope . isConstructorCall ) { return BlockScope . NoEnclosingInstanceInConstructorCall ; } if ( currentMethodScope != null && currentMethodScope . isStatic ) { return BlockScope . NoEnclosingInstanceInStaticContext ; } } syntheticField = ( ( NestedTypeBinding ) currentType ) . getSyntheticField ( currentEnclosingType , onlyExactMatch ) ; if ( syntheticField == null ) break ; if ( count == path . length ) { System . arraycopy ( path , <NUM_LIT:0> , ( path = new Object [ count + <NUM_LIT:1> ] ) , <NUM_LIT:0> , count ) ; } path [ count ++ ] = ( ( SourceTypeBinding ) syntheticField . declaringClass ) . addSyntheticMethod ( syntheticField , true , false ) ; currentType = currentEnclosingType ; } if ( currentType == targetEnclosingType || ( ! onlyExactMatch && currentType . findSuperTypeOriginatingFrom ( targetEnclosingType ) != null ) ) { return path ; } } return null ; } public final boolean isDuplicateLocalVariable ( char [ ] name ) { BlockScope current = this ; while ( true ) { for ( int i = <NUM_LIT:0> ; i < this . localIndex ; i ++ ) { if ( CharOperation . equals ( name , current . locals [ i ] . name ) ) return true ; } if ( current . kind != Scope . BLOCK_SCOPE ) return false ; current = ( BlockScope ) current . parent ; } } public int maxShiftedOffset ( ) { int max = - <NUM_LIT:1> ; if ( this . shiftScopes != null ) { for ( int i = <NUM_LIT:0> , length = this . shiftScopes . length ; i < length ; i ++ ) { if ( this . shiftScopes [ i ] != null ) { int subMaxOffset = this . shiftScopes [ i ] . maxOffset ; if ( subMaxOffset > max ) max = subMaxOffset ; } } } return max ; } public final boolean needBlankFinalFieldInitializationCheck ( FieldBinding binding ) { boolean isStatic = binding . isStatic ( ) ; ReferenceBinding fieldDeclaringClass = binding . declaringClass ; MethodScope methodScope = methodScope ( ) ; while ( methodScope != null ) { if ( methodScope . isStatic != isStatic ) return false ; if ( ! methodScope . isInsideInitializer ( ) && ! ( ( AbstractMethodDeclaration ) methodScope . referenceContext ) . isInitializationMethod ( ) ) { return false ; } ReferenceBinding enclosingType = methodScope . enclosingReceiverType ( ) ; if ( enclosingType == fieldDeclaringClass ) { return true ; } if ( ! enclosingType . erasure ( ) . isAnonymousType ( ) ) { return false ; } methodScope = methodScope . enclosingMethodScope ( ) ; } return false ; } public ProblemReporter problemReporter ( ) { return methodScope ( ) . problemReporter ( ) ; } public void propagateInnerEmulation ( ReferenceBinding targetType , boolean isEnclosingInstanceSupplied ) { SyntheticArgumentBinding [ ] syntheticArguments ; if ( ( syntheticArguments = targetType . syntheticOuterLocalVariables ( ) ) != null ) { for ( int i = <NUM_LIT:0> , max = syntheticArguments . length ; i < max ; i ++ ) { SyntheticArgumentBinding syntheticArg = syntheticArguments [ i ] ; if ( ! ( isEnclosingInstanceSupplied && ( syntheticArg . type == targetType . enclosingType ( ) ) ) ) { emulateOuterAccess ( syntheticArg . actualOuterLocalVariable ) ; } } } } public TypeDeclaration referenceType ( ) { return methodScope ( ) . referenceType ( ) ; } public int scopeIndex ( ) { if ( this instanceof MethodScope ) return - <NUM_LIT:1> ; BlockScope parentScope = ( BlockScope ) this . parent ; Scope [ ] parentSubscopes = parentScope . subscopes ; for ( int i = <NUM_LIT:0> , max = parentScope . subscopeCount ; i < max ; i ++ ) { if ( parentSubscopes [ i ] == this ) return i ; } return - <NUM_LIT:1> ; } int startIndex ( ) { return this . startIndex ; } public String toString ( ) { return toString ( <NUM_LIT:0> ) ; } public String toString ( int tab ) { String s = basicToString ( tab ) ; for ( int i = <NUM_LIT:0> ; i < this . subscopeCount ; i ++ ) if ( this . subscopes [ i ] instanceof BlockScope ) s += ( ( BlockScope ) this . subscopes [ i ] ) . toString ( tab + <NUM_LIT:1> ) + "<STR_LIT:n>" ; return s ; } public void resetEnclosingMethodStaticFlag ( ) { MethodScope methodScope = methodScope ( ) ; while ( methodScope != null && methodScope . referenceContext instanceof MethodDeclaration ) { MethodDeclaration methodDeclaration = ( MethodDeclaration ) methodScope . referenceContext ; methodDeclaration . bits &= ~ ASTNode . CanBeStatic ; ClassScope enclosingClassScope = methodScope . enclosingClassScope ( ) ; if ( enclosingClassScope != null ) { methodScope = enclosingClassScope . methodScope ( ) ; } else { break ; } } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; public class SignatureWrapper { public char [ ] signature ; public int start ; public int end ; public int bracket ; private boolean use15specifics ; public SignatureWrapper ( char [ ] signature , boolean use15specifics ) { this . signature = signature ; this . start = <NUM_LIT:0> ; this . end = this . bracket = - <NUM_LIT:1> ; this . use15specifics = use15specifics ; } public SignatureWrapper ( char [ ] signature ) { this ( signature , true ) ; } public boolean atEnd ( ) { return this . start < <NUM_LIT:0> || this . start >= this . signature . length ; } public int computeEnd ( ) { int index = this . start ; while ( this . signature [ index ] == '<CHAR_LIT:[>' ) index ++ ; switch ( this . signature [ index ] ) { case '<CHAR_LIT>' : case '<CHAR_LIT>' : this . end = CharOperation . indexOf ( '<CHAR_LIT:;>' , this . signature , this . start ) ; if ( this . bracket <= this . start ) this . bracket = CharOperation . indexOf ( '<CHAR_LIT>' , this . signature , this . start ) ; if ( this . bracket > this . start && this . bracket < this . end ) this . end = this . bracket ; else if ( this . end == - <NUM_LIT:1> ) this . end = this . signature . length + <NUM_LIT:1> ; break ; default : this . end = this . start ; } if ( this . use15specifics || this . end != this . bracket ) { this . start = this . end + <NUM_LIT:1> ; } else { this . start = skipAngleContents ( this . end ) + <NUM_LIT:1> ; this . bracket = - <NUM_LIT:1> ; } return this . end ; } public int skipAngleContents ( int i ) { if ( this . signature [ i ] != '<CHAR_LIT>' ) { return i ; } int depth = <NUM_LIT:0> , length = this . signature . length ; for ( ++ i ; i < length ; i ++ ) { switch ( this . signature [ i ] ) { case '<CHAR_LIT>' : depth ++ ; break ; case '<CHAR_LIT:>>' : if ( -- depth < <NUM_LIT:0> ) return i + <NUM_LIT:1> ; break ; } } return i ; } public char [ ] nextWord ( ) { this . end = CharOperation . indexOf ( '<CHAR_LIT:;>' , this . signature , this . start ) ; if ( this . bracket <= this . start ) this . bracket = CharOperation . indexOf ( '<CHAR_LIT>' , this . signature , this . start ) ; int dot = CharOperation . indexOf ( '<CHAR_LIT:.>' , this . signature , this . start ) ; if ( this . bracket > this . start && this . bracket < this . end ) this . end = this . bracket ; if ( dot > this . start && dot < this . end ) this . end = dot ; return CharOperation . subarray ( this . signature , this . start , this . start = this . end ) ; } public String toString ( ) { return new String ( this . signature ) + "<STR_LIT>" + this . start ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; public class SyntheticArgumentBinding extends LocalVariableBinding { { this . tagBits |= TagBits . IsArgument ; this . useFlag = USED ; } public LocalVariableBinding actualOuterLocalVariable ; public FieldBinding matchingField ; public SyntheticArgumentBinding ( LocalVariableBinding actualOuterLocalVariable ) { super ( CharOperation . concat ( TypeConstants . SYNTHETIC_OUTER_LOCAL_PREFIX , actualOuterLocalVariable . name ) , actualOuterLocalVariable . type , ClassFileConstants . AccFinal , true ) ; this . actualOuterLocalVariable = actualOuterLocalVariable ; } public SyntheticArgumentBinding ( ReferenceBinding enclosingType ) { super ( CharOperation . concat ( TypeConstants . SYNTHETIC_ENCLOSING_INSTANCE_PREFIX , String . valueOf ( enclosingType . depth ( ) ) . toCharArray ( ) ) , enclosingType , ClassFileConstants . AccFinal , true ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; public interface Substitution { TypeBinding substitute ( TypeVariableBinding typeVariable ) ; LookupEnvironment environment ( ) ; boolean isRawSubstitution ( ) ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; public class ProblemMethodBinding extends MethodBinding { private int problemReason ; public MethodBinding closestMatch ; public ProblemMethodBinding ( char [ ] selector , TypeBinding [ ] args , int problemReason ) { this . selector = selector ; this . parameters = ( args == null || args . length == <NUM_LIT:0> ) ? Binding . NO_PARAMETERS : args ; this . problemReason = problemReason ; this . thrownExceptions = Binding . NO_EXCEPTIONS ; } public ProblemMethodBinding ( char [ ] selector , TypeBinding [ ] args , ReferenceBinding declaringClass , int problemReason ) { this . selector = selector ; this . parameters = ( args == null || args . length == <NUM_LIT:0> ) ? Binding . NO_PARAMETERS : args ; this . declaringClass = declaringClass ; this . problemReason = problemReason ; this . thrownExceptions = Binding . NO_EXCEPTIONS ; } public ProblemMethodBinding ( MethodBinding closestMatch , char [ ] selector , TypeBinding [ ] args , int problemReason ) { this ( selector , args , problemReason ) ; this . closestMatch = closestMatch ; if ( closestMatch != null && problemReason != ProblemReasons . Ambiguous ) this . declaringClass = closestMatch . declaringClass ; } public final int problemId ( ) { return this . problemReason ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; public class ProblemFieldBinding extends FieldBinding { private int problemId ; public FieldBinding closestMatch ; public ProblemFieldBinding ( ReferenceBinding declaringClass , char [ ] name , int problemId ) { this ( null , declaringClass , name , problemId ) ; } public ProblemFieldBinding ( FieldBinding closestMatch , ReferenceBinding declaringClass , char [ ] name , int problemId ) { this . closestMatch = closestMatch ; this . declaringClass = declaringClass ; this . name = name ; this . problemId = problemId ; } public final int problemId ( ) { return this . problemId ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; public interface TagBits { long IsArrayType = ASTNode . Bit1 ; long IsBaseType = ASTNode . Bit2 ; long IsNestedType = ASTNode . Bit3 ; long IsMemberType = ASTNode . Bit4 ; long ContainsNestedTypeReferences = ASTNode . Bit12 ; long MemberTypeMask = IsNestedType | IsMemberType | ContainsNestedTypeReferences ; long IsLocalType = ASTNode . Bit5 ; long LocalTypeMask = IsNestedType | IsLocalType | ContainsNestedTypeReferences ; long IsAnonymousType = ASTNode . Bit6 ; long AnonymousTypeMask = LocalTypeMask | IsAnonymousType | ContainsNestedTypeReferences ; long IsBinaryBinding = ASTNode . Bit7 ; long HasMissingType = ASTNode . Bit8 ; long HasUncheckedTypeArgumentForBoundCheck = ASTNode . Bit9 ; long NotInitialized = ASTNode . Bit9 ; long ForcedToBeRawType = ASTNode . Bit10 ; long HasUnresolvedArguments = ASTNode . Bit10 ; long BeginHierarchyCheck = ASTNode . Bit9 ; long EndHierarchyCheck = ASTNode . Bit10 ; long PauseHierarchyCheck = ASTNode . Bit20 ; long HasParameterAnnotations = ASTNode . Bit11 ; long KnowsDefaultAbstractMethods = ASTNode . Bit11 ; long IsArgument = ASTNode . Bit11 ; long ClearPrivateModifier = ASTNode . Bit10 ; long IsEffectivelyFinal = ASTNode . Bit12 ; long MultiCatchParameter = ASTNode . Bit13 ; long IsResource = ASTNode . Bit14 ; long AreFieldsSorted = ASTNode . Bit13 ; long AreFieldsComplete = ASTNode . Bit14 ; long AreMethodsSorted = ASTNode . Bit15 ; long AreMethodsComplete = ASTNode . Bit16 ; long HasNoMemberTypes = ASTNode . Bit17 ; long HierarchyHasProblems = ASTNode . Bit18 ; long TypeVariablesAreConnected = ASTNode . Bit19 ; long PassedBoundCheck = ASTNode . Bit23 ; long IsBoundParameterizedType = ASTNode . Bit24 ; long HasUnresolvedTypeVariables = ASTNode . Bit25 ; long HasUnresolvedSuperclass = ASTNode . Bit26 ; long HasUnresolvedSuperinterfaces = ASTNode . Bit27 ; long HasUnresolvedEnclosingType = ASTNode . Bit28 ; long HasUnresolvedMemberTypes = ASTNode . Bit29 ; long HasTypeVariable = ASTNode . Bit30 ; long HasDirectWildcard = ASTNode . Bit31 ; long BeginAnnotationCheck = ASTNode . Bit32L ; long EndAnnotationCheck = ASTNode . Bit33L ; long AnnotationResolved = ASTNode . Bit34L ; long DeprecatedAnnotationResolved = ASTNode . Bit35L ; long AnnotationTarget = ASTNode . Bit36L ; long AnnotationForType = ASTNode . Bit37L ; long AnnotationForField = ASTNode . Bit38L ; long AnnotationForMethod = ASTNode . Bit39L ; long AnnotationForParameter = ASTNode . Bit40L ; long AnnotationForConstructor = ASTNode . Bit41L ; long AnnotationForLocalVariable = ASTNode . Bit42L ; long AnnotationForAnnotationType = ASTNode . Bit43L ; long AnnotationForPackage = ASTNode . Bit44L ; long AnnotationTargetMASK = AnnotationTarget | AnnotationForType | AnnotationForField | AnnotationForMethod | AnnotationForParameter | AnnotationForConstructor | AnnotationForLocalVariable | AnnotationForAnnotationType | AnnotationForPackage ; long AnnotationSourceRetention = ASTNode . Bit45L ; long AnnotationClassRetention = ASTNode . Bit46L ; long AnnotationRuntimeRetention = AnnotationSourceRetention | AnnotationClassRetention ; long AnnotationRetentionMASK = AnnotationSourceRetention | AnnotationClassRetention | AnnotationRuntimeRetention ; long AnnotationDeprecated = ASTNode . Bit47L ; long AnnotationDocumented = ASTNode . Bit48L ; long AnnotationInherited = ASTNode . Bit49L ; long AnnotationOverride = ASTNode . Bit50L ; long AnnotationSuppressWarnings = ASTNode . Bit51L ; long AnnotationSafeVarargs = ASTNode . Bit52L ; long AnnotationPolymorphicSignature = ASTNode . Bit53L ; long AllStandardAnnotationsMask = AnnotationTargetMASK | AnnotationRetentionMASK | AnnotationDeprecated | AnnotationDocumented | AnnotationInherited | AnnotationOverride | AnnotationSuppressWarnings | AnnotationSafeVarargs | AnnotationPolymorphicSignature ; long DefaultValueResolved = ASTNode . Bit54L ; long HasNonPrivateConstructor = ASTNode . Bit55L ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; public class InnerEmulationDependency { public BlockScope scope ; public boolean wasEnclosingInstanceSupplied ; public InnerEmulationDependency ( BlockScope scope , boolean wasEnclosingInstanceSupplied ) { this . scope = scope ; this . wasEnclosingInstanceSupplied = wasEnclosingInstanceSupplied ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; public class ProblemBinding extends Binding { public char [ ] name ; public ReferenceBinding searchType ; private int problemId ; public ProblemBinding ( char [ ] [ ] compoundName , int problemId ) { this ( CharOperation . concatWith ( compoundName , '<CHAR_LIT:.>' ) , problemId ) ; } public ProblemBinding ( char [ ] [ ] compoundName , ReferenceBinding searchType , int problemId ) { this ( CharOperation . concatWith ( compoundName , '<CHAR_LIT:.>' ) , searchType , problemId ) ; } ProblemBinding ( char [ ] name , int problemId ) { this . name = name ; this . problemId = problemId ; } ProblemBinding ( char [ ] name , ReferenceBinding searchType , int problemId ) { this ( name , problemId ) ; this . searchType = searchType ; } public final int kind ( ) { return VARIABLE | TYPE ; } public final int problemId ( ) { return this . problemId ; } public char [ ] readableName ( ) { return this . name ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; import java . util . List ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . impl . Constant ; public final class ArrayBinding extends TypeBinding { public static final FieldBinding ArrayLength = new FieldBinding ( TypeConstants . LENGTH , TypeBinding . INT , ClassFileConstants . AccPublic | ClassFileConstants . AccFinal , null , Constant . NotAConstant ) ; public TypeBinding leafComponentType ; public int dimensions ; LookupEnvironment environment ; char [ ] constantPoolName ; char [ ] genericTypeSignature ; public ArrayBinding ( TypeBinding type , int dimensions , LookupEnvironment environment ) { this . tagBits |= TagBits . IsArrayType ; this . leafComponentType = type ; this . dimensions = dimensions ; this . environment = environment ; if ( type instanceof UnresolvedReferenceBinding ) ( ( UnresolvedReferenceBinding ) type ) . addWrapper ( this , environment ) ; else this . tagBits |= type . tagBits & ( TagBits . HasTypeVariable | TagBits . HasDirectWildcard | TagBits . HasMissingType | TagBits . ContainsNestedTypeReferences ) ; } public TypeBinding closestMatch ( ) { if ( isValidBinding ( ) ) { return this ; } TypeBinding leafClosestMatch = this . leafComponentType . closestMatch ( ) ; if ( leafClosestMatch == null ) { return null ; } return this . environment . createArrayType ( this . leafComponentType . closestMatch ( ) , this . dimensions ) ; } public List collectMissingTypes ( List missingTypes ) { if ( ( this . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { missingTypes = this . leafComponentType . collectMissingTypes ( missingTypes ) ; } return missingTypes ; } public void collectSubstitutes ( Scope scope , TypeBinding actualType , InferenceContext inferenceContext , int constraint ) { if ( ( this . tagBits & TagBits . HasTypeVariable ) == <NUM_LIT:0> ) return ; if ( actualType == TypeBinding . NULL ) return ; switch ( actualType . kind ( ) ) { case Binding . ARRAY_TYPE : int actualDim = actualType . dimensions ( ) ; if ( actualDim == this . dimensions ) { this . leafComponentType . collectSubstitutes ( scope , actualType . leafComponentType ( ) , inferenceContext , constraint ) ; } else if ( actualDim > this . dimensions ) { ArrayBinding actualReducedType = this . environment . createArrayType ( actualType . leafComponentType ( ) , actualDim - this . dimensions ) ; this . leafComponentType . collectSubstitutes ( scope , actualReducedType , inferenceContext , constraint ) ; } break ; case Binding . TYPE_PARAMETER : break ; } } public char [ ] computeUniqueKey ( boolean isLeaf ) { char [ ] brackets = new char [ this . dimensions ] ; for ( int i = this . dimensions - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) brackets [ i ] = '<CHAR_LIT:[>' ; return CharOperation . concat ( brackets , this . leafComponentType . computeUniqueKey ( isLeaf ) ) ; } public char [ ] constantPoolName ( ) { if ( this . constantPoolName != null ) return this . constantPoolName ; char [ ] brackets = new char [ this . dimensions ] ; for ( int i = this . dimensions - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) brackets [ i ] = '<CHAR_LIT:[>' ; return this . constantPoolName = CharOperation . concat ( brackets , this . leafComponentType . signature ( ) ) ; } public String debugName ( ) { StringBuffer brackets = new StringBuffer ( this . dimensions * <NUM_LIT:2> ) ; for ( int i = this . dimensions ; -- i >= <NUM_LIT:0> ; ) brackets . append ( "<STR_LIT:[]>" ) ; return this . leafComponentType . debugName ( ) + brackets . toString ( ) ; } public int dimensions ( ) { return this . dimensions ; } public TypeBinding elementsType ( ) { if ( this . dimensions == <NUM_LIT:1> ) return this . leafComponentType ; return this . environment . createArrayType ( this . leafComponentType , this . dimensions - <NUM_LIT:1> ) ; } public TypeBinding erasure ( ) { TypeBinding erasedType = this . leafComponentType . erasure ( ) ; if ( this . leafComponentType != erasedType ) return this . environment . createArrayType ( erasedType , this . dimensions ) ; return this ; } public LookupEnvironment environment ( ) { return this . environment ; } public char [ ] genericTypeSignature ( ) { if ( this . genericTypeSignature == null ) { char [ ] brackets = new char [ this . dimensions ] ; for ( int i = this . dimensions - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) brackets [ i ] = '<CHAR_LIT:[>' ; this . genericTypeSignature = CharOperation . concat ( brackets , this . leafComponentType . genericTypeSignature ( ) ) ; } return this . genericTypeSignature ; } public PackageBinding getPackage ( ) { return this . leafComponentType . getPackage ( ) ; } public int hashCode ( ) { return this . leafComponentType == null ? super . hashCode ( ) : this . leafComponentType . hashCode ( ) ; } public boolean isCompatibleWith ( TypeBinding otherType ) { if ( this == otherType ) return true ; switch ( otherType . kind ( ) ) { case Binding . ARRAY_TYPE : ArrayBinding otherArray = ( ArrayBinding ) otherType ; if ( otherArray . leafComponentType . isBaseType ( ) ) return false ; if ( this . dimensions == otherArray . dimensions ) return this . leafComponentType . isCompatibleWith ( otherArray . leafComponentType ) ; if ( this . dimensions < otherArray . dimensions ) return false ; break ; case Binding . BASE_TYPE : return false ; case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : return ( ( WildcardBinding ) otherType ) . boundCheck ( this ) ; case Binding . TYPE_PARAMETER : if ( otherType . isCapture ( ) ) { CaptureBinding otherCapture = ( CaptureBinding ) otherType ; TypeBinding otherLowerBound ; if ( ( otherLowerBound = otherCapture . lowerBound ) != null ) { if ( ! otherLowerBound . isArrayType ( ) ) return false ; return isCompatibleWith ( otherLowerBound ) ; } } return false ; } switch ( otherType . leafComponentType ( ) . id ) { case TypeIds . T_JavaLangObject : case TypeIds . T_JavaLangCloneable : case TypeIds . T_JavaIoSerializable : return true ; } return false ; } public int kind ( ) { return ARRAY_TYPE ; } public TypeBinding leafComponentType ( ) { return this . leafComponentType ; } public int problemId ( ) { return this . leafComponentType . problemId ( ) ; } public char [ ] qualifiedSourceName ( ) { char [ ] brackets = new char [ this . dimensions * <NUM_LIT:2> ] ; for ( int i = this . dimensions * <NUM_LIT:2> - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -= <NUM_LIT:2> ) { brackets [ i ] = '<CHAR_LIT:]>' ; brackets [ i - <NUM_LIT:1> ] = '<CHAR_LIT:[>' ; } return CharOperation . concat ( this . leafComponentType . qualifiedSourceName ( ) , brackets ) ; } public char [ ] readableName ( ) { char [ ] brackets = new char [ this . dimensions * <NUM_LIT:2> ] ; for ( int i = this . dimensions * <NUM_LIT:2> - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -= <NUM_LIT:2> ) { brackets [ i ] = '<CHAR_LIT:]>' ; brackets [ i - <NUM_LIT:1> ] = '<CHAR_LIT:[>' ; } return CharOperation . concat ( this . leafComponentType . readableName ( ) , brackets ) ; } public char [ ] shortReadableName ( ) { char [ ] brackets = new char [ this . dimensions * <NUM_LIT:2> ] ; for ( int i = this . dimensions * <NUM_LIT:2> - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -= <NUM_LIT:2> ) { brackets [ i ] = '<CHAR_LIT:]>' ; brackets [ i - <NUM_LIT:1> ] = '<CHAR_LIT:[>' ; } return CharOperation . concat ( this . leafComponentType . shortReadableName ( ) , brackets ) ; } public char [ ] sourceName ( ) { char [ ] brackets = new char [ this . dimensions * <NUM_LIT:2> ] ; for ( int i = this . dimensions * <NUM_LIT:2> - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -= <NUM_LIT:2> ) { brackets [ i ] = '<CHAR_LIT:]>' ; brackets [ i - <NUM_LIT:1> ] = '<CHAR_LIT:[>' ; } return CharOperation . concat ( this . leafComponentType . sourceName ( ) , brackets ) ; } public void swapUnresolved ( UnresolvedReferenceBinding unresolvedType , ReferenceBinding resolvedType , LookupEnvironment env ) { if ( this . leafComponentType == unresolvedType ) { this . leafComponentType = env . convertUnresolvedBinaryToRawType ( resolvedType ) ; this . tagBits |= this . leafComponentType . tagBits & ( TagBits . HasTypeVariable | TagBits . HasDirectWildcard | TagBits . HasMissingType ) ; } } public String toString ( ) { return this . leafComponentType != null ? debugName ( ) : "<STR_LIT>" ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; public interface ExtraCompilerModifiers { final int AccJustFlag = <NUM_LIT> ; final int AccRestrictedAccess = ASTNode . Bit19 ; final int AccFromClassFile = ASTNode . Bit20 ; final int AccDefaultAbstract = ASTNode . Bit20 ; final int AccDeprecatedImplicitly = ASTNode . Bit22 ; final int AccAlternateModifierProblem = ASTNode . Bit23 ; final int AccModifierProblem = ASTNode . Bit24 ; final int AccSemicolonBody = ASTNode . Bit25 ; final int AccUnresolved = ASTNode . Bit26 ; final int AccBlankFinal = ASTNode . Bit27 ; final int AccIsDefaultConstructor = ASTNode . Bit27 ; final int AccLocallyUsed = ASTNode . Bit28 ; final int AccVisibilityMASK = ClassFileConstants . AccPublic | ClassFileConstants . AccProtected | ClassFileConstants . AccPrivate ; final int AccOverriding = ASTNode . Bit29 ; final int AccImplementing = ASTNode . Bit30 ; final int AccGenericSignature = ASTNode . Bit31 ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . impl . Constant ; public class ParameterizedFieldBinding extends FieldBinding { public FieldBinding originalField ; public ParameterizedFieldBinding ( ParameterizedTypeBinding parameterizedDeclaringClass , FieldBinding originalField ) { super ( originalField . name , ( originalField . modifiers & ClassFileConstants . AccEnum ) != <NUM_LIT:0> ? parameterizedDeclaringClass : ( originalField . modifiers & ClassFileConstants . AccStatic ) != <NUM_LIT:0> ? originalField . type : Scope . substitute ( parameterizedDeclaringClass , originalField . type ) , originalField . modifiers , parameterizedDeclaringClass , null ) ; this . originalField = originalField ; this . tagBits = originalField . tagBits ; this . id = originalField . id ; } public Constant constant ( ) { return this . originalField . constant ( ) ; } public FieldBinding original ( ) { return this . originalField . original ( ) ; } public void setConstant ( Constant constant ) { this . originalField . setConstant ( constant ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . ast . Annotation ; public class AnnotationBinding { ReferenceBinding type ; ElementValuePair [ ] pairs ; public static AnnotationBinding [ ] addStandardAnnotations ( AnnotationBinding [ ] recordedAnnotations , long annotationTagBits , LookupEnvironment env ) { int count = <NUM_LIT:0> ; if ( ( annotationTagBits & TagBits . AnnotationTargetMASK ) != <NUM_LIT:0> ) count ++ ; if ( ( annotationTagBits & TagBits . AnnotationRetentionMASK ) != <NUM_LIT:0> ) count ++ ; if ( ( annotationTagBits & TagBits . AnnotationDeprecated ) != <NUM_LIT:0> ) count ++ ; if ( ( annotationTagBits & TagBits . AnnotationDocumented ) != <NUM_LIT:0> ) count ++ ; if ( ( annotationTagBits & TagBits . AnnotationInherited ) != <NUM_LIT:0> ) count ++ ; if ( ( annotationTagBits & TagBits . AnnotationOverride ) != <NUM_LIT:0> ) count ++ ; if ( ( annotationTagBits & TagBits . AnnotationSuppressWarnings ) != <NUM_LIT:0> ) count ++ ; if ( ( annotationTagBits & TagBits . AnnotationPolymorphicSignature ) != <NUM_LIT:0> ) count ++ ; if ( ( annotationTagBits & TagBits . AnnotationSafeVarargs ) != <NUM_LIT:0> ) count ++ ; if ( count == <NUM_LIT:0> ) return recordedAnnotations ; int index = recordedAnnotations . length ; AnnotationBinding [ ] result = new AnnotationBinding [ index + count ] ; System . arraycopy ( recordedAnnotations , <NUM_LIT:0> , result , <NUM_LIT:0> , index ) ; if ( ( annotationTagBits & TagBits . AnnotationTargetMASK ) != <NUM_LIT:0> ) result [ index ++ ] = buildTargetAnnotation ( annotationTagBits , env ) ; if ( ( annotationTagBits & TagBits . AnnotationRetentionMASK ) != <NUM_LIT:0> ) result [ index ++ ] = buildRetentionAnnotation ( annotationTagBits , env ) ; if ( ( annotationTagBits & TagBits . AnnotationDeprecated ) != <NUM_LIT:0> ) result [ index ++ ] = buildMarkerAnnotation ( TypeConstants . JAVA_LANG_DEPRECATED , env ) ; if ( ( annotationTagBits & TagBits . AnnotationDocumented ) != <NUM_LIT:0> ) result [ index ++ ] = buildMarkerAnnotation ( TypeConstants . JAVA_LANG_ANNOTATION_DOCUMENTED , env ) ; if ( ( annotationTagBits & TagBits . AnnotationInherited ) != <NUM_LIT:0> ) result [ index ++ ] = buildMarkerAnnotation ( TypeConstants . JAVA_LANG_ANNOTATION_INHERITED , env ) ; if ( ( annotationTagBits & TagBits . AnnotationOverride ) != <NUM_LIT:0> ) result [ index ++ ] = buildMarkerAnnotation ( TypeConstants . JAVA_LANG_OVERRIDE , env ) ; if ( ( annotationTagBits & TagBits . AnnotationSuppressWarnings ) != <NUM_LIT:0> ) result [ index ++ ] = buildMarkerAnnotation ( TypeConstants . JAVA_LANG_SUPPRESSWARNINGS , env ) ; if ( ( annotationTagBits & TagBits . AnnotationPolymorphicSignature ) != <NUM_LIT:0> ) result [ index ++ ] = buildMarkerAnnotationForMemberType ( TypeConstants . JAVA_LANG_INVOKE_METHODHANDLE_$_POLYMORPHICSIGNATURE , env ) ; if ( ( annotationTagBits & TagBits . AnnotationSafeVarargs ) != <NUM_LIT:0> ) result [ index ++ ] = buildMarkerAnnotation ( TypeConstants . JAVA_LANG_SAFEVARARGS , env ) ; return result ; } private static AnnotationBinding buildMarkerAnnotationForMemberType ( char [ ] [ ] compoundName , LookupEnvironment env ) { ReferenceBinding type = env . getResolvedType ( compoundName , null ) ; if ( ! type . isValidBinding ( ) ) { type = ( ( ProblemReferenceBinding ) type ) . closestMatch ; } return env . createAnnotation ( type , Binding . NO_ELEMENT_VALUE_PAIRS ) ; } private static AnnotationBinding buildMarkerAnnotation ( char [ ] [ ] compoundName , LookupEnvironment env ) { ReferenceBinding type = env . getResolvedType ( compoundName , null ) ; return env . createAnnotation ( type , Binding . NO_ELEMENT_VALUE_PAIRS ) ; } private static AnnotationBinding buildRetentionAnnotation ( long bits , LookupEnvironment env ) { ReferenceBinding retentionPolicy = env . getResolvedType ( TypeConstants . JAVA_LANG_ANNOTATION_RETENTIONPOLICY , null ) ; Object value = null ; if ( ( bits & TagBits . AnnotationRuntimeRetention ) == TagBits . AnnotationRuntimeRetention ) { value = retentionPolicy . getField ( TypeConstants . UPPER_RUNTIME , true ) ; } else if ( ( bits & TagBits . AnnotationClassRetention ) != <NUM_LIT:0> ) { value = retentionPolicy . getField ( TypeConstants . UPPER_CLASS , true ) ; } else if ( ( bits & TagBits . AnnotationSourceRetention ) != <NUM_LIT:0> ) { value = retentionPolicy . getField ( TypeConstants . UPPER_SOURCE , true ) ; } return env . createAnnotation ( env . getResolvedType ( TypeConstants . JAVA_LANG_ANNOTATION_RETENTION , null ) , new ElementValuePair [ ] { new ElementValuePair ( TypeConstants . VALUE , value , null ) } ) ; } private static AnnotationBinding buildTargetAnnotation ( long bits , LookupEnvironment env ) { ReferenceBinding target = env . getResolvedType ( TypeConstants . JAVA_LANG_ANNOTATION_TARGET , null ) ; if ( ( bits & TagBits . AnnotationTarget ) != <NUM_LIT:0> ) return new AnnotationBinding ( target , Binding . NO_ELEMENT_VALUE_PAIRS ) ; int arraysize = <NUM_LIT:0> ; if ( ( bits & TagBits . AnnotationForAnnotationType ) != <NUM_LIT:0> ) arraysize ++ ; if ( ( bits & TagBits . AnnotationForConstructor ) != <NUM_LIT:0> ) arraysize ++ ; if ( ( bits & TagBits . AnnotationForField ) != <NUM_LIT:0> ) arraysize ++ ; if ( ( bits & TagBits . AnnotationForLocalVariable ) != <NUM_LIT:0> ) arraysize ++ ; if ( ( bits & TagBits . AnnotationForMethod ) != <NUM_LIT:0> ) arraysize ++ ; if ( ( bits & TagBits . AnnotationForPackage ) != <NUM_LIT:0> ) arraysize ++ ; if ( ( bits & TagBits . AnnotationForParameter ) != <NUM_LIT:0> ) arraysize ++ ; if ( ( bits & TagBits . AnnotationForType ) != <NUM_LIT:0> ) arraysize ++ ; Object [ ] value = new Object [ arraysize ] ; if ( arraysize > <NUM_LIT:0> ) { ReferenceBinding elementType = env . getResolvedType ( TypeConstants . JAVA_LANG_ANNOTATION_ELEMENTTYPE , null ) ; int index = <NUM_LIT:0> ; if ( ( bits & TagBits . AnnotationForAnnotationType ) != <NUM_LIT:0> ) value [ index ++ ] = elementType . getField ( TypeConstants . UPPER_ANNOTATION_TYPE , true ) ; if ( ( bits & TagBits . AnnotationForConstructor ) != <NUM_LIT:0> ) value [ index ++ ] = elementType . getField ( TypeConstants . UPPER_CONSTRUCTOR , true ) ; if ( ( bits & TagBits . AnnotationForField ) != <NUM_LIT:0> ) value [ index ++ ] = elementType . getField ( TypeConstants . UPPER_FIELD , true ) ; if ( ( bits & TagBits . AnnotationForLocalVariable ) != <NUM_LIT:0> ) value [ index ++ ] = elementType . getField ( TypeConstants . UPPER_LOCAL_VARIABLE , true ) ; if ( ( bits & TagBits . AnnotationForMethod ) != <NUM_LIT:0> ) value [ index ++ ] = elementType . getField ( TypeConstants . UPPER_METHOD , true ) ; if ( ( bits & TagBits . AnnotationForPackage ) != <NUM_LIT:0> ) value [ index ++ ] = elementType . getField ( TypeConstants . UPPER_PACKAGE , true ) ; if ( ( bits & TagBits . AnnotationForParameter ) != <NUM_LIT:0> ) value [ index ++ ] = elementType . getField ( TypeConstants . UPPER_PARAMETER , true ) ; if ( ( bits & TagBits . AnnotationForType ) != <NUM_LIT:0> ) value [ index ++ ] = elementType . getField ( TypeConstants . TYPE , true ) ; } return env . createAnnotation ( target , new ElementValuePair [ ] { new ElementValuePair ( TypeConstants . VALUE , value , null ) } ) ; } AnnotationBinding ( ReferenceBinding type , ElementValuePair [ ] pairs ) { this . type = type ; this . pairs = pairs ; } AnnotationBinding ( Annotation astAnnotation ) { this ( ( ReferenceBinding ) astAnnotation . resolvedType , astAnnotation . computeElementValuePairs ( ) ) ; } public char [ ] computeUniqueKey ( char [ ] recipientKey ) { char [ ] typeKey = this . type . computeUniqueKey ( false ) ; int recipientKeyLength = recipientKey . length ; char [ ] uniqueKey = new char [ recipientKeyLength + <NUM_LIT:1> + typeKey . length ] ; System . arraycopy ( recipientKey , <NUM_LIT:0> , uniqueKey , <NUM_LIT:0> , recipientKeyLength ) ; uniqueKey [ recipientKeyLength ] = '<CHAR_LIT>' ; System . arraycopy ( typeKey , <NUM_LIT:0> , uniqueKey , recipientKeyLength + <NUM_LIT:1> , typeKey . length ) ; return uniqueKey ; } public ReferenceBinding getAnnotationType ( ) { return this . type ; } public ElementValuePair [ ] getElementValuePairs ( ) { return this . pairs ; } public static void setMethodBindings ( ReferenceBinding type , ElementValuePair [ ] pairs ) { for ( int i = pairs . length ; -- i >= <NUM_LIT:0> ; ) { ElementValuePair pair = pairs [ i ] ; MethodBinding [ ] methods = type . getMethods ( pair . getName ( ) ) ; if ( methods != null && methods . length == <NUM_LIT:1> ) pair . setMethodBinding ( methods [ <NUM_LIT:0> ] ) ; } } public String toString ( ) { StringBuffer buffer = new StringBuffer ( <NUM_LIT:5> ) ; buffer . append ( '<CHAR_LIT>' ) . append ( this . type . sourceName ) ; if ( this . pairs != null && this . pairs . length > <NUM_LIT:0> ) { buffer . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> , max = this . pairs . length ; i < max ; i ++ ) { if ( i > <NUM_LIT:0> ) buffer . append ( "<STR_LIT:U+002CU+0020>" ) ; buffer . append ( this . pairs [ i ] ) ; } buffer . append ( '<CHAR_LIT:}>' ) ; } return buffer . toString ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; import java . util . ArrayList ; import java . util . List ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; public class MissingTypeBinding extends BinaryTypeBinding { public MissingTypeBinding ( PackageBinding packageBinding , char [ ] [ ] compoundName , LookupEnvironment environment ) { this . compoundName = compoundName ; computeId ( ) ; this . tagBits |= TagBits . IsBinaryBinding | TagBits . HierarchyHasProblems | TagBits . HasMissingType ; this . environment = environment ; this . fPackage = packageBinding ; this . fileName = CharOperation . concatWith ( compoundName , '<CHAR_LIT:/>' ) ; this . sourceName = compoundName [ compoundName . length - <NUM_LIT:1> ] ; this . modifiers = ClassFileConstants . AccPublic ; this . superclass = null ; this . superInterfaces = Binding . NO_SUPERINTERFACES ; this . typeVariables = Binding . NO_TYPE_VARIABLES ; this . memberTypes = Binding . NO_MEMBER_TYPES ; this . fields = Binding . NO_FIELDS ; this . methods = Binding . NO_METHODS ; } public List collectMissingTypes ( List missingTypes ) { if ( missingTypes == null ) { missingTypes = new ArrayList ( <NUM_LIT:5> ) ; } else if ( missingTypes . contains ( this ) ) { return missingTypes ; } missingTypes . add ( this ) ; return missingTypes ; } public int problemId ( ) { return ProblemReasons . NotFound ; } void setMissingSuperclass ( ReferenceBinding missingSuperclass ) { this . superclass = missingSuperclass ; } public String toString ( ) { return "<STR_LIT>" + new String ( CharOperation . concatWith ( this . compoundName , '<CHAR_LIT:.>' ) ) + "<STR_LIT:]>" ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; public interface ProblemReasons { final int NoError = <NUM_LIT:0> ; final int NotFound = <NUM_LIT:1> ; final int NotVisible = <NUM_LIT:2> ; final int Ambiguous = <NUM_LIT:3> ; final int InternalNameProvided = <NUM_LIT:4> ; final int InheritedNameHidesEnclosingName = <NUM_LIT:5> ; final int NonStaticReferenceInConstructorInvocation = <NUM_LIT:6> ; final int NonStaticReferenceInStaticContext = <NUM_LIT:7> ; final int ReceiverTypeNotVisible = <NUM_LIT:8> ; final int IllegalSuperTypeVariable = <NUM_LIT:9> ; final int ParameterBoundMismatch = <NUM_LIT:10> ; final int TypeParameterArityMismatch = <NUM_LIT:11> ; final int ParameterizedMethodTypeMismatch = <NUM_LIT:12> ; final int TypeArgumentsForRawGenericMethod = <NUM_LIT> ; final int InvalidTypeForStaticImport = <NUM_LIT> ; final int InvalidTypeForAutoManagedResource = <NUM_LIT:15> ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; import java . util . HashMap ; import java . util . Iterator ; import java . util . Map ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . core . compiler . IProblem ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . AbstractMethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . AbstractVariableDeclaration ; import org . eclipse . jdt . internal . compiler . ast . FieldDeclaration ; import org . eclipse . jdt . internal . compiler . ast . QualifiedAllocationExpression ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; import org . eclipse . jdt . internal . compiler . ast . TypeParameter ; import org . eclipse . jdt . internal . compiler . ast . TypeReference ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . env . AccessRestriction ; import org . eclipse . jdt . internal . compiler . problem . AbortCompilation ; import org . eclipse . jdt . internal . compiler . problem . ProblemReporter ; import org . eclipse . jdt . internal . compiler . util . HashtableOfObject ; public class ClassScope extends Scope { public TypeDeclaration referenceContext ; public TypeReference superTypeReference ; java . util . ArrayList deferredBoundChecks ; public ClassScope ( Scope parent , TypeDeclaration context ) { super ( Scope . CLASS_SCOPE , parent ) ; this . referenceContext = context ; this . deferredBoundChecks = null ; } void buildAnonymousTypeBinding ( SourceTypeBinding enclosingType , ReferenceBinding supertype ) { LocalTypeBinding anonymousType = buildLocalType ( enclosingType , enclosingType . fPackage ) ; anonymousType . modifiers |= ExtraCompilerModifiers . AccLocallyUsed ; if ( supertype . isInterface ( ) ) { anonymousType . superclass = getJavaLangObject ( ) ; anonymousType . superInterfaces = new ReferenceBinding [ ] { supertype } ; TypeReference typeReference = this . referenceContext . allocation . type ; if ( typeReference != null ) { if ( ( supertype . tagBits & TagBits . HasDirectWildcard ) != <NUM_LIT:0> ) { problemReporter ( ) . superTypeCannotUseWildcard ( anonymousType , typeReference , supertype ) ; anonymousType . tagBits |= TagBits . HierarchyHasProblems ; anonymousType . superInterfaces = Binding . NO_SUPERINTERFACES ; } } } else { anonymousType . superclass = supertype ; anonymousType . superInterfaces = Binding . NO_SUPERINTERFACES ; TypeReference typeReference = this . referenceContext . allocation . type ; if ( typeReference != null ) { if ( supertype . erasure ( ) . id == TypeIds . T_JavaLangEnum ) { problemReporter ( ) . cannotExtendEnum ( anonymousType , typeReference , supertype ) ; anonymousType . tagBits |= TagBits . HierarchyHasProblems ; anonymousType . superclass = getJavaLangObject ( ) ; } else if ( supertype . isFinal ( ) ) { problemReporter ( ) . anonymousClassCannotExtendFinalClass ( typeReference , supertype ) ; anonymousType . tagBits |= TagBits . HierarchyHasProblems ; anonymousType . superclass = getJavaLangObject ( ) ; } else if ( ( supertype . tagBits & TagBits . HasDirectWildcard ) != <NUM_LIT:0> ) { problemReporter ( ) . superTypeCannotUseWildcard ( anonymousType , typeReference , supertype ) ; anonymousType . tagBits |= TagBits . HierarchyHasProblems ; anonymousType . superclass = getJavaLangObject ( ) ; } } } connectMemberTypes ( ) ; buildFieldsAndMethods ( ) ; anonymousType . faultInTypesForFieldsAndMethods ( ) ; anonymousType . verifyMethods ( environment ( ) . methodVerifier ( ) ) ; } void buildFields ( ) { SourceTypeBinding sourceType = this . referenceContext . binding ; if ( sourceType . areFieldsInitialized ( ) ) return ; if ( this . referenceContext . fields == null ) { sourceType . setFields ( Binding . NO_FIELDS ) ; return ; } FieldDeclaration [ ] fields = this . referenceContext . fields ; int size = fields . length ; int count = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) { switch ( fields [ i ] . getKind ( ) ) { case AbstractVariableDeclaration . FIELD : case AbstractVariableDeclaration . ENUM_CONSTANT : count ++ ; } } FieldBinding [ ] fieldBindings = new FieldBinding [ count ] ; HashtableOfObject knownFieldNames = new HashtableOfObject ( count ) ; count = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) { FieldDeclaration field = fields [ i ] ; if ( field . getKind ( ) == AbstractVariableDeclaration . INITIALIZER ) { } else { FieldBinding fieldBinding = new FieldBinding ( field , null , field . modifiers | ExtraCompilerModifiers . AccUnresolved , sourceType ) ; fieldBinding . id = count ; checkAndSetModifiersForField ( fieldBinding , field ) ; if ( knownFieldNames . containsKey ( field . name ) ) { FieldBinding previousBinding = ( FieldBinding ) knownFieldNames . get ( field . name ) ; if ( previousBinding != null ) { for ( int f = <NUM_LIT:0> ; f < i ; f ++ ) { FieldDeclaration previousField = fields [ f ] ; if ( previousField . binding == previousBinding ) { problemReporter ( ) . duplicateFieldInType ( sourceType , previousField ) ; break ; } } } knownFieldNames . put ( field . name , null ) ; problemReporter ( ) . duplicateFieldInType ( sourceType , field ) ; field . binding = null ; } else { knownFieldNames . put ( field . name , fieldBinding ) ; fieldBindings [ count ++ ] = fieldBinding ; } } } if ( count != fieldBindings . length ) System . arraycopy ( fieldBindings , <NUM_LIT:0> , fieldBindings = new FieldBinding [ count ] , <NUM_LIT:0> , count ) ; sourceType . tagBits &= ~ ( TagBits . AreFieldsSorted | TagBits . AreFieldsComplete ) ; sourceType . setFields ( fieldBindings ) ; } void buildFieldsAndMethods ( ) { buildFields ( ) ; buildMethods ( ) ; SourceTypeBinding sourceType = this . referenceContext . binding ; if ( ! sourceType . isPrivate ( ) && sourceType . superclass instanceof SourceTypeBinding && sourceType . superclass . isPrivate ( ) ) ( ( SourceTypeBinding ) sourceType . superclass ) . tagIndirectlyAccessibleMembers ( ) ; if ( sourceType . isMemberType ( ) && ! sourceType . isLocalType ( ) ) ( ( MemberTypeBinding ) sourceType ) . checkSyntheticArgsAndFields ( ) ; ReferenceBinding [ ] memberTypes = sourceType . memberTypes ; for ( int i = <NUM_LIT:0> , length = memberTypes . length ; i < length ; i ++ ) ( ( SourceTypeBinding ) memberTypes [ i ] ) . scope . buildFieldsAndMethods ( ) ; } private LocalTypeBinding buildLocalType ( SourceTypeBinding enclosingType , PackageBinding packageBinding ) { this . referenceContext . scope = this ; this . referenceContext . staticInitializerScope = new MethodScope ( this , this . referenceContext , true ) ; this . referenceContext . initializerScope = new MethodScope ( this , this . referenceContext , false ) ; LocalTypeBinding localType = new LocalTypeBinding ( this , enclosingType , innermostSwitchCase ( ) ) ; this . referenceContext . binding = localType ; checkAndSetModifiers ( ) ; buildTypeVariables ( ) ; ReferenceBinding [ ] memberTypeBindings = Binding . NO_MEMBER_TYPES ; if ( this . referenceContext . memberTypes != null ) { int size = this . referenceContext . memberTypes . length ; memberTypeBindings = new ReferenceBinding [ size ] ; int count = <NUM_LIT:0> ; nextMember : for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) { TypeDeclaration memberContext = this . referenceContext . memberTypes [ i ] ; switch ( TypeDeclaration . kind ( memberContext . modifiers ) ) { case TypeDeclaration . INTERFACE_DECL : case TypeDeclaration . ANNOTATION_TYPE_DECL : problemReporter ( ) . illegalLocalTypeDeclaration ( memberContext ) ; continue nextMember ; } ReferenceBinding type = localType ; do { if ( CharOperation . equals ( type . sourceName , memberContext . name ) ) { problemReporter ( ) . typeCollidesWithEnclosingType ( memberContext ) ; continue nextMember ; } type = type . enclosingType ( ) ; } while ( type != null ) ; for ( int j = <NUM_LIT:0> ; j < i ; j ++ ) { if ( CharOperation . equals ( this . referenceContext . memberTypes [ j ] . name , memberContext . name ) ) { problemReporter ( ) . duplicateNestedType ( memberContext ) ; continue nextMember ; } } ClassScope memberScope = new ClassScope ( this , this . referenceContext . memberTypes [ i ] ) ; LocalTypeBinding memberBinding = memberScope . buildLocalType ( localType , packageBinding ) ; memberBinding . setAsMemberType ( ) ; memberTypeBindings [ count ++ ] = memberBinding ; } if ( count != size ) System . arraycopy ( memberTypeBindings , <NUM_LIT:0> , memberTypeBindings = new ReferenceBinding [ count ] , <NUM_LIT:0> , count ) ; } localType . memberTypes = memberTypeBindings ; return localType ; } void buildLocalTypeBinding ( SourceTypeBinding enclosingType ) { LocalTypeBinding localType = buildLocalType ( enclosingType , enclosingType . fPackage ) ; connectTypeHierarchy ( ) ; if ( compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ) { checkParameterizedTypeBounds ( ) ; checkParameterizedSuperTypeCollisions ( ) ; } buildFieldsAndMethods ( ) ; localType . faultInTypesForFieldsAndMethods ( ) ; this . referenceContext . binding . verifyMethods ( environment ( ) . methodVerifier ( ) ) ; } private void buildMemberTypes ( AccessRestriction accessRestriction ) { SourceTypeBinding sourceType = this . referenceContext . binding ; ReferenceBinding [ ] memberTypeBindings = Binding . NO_MEMBER_TYPES ; if ( this . referenceContext . memberTypes != null ) { int length = this . referenceContext . memberTypes . length ; memberTypeBindings = new ReferenceBinding [ length ] ; int count = <NUM_LIT:0> ; nextMember : for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeDeclaration memberContext = this . referenceContext . memberTypes [ i ] ; switch ( TypeDeclaration . kind ( memberContext . modifiers ) ) { case TypeDeclaration . INTERFACE_DECL : case TypeDeclaration . ANNOTATION_TYPE_DECL : if ( sourceType . isNestedType ( ) && sourceType . isClass ( ) && ! sourceType . isStatic ( ) ) { problemReporter ( ) . illegalLocalTypeDeclaration ( memberContext ) ; continue nextMember ; } break ; } ReferenceBinding type = sourceType ; do { if ( CharOperation . equals ( type . sourceName , memberContext . name ) ) { problemReporter ( ) . typeCollidesWithEnclosingType ( memberContext ) ; continue nextMember ; } type = type . enclosingType ( ) ; } while ( type != null ) ; for ( int j = <NUM_LIT:0> ; j < i ; j ++ ) { if ( CharOperation . equals ( this . referenceContext . memberTypes [ j ] . name , memberContext . name ) ) { problemReporter ( ) . duplicateNestedType ( memberContext ) ; continue nextMember ; } } ClassScope memberScope = buildClassScope ( this , memberContext ) ; memberTypeBindings [ count ++ ] = memberScope . buildType ( sourceType , sourceType . fPackage , accessRestriction ) ; } if ( count != length ) System . arraycopy ( memberTypeBindings , <NUM_LIT:0> , memberTypeBindings = new ReferenceBinding [ count ] , <NUM_LIT:0> , count ) ; } sourceType . memberTypes = memberTypeBindings ; } protected ClassScope buildClassScope ( Scope parent , TypeDeclaration typeDecl ) { return new ClassScope ( parent , typeDecl ) ; } void buildMethods ( ) { SourceTypeBinding sourceType = this . referenceContext . binding ; if ( sourceType . areMethodsInitialized ( ) ) return ; boolean isEnum = TypeDeclaration . kind ( this . referenceContext . modifiers ) == TypeDeclaration . ENUM_DECL ; if ( this . referenceContext . methods == null && ! isEnum ) { this . referenceContext . binding . setMethods ( Binding . NO_METHODS ) ; return ; } AbstractMethodDeclaration [ ] methods = this . referenceContext . methods ; int size = methods == null ? <NUM_LIT:0> : methods . length ; int clinitIndex = - <NUM_LIT:1> ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) { if ( methods [ i ] . isClinit ( ) ) { clinitIndex = i ; break ; } } int count = isEnum ? <NUM_LIT:2> : <NUM_LIT:0> ; MethodBinding [ ] methodBindings = new MethodBinding [ ( clinitIndex == - <NUM_LIT:1> ? size : size - <NUM_LIT:1> ) + count ] ; if ( isEnum ) { methodBindings [ <NUM_LIT:0> ] = sourceType . addSyntheticEnumMethod ( TypeConstants . VALUES ) ; methodBindings [ <NUM_LIT:1> ] = sourceType . addSyntheticEnumMethod ( TypeConstants . VALUEOF ) ; } boolean hasNativeMethods = false ; if ( sourceType . isAbstract ( ) ) { for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) { if ( i != clinitIndex ) { MethodScope scope = new MethodScope ( this , methods [ i ] , false ) ; MethodBinding methodBinding = scope . createMethod ( methods [ i ] ) ; if ( methodBinding != null ) { methodBindings [ count ++ ] = methodBinding ; hasNativeMethods = hasNativeMethods || methodBinding . isNative ( ) ; } } } } else { boolean hasAbstractMethods = false ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) { if ( i != clinitIndex ) { MethodScope scope = new MethodScope ( this , methods [ i ] , false ) ; MethodBinding methodBinding = scope . createMethod ( methods [ i ] ) ; if ( methodBinding != null ) { methodBindings [ count ++ ] = methodBinding ; hasAbstractMethods = hasAbstractMethods || methodBinding . isAbstract ( ) ; hasNativeMethods = hasNativeMethods || methodBinding . isNative ( ) ; } } } if ( hasAbstractMethods ) problemReporter ( ) . abstractMethodInConcreteClass ( sourceType ) ; } if ( count != methodBindings . length ) System . arraycopy ( methodBindings , <NUM_LIT:0> , methodBindings = new MethodBinding [ count ] , <NUM_LIT:0> , count ) ; methodBindings = augmentMethodBindings ( methodBindings ) ; sourceType . tagBits &= ~ ( TagBits . AreMethodsSorted | TagBits . AreMethodsComplete ) ; sourceType . setMethods ( methodBindings ) ; if ( hasNativeMethods ) { for ( int i = <NUM_LIT:0> ; i < methodBindings . length ; i ++ ) { methodBindings [ i ] . modifiers |= ExtraCompilerModifiers . AccLocallyUsed ; } FieldBinding [ ] fields = sourceType . unResolvedFields ( ) ; for ( int i = <NUM_LIT:0> ; i < fields . length ; i ++ ) { fields [ i ] . modifiers |= ExtraCompilerModifiers . AccLocallyUsed ; } } } protected MethodBinding [ ] augmentMethodBindings ( MethodBinding [ ] methodBindings ) { return methodBindings ; } SourceTypeBinding buildType ( SourceTypeBinding enclosingType , PackageBinding packageBinding , AccessRestriction accessRestriction ) { this . referenceContext . scope = this ; this . referenceContext . staticInitializerScope = new MethodScope ( this , this . referenceContext , true ) ; this . referenceContext . initializerScope = new MethodScope ( this , this . referenceContext , false ) ; if ( enclosingType == null ) { char [ ] [ ] className = CharOperation . arrayConcat ( packageBinding . compoundName , this . referenceContext . name ) ; this . referenceContext . binding = new SourceTypeBinding ( className , packageBinding , this ) ; } else { char [ ] [ ] className = CharOperation . deepCopy ( enclosingType . compoundName ) ; className [ className . length - <NUM_LIT:1> ] = CharOperation . concat ( className [ className . length - <NUM_LIT:1> ] , this . referenceContext . name , '<CHAR_LIT>' ) ; ReferenceBinding existingType = packageBinding . getType0 ( className [ className . length - <NUM_LIT:1> ] ) ; if ( existingType != null ) { if ( existingType instanceof UnresolvedReferenceBinding ) { } else { this . parent . problemReporter ( ) . duplicateNestedType ( this . referenceContext ) ; } } this . referenceContext . binding = new MemberTypeBinding ( className , this , enclosingType ) ; } SourceTypeBinding sourceType = this . referenceContext . binding ; environment ( ) . setAccessRestriction ( sourceType , accessRestriction ) ; sourceType . fPackage . addType ( sourceType ) ; checkAndSetModifiers ( ) ; buildTypeVariables ( ) ; buildMemberTypes ( accessRestriction ) ; return sourceType ; } private void buildTypeVariables ( ) { SourceTypeBinding sourceType = this . referenceContext . binding ; TypeParameter [ ] typeParameters = this . referenceContext . typeParameters ; if ( typeParameters == null || typeParameters . length == <NUM_LIT:0> ) { sourceType . typeVariables = Binding . NO_TYPE_VARIABLES ; return ; } sourceType . typeVariables = Binding . NO_TYPE_VARIABLES ; if ( sourceType . id == TypeIds . T_JavaLangObject ) { problemReporter ( ) . objectCannotBeGeneric ( this . referenceContext ) ; return ; } sourceType . typeVariables = createTypeVariables ( typeParameters , sourceType ) ; sourceType . modifiers |= ExtraCompilerModifiers . AccGenericSignature ; } private void checkAndSetModifiers ( ) { SourceTypeBinding sourceType = this . referenceContext . binding ; int modifiers = sourceType . modifiers ; if ( ( modifiers & ExtraCompilerModifiers . AccAlternateModifierProblem ) != <NUM_LIT:0> ) problemReporter ( ) . duplicateModifierForType ( sourceType ) ; ReferenceBinding enclosingType = sourceType . enclosingType ( ) ; boolean isMemberType = sourceType . isMemberType ( ) ; if ( isMemberType ) { modifiers |= ( enclosingType . modifiers & ( ExtraCompilerModifiers . AccGenericSignature | ClassFileConstants . AccStrictfp ) ) ; if ( enclosingType . isInterface ( ) ) modifiers |= ClassFileConstants . AccPublic ; if ( sourceType . isEnum ( ) ) { if ( ! enclosingType . isStatic ( ) ) problemReporter ( ) . nonStaticContextForEnumMemberType ( sourceType ) ; else modifiers |= ClassFileConstants . AccStatic ; } } else if ( sourceType . isLocalType ( ) ) { if ( sourceType . isEnum ( ) ) { problemReporter ( ) . illegalLocalTypeDeclaration ( this . referenceContext ) ; sourceType . modifiers = <NUM_LIT:0> ; return ; } if ( sourceType . isAnonymousType ( ) ) { modifiers |= ClassFileConstants . AccFinal ; if ( this . referenceContext . allocation . type == null ) modifiers |= ClassFileConstants . AccEnum ; } Scope scope = this ; do { switch ( scope . kind ) { case METHOD_SCOPE : MethodScope methodScope = ( MethodScope ) scope ; if ( methodScope . isInsideInitializer ( ) ) { SourceTypeBinding type = ( ( TypeDeclaration ) methodScope . referenceContext ) . binding ; if ( methodScope . initializedField != null ) { if ( methodScope . initializedField . isViewedAsDeprecated ( ) && ! sourceType . isDeprecated ( ) ) modifiers |= ExtraCompilerModifiers . AccDeprecatedImplicitly ; } else { if ( type . isStrictfp ( ) ) modifiers |= ClassFileConstants . AccStrictfp ; if ( type . isViewedAsDeprecated ( ) && ! sourceType . isDeprecated ( ) ) modifiers |= ExtraCompilerModifiers . AccDeprecatedImplicitly ; } } else { MethodBinding method = ( ( AbstractMethodDeclaration ) methodScope . referenceContext ) . binding ; if ( method != null ) { if ( method . isStrictfp ( ) ) modifiers |= ClassFileConstants . AccStrictfp ; if ( method . isViewedAsDeprecated ( ) && ! sourceType . isDeprecated ( ) ) modifiers |= ExtraCompilerModifiers . AccDeprecatedImplicitly ; } } break ; case CLASS_SCOPE : if ( enclosingType . isStrictfp ( ) ) modifiers |= ClassFileConstants . AccStrictfp ; if ( enclosingType . isViewedAsDeprecated ( ) && ! sourceType . isDeprecated ( ) ) modifiers |= ExtraCompilerModifiers . AccDeprecatedImplicitly ; break ; } scope = scope . parent ; } while ( scope != null ) ; } int realModifiers = modifiers & ExtraCompilerModifiers . AccJustFlag ; if ( ( realModifiers & ClassFileConstants . AccInterface ) != <NUM_LIT:0> ) { if ( isMemberType ) { final int UNEXPECTED_MODIFIERS = ~ ( ClassFileConstants . AccPublic | ClassFileConstants . AccPrivate | ClassFileConstants . AccProtected | ClassFileConstants . AccStatic | ClassFileConstants . AccAbstract | ClassFileConstants . AccInterface | ClassFileConstants . AccStrictfp | ClassFileConstants . AccAnnotation ) ; if ( ( realModifiers & UNEXPECTED_MODIFIERS ) != <NUM_LIT:0> ) { if ( ( realModifiers & ClassFileConstants . AccAnnotation ) != <NUM_LIT:0> ) problemReporter ( ) . illegalModifierForAnnotationMemberType ( sourceType ) ; else problemReporter ( ) . illegalModifierForMemberInterface ( sourceType ) ; } } else { final int UNEXPECTED_MODIFIERS = ~ ( ClassFileConstants . AccPublic | ClassFileConstants . AccAbstract | ClassFileConstants . AccInterface | ClassFileConstants . AccStrictfp | ClassFileConstants . AccAnnotation ) ; if ( ( realModifiers & UNEXPECTED_MODIFIERS ) != <NUM_LIT:0> ) { if ( ( realModifiers & ClassFileConstants . AccAnnotation ) != <NUM_LIT:0> ) problemReporter ( ) . illegalModifierForAnnotationType ( sourceType ) ; else problemReporter ( ) . illegalModifierForInterface ( sourceType ) ; } } if ( sourceType . sourceName == TypeConstants . PACKAGE_INFO_NAME && compilerOptions ( ) . targetJDK > ClassFileConstants . JDK1_5 ) { modifiers |= ClassFileConstants . AccSynthetic ; } modifiers |= ClassFileConstants . AccAbstract ; } else if ( ( realModifiers & ClassFileConstants . AccEnum ) != <NUM_LIT:0> ) { if ( isMemberType ) { final int UNEXPECTED_MODIFIERS = ~ ( ClassFileConstants . AccPublic | ClassFileConstants . AccPrivate | ClassFileConstants . AccProtected | ClassFileConstants . AccStatic | ClassFileConstants . AccStrictfp | ClassFileConstants . AccEnum ) ; if ( ( realModifiers & UNEXPECTED_MODIFIERS ) != <NUM_LIT:0> ) { problemReporter ( ) . illegalModifierForMemberEnum ( sourceType ) ; modifiers &= ~ ClassFileConstants . AccAbstract ; realModifiers &= ~ ClassFileConstants . AccAbstract ; } } else if ( sourceType . isLocalType ( ) ) { } else { final int UNEXPECTED_MODIFIERS = ~ ( ClassFileConstants . AccPublic | ClassFileConstants . AccStrictfp | ClassFileConstants . AccEnum ) ; if ( ( realModifiers & UNEXPECTED_MODIFIERS ) != <NUM_LIT:0> ) problemReporter ( ) . illegalModifierForEnum ( sourceType ) ; } if ( ! sourceType . isAnonymousType ( ) ) { checkAbstractEnum : { if ( ( this . referenceContext . bits & ASTNode . HasAbstractMethods ) != <NUM_LIT:0> ) { modifiers |= ClassFileConstants . AccAbstract ; break checkAbstractEnum ; } TypeDeclaration typeDeclaration = this . referenceContext ; FieldDeclaration [ ] fields = typeDeclaration . fields ; int fieldsLength = fields == null ? <NUM_LIT:0> : fields . length ; if ( fieldsLength == <NUM_LIT:0> ) break checkAbstractEnum ; AbstractMethodDeclaration [ ] methods = typeDeclaration . methods ; int methodsLength = methods == null ? <NUM_LIT:0> : methods . length ; boolean definesAbstractMethod = typeDeclaration . superInterfaces != null ; for ( int i = <NUM_LIT:0> ; i < methodsLength && ! definesAbstractMethod ; i ++ ) definesAbstractMethod = methods [ i ] . isAbstract ( ) ; if ( ! definesAbstractMethod ) break checkAbstractEnum ; boolean needAbstractBit = false ; for ( int i = <NUM_LIT:0> ; i < fieldsLength ; i ++ ) { FieldDeclaration fieldDecl = fields [ i ] ; if ( fieldDecl . getKind ( ) == AbstractVariableDeclaration . ENUM_CONSTANT ) { if ( fieldDecl . initialization instanceof QualifiedAllocationExpression ) { needAbstractBit = true ; } else { break checkAbstractEnum ; } } } if ( needAbstractBit ) { modifiers |= ClassFileConstants . AccAbstract ; } } checkFinalEnum : { TypeDeclaration typeDeclaration = this . referenceContext ; FieldDeclaration [ ] fields = typeDeclaration . fields ; if ( fields != null ) { for ( int i = <NUM_LIT:0> , fieldsLength = fields . length ; i < fieldsLength ; i ++ ) { FieldDeclaration fieldDecl = fields [ i ] ; if ( fieldDecl . getKind ( ) == AbstractVariableDeclaration . ENUM_CONSTANT ) { if ( fieldDecl . initialization instanceof QualifiedAllocationExpression ) { break checkFinalEnum ; } } } } modifiers |= ClassFileConstants . AccFinal ; } } } else { if ( isMemberType ) { final int UNEXPECTED_MODIFIERS = ~ ( ClassFileConstants . AccPublic | ClassFileConstants . AccPrivate | ClassFileConstants . AccProtected | ClassFileConstants . AccStatic | ClassFileConstants . AccAbstract | ClassFileConstants . AccFinal | ClassFileConstants . AccStrictfp ) ; if ( ( realModifiers & UNEXPECTED_MODIFIERS ) != <NUM_LIT:0> ) problemReporter ( ) . illegalModifierForMemberClass ( sourceType ) ; } else if ( sourceType . isLocalType ( ) ) { final int UNEXPECTED_MODIFIERS = ~ ( ClassFileConstants . AccAbstract | ClassFileConstants . AccFinal | ClassFileConstants . AccStrictfp ) ; if ( ( realModifiers & UNEXPECTED_MODIFIERS ) != <NUM_LIT:0> ) problemReporter ( ) . illegalModifierForLocalClass ( sourceType ) ; } else { final int UNEXPECTED_MODIFIERS = ~ ( ClassFileConstants . AccPublic | ClassFileConstants . AccAbstract | ClassFileConstants . AccFinal | ClassFileConstants . AccStrictfp ) ; if ( ( realModifiers & UNEXPECTED_MODIFIERS ) != <NUM_LIT:0> ) problemReporter ( ) . illegalModifierForClass ( sourceType ) ; } if ( ( realModifiers & ( ClassFileConstants . AccFinal | ClassFileConstants . AccAbstract ) ) == ( ClassFileConstants . AccFinal | ClassFileConstants . AccAbstract ) ) problemReporter ( ) . illegalModifierCombinationFinalAbstractForClass ( sourceType ) ; } if ( isMemberType ) { if ( enclosingType . isInterface ( ) ) { if ( ( realModifiers & ( ClassFileConstants . AccProtected | ClassFileConstants . AccPrivate ) ) != <NUM_LIT:0> ) { problemReporter ( ) . illegalVisibilityModifierForInterfaceMemberType ( sourceType ) ; if ( ( realModifiers & ClassFileConstants . AccProtected ) != <NUM_LIT:0> ) modifiers &= ~ ClassFileConstants . AccProtected ; if ( ( realModifiers & ClassFileConstants . AccPrivate ) != <NUM_LIT:0> ) modifiers &= ~ ClassFileConstants . AccPrivate ; } } else { int accessorBits = realModifiers & ( ClassFileConstants . AccPublic | ClassFileConstants . AccProtected | ClassFileConstants . AccPrivate ) ; if ( ( accessorBits & ( accessorBits - <NUM_LIT:1> ) ) > <NUM_LIT:1> ) { problemReporter ( ) . illegalVisibilityModifierCombinationForMemberType ( sourceType ) ; if ( ( accessorBits & ClassFileConstants . AccPublic ) != <NUM_LIT:0> ) { if ( ( accessorBits & ClassFileConstants . AccProtected ) != <NUM_LIT:0> ) modifiers &= ~ ClassFileConstants . AccProtected ; if ( ( accessorBits & ClassFileConstants . AccPrivate ) != <NUM_LIT:0> ) modifiers &= ~ ClassFileConstants . AccPrivate ; } else if ( ( accessorBits & ClassFileConstants . AccProtected ) != <NUM_LIT:0> && ( accessorBits & ClassFileConstants . AccPrivate ) != <NUM_LIT:0> ) { modifiers &= ~ ClassFileConstants . AccPrivate ; } } } if ( ( realModifiers & ClassFileConstants . AccStatic ) == <NUM_LIT:0> ) { if ( enclosingType . isInterface ( ) ) modifiers |= ClassFileConstants . AccStatic ; } else if ( ! enclosingType . isStatic ( ) ) { problemReporter ( ) . illegalStaticModifierForMemberType ( sourceType ) ; } } sourceType . modifiers = modifiers ; } private void checkAndSetModifiersForField ( FieldBinding fieldBinding , FieldDeclaration fieldDecl ) { int modifiers = fieldBinding . modifiers ; final ReferenceBinding declaringClass = fieldBinding . declaringClass ; if ( ( modifiers & ExtraCompilerModifiers . AccAlternateModifierProblem ) != <NUM_LIT:0> ) problemReporter ( ) . duplicateModifierForField ( declaringClass , fieldDecl ) ; if ( declaringClass . isInterface ( ) ) { final int IMPLICIT_MODIFIERS = ClassFileConstants . AccPublic | ClassFileConstants . AccStatic | ClassFileConstants . AccFinal ; modifiers |= IMPLICIT_MODIFIERS ; if ( ( modifiers & ExtraCompilerModifiers . AccJustFlag ) != IMPLICIT_MODIFIERS ) { if ( ( declaringClass . modifiers & ClassFileConstants . AccAnnotation ) != <NUM_LIT:0> ) problemReporter ( ) . illegalModifierForAnnotationField ( fieldDecl ) ; else problemReporter ( ) . illegalModifierForInterfaceField ( fieldDecl ) ; } fieldBinding . modifiers = modifiers ; return ; } else if ( fieldDecl . getKind ( ) == AbstractVariableDeclaration . ENUM_CONSTANT ) { if ( ( modifiers & ExtraCompilerModifiers . AccJustFlag ) != <NUM_LIT:0> ) problemReporter ( ) . illegalModifierForEnumConstant ( declaringClass , fieldDecl ) ; final int IMPLICIT_MODIFIERS = ClassFileConstants . AccPublic | ClassFileConstants . AccStatic | ClassFileConstants . AccFinal | ClassFileConstants . AccEnum | ExtraCompilerModifiers . AccLocallyUsed ; fieldBinding . modifiers |= IMPLICIT_MODIFIERS ; return ; } int realModifiers = modifiers & ExtraCompilerModifiers . AccJustFlag ; final int UNEXPECTED_MODIFIERS = ~ ( ClassFileConstants . AccPublic | ClassFileConstants . AccPrivate | ClassFileConstants . AccProtected | ClassFileConstants . AccFinal | ClassFileConstants . AccStatic | ClassFileConstants . AccTransient | ClassFileConstants . AccVolatile ) ; if ( ( realModifiers & UNEXPECTED_MODIFIERS ) != <NUM_LIT:0> ) { problemReporter ( ) . illegalModifierForField ( declaringClass , fieldDecl ) ; modifiers &= ~ ExtraCompilerModifiers . AccJustFlag | ~ UNEXPECTED_MODIFIERS ; } int accessorBits = realModifiers & ( ClassFileConstants . AccPublic | ClassFileConstants . AccProtected | ClassFileConstants . AccPrivate ) ; if ( ( accessorBits & ( accessorBits - <NUM_LIT:1> ) ) > <NUM_LIT:1> ) { problemReporter ( ) . illegalVisibilityModifierCombinationForField ( declaringClass , fieldDecl ) ; if ( ( accessorBits & ClassFileConstants . AccPublic ) != <NUM_LIT:0> ) { if ( ( accessorBits & ClassFileConstants . AccProtected ) != <NUM_LIT:0> ) modifiers &= ~ ClassFileConstants . AccProtected ; if ( ( accessorBits & ClassFileConstants . AccPrivate ) != <NUM_LIT:0> ) modifiers &= ~ ClassFileConstants . AccPrivate ; } else if ( ( accessorBits & ClassFileConstants . AccProtected ) != <NUM_LIT:0> && ( accessorBits & ClassFileConstants . AccPrivate ) != <NUM_LIT:0> ) { modifiers &= ~ ClassFileConstants . AccPrivate ; } } if ( ( realModifiers & ( ClassFileConstants . AccFinal | ClassFileConstants . AccVolatile ) ) == ( ClassFileConstants . AccFinal | ClassFileConstants . AccVolatile ) ) problemReporter ( ) . illegalModifierCombinationFinalVolatileForField ( declaringClass , fieldDecl ) ; if ( fieldDecl . initialization == null && ( modifiers & ClassFileConstants . AccFinal ) != <NUM_LIT:0> ) modifiers |= ExtraCompilerModifiers . AccBlankFinal ; fieldBinding . modifiers = modifiers ; } public void checkParameterizedSuperTypeCollisions ( ) { SourceTypeBinding sourceType = this . referenceContext . binding ; ReferenceBinding [ ] interfaces = sourceType . superInterfaces ; Map invocations = new HashMap ( <NUM_LIT:2> ) ; ReferenceBinding itsSuperclass = sourceType . isInterface ( ) ? null : sourceType . superclass ; nextInterface : for ( int i = <NUM_LIT:0> , length = interfaces . length ; i < length ; i ++ ) { ReferenceBinding one = interfaces [ i ] ; if ( one == null ) continue nextInterface ; if ( itsSuperclass != null && hasErasedCandidatesCollisions ( itsSuperclass , one , invocations , sourceType , this . referenceContext ) ) continue nextInterface ; nextOtherInterface : for ( int j = <NUM_LIT:0> ; j < i ; j ++ ) { ReferenceBinding two = interfaces [ j ] ; if ( two == null ) continue nextOtherInterface ; if ( hasErasedCandidatesCollisions ( one , two , invocations , sourceType , this . referenceContext ) ) continue nextInterface ; } } TypeParameter [ ] typeParameters = this . referenceContext . typeParameters ; nextVariable : for ( int i = <NUM_LIT:0> , paramLength = typeParameters == null ? <NUM_LIT:0> : typeParameters . length ; i < paramLength ; i ++ ) { TypeParameter typeParameter = typeParameters [ i ] ; TypeVariableBinding typeVariable = typeParameter . binding ; if ( typeVariable == null || ! typeVariable . isValidBinding ( ) ) continue nextVariable ; TypeReference [ ] boundRefs = typeParameter . bounds ; if ( boundRefs != null ) { boolean checkSuperclass = typeVariable . firstBound == typeVariable . superclass ; for ( int j = <NUM_LIT:0> , boundLength = boundRefs . length ; j < boundLength ; j ++ ) { TypeReference typeRef = boundRefs [ j ] ; TypeBinding superType = typeRef . resolvedType ; if ( superType == null || ! superType . isValidBinding ( ) ) continue ; if ( checkSuperclass ) if ( hasErasedCandidatesCollisions ( superType , typeVariable . superclass , invocations , typeVariable , typeRef ) ) continue nextVariable ; for ( int index = typeVariable . superInterfaces . length ; -- index >= <NUM_LIT:0> ; ) if ( hasErasedCandidatesCollisions ( superType , typeVariable . superInterfaces [ index ] , invocations , typeVariable , typeRef ) ) continue nextVariable ; } } } ReferenceBinding [ ] memberTypes = this . referenceContext . binding . memberTypes ; if ( memberTypes != null && memberTypes != Binding . NO_MEMBER_TYPES ) for ( int i = <NUM_LIT:0> , size = memberTypes . length ; i < size ; i ++ ) ( ( SourceTypeBinding ) memberTypes [ i ] ) . scope . checkParameterizedSuperTypeCollisions ( ) ; } private void checkForInheritedMemberTypes ( SourceTypeBinding sourceType ) { ReferenceBinding currentType = sourceType ; ReferenceBinding [ ] interfacesToVisit = null ; int nextPosition = <NUM_LIT:0> ; do { if ( currentType . hasMemberTypes ( ) ) return ; ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { if ( interfacesToVisit == null ) { interfacesToVisit = itsInterfaces ; nextPosition = interfacesToVisit . length ; } else { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } } while ( ( currentType = currentType . superclass ( ) ) != null && ( currentType . tagBits & TagBits . HasNoMemberTypes ) == <NUM_LIT:0> ) ; if ( interfacesToVisit != null ) { boolean needToTag = false ; for ( int i = <NUM_LIT:0> ; i < nextPosition ; i ++ ) { ReferenceBinding anInterface = interfacesToVisit [ i ] ; if ( ( anInterface . tagBits & TagBits . HasNoMemberTypes ) == <NUM_LIT:0> ) { if ( anInterface . hasMemberTypes ( ) ) return ; needToTag = true ; ReferenceBinding [ ] itsInterfaces = anInterface . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } } if ( needToTag ) { for ( int i = <NUM_LIT:0> ; i < nextPosition ; i ++ ) interfacesToVisit [ i ] . tagBits |= TagBits . HasNoMemberTypes ; } } currentType = sourceType ; do { currentType . tagBits |= TagBits . HasNoMemberTypes ; } while ( ( currentType = currentType . superclass ( ) ) != null && ( currentType . tagBits & TagBits . HasNoMemberTypes ) == <NUM_LIT:0> ) ; } public void checkParameterizedTypeBounds ( ) { for ( int i = <NUM_LIT:0> , l = this . deferredBoundChecks == null ? <NUM_LIT:0> : this . deferredBoundChecks . size ( ) ; i < l ; i ++ ) ( ( TypeReference ) this . deferredBoundChecks . get ( i ) ) . checkBounds ( this ) ; this . deferredBoundChecks = null ; ReferenceBinding [ ] memberTypes = this . referenceContext . binding . memberTypes ; if ( memberTypes != null && memberTypes != Binding . NO_MEMBER_TYPES ) for ( int i = <NUM_LIT:0> , size = memberTypes . length ; i < size ; i ++ ) ( ( SourceTypeBinding ) memberTypes [ i ] ) . scope . checkParameterizedTypeBounds ( ) ; } private void connectMemberTypes ( ) { SourceTypeBinding sourceType = this . referenceContext . binding ; ReferenceBinding [ ] memberTypes = sourceType . memberTypes ; if ( memberTypes != null && memberTypes != Binding . NO_MEMBER_TYPES ) { for ( int i = <NUM_LIT:0> , size = memberTypes . length ; i < size ; i ++ ) ( ( SourceTypeBinding ) memberTypes [ i ] ) . scope . connectTypeHierarchy ( ) ; } } private boolean connectSuperclass ( ) { SourceTypeBinding sourceType = this . referenceContext . binding ; if ( sourceType . id == TypeIds . T_JavaLangObject ) { sourceType . superclass = null ; sourceType . superInterfaces = Binding . NO_SUPERINTERFACES ; if ( ! sourceType . isClass ( ) ) problemReporter ( ) . objectMustBeClass ( sourceType ) ; if ( this . referenceContext . superclass != null || ( this . referenceContext . superInterfaces != null && this . referenceContext . superInterfaces . length > <NUM_LIT:0> ) ) problemReporter ( ) . objectCannotHaveSuperTypes ( sourceType ) ; return true ; } if ( this . referenceContext . superclass == null ) { if ( sourceType . isEnum ( ) && compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ) return connectEnumSuperclass ( ) ; sourceType . superclass = getJavaLangObject ( ) ; return ! detectHierarchyCycle ( sourceType , sourceType . superclass , null ) ; } TypeReference superclassRef = this . referenceContext . superclass ; ReferenceBinding superclass = findSupertype ( superclassRef ) ; if ( superclass != null ) { if ( ! superclass . isClass ( ) && ( superclass . tagBits & TagBits . HasMissingType ) == <NUM_LIT:0> ) { if ( shouldReport ( IProblem . SuperclassMustBeAClass ) ) problemReporter ( ) . superclassMustBeAClass ( sourceType , superclassRef , superclass ) ; } else if ( superclass . isFinal ( ) ) { problemReporter ( ) . classExtendFinalClass ( sourceType , superclassRef , superclass ) ; } else if ( ( superclass . tagBits & TagBits . HasDirectWildcard ) != <NUM_LIT:0> ) { problemReporter ( ) . superTypeCannotUseWildcard ( sourceType , superclassRef , superclass ) ; } else if ( superclass . erasure ( ) . id == TypeIds . T_JavaLangEnum ) { problemReporter ( ) . cannotExtendEnum ( sourceType , superclassRef , superclass ) ; } else if ( ( superclass . tagBits & TagBits . HierarchyHasProblems ) != <NUM_LIT:0> || ! superclassRef . resolvedType . isValidBinding ( ) ) { sourceType . superclass = superclass ; sourceType . tagBits |= TagBits . HierarchyHasProblems ; return superclassRef . resolvedType . isValidBinding ( ) ; } else { sourceType . superclass = superclass ; return true ; } } sourceType . tagBits |= TagBits . HierarchyHasProblems ; sourceType . superclass = getJavaLangObject ( ) ; if ( ( sourceType . superclass . tagBits & TagBits . BeginHierarchyCheck ) == <NUM_LIT:0> ) detectHierarchyCycle ( sourceType , sourceType . superclass , null ) ; return false ; } public boolean shouldReport ( int i ) { return true ; } private boolean connectEnumSuperclass ( ) { SourceTypeBinding sourceType = this . referenceContext . binding ; ReferenceBinding rootEnumType = getJavaLangEnum ( ) ; if ( ( rootEnumType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { sourceType . tagBits |= TagBits . HierarchyHasProblems ; sourceType . superclass = rootEnumType ; return false ; } boolean foundCycle = detectHierarchyCycle ( sourceType , rootEnumType , null ) ; TypeVariableBinding [ ] refTypeVariables = rootEnumType . typeVariables ( ) ; if ( refTypeVariables == Binding . NO_TYPE_VARIABLES ) { problemReporter ( ) . nonGenericTypeCannotBeParameterized ( <NUM_LIT:0> , null , rootEnumType , new TypeBinding [ ] { sourceType } ) ; return false ; } else if ( <NUM_LIT:1> != refTypeVariables . length ) { problemReporter ( ) . incorrectArityForParameterizedType ( null , rootEnumType , new TypeBinding [ ] { sourceType } ) ; return false ; } ParameterizedTypeBinding superType = environment ( ) . createParameterizedType ( rootEnumType , new TypeBinding [ ] { environment ( ) . convertToRawType ( sourceType , false ) , } , null ) ; sourceType . tagBits |= ( superType . tagBits & TagBits . HierarchyHasProblems ) ; sourceType . superclass = superType ; if ( refTypeVariables [ <NUM_LIT:0> ] . boundCheck ( superType , sourceType ) != TypeConstants . OK ) { problemReporter ( ) . typeMismatchError ( rootEnumType , refTypeVariables [ <NUM_LIT:0> ] , sourceType , null ) ; } return ! foundCycle ; } protected boolean connectSuperInterfaces ( ) { SourceTypeBinding sourceType = this . referenceContext . binding ; sourceType . superInterfaces = Binding . NO_SUPERINTERFACES ; if ( this . referenceContext . superInterfaces == null ) { if ( sourceType . isAnnotationType ( ) && compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ) { ReferenceBinding annotationType = getJavaLangAnnotationAnnotation ( ) ; boolean foundCycle = detectHierarchyCycle ( sourceType , annotationType , null ) ; sourceType . superInterfaces = new ReferenceBinding [ ] { annotationType } ; return ! foundCycle ; } return true ; } if ( sourceType . id == TypeIds . T_JavaLangObject ) return true ; boolean noProblems = true ; int length = this . referenceContext . superInterfaces . length ; ReferenceBinding [ ] interfaceBindings = new ReferenceBinding [ length ] ; int count = <NUM_LIT:0> ; nextInterface : for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeReference superInterfaceRef = this . referenceContext . superInterfaces [ i ] ; ReferenceBinding superInterface = findSupertype ( superInterfaceRef ) ; if ( superInterface == null ) { sourceType . tagBits |= TagBits . HierarchyHasProblems ; noProblems = false ; continue nextInterface ; } for ( int j = <NUM_LIT:0> ; j < i ; j ++ ) { if ( interfaceBindings [ j ] == superInterface ) { problemReporter ( ) . duplicateSuperinterface ( sourceType , superInterfaceRef , superInterface ) ; sourceType . tagBits |= TagBits . HierarchyHasProblems ; noProblems = false ; continue nextInterface ; } } if ( ! superInterface . isInterface ( ) && ( superInterface . tagBits & TagBits . HasMissingType ) == <NUM_LIT:0> ) { problemReporter ( ) . superinterfaceMustBeAnInterface ( sourceType , superInterfaceRef , superInterface ) ; sourceType . tagBits |= TagBits . HierarchyHasProblems ; noProblems = false ; continue nextInterface ; } else if ( superInterface . isAnnotationType ( ) ) { problemReporter ( ) . annotationTypeUsedAsSuperinterface ( sourceType , superInterfaceRef , superInterface ) ; } if ( ( superInterface . tagBits & TagBits . HasDirectWildcard ) != <NUM_LIT:0> ) { problemReporter ( ) . superTypeCannotUseWildcard ( sourceType , superInterfaceRef , superInterface ) ; sourceType . tagBits |= TagBits . HierarchyHasProblems ; noProblems = false ; continue nextInterface ; } if ( ( superInterface . tagBits & TagBits . HierarchyHasProblems ) != <NUM_LIT:0> || ! superInterfaceRef . resolvedType . isValidBinding ( ) ) { sourceType . tagBits |= TagBits . HierarchyHasProblems ; noProblems &= superInterfaceRef . resolvedType . isValidBinding ( ) ; } interfaceBindings [ count ++ ] = superInterface ; } if ( count > <NUM_LIT:0> ) { if ( count != length ) System . arraycopy ( interfaceBindings , <NUM_LIT:0> , interfaceBindings = new ReferenceBinding [ count ] , <NUM_LIT:0> , count ) ; sourceType . superInterfaces = interfaceBindings ; } return noProblems ; } void connectTypeHierarchy ( ) { SourceTypeBinding sourceType = this . referenceContext . binding ; if ( ( sourceType . tagBits & TagBits . BeginHierarchyCheck ) == <NUM_LIT:0> ) { sourceType . tagBits |= TagBits . BeginHierarchyCheck ; environment ( ) . typesBeingConnected . add ( sourceType ) ; boolean noProblems = connectSuperclass ( ) ; noProblems &= connectSuperInterfaces ( ) ; environment ( ) . typesBeingConnected . remove ( sourceType ) ; sourceType . tagBits |= TagBits . EndHierarchyCheck ; noProblems &= connectTypeVariables ( this . referenceContext . typeParameters , false ) ; sourceType . tagBits |= TagBits . TypeVariablesAreConnected ; if ( noProblems && sourceType . isHierarchyInconsistent ( ) ) problemReporter ( ) . hierarchyHasProblems ( sourceType ) ; } connectMemberTypes ( ) ; LookupEnvironment env = environment ( ) ; try { env . missingClassFileLocation = this . referenceContext ; checkForInheritedMemberTypes ( sourceType ) ; } catch ( AbortCompilation e ) { e . updateContext ( this . referenceContext , referenceCompilationUnit ( ) . compilationResult ) ; throw e ; } finally { env . missingClassFileLocation = null ; } } private void connectTypeHierarchyWithoutMembers ( ) { if ( this . parent instanceof CompilationUnitScope ) { if ( ( ( CompilationUnitScope ) this . parent ) . imports == null ) ( ( CompilationUnitScope ) this . parent ) . checkAndSetImports ( ) ; } else if ( this . parent instanceof ClassScope ) { ( ( ClassScope ) this . parent ) . connectTypeHierarchyWithoutMembers ( ) ; } SourceTypeBinding sourceType = this . referenceContext . binding ; if ( ( sourceType . tagBits & TagBits . BeginHierarchyCheck ) != <NUM_LIT:0> ) return ; sourceType . tagBits |= TagBits . BeginHierarchyCheck ; environment ( ) . typesBeingConnected . add ( sourceType ) ; boolean noProblems = connectSuperclass ( ) ; noProblems &= connectSuperInterfaces ( ) ; environment ( ) . typesBeingConnected . remove ( sourceType ) ; sourceType . tagBits |= TagBits . EndHierarchyCheck ; noProblems &= connectTypeVariables ( this . referenceContext . typeParameters , false ) ; sourceType . tagBits |= TagBits . TypeVariablesAreConnected ; if ( noProblems && sourceType . isHierarchyInconsistent ( ) ) problemReporter ( ) . hierarchyHasProblems ( sourceType ) ; } public boolean detectHierarchyCycle ( TypeBinding superType , TypeReference reference ) { if ( ! ( superType instanceof ReferenceBinding ) ) return false ; if ( reference == this . superTypeReference ) { if ( superType . isTypeVariable ( ) ) return false ; if ( superType . isParameterizedType ( ) ) superType = ( ( ParameterizedTypeBinding ) superType ) . genericType ( ) ; compilationUnitScope ( ) . recordSuperTypeReference ( superType ) ; return detectHierarchyCycle ( this . referenceContext . binding , ( ReferenceBinding ) superType , reference ) ; } if ( ( superType . tagBits & TagBits . BeginHierarchyCheck ) == <NUM_LIT:0> && superType instanceof SourceTypeBinding ) ( ( SourceTypeBinding ) superType ) . scope . connectTypeHierarchyWithoutMembers ( ) ; return false ; } private boolean detectHierarchyCycle ( SourceTypeBinding sourceType , ReferenceBinding superType , TypeReference reference ) { if ( superType . isRawType ( ) ) superType = ( ( RawTypeBinding ) superType ) . genericType ( ) ; if ( sourceType == superType ) { problemReporter ( ) . hierarchyCircularity ( sourceType , superType , reference ) ; sourceType . tagBits |= TagBits . HierarchyHasProblems ; return true ; } if ( superType . isMemberType ( ) ) { ReferenceBinding current = superType . enclosingType ( ) ; do { if ( current . isHierarchyBeingActivelyConnected ( ) && current == sourceType ) { problemReporter ( ) . hierarchyCircularity ( sourceType , current , reference ) ; sourceType . tagBits |= TagBits . HierarchyHasProblems ; current . tagBits |= TagBits . HierarchyHasProblems ; return true ; } } while ( ( current = current . enclosingType ( ) ) != null ) ; } if ( superType . isBinaryBinding ( ) ) { boolean hasCycle = false ; ReferenceBinding parentType = superType . superclass ( ) ; if ( parentType != null ) { if ( sourceType == parentType ) { problemReporter ( ) . hierarchyCircularity ( sourceType , superType , reference ) ; sourceType . tagBits |= TagBits . HierarchyHasProblems ; superType . tagBits |= TagBits . HierarchyHasProblems ; return true ; } if ( parentType . isParameterizedType ( ) ) parentType = ( ( ParameterizedTypeBinding ) parentType ) . genericType ( ) ; hasCycle |= detectHierarchyCycle ( sourceType , parentType , reference ) ; if ( ( parentType . tagBits & TagBits . HierarchyHasProblems ) != <NUM_LIT:0> ) { sourceType . tagBits |= TagBits . HierarchyHasProblems ; parentType . tagBits |= TagBits . HierarchyHasProblems ; } } ReferenceBinding [ ] itsInterfaces = superType . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { for ( int i = <NUM_LIT:0> , length = itsInterfaces . length ; i < length ; i ++ ) { ReferenceBinding anInterface = itsInterfaces [ i ] ; if ( sourceType == anInterface ) { problemReporter ( ) . hierarchyCircularity ( sourceType , superType , reference ) ; sourceType . tagBits |= TagBits . HierarchyHasProblems ; superType . tagBits |= TagBits . HierarchyHasProblems ; return true ; } if ( anInterface . isParameterizedType ( ) ) anInterface = ( ( ParameterizedTypeBinding ) anInterface ) . genericType ( ) ; hasCycle |= detectHierarchyCycle ( sourceType , anInterface , reference ) ; if ( ( anInterface . tagBits & TagBits . HierarchyHasProblems ) != <NUM_LIT:0> ) { sourceType . tagBits |= TagBits . HierarchyHasProblems ; superType . tagBits |= TagBits . HierarchyHasProblems ; } } } return hasCycle ; } if ( superType . isHierarchyBeingActivelyConnected ( ) ) { org . eclipse . jdt . internal . compiler . ast . TypeReference ref = ( ( SourceTypeBinding ) superType ) . scope . superTypeReference ; if ( ref != null && ref . resolvedType != null && ( ( ReferenceBinding ) ref . resolvedType ) . isHierarchyBeingActivelyConnected ( ) ) { problemReporter ( ) . hierarchyCircularity ( sourceType , superType , reference ) ; sourceType . tagBits |= TagBits . HierarchyHasProblems ; superType . tagBits |= TagBits . HierarchyHasProblems ; return true ; } if ( ref != null && ref . resolvedType == null ) { char [ ] referredName = ref . getLastToken ( ) ; for ( Iterator iter = environment ( ) . typesBeingConnected . iterator ( ) ; iter . hasNext ( ) ; ) { SourceTypeBinding type = ( SourceTypeBinding ) iter . next ( ) ; if ( CharOperation . equals ( referredName , type . sourceName ( ) ) ) { problemReporter ( ) . hierarchyCircularity ( sourceType , superType , reference ) ; sourceType . tagBits |= TagBits . HierarchyHasProblems ; superType . tagBits |= TagBits . HierarchyHasProblems ; return true ; } } } } if ( ( superType . tagBits & TagBits . BeginHierarchyCheck ) == <NUM_LIT:0> ) ( ( SourceTypeBinding ) superType ) . scope . connectTypeHierarchyWithoutMembers ( ) ; if ( ( superType . tagBits & TagBits . HierarchyHasProblems ) != <NUM_LIT:0> ) sourceType . tagBits |= TagBits . HierarchyHasProblems ; return false ; } private ReferenceBinding findSupertype ( TypeReference typeReference ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; LookupEnvironment env = unitScope . environment ; try { env . missingClassFileLocation = typeReference ; typeReference . aboutToResolve ( this ) ; unitScope . recordQualifiedReference ( typeReference . getTypeName ( ) ) ; this . superTypeReference = typeReference ; ReferenceBinding superType = ( ReferenceBinding ) typeReference . resolveSuperType ( this ) ; return superType ; } catch ( AbortCompilation e ) { SourceTypeBinding sourceType = this . referenceContext . binding ; if ( sourceType . superInterfaces == null ) sourceType . superInterfaces = Binding . NO_SUPERINTERFACES ; e . updateContext ( typeReference , referenceCompilationUnit ( ) . compilationResult ) ; throw e ; } finally { env . missingClassFileLocation = null ; this . superTypeReference = null ; } } public ProblemReporter problemReporter ( ) { MethodScope outerMethodScope ; if ( ( outerMethodScope = outerMostMethodScope ( ) ) == null ) { ProblemReporter problemReporter = referenceCompilationUnit ( ) . problemReporter ; problemReporter . referenceContext = this . referenceContext ; return problemReporter ; } return outerMethodScope . problemReporter ( ) ; } public TypeDeclaration referenceType ( ) { return this . referenceContext ; } public String toString ( ) { if ( this . referenceContext != null ) return "<STR_LIT>" + this . referenceContext . binding . toString ( ) ; return "<STR_LIT>" ; } public MethodBinding [ ] getAnyExtraMethods ( char [ ] selector ) { return null ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . ImportReference ; public class ImportConflictBinding extends ImportBinding { public ReferenceBinding conflictingTypeBinding ; public ImportConflictBinding ( char [ ] [ ] compoundName , Binding methodBinding , ReferenceBinding conflictingTypeBinding , ImportReference reference ) { super ( compoundName , false , methodBinding , reference ) ; this . conflictingTypeBinding = conflictingTypeBinding ; } public char [ ] readableName ( ) { return CharOperation . concatWith ( this . compoundName , '<CHAR_LIT:.>' ) ; } public String toString ( ) { return "<STR_LIT>" + new String ( readableName ( ) ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; public class NestedTypeBinding extends SourceTypeBinding { public SourceTypeBinding enclosingType ; public SyntheticArgumentBinding [ ] enclosingInstances ; private ReferenceBinding [ ] enclosingTypes = Binding . UNINITIALIZED_REFERENCE_TYPES ; public SyntheticArgumentBinding [ ] outerLocalVariables ; private int outerLocalVariablesSlotSize = - <NUM_LIT:1> ; public NestedTypeBinding ( char [ ] [ ] typeName , ClassScope scope , SourceTypeBinding enclosingType ) { super ( typeName , enclosingType . fPackage , scope ) ; this . tagBits |= ( TagBits . IsNestedType | TagBits . ContainsNestedTypeReferences ) ; this . enclosingType = enclosingType ; } public SyntheticArgumentBinding addSyntheticArgument ( LocalVariableBinding actualOuterLocalVariable ) { SyntheticArgumentBinding synthLocal = null ; if ( this . outerLocalVariables == null ) { synthLocal = new SyntheticArgumentBinding ( actualOuterLocalVariable ) ; this . outerLocalVariables = new SyntheticArgumentBinding [ ] { synthLocal } ; } else { int size = this . outerLocalVariables . length ; int newArgIndex = size ; for ( int i = size ; -- i >= <NUM_LIT:0> ; ) { if ( this . outerLocalVariables [ i ] . actualOuterLocalVariable == actualOuterLocalVariable ) return this . outerLocalVariables [ i ] ; if ( this . outerLocalVariables [ i ] . id > actualOuterLocalVariable . id ) newArgIndex = i ; } SyntheticArgumentBinding [ ] synthLocals = new SyntheticArgumentBinding [ size + <NUM_LIT:1> ] ; System . arraycopy ( this . outerLocalVariables , <NUM_LIT:0> , synthLocals , <NUM_LIT:0> , newArgIndex ) ; synthLocals [ newArgIndex ] = synthLocal = new SyntheticArgumentBinding ( actualOuterLocalVariable ) ; System . arraycopy ( this . outerLocalVariables , newArgIndex , synthLocals , newArgIndex + <NUM_LIT:1> , size - newArgIndex ) ; this . outerLocalVariables = synthLocals ; } if ( this . scope . referenceCompilationUnit ( ) . isPropagatingInnerClassEmulation ) updateInnerEmulationDependents ( ) ; return synthLocal ; } public SyntheticArgumentBinding addSyntheticArgument ( ReferenceBinding targetEnclosingType ) { SyntheticArgumentBinding synthLocal = null ; if ( this . enclosingInstances == null ) { synthLocal = new SyntheticArgumentBinding ( targetEnclosingType ) ; this . enclosingInstances = new SyntheticArgumentBinding [ ] { synthLocal } ; } else { int size = this . enclosingInstances . length ; int newArgIndex = size ; for ( int i = size ; -- i >= <NUM_LIT:0> ; ) { if ( this . enclosingInstances [ i ] . type == targetEnclosingType ) return this . enclosingInstances [ i ] ; if ( enclosingType ( ) == targetEnclosingType ) newArgIndex = <NUM_LIT:0> ; } SyntheticArgumentBinding [ ] newInstances = new SyntheticArgumentBinding [ size + <NUM_LIT:1> ] ; System . arraycopy ( this . enclosingInstances , <NUM_LIT:0> , newInstances , newArgIndex == <NUM_LIT:0> ? <NUM_LIT:1> : <NUM_LIT:0> , size ) ; newInstances [ newArgIndex ] = synthLocal = new SyntheticArgumentBinding ( targetEnclosingType ) ; this . enclosingInstances = newInstances ; } if ( this . scope . referenceCompilationUnit ( ) . isPropagatingInnerClassEmulation ) updateInnerEmulationDependents ( ) ; return synthLocal ; } public SyntheticArgumentBinding addSyntheticArgumentAndField ( LocalVariableBinding actualOuterLocalVariable ) { SyntheticArgumentBinding synthLocal = addSyntheticArgument ( actualOuterLocalVariable ) ; if ( synthLocal == null ) return null ; if ( synthLocal . matchingField == null ) synthLocal . matchingField = addSyntheticFieldForInnerclass ( actualOuterLocalVariable ) ; return synthLocal ; } public SyntheticArgumentBinding addSyntheticArgumentAndField ( ReferenceBinding targetEnclosingType ) { SyntheticArgumentBinding synthLocal = addSyntheticArgument ( targetEnclosingType ) ; if ( synthLocal == null ) return null ; if ( synthLocal . matchingField == null ) synthLocal . matchingField = addSyntheticFieldForInnerclass ( targetEnclosingType ) ; return synthLocal ; } public ReferenceBinding enclosingType ( ) { return this . enclosingType ; } public int getEnclosingInstancesSlotSize ( ) { return this . enclosingInstances == null ? <NUM_LIT:0> : this . enclosingInstances . length ; } public int getOuterLocalVariablesSlotSize ( ) { if ( this . outerLocalVariablesSlotSize < <NUM_LIT:0> ) { this . outerLocalVariablesSlotSize = <NUM_LIT:0> ; int outerLocalsCount = this . outerLocalVariables == null ? <NUM_LIT:0> : this . outerLocalVariables . length ; for ( int i = <NUM_LIT:0> ; i < outerLocalsCount ; i ++ ) { SyntheticArgumentBinding argument = this . outerLocalVariables [ i ] ; switch ( argument . type . id ) { case TypeIds . T_long : case TypeIds . T_double : this . outerLocalVariablesSlotSize += <NUM_LIT:2> ; break ; default : this . outerLocalVariablesSlotSize ++ ; break ; } } } return this . outerLocalVariablesSlotSize ; } public SyntheticArgumentBinding getSyntheticArgument ( LocalVariableBinding actualOuterLocalVariable ) { if ( this . outerLocalVariables == null ) return null ; for ( int i = this . outerLocalVariables . length ; -- i >= <NUM_LIT:0> ; ) if ( this . outerLocalVariables [ i ] . actualOuterLocalVariable == actualOuterLocalVariable ) return this . outerLocalVariables [ i ] ; return null ; } public SyntheticArgumentBinding getSyntheticArgument ( ReferenceBinding targetEnclosingType , boolean onlyExactMatch ) { if ( this . enclosingInstances == null ) return null ; for ( int i = this . enclosingInstances . length ; -- i >= <NUM_LIT:0> ; ) if ( this . enclosingInstances [ i ] . type == targetEnclosingType ) if ( this . enclosingInstances [ i ] . actualOuterLocalVariable == null ) return this . enclosingInstances [ i ] ; if ( ! onlyExactMatch ) { for ( int i = this . enclosingInstances . length ; -- i >= <NUM_LIT:0> ; ) if ( this . enclosingInstances [ i ] . actualOuterLocalVariable == null ) if ( this . enclosingInstances [ i ] . type . findSuperTypeOriginatingFrom ( targetEnclosingType ) != null ) return this . enclosingInstances [ i ] ; } return null ; } public SyntheticArgumentBinding [ ] syntheticEnclosingInstances ( ) { return this . enclosingInstances ; } public ReferenceBinding [ ] syntheticEnclosingInstanceTypes ( ) { if ( this . enclosingTypes == UNINITIALIZED_REFERENCE_TYPES ) { if ( this . enclosingInstances == null ) { this . enclosingTypes = null ; } else { int length = this . enclosingInstances . length ; this . enclosingTypes = new ReferenceBinding [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { this . enclosingTypes [ i ] = ( ReferenceBinding ) this . enclosingInstances [ i ] . type ; } } } return this . enclosingTypes ; } public SyntheticArgumentBinding [ ] syntheticOuterLocalVariables ( ) { return this . outerLocalVariables ; } public void updateInnerEmulationDependents ( ) { } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; import java . lang . reflect . Field ; import org . eclipse . jdt . core . compiler . CharOperation ; public class ProblemReferenceBinding extends ReferenceBinding { ReferenceBinding closestMatch ; private int problemReason ; public ProblemReferenceBinding ( char [ ] [ ] compoundName , ReferenceBinding closestMatch , int problemReason ) { this . compoundName = compoundName ; this . closestMatch = closestMatch ; this . problemReason = problemReason ; } public TypeBinding closestMatch ( ) { return this . closestMatch ; } public ReferenceBinding closestReferenceMatch ( ) { return this . closestMatch ; } public int problemId ( ) { return this . problemReason ; } public static String problemReasonString ( int problemReason ) { try { Class reasons = ProblemReasons . class ; String simpleName = reasons . getName ( ) ; int lastDot = simpleName . lastIndexOf ( '<CHAR_LIT:.>' ) ; if ( lastDot >= <NUM_LIT:0> ) { simpleName = simpleName . substring ( lastDot + <NUM_LIT:1> ) ; } Field [ ] fields = reasons . getFields ( ) ; for ( int i = <NUM_LIT:0> , length = fields . length ; i < length ; i ++ ) { Field field = fields [ i ] ; if ( ! field . getType ( ) . equals ( int . class ) ) continue ; if ( field . getInt ( reasons ) == problemReason ) { return simpleName + '<CHAR_LIT:.>' + field . getName ( ) ; } } } catch ( IllegalAccessException e ) { } return "<STR_LIT:unknown>" ; } public char [ ] shortReadableName ( ) { return readableName ( ) ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( <NUM_LIT:10> ) ; buffer . append ( "<STR_LIT>" ) ; buffer . append ( this . compoundName == null ? "<STR_LIT>" : new String ( CharOperation . concatWith ( this . compoundName , '<CHAR_LIT:.>' ) ) ) ; buffer . append ( "<STR_LIT>" ) . append ( problemReasonString ( this . problemReason ) ) ; buffer . append ( "<STR_LIT>" ) ; buffer . append ( this . closestMatch == null ? "<STR_LIT>" : this . closestMatch . toString ( ) ) ; buffer . append ( "<STR_LIT:]>" ) ; return buffer . toString ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . impl . Constant ; public abstract class VariableBinding extends Binding { public int modifiers ; public TypeBinding type ; public char [ ] name ; protected Constant constant ; public int id ; public long tagBits ; public VariableBinding ( char [ ] name , TypeBinding type , int modifiers , Constant constant ) { this . name = name ; this . type = type ; this . modifiers = modifiers ; this . constant = constant ; if ( type != null ) { this . tagBits |= ( type . tagBits & TagBits . HasMissingType ) ; } } public Constant constant ( ) { return this . constant ; } public abstract AnnotationBinding [ ] getAnnotations ( ) ; public final boolean isBlankFinal ( ) { return ( this . modifiers & ExtraCompilerModifiers . AccBlankFinal ) != <NUM_LIT:0> ; } public final boolean isFinal ( ) { return ( this . modifiers & ClassFileConstants . AccFinal ) != <NUM_LIT:0> ; } public final boolean isEffectivelyFinal ( ) { return ( this . tagBits & TagBits . IsEffectivelyFinal ) != <NUM_LIT:0> ; } public char [ ] readableName ( ) { return this . name ; } public void setConstant ( Constant constant ) { this . constant = constant ; } public String toString ( ) { StringBuffer output = new StringBuffer ( <NUM_LIT:10> ) ; ASTNode . printModifiers ( this . modifiers , output ) ; if ( ( this . modifiers & ExtraCompilerModifiers . AccUnresolved ) != <NUM_LIT:0> ) { output . append ( "<STR_LIT>" ) ; } output . append ( this . type != null ? this . type . debugName ( ) : "<STR_LIT>" ) ; output . append ( "<STR_LIT:U+0020>" ) ; output . append ( ( this . name != null ) ? new String ( this . name ) : "<STR_LIT>" ) ; return output . toString ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; import java . util . List ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . Wildcard ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; public class WildcardBinding extends ReferenceBinding { public ReferenceBinding genericType ; public int rank ; public TypeBinding bound ; public TypeBinding [ ] otherBounds ; char [ ] genericSignature ; public int boundKind ; ReferenceBinding superclass ; ReferenceBinding [ ] superInterfaces ; TypeVariableBinding typeVariable ; LookupEnvironment environment ; public WildcardBinding ( ReferenceBinding genericType , int rank , TypeBinding bound , TypeBinding [ ] otherBounds , int boundKind , LookupEnvironment environment ) { this . rank = rank ; this . boundKind = boundKind ; this . modifiers = ClassFileConstants . AccPublic | ExtraCompilerModifiers . AccGenericSignature ; this . environment = environment ; initialize ( genericType , bound , otherBounds ) ; if ( genericType instanceof UnresolvedReferenceBinding ) ( ( UnresolvedReferenceBinding ) genericType ) . addWrapper ( this , environment ) ; if ( bound instanceof UnresolvedReferenceBinding ) ( ( UnresolvedReferenceBinding ) bound ) . addWrapper ( this , environment ) ; this . tagBits |= TagBits . HasUnresolvedTypeVariables ; } public int kind ( ) { return this . otherBounds == null ? Binding . WILDCARD_TYPE : Binding . INTERSECTION_TYPE ; } public boolean boundCheck ( TypeBinding argumentType ) { switch ( this . boundKind ) { case Wildcard . UNBOUND : return true ; case Wildcard . EXTENDS : if ( ! argumentType . isCompatibleWith ( this . bound ) ) return false ; for ( int i = <NUM_LIT:0> , length = this . otherBounds == null ? <NUM_LIT:0> : this . otherBounds . length ; i < length ; i ++ ) { if ( ! argumentType . isCompatibleWith ( this . otherBounds [ i ] ) ) return false ; } return true ; default : return argumentType . isCompatibleWith ( this . bound ) ; } } public boolean canBeInstantiated ( ) { return false ; } public List collectMissingTypes ( List missingTypes ) { if ( ( this . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { missingTypes = this . bound . collectMissingTypes ( missingTypes ) ; } return missingTypes ; } public void collectSubstitutes ( Scope scope , TypeBinding actualType , InferenceContext inferenceContext , int constraint ) { if ( ( this . tagBits & TagBits . HasTypeVariable ) == <NUM_LIT:0> ) return ; if ( actualType == TypeBinding . NULL ) return ; if ( actualType . isCapture ( ) ) { CaptureBinding capture = ( CaptureBinding ) actualType ; actualType = capture . wildcard ; } switch ( constraint ) { case TypeConstants . CONSTRAINT_EXTENDS : switch ( this . boundKind ) { case Wildcard . UNBOUND : break ; case Wildcard . EXTENDS : switch ( actualType . kind ( ) ) { case Binding . WILDCARD_TYPE : WildcardBinding actualWildcard = ( WildcardBinding ) actualType ; switch ( actualWildcard . boundKind ) { case Wildcard . UNBOUND : break ; case Wildcard . EXTENDS : this . bound . collectSubstitutes ( scope , actualWildcard . bound , inferenceContext , TypeConstants . CONSTRAINT_EXTENDS ) ; break ; case Wildcard . SUPER : break ; } break ; case Binding . INTERSECTION_TYPE : WildcardBinding actualIntersection = ( WildcardBinding ) actualType ; this . bound . collectSubstitutes ( scope , actualIntersection . bound , inferenceContext , TypeConstants . CONSTRAINT_EXTENDS ) ; for ( int i = <NUM_LIT:0> , length = actualIntersection . otherBounds . length ; i < length ; i ++ ) { this . bound . collectSubstitutes ( scope , actualIntersection . otherBounds [ i ] , inferenceContext , TypeConstants . CONSTRAINT_EXTENDS ) ; } break ; default : this . bound . collectSubstitutes ( scope , actualType , inferenceContext , TypeConstants . CONSTRAINT_EXTENDS ) ; break ; } break ; case Wildcard . SUPER : switch ( actualType . kind ( ) ) { case Binding . WILDCARD_TYPE : WildcardBinding actualWildcard = ( WildcardBinding ) actualType ; switch ( actualWildcard . boundKind ) { case Wildcard . UNBOUND : break ; case Wildcard . EXTENDS : break ; case Wildcard . SUPER : this . bound . collectSubstitutes ( scope , actualWildcard . bound , inferenceContext , TypeConstants . CONSTRAINT_SUPER ) ; for ( int i = <NUM_LIT:0> , length = actualWildcard . otherBounds == null ? <NUM_LIT:0> : actualWildcard . otherBounds . length ; i < length ; i ++ ) { this . bound . collectSubstitutes ( scope , actualWildcard . otherBounds [ i ] , inferenceContext , TypeConstants . CONSTRAINT_SUPER ) ; } break ; } break ; case Binding . INTERSECTION_TYPE : break ; default : this . bound . collectSubstitutes ( scope , actualType , inferenceContext , TypeConstants . CONSTRAINT_SUPER ) ; break ; } break ; } break ; case TypeConstants . CONSTRAINT_EQUAL : switch ( this . boundKind ) { case Wildcard . UNBOUND : break ; case Wildcard . EXTENDS : switch ( actualType . kind ( ) ) { case Binding . WILDCARD_TYPE : WildcardBinding actualWildcard = ( WildcardBinding ) actualType ; switch ( actualWildcard . boundKind ) { case Wildcard . UNBOUND : break ; case Wildcard . EXTENDS : this . bound . collectSubstitutes ( scope , actualWildcard . bound , inferenceContext , TypeConstants . CONSTRAINT_EQUAL ) ; for ( int i = <NUM_LIT:0> , length = actualWildcard . otherBounds == null ? <NUM_LIT:0> : actualWildcard . otherBounds . length ; i < length ; i ++ ) { this . bound . collectSubstitutes ( scope , actualWildcard . otherBounds [ i ] , inferenceContext , TypeConstants . CONSTRAINT_EQUAL ) ; } break ; case Wildcard . SUPER : break ; } break ; case Binding . INTERSECTION_TYPE : WildcardBinding actuaIntersection = ( WildcardBinding ) actualType ; this . bound . collectSubstitutes ( scope , actuaIntersection . bound , inferenceContext , TypeConstants . CONSTRAINT_EQUAL ) ; for ( int i = <NUM_LIT:0> , length = actuaIntersection . otherBounds == null ? <NUM_LIT:0> : actuaIntersection . otherBounds . length ; i < length ; i ++ ) { this . bound . collectSubstitutes ( scope , actuaIntersection . otherBounds [ i ] , inferenceContext , TypeConstants . CONSTRAINT_EQUAL ) ; } break ; default : break ; } break ; case Wildcard . SUPER : switch ( actualType . kind ( ) ) { case Binding . WILDCARD_TYPE : WildcardBinding actualWildcard = ( WildcardBinding ) actualType ; switch ( actualWildcard . boundKind ) { case Wildcard . UNBOUND : break ; case Wildcard . EXTENDS : break ; case Wildcard . SUPER : this . bound . collectSubstitutes ( scope , actualWildcard . bound , inferenceContext , TypeConstants . CONSTRAINT_EQUAL ) ; for ( int i = <NUM_LIT:0> , length = actualWildcard . otherBounds == null ? <NUM_LIT:0> : actualWildcard . otherBounds . length ; i < length ; i ++ ) { this . bound . collectSubstitutes ( scope , actualWildcard . otherBounds [ i ] , inferenceContext , TypeConstants . CONSTRAINT_EQUAL ) ; } break ; } break ; case Binding . INTERSECTION_TYPE : break ; default : break ; } break ; } break ; case TypeConstants . CONSTRAINT_SUPER : switch ( this . boundKind ) { case Wildcard . UNBOUND : break ; case Wildcard . EXTENDS : switch ( actualType . kind ( ) ) { case Binding . WILDCARD_TYPE : WildcardBinding actualWildcard = ( WildcardBinding ) actualType ; switch ( actualWildcard . boundKind ) { case Wildcard . UNBOUND : break ; case Wildcard . EXTENDS : this . bound . collectSubstitutes ( scope , actualWildcard . bound , inferenceContext , TypeConstants . CONSTRAINT_SUPER ) ; for ( int i = <NUM_LIT:0> , length = actualWildcard . otherBounds == null ? <NUM_LIT:0> : actualWildcard . otherBounds . length ; i < length ; i ++ ) { this . bound . collectSubstitutes ( scope , actualWildcard . otherBounds [ i ] , inferenceContext , TypeConstants . CONSTRAINT_SUPER ) ; } break ; case Wildcard . SUPER : break ; } break ; case Binding . INTERSECTION_TYPE : WildcardBinding actualIntersection = ( WildcardBinding ) actualType ; this . bound . collectSubstitutes ( scope , actualIntersection . bound , inferenceContext , TypeConstants . CONSTRAINT_SUPER ) ; for ( int i = <NUM_LIT:0> , length = actualIntersection . otherBounds == null ? <NUM_LIT:0> : actualIntersection . otherBounds . length ; i < length ; i ++ ) { this . bound . collectSubstitutes ( scope , actualIntersection . otherBounds [ i ] , inferenceContext , TypeConstants . CONSTRAINT_SUPER ) ; } break ; default : break ; } break ; case Wildcard . SUPER : switch ( actualType . kind ( ) ) { case Binding . WILDCARD_TYPE : WildcardBinding actualWildcard = ( WildcardBinding ) actualType ; switch ( actualWildcard . boundKind ) { case Wildcard . UNBOUND : break ; case Wildcard . EXTENDS : break ; case Wildcard . SUPER : this . bound . collectSubstitutes ( scope , actualWildcard . bound , inferenceContext , TypeConstants . CONSTRAINT_SUPER ) ; for ( int i = <NUM_LIT:0> , length = actualWildcard . otherBounds == null ? <NUM_LIT:0> : actualWildcard . otherBounds . length ; i < length ; i ++ ) { this . bound . collectSubstitutes ( scope , actualWildcard . otherBounds [ i ] , inferenceContext , TypeConstants . CONSTRAINT_SUPER ) ; } break ; } break ; case Binding . INTERSECTION_TYPE : break ; default : break ; } break ; } break ; } } public char [ ] computeUniqueKey ( boolean isLeaf ) { char [ ] genericTypeKey = this . genericType . computeUniqueKey ( false ) ; char [ ] wildCardKey ; char [ ] rankComponent = ( '<CHAR_LIT>' + String . valueOf ( this . rank ) + '<CHAR_LIT:}>' ) . toCharArray ( ) ; switch ( this . boundKind ) { case Wildcard . UNBOUND : wildCardKey = TypeConstants . WILDCARD_STAR ; break ; case Wildcard . EXTENDS : wildCardKey = CharOperation . concat ( TypeConstants . WILDCARD_PLUS , this . bound . computeUniqueKey ( false ) ) ; break ; default : wildCardKey = CharOperation . concat ( TypeConstants . WILDCARD_MINUS , this . bound . computeUniqueKey ( false ) ) ; break ; } return CharOperation . concat ( genericTypeKey , rankComponent , wildCardKey ) ; } public char [ ] constantPoolName ( ) { return erasure ( ) . constantPoolName ( ) ; } public String debugName ( ) { return toString ( ) ; } public TypeBinding erasure ( ) { if ( this . otherBounds == null ) { if ( this . boundKind == Wildcard . EXTENDS ) return this . bound . erasure ( ) ; TypeVariableBinding var = typeVariable ( ) ; if ( var != null ) return var . erasure ( ) ; return this . genericType ; } return this . bound . id == TypeIds . T_JavaLangObject ? this . otherBounds [ <NUM_LIT:0> ] . erasure ( ) : this . bound . erasure ( ) ; } public char [ ] genericTypeSignature ( ) { if ( this . genericSignature == null ) { switch ( this . boundKind ) { case Wildcard . UNBOUND : this . genericSignature = TypeConstants . WILDCARD_STAR ; break ; case Wildcard . EXTENDS : this . genericSignature = CharOperation . concat ( TypeConstants . WILDCARD_PLUS , this . bound . genericTypeSignature ( ) ) ; break ; default : this . genericSignature = CharOperation . concat ( TypeConstants . WILDCARD_MINUS , this . bound . genericTypeSignature ( ) ) ; } } return this . genericSignature ; } public int hashCode ( ) { return this . genericType . hashCode ( ) ; } void initialize ( ReferenceBinding someGenericType , TypeBinding someBound , TypeBinding [ ] someOtherBounds ) { this . genericType = someGenericType ; this . bound = someBound ; this . otherBounds = someOtherBounds ; if ( someGenericType != null ) { this . fPackage = someGenericType . getPackage ( ) ; } if ( someBound != null ) { this . tagBits |= someBound . tagBits & ( TagBits . HasTypeVariable | TagBits . HasMissingType | TagBits . ContainsNestedTypeReferences ) ; } if ( someOtherBounds != null ) { for ( int i = <NUM_LIT:0> , max = someOtherBounds . length ; i < max ; i ++ ) { TypeBinding someOtherBound = someOtherBounds [ i ] ; this . tagBits |= someOtherBound . tagBits & TagBits . ContainsNestedTypeReferences ; } } } public boolean isSuperclassOf ( ReferenceBinding otherType ) { if ( this . boundKind == Wildcard . SUPER ) { if ( this . bound instanceof ReferenceBinding ) { return ( ( ReferenceBinding ) this . bound ) . isSuperclassOf ( otherType ) ; } else { return otherType . id == TypeIds . T_JavaLangObject ; } } return false ; } public boolean isIntersectionType ( ) { return this . otherBounds != null ; } public boolean isHierarchyConnected ( ) { return this . superclass != null && this . superInterfaces != null ; } public boolean isUnboundWildcard ( ) { return this . boundKind == Wildcard . UNBOUND ; } public boolean isWildcard ( ) { return true ; } public char [ ] readableName ( ) { switch ( this . boundKind ) { case Wildcard . UNBOUND : return TypeConstants . WILDCARD_NAME ; case Wildcard . EXTENDS : if ( this . otherBounds == null ) return CharOperation . concat ( TypeConstants . WILDCARD_NAME , TypeConstants . WILDCARD_EXTENDS , this . bound . readableName ( ) ) ; StringBuffer buffer = new StringBuffer ( <NUM_LIT:10> ) ; buffer . append ( this . bound . readableName ( ) ) ; for ( int i = <NUM_LIT:0> , length = this . otherBounds . length ; i < length ; i ++ ) { buffer . append ( '<CHAR_LIT>' ) . append ( this . otherBounds [ i ] . readableName ( ) ) ; } int length ; char [ ] result = new char [ length = buffer . length ( ) ] ; buffer . getChars ( <NUM_LIT:0> , length , result , <NUM_LIT:0> ) ; return result ; default : return CharOperation . concat ( TypeConstants . WILDCARD_NAME , TypeConstants . WILDCARD_SUPER , this . bound . readableName ( ) ) ; } } ReferenceBinding resolve ( ) { if ( ( this . tagBits & TagBits . HasUnresolvedTypeVariables ) == <NUM_LIT:0> ) return this ; this . tagBits &= ~ TagBits . HasUnresolvedTypeVariables ; BinaryTypeBinding . resolveType ( this . genericType , this . environment , false ) ; switch ( this . boundKind ) { case Wildcard . EXTENDS : TypeBinding resolveType = BinaryTypeBinding . resolveType ( this . bound , this . environment , true ) ; this . bound = resolveType ; this . tagBits |= resolveType . tagBits & TagBits . ContainsNestedTypeReferences ; for ( int i = <NUM_LIT:0> , length = this . otherBounds == null ? <NUM_LIT:0> : this . otherBounds . length ; i < length ; i ++ ) { resolveType = BinaryTypeBinding . resolveType ( this . otherBounds [ i ] , this . environment , true ) ; this . otherBounds [ i ] = resolveType ; this . tagBits |= resolveType . tagBits & TagBits . ContainsNestedTypeReferences ; } break ; case Wildcard . SUPER : resolveType = BinaryTypeBinding . resolveType ( this . bound , this . environment , true ) ; this . bound = resolveType ; this . tagBits |= resolveType . tagBits & TagBits . ContainsNestedTypeReferences ; break ; case Wildcard . UNBOUND : } return this ; } public char [ ] shortReadableName ( ) { switch ( this . boundKind ) { case Wildcard . UNBOUND : return TypeConstants . WILDCARD_NAME ; case Wildcard . EXTENDS : if ( this . otherBounds == null ) return CharOperation . concat ( TypeConstants . WILDCARD_NAME , TypeConstants . WILDCARD_EXTENDS , this . bound . shortReadableName ( ) ) ; StringBuffer buffer = new StringBuffer ( <NUM_LIT:10> ) ; buffer . append ( this . bound . shortReadableName ( ) ) ; for ( int i = <NUM_LIT:0> , length = this . otherBounds . length ; i < length ; i ++ ) { buffer . append ( '<CHAR_LIT>' ) . append ( this . otherBounds [ i ] . shortReadableName ( ) ) ; } int length ; char [ ] result = new char [ length = buffer . length ( ) ] ; buffer . getChars ( <NUM_LIT:0> , length , result , <NUM_LIT:0> ) ; return result ; default : return CharOperation . concat ( TypeConstants . WILDCARD_NAME , TypeConstants . WILDCARD_SUPER , this . bound . shortReadableName ( ) ) ; } } public char [ ] signature ( ) { if ( this . signature == null ) { switch ( this . boundKind ) { case Wildcard . EXTENDS : return this . bound . signature ( ) ; default : return typeVariable ( ) . signature ( ) ; } } return this . signature ; } public char [ ] sourceName ( ) { switch ( this . boundKind ) { case Wildcard . UNBOUND : return TypeConstants . WILDCARD_NAME ; case Wildcard . EXTENDS : return CharOperation . concat ( TypeConstants . WILDCARD_NAME , TypeConstants . WILDCARD_EXTENDS , this . bound . sourceName ( ) ) ; default : return CharOperation . concat ( TypeConstants . WILDCARD_NAME , TypeConstants . WILDCARD_SUPER , this . bound . sourceName ( ) ) ; } } public ReferenceBinding superclass ( ) { if ( this . superclass == null ) { TypeBinding superType = null ; if ( this . boundKind == Wildcard . EXTENDS && ! this . bound . isInterface ( ) ) { superType = this . bound ; } else { TypeVariableBinding variable = typeVariable ( ) ; if ( variable != null ) superType = variable . firstBound ; } this . superclass = superType instanceof ReferenceBinding && ! superType . isInterface ( ) ? ( ReferenceBinding ) superType : this . environment . getResolvedType ( TypeConstants . JAVA_LANG_OBJECT , null ) ; } return this . superclass ; } public ReferenceBinding [ ] superInterfaces ( ) { if ( this . superInterfaces == null ) { if ( typeVariable ( ) != null ) { this . superInterfaces = this . typeVariable . superInterfaces ( ) ; } else { this . superInterfaces = Binding . NO_SUPERINTERFACES ; } if ( this . boundKind == Wildcard . EXTENDS ) { if ( this . bound . isInterface ( ) ) { int length = this . superInterfaces . length ; System . arraycopy ( this . superInterfaces , <NUM_LIT:0> , this . superInterfaces = new ReferenceBinding [ length + <NUM_LIT:1> ] , <NUM_LIT:1> , length ) ; this . superInterfaces [ <NUM_LIT:0> ] = ( ReferenceBinding ) this . bound ; } if ( this . otherBounds != null ) { int length = this . superInterfaces . length ; int otherLength = this . otherBounds . length ; System . arraycopy ( this . superInterfaces , <NUM_LIT:0> , this . superInterfaces = new ReferenceBinding [ length + otherLength ] , <NUM_LIT:0> , length ) ; for ( int i = <NUM_LIT:0> ; i < otherLength ; i ++ ) { this . superInterfaces [ length + i ] = ( ReferenceBinding ) this . otherBounds [ i ] ; } } } } return this . superInterfaces ; } public void swapUnresolved ( UnresolvedReferenceBinding unresolvedType , ReferenceBinding resolvedType , LookupEnvironment env ) { boolean affected = false ; if ( this . genericType == unresolvedType ) { this . genericType = resolvedType ; affected = true ; } if ( this . bound == unresolvedType ) { this . bound = env . convertUnresolvedBinaryToRawType ( resolvedType ) ; affected = true ; } if ( this . otherBounds != null ) { for ( int i = <NUM_LIT:0> , length = this . otherBounds . length ; i < length ; i ++ ) { if ( this . otherBounds [ i ] == unresolvedType ) { this . otherBounds [ i ] = env . convertUnresolvedBinaryToRawType ( resolvedType ) ; affected = true ; } } } if ( affected ) initialize ( this . genericType , this . bound , this . otherBounds ) ; } public String toString ( ) { switch ( this . boundKind ) { case Wildcard . UNBOUND : return new String ( TypeConstants . WILDCARD_NAME ) ; case Wildcard . EXTENDS : if ( this . otherBounds == null ) return new String ( CharOperation . concat ( TypeConstants . WILDCARD_NAME , TypeConstants . WILDCARD_EXTENDS , this . bound . debugName ( ) . toCharArray ( ) ) ) ; StringBuffer buffer = new StringBuffer ( this . bound . debugName ( ) ) ; for ( int i = <NUM_LIT:0> , length = this . otherBounds . length ; i < length ; i ++ ) { buffer . append ( '<CHAR_LIT>' ) . append ( this . otherBounds [ i ] . debugName ( ) ) ; } return buffer . toString ( ) ; default : return new String ( CharOperation . concat ( TypeConstants . WILDCARD_NAME , TypeConstants . WILDCARD_SUPER , this . bound . debugName ( ) . toCharArray ( ) ) ) ; } } public TypeVariableBinding typeVariable ( ) { if ( this . typeVariable == null ) { TypeVariableBinding [ ] typeVariables = this . genericType . typeVariables ( ) ; if ( this . rank < typeVariables . length ) this . typeVariable = typeVariables [ this . rank ] ; } return this . typeVariable ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; public class RawTypeBinding extends ParameterizedTypeBinding { public RawTypeBinding ( ReferenceBinding type , ReferenceBinding enclosingType , LookupEnvironment environment ) { super ( type , null , enclosingType , environment ) ; this . tagBits &= ~ TagBits . HasMissingType ; if ( ( type . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { if ( type instanceof MissingTypeBinding ) { this . tagBits |= TagBits . HasMissingType ; } else if ( type instanceof ParameterizedTypeBinding ) { ParameterizedTypeBinding parameterizedTypeBinding = ( ParameterizedTypeBinding ) type ; if ( parameterizedTypeBinding . genericType ( ) instanceof MissingTypeBinding ) { this . tagBits |= TagBits . HasMissingType ; } } } if ( enclosingType != null && ( enclosingType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { if ( enclosingType instanceof MissingTypeBinding ) { this . tagBits |= TagBits . HasMissingType ; } else if ( enclosingType instanceof ParameterizedTypeBinding ) { ParameterizedTypeBinding parameterizedTypeBinding = ( ParameterizedTypeBinding ) enclosingType ; if ( parameterizedTypeBinding . genericType ( ) instanceof MissingTypeBinding ) { this . tagBits |= TagBits . HasMissingType ; } } } if ( enclosingType == null || ( enclosingType . modifiers & ExtraCompilerModifiers . AccGenericSignature ) == <NUM_LIT:0> ) { this . modifiers &= ~ ExtraCompilerModifiers . AccGenericSignature ; } } public char [ ] computeUniqueKey ( boolean isLeaf ) { StringBuffer sig = new StringBuffer ( <NUM_LIT:10> ) ; if ( isMemberType ( ) && enclosingType ( ) . isParameterizedType ( ) ) { char [ ] typeSig = enclosingType ( ) . computeUniqueKey ( false ) ; sig . append ( typeSig , <NUM_LIT:0> , typeSig . length - <NUM_LIT:1> ) ; sig . append ( '<CHAR_LIT:.>' ) . append ( sourceName ( ) ) . append ( '<CHAR_LIT>' ) . append ( '<CHAR_LIT:>>' ) . append ( '<CHAR_LIT:;>' ) ; } else { sig . append ( genericType ( ) . computeUniqueKey ( false ) ) ; sig . insert ( sig . length ( ) - <NUM_LIT:1> , "<STR_LIT>" ) ; } int sigLength = sig . length ( ) ; char [ ] uniqueKey = new char [ sigLength ] ; sig . getChars ( <NUM_LIT:0> , sigLength , uniqueKey , <NUM_LIT:0> ) ; return uniqueKey ; } public ParameterizedMethodBinding createParameterizedMethod ( MethodBinding originalMethod ) { if ( originalMethod . typeVariables == Binding . NO_TYPE_VARIABLES || originalMethod . isStatic ( ) ) { return super . createParameterizedMethod ( originalMethod ) ; } return this . environment . createParameterizedGenericMethod ( originalMethod , this ) ; } public int kind ( ) { return RAW_TYPE ; } public String debugName ( ) { StringBuffer nameBuffer = new StringBuffer ( <NUM_LIT:10> ) ; nameBuffer . append ( actualType ( ) . sourceName ( ) ) . append ( "<STR_LIT>" ) ; return nameBuffer . toString ( ) ; } public char [ ] genericTypeSignature ( ) { if ( this . genericTypeSignature == null ) { if ( ( this . modifiers & ExtraCompilerModifiers . AccGenericSignature ) == <NUM_LIT:0> ) { this . genericTypeSignature = genericType ( ) . signature ( ) ; } else { StringBuffer sig = new StringBuffer ( <NUM_LIT:10> ) ; if ( isMemberType ( ) ) { ReferenceBinding enclosing = enclosingType ( ) ; char [ ] typeSig = enclosing . genericTypeSignature ( ) ; sig . append ( typeSig , <NUM_LIT:0> , typeSig . length - <NUM_LIT:1> ) ; if ( ( enclosing . modifiers & ExtraCompilerModifiers . AccGenericSignature ) != <NUM_LIT:0> ) { sig . append ( '<CHAR_LIT:.>' ) ; } else { sig . append ( '<CHAR_LIT>' ) ; } sig . append ( sourceName ( ) ) ; } else { char [ ] typeSig = genericType ( ) . signature ( ) ; sig . append ( typeSig , <NUM_LIT:0> , typeSig . length - <NUM_LIT:1> ) ; } sig . append ( '<CHAR_LIT:;>' ) ; int sigLength = sig . length ( ) ; this . genericTypeSignature = new char [ sigLength ] ; sig . getChars ( <NUM_LIT:0> , sigLength , this . genericTypeSignature , <NUM_LIT:0> ) ; } } return this . genericTypeSignature ; } public boolean isEquivalentTo ( TypeBinding otherType ) { if ( this == otherType || erasure ( ) == otherType ) return true ; if ( otherType == null ) return false ; switch ( otherType . kind ( ) ) { case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : return ( ( WildcardBinding ) otherType ) . boundCheck ( this ) ; case Binding . GENERIC_TYPE : case Binding . PARAMETERIZED_TYPE : case Binding . RAW_TYPE : return erasure ( ) == otherType . erasure ( ) ; } return false ; } public boolean isProvablyDistinct ( TypeBinding otherType ) { if ( this == otherType || erasure ( ) == otherType ) return false ; if ( otherType == null ) return true ; switch ( otherType . kind ( ) ) { case Binding . GENERIC_TYPE : case Binding . PARAMETERIZED_TYPE : case Binding . RAW_TYPE : return erasure ( ) != otherType . erasure ( ) ; } return true ; } protected void initializeArguments ( ) { TypeVariableBinding [ ] typeVariables = genericType ( ) . typeVariables ( ) ; int length = typeVariables . length ; TypeBinding [ ] typeArguments = new TypeBinding [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { typeArguments [ i ] = this . environment . convertToRawType ( typeVariables [ i ] . erasure ( ) , false ) ; } this . arguments = typeArguments ; } public char [ ] readableName ( ) { char [ ] readableName ; if ( isMemberType ( ) ) { readableName = CharOperation . concat ( enclosingType ( ) . readableName ( ) , this . sourceName , '<CHAR_LIT:.>' ) ; } else { readableName = CharOperation . concatWith ( actualType ( ) . compoundName , '<CHAR_LIT:.>' ) ; } return readableName ; } public char [ ] shortReadableName ( ) { char [ ] shortReadableName ; if ( isMemberType ( ) ) { shortReadableName = CharOperation . concat ( enclosingType ( ) . shortReadableName ( ) , this . sourceName , '<CHAR_LIT:.>' ) ; } else { shortReadableName = actualType ( ) . sourceName ; } return shortReadableName ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . ast . * ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . problem . ProblemReporter ; import org . eclipse . jdt . internal . compiler . util . HashtableOfObject ; import org . eclipse . jdt . internal . compiler . util . SimpleSet ; public class MethodVerifier { SourceTypeBinding type ; HashtableOfObject inheritedMethods ; HashtableOfObject currentMethods ; LookupEnvironment environment ; private boolean allowCompatibleReturnTypes ; MethodVerifier ( LookupEnvironment environment ) { this . type = null ; this . inheritedMethods = null ; this . currentMethods = null ; this . environment = environment ; this . allowCompatibleReturnTypes = environment . globalOptions . complianceLevel >= ClassFileConstants . JDK1_5 && environment . globalOptions . sourceLevel < ClassFileConstants . JDK1_5 ; } boolean areMethodsCompatible ( MethodBinding one , MethodBinding two ) { return isParameterSubsignature ( one , two ) && areReturnTypesCompatible ( one , two ) ; } boolean areParametersEqual ( MethodBinding one , MethodBinding two ) { TypeBinding [ ] oneArgs = one . parameters ; TypeBinding [ ] twoArgs = two . parameters ; if ( oneArgs == twoArgs ) return true ; int length = oneArgs . length ; if ( length != twoArgs . length ) return false ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) if ( ! areTypesEqual ( oneArgs [ i ] , twoArgs [ i ] ) ) return false ; return true ; } boolean areReturnTypesCompatible ( MethodBinding one , MethodBinding two ) { if ( one . returnType == two . returnType ) return true ; if ( areTypesEqual ( one . returnType , two . returnType ) ) return true ; if ( this . allowCompatibleReturnTypes && one . declaringClass instanceof BinaryTypeBinding && two . declaringClass instanceof BinaryTypeBinding ) { return areReturnTypesCompatible0 ( one , two ) ; } return false ; } boolean areReturnTypesCompatible0 ( MethodBinding one , MethodBinding two ) { if ( one . returnType . isBaseType ( ) ) return false ; if ( ! one . declaringClass . isInterface ( ) && one . declaringClass . id == TypeIds . T_JavaLangObject ) return two . returnType . isCompatibleWith ( one . returnType ) ; return one . returnType . isCompatibleWith ( two . returnType ) ; } boolean areTypesEqual ( TypeBinding one , TypeBinding two ) { if ( one == two ) return true ; if ( one instanceof UnresolvedReferenceBinding ) return ( ( UnresolvedReferenceBinding ) one ) . resolvedType == two ; if ( two instanceof UnresolvedReferenceBinding ) return ( ( UnresolvedReferenceBinding ) two ) . resolvedType == one ; return false ; } boolean canSkipInheritedMethods ( ) { if ( this . type . superclass ( ) != null && this . type . superclass ( ) . isAbstract ( ) ) return false ; return this . type . superInterfaces ( ) == Binding . NO_SUPERINTERFACES ; } boolean canSkipInheritedMethods ( MethodBinding one , MethodBinding two ) { return two == null || one . declaringClass == two . declaringClass ; } void checkAbstractMethod ( MethodBinding abstractMethod ) { if ( mustImplementAbstractMethod ( abstractMethod . declaringClass ) ) { TypeDeclaration typeDeclaration = this . type . scope . referenceContext ; if ( typeDeclaration != null ) { MethodDeclaration missingAbstractMethod = typeDeclaration . addMissingAbstractMethodFor ( abstractMethod ) ; missingAbstractMethod . scope . problemReporter ( ) . abstractMethodMustBeImplemented ( this . type , abstractMethod ) ; } else { problemReporter ( ) . abstractMethodMustBeImplemented ( this . type , abstractMethod ) ; } } } void checkAgainstInheritedMethods ( MethodBinding currentMethod , MethodBinding [ ] methods , int length , MethodBinding [ ] allInheritedMethods ) { if ( this . type . isAnnotationType ( ) ) { problemReporter ( ) . annotationCannotOverrideMethod ( currentMethod , methods [ length - <NUM_LIT:1> ] ) ; return ; } CompilerOptions options = this . type . scope . compilerOptions ( ) ; int [ ] overriddenInheritedMethods = length > <NUM_LIT:1> ? findOverriddenInheritedMethods ( methods , length ) : null ; nextMethod : for ( int i = length ; -- i >= <NUM_LIT:0> ; ) { MethodBinding inheritedMethod = methods [ i ] ; if ( overriddenInheritedMethods == null || overriddenInheritedMethods [ i ] == <NUM_LIT:0> ) { if ( currentMethod . isStatic ( ) != inheritedMethod . isStatic ( ) ) { problemReporter ( currentMethod ) . staticAndInstanceConflict ( currentMethod , inheritedMethod ) ; continue nextMethod ; } if ( inheritedMethod . isAbstract ( ) ) { if ( inheritedMethod . declaringClass . isInterface ( ) ) { currentMethod . modifiers |= ExtraCompilerModifiers . AccImplementing ; } else { currentMethod . modifiers |= ExtraCompilerModifiers . AccImplementing | ExtraCompilerModifiers . AccOverriding ; } } else if ( inheritedMethod . isPublic ( ) || ! this . type . isInterface ( ) ) { currentMethod . modifiers |= ExtraCompilerModifiers . AccOverriding ; } if ( ! areReturnTypesCompatible ( currentMethod , inheritedMethod ) && ( currentMethod . returnType . tagBits & TagBits . HasMissingType ) == <NUM_LIT:0> ) { if ( reportIncompatibleReturnTypeError ( currentMethod , inheritedMethod ) ) continue nextMethod ; } reportRawReferences ( currentMethod , inheritedMethod ) ; if ( currentMethod . thrownExceptions != Binding . NO_EXCEPTIONS ) checkExceptions ( currentMethod , inheritedMethod ) ; if ( inheritedMethod . isFinal ( ) ) problemReporter ( currentMethod ) . finalMethodCannotBeOverridden ( currentMethod , inheritedMethod ) ; if ( ! isAsVisible ( currentMethod , inheritedMethod ) ) problemReporter ( currentMethod ) . visibilityConflict ( currentMethod , inheritedMethod ) ; if ( inheritedMethod . isSynchronized ( ) && ! currentMethod . isSynchronized ( ) ) { problemReporter ( currentMethod ) . missingSynchronizedOnInheritedMethod ( currentMethod , inheritedMethod ) ; } if ( options . reportDeprecationWhenOverridingDeprecatedMethod && inheritedMethod . isViewedAsDeprecated ( ) ) { if ( ! currentMethod . isViewedAsDeprecated ( ) || options . reportDeprecationInsideDeprecatedCode ) { ReferenceBinding declaringClass = inheritedMethod . declaringClass ; if ( declaringClass . isInterface ( ) ) for ( int j = length ; -- j >= <NUM_LIT:0> ; ) if ( i != j && methods [ j ] . declaringClass . implementsInterface ( declaringClass , false ) ) continue nextMethod ; problemReporter ( currentMethod ) . overridesDeprecatedMethod ( currentMethod , inheritedMethod ) ; } } } checkForBridgeMethod ( currentMethod , inheritedMethod , allInheritedMethods ) ; } } public void reportRawReferences ( MethodBinding currentMethod , MethodBinding inheritedMethod ) { } void checkConcreteInheritedMethod ( MethodBinding concreteMethod , MethodBinding [ ] abstractMethods ) { if ( concreteMethod . isStatic ( ) ) problemReporter ( ) . staticInheritedMethodConflicts ( this . type , concreteMethod , abstractMethods ) ; if ( ! concreteMethod . isPublic ( ) ) { int index = <NUM_LIT:0> , length = abstractMethods . length ; if ( concreteMethod . isProtected ( ) ) { for ( ; index < length ; index ++ ) if ( abstractMethods [ index ] . isPublic ( ) ) break ; } else if ( concreteMethod . isDefault ( ) ) { for ( ; index < length ; index ++ ) if ( ! abstractMethods [ index ] . isDefault ( ) ) break ; } if ( index < length ) problemReporter ( ) . inheritedMethodReducesVisibility ( this . type , concreteMethod , abstractMethods ) ; } if ( concreteMethod . thrownExceptions != Binding . NO_EXCEPTIONS ) for ( int i = abstractMethods . length ; -- i >= <NUM_LIT:0> ; ) checkExceptions ( concreteMethod , abstractMethods [ i ] ) ; if ( concreteMethod . isOrEnclosedByPrivateType ( ) ) concreteMethod . original ( ) . modifiers |= ExtraCompilerModifiers . AccLocallyUsed ; } void checkExceptions ( MethodBinding newMethod , MethodBinding inheritedMethod ) { ReferenceBinding [ ] newExceptions = resolvedExceptionTypesFor ( newMethod ) ; ReferenceBinding [ ] inheritedExceptions = resolvedExceptionTypesFor ( inheritedMethod ) ; for ( int i = newExceptions . length ; -- i >= <NUM_LIT:0> ; ) { ReferenceBinding newException = newExceptions [ i ] ; int j = inheritedExceptions . length ; while ( -- j > - <NUM_LIT:1> && ! isSameClassOrSubclassOf ( newException , inheritedExceptions [ j ] ) ) { } if ( j == - <NUM_LIT:1> ) if ( ! newException . isUncheckedException ( false ) && ( newException . tagBits & TagBits . HasMissingType ) == <NUM_LIT:0> ) { problemReporter ( newMethod ) . incompatibleExceptionInThrowsClause ( this . type , newMethod , inheritedMethod , newException ) ; } } } void checkForBridgeMethod ( MethodBinding currentMethod , MethodBinding inheritedMethod , MethodBinding [ ] allInheritedMethods ) { } void checkForMissingHashCodeMethod ( ) { MethodBinding [ ] choices = this . type . getMethods ( TypeConstants . EQUALS ) ; boolean overridesEquals = false ; for ( int i = choices . length ; ! overridesEquals && -- i >= <NUM_LIT:0> ; ) overridesEquals = choices [ i ] . parameters . length == <NUM_LIT:1> && choices [ i ] . parameters [ <NUM_LIT:0> ] . id == TypeIds . T_JavaLangObject ; if ( overridesEquals ) { MethodBinding hashCodeMethod = this . type . getExactMethod ( TypeConstants . HASHCODE , Binding . NO_PARAMETERS , null ) ; if ( hashCodeMethod != null && hashCodeMethod . declaringClass . id == TypeIds . T_JavaLangObject ) this . problemReporter ( ) . shouldImplementHashcode ( this . type ) ; } } void checkForRedundantSuperinterfaces ( ReferenceBinding superclass , ReferenceBinding [ ] superInterfaces ) { if ( superInterfaces == Binding . NO_SUPERINTERFACES ) return ; SimpleSet interfacesToCheck = new SimpleSet ( superInterfaces . length ) ; SimpleSet redundantInterfaces = null ; for ( int i = <NUM_LIT:0> , l = superInterfaces . length ; i < l ; i ++ ) { ReferenceBinding toCheck = superInterfaces [ i ] ; for ( int j = <NUM_LIT:0> ; j < l ; j ++ ) { ReferenceBinding implementedInterface = superInterfaces [ j ] ; if ( i != j && toCheck . implementsInterface ( implementedInterface , true ) ) { if ( redundantInterfaces == null ) { redundantInterfaces = new SimpleSet ( <NUM_LIT:3> ) ; } else if ( redundantInterfaces . includes ( implementedInterface ) ) { continue ; } redundantInterfaces . add ( implementedInterface ) ; TypeReference [ ] refs = this . type . scope . referenceContext . superInterfaces ; for ( int r = <NUM_LIT:0> , rl = refs . length ; r < rl ; r ++ ) { if ( refs [ r ] . resolvedType == toCheck ) { problemReporter ( ) . redundantSuperInterface ( this . type , refs [ j ] , implementedInterface , toCheck ) ; break ; } } } } interfacesToCheck . add ( toCheck ) ; } ReferenceBinding [ ] itsInterfaces = null ; SimpleSet inheritedInterfaces = new SimpleSet ( <NUM_LIT:5> ) ; ReferenceBinding superType = superclass ; while ( superType != null && superType . isValidBinding ( ) ) { if ( ( itsInterfaces = superType . superInterfaces ( ) ) != Binding . NO_SUPERINTERFACES ) { for ( int i = <NUM_LIT:0> , l = itsInterfaces . length ; i < l ; i ++ ) { ReferenceBinding inheritedInterface = itsInterfaces [ i ] ; if ( ! inheritedInterfaces . includes ( inheritedInterface ) && inheritedInterface . isValidBinding ( ) ) { if ( interfacesToCheck . includes ( inheritedInterface ) ) { if ( redundantInterfaces == null ) { redundantInterfaces = new SimpleSet ( <NUM_LIT:3> ) ; } else if ( redundantInterfaces . includes ( inheritedInterface ) ) { continue ; } redundantInterfaces . add ( inheritedInterface ) ; TypeReference [ ] refs = this . type . scope . referenceContext . superInterfaces ; for ( int r = <NUM_LIT:0> , rl = refs . length ; r < rl ; r ++ ) { if ( refs [ r ] . resolvedType == inheritedInterface ) { problemReporter ( ) . redundantSuperInterface ( this . type , refs [ r ] , inheritedInterface , superType ) ; break ; } } } else { inheritedInterfaces . add ( inheritedInterface ) ; } } } } superType = superType . superclass ( ) ; } int nextPosition = inheritedInterfaces . elementSize ; if ( nextPosition == <NUM_LIT:0> ) return ; ReferenceBinding [ ] interfacesToVisit = new ReferenceBinding [ nextPosition ] ; inheritedInterfaces . asArray ( interfacesToVisit ) ; for ( int i = <NUM_LIT:0> ; i < nextPosition ; i ++ ) { superType = interfacesToVisit [ i ] ; if ( ( itsInterfaces = superType . superInterfaces ( ) ) != Binding . NO_SUPERINTERFACES ) { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding inheritedInterface = itsInterfaces [ a ] ; if ( ! inheritedInterfaces . includes ( inheritedInterface ) && inheritedInterface . isValidBinding ( ) ) { if ( interfacesToCheck . includes ( inheritedInterface ) ) { if ( redundantInterfaces == null ) { redundantInterfaces = new SimpleSet ( <NUM_LIT:3> ) ; } else if ( redundantInterfaces . includes ( inheritedInterface ) ) { continue ; } redundantInterfaces . add ( inheritedInterface ) ; TypeReference [ ] refs = this . type . scope . referenceContext . superInterfaces ; for ( int r = <NUM_LIT:0> , rl = refs . length ; r < rl ; r ++ ) { if ( refs [ r ] . resolvedType == inheritedInterface ) { problemReporter ( ) . redundantSuperInterface ( this . type , refs [ r ] , inheritedInterface , superType ) ; break ; } } } else { inheritedInterfaces . add ( inheritedInterface ) ; interfacesToVisit [ nextPosition ++ ] = inheritedInterface ; } } } } } } void checkInheritedMethods ( MethodBinding [ ] methods , int length ) { MethodBinding concreteMethod = this . type . isInterface ( ) || methods [ <NUM_LIT:0> ] . isAbstract ( ) ? null : methods [ <NUM_LIT:0> ] ; if ( concreteMethod == null ) { MethodBinding bestAbstractMethod = length == <NUM_LIT:1> ? methods [ <NUM_LIT:0> ] : findBestInheritedAbstractMethod ( methods , length ) ; boolean noMatch = bestAbstractMethod == null ; if ( noMatch ) bestAbstractMethod = methods [ <NUM_LIT:0> ] ; if ( mustImplementAbstractMethod ( bestAbstractMethod . declaringClass ) ) { TypeDeclaration typeDeclaration = this . type . scope . referenceContext ; MethodBinding superclassAbstractMethod = methods [ <NUM_LIT:0> ] ; if ( superclassAbstractMethod == bestAbstractMethod || superclassAbstractMethod . declaringClass . isInterface ( ) ) { if ( typeDeclaration != null ) { MethodDeclaration missingAbstractMethod = typeDeclaration . addMissingAbstractMethodFor ( bestAbstractMethod ) ; missingAbstractMethod . scope . problemReporter ( ) . abstractMethodMustBeImplemented ( this . type , bestAbstractMethod ) ; } else { problemReporter ( ) . abstractMethodMustBeImplemented ( this . type , bestAbstractMethod ) ; } } else { if ( typeDeclaration != null ) { MethodDeclaration missingAbstractMethod = typeDeclaration . addMissingAbstractMethodFor ( bestAbstractMethod ) ; missingAbstractMethod . scope . problemReporter ( ) . abstractMethodMustBeImplemented ( this . type , bestAbstractMethod , superclassAbstractMethod ) ; } else { problemReporter ( ) . abstractMethodMustBeImplemented ( this . type , bestAbstractMethod , superclassAbstractMethod ) ; } } } else if ( noMatch ) { problemReporter ( ) . inheritedMethodsHaveIncompatibleReturnTypes ( this . type , methods , length ) ; } return ; } if ( length < <NUM_LIT:2> ) return ; int index = length ; while ( -- index > <NUM_LIT:0> && checkInheritedReturnTypes ( concreteMethod , methods [ index ] ) ) { } if ( index > <NUM_LIT:0> ) { MethodBinding bestAbstractMethod = findBestInheritedAbstractMethod ( methods , length ) ; if ( bestAbstractMethod == null ) problemReporter ( ) . inheritedMethodsHaveIncompatibleReturnTypes ( this . type , methods , length ) ; else problemReporter ( ) . abstractMethodMustBeImplemented ( this . type , bestAbstractMethod , concreteMethod ) ; return ; } MethodBinding [ ] abstractMethods = new MethodBinding [ length - <NUM_LIT:1> ] ; index = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) if ( methods [ i ] . isAbstract ( ) ) abstractMethods [ index ++ ] = methods [ i ] ; if ( index == <NUM_LIT:0> ) return ; if ( index < abstractMethods . length ) System . arraycopy ( abstractMethods , <NUM_LIT:0> , abstractMethods = new MethodBinding [ index ] , <NUM_LIT:0> , index ) ; checkConcreteInheritedMethod ( concreteMethod , abstractMethods ) ; } boolean checkInheritedReturnTypes ( MethodBinding method , MethodBinding otherMethod ) { if ( areReturnTypesCompatible ( method , otherMethod ) ) return true ; if ( ! this . type . isInterface ( ) ) if ( method . declaringClass . isClass ( ) || ! this . type . implementsInterface ( method . declaringClass , false ) ) if ( otherMethod . declaringClass . isClass ( ) || ! this . type . implementsInterface ( otherMethod . declaringClass , false ) ) return true ; return false ; } void checkMethods ( ) { boolean mustImplementAbstractMethods = mustImplementAbstractMethods ( ) ; boolean skipInheritedMethods = mustImplementAbstractMethods && canSkipInheritedMethods ( ) ; boolean isOrEnclosedByPrivateType = this . type . isOrEnclosedByPrivateType ( ) ; char [ ] [ ] methodSelectors = this . inheritedMethods . keyTable ; nextSelector : for ( int s = methodSelectors . length ; -- s >= <NUM_LIT:0> ; ) { if ( methodSelectors [ s ] == null ) continue nextSelector ; MethodBinding [ ] current = ( MethodBinding [ ] ) this . currentMethods . get ( methodSelectors [ s ] ) ; MethodBinding [ ] inherited = ( MethodBinding [ ] ) this . inheritedMethods . valueTable [ s ] ; if ( current == null && ! isOrEnclosedByPrivateType ) { int length = inherited . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { inherited [ i ] . original ( ) . modifiers |= ExtraCompilerModifiers . AccLocallyUsed ; } } if ( current == null && skipInheritedMethods ) continue nextSelector ; if ( inherited . length == <NUM_LIT:1> && current == null ) { if ( mustImplementAbstractMethods && inherited [ <NUM_LIT:0> ] . isAbstract ( ) ) checkAbstractMethod ( inherited [ <NUM_LIT:0> ] ) ; continue nextSelector ; } int index = - <NUM_LIT:1> ; MethodBinding [ ] matchingInherited = new MethodBinding [ inherited . length ] ; if ( current != null ) { for ( int i = <NUM_LIT:0> , length1 = current . length ; i < length1 ; i ++ ) { MethodBinding currentMethod = current [ i ] ; for ( int j = <NUM_LIT:0> , length2 = inherited . length ; j < length2 ; j ++ ) { MethodBinding inheritedMethod = computeSubstituteMethod ( inherited [ j ] , currentMethod ) ; if ( inheritedMethod != null ) { if ( isParameterSubsignature ( currentMethod , inheritedMethod ) ) { matchingInherited [ ++ index ] = inheritedMethod ; inherited [ j ] = null ; } } } if ( index >= <NUM_LIT:0> ) { checkAgainstInheritedMethods ( currentMethod , matchingInherited , index + <NUM_LIT:1> , inherited ) ; while ( index >= <NUM_LIT:0> ) matchingInherited [ index -- ] = null ; } } } for ( int i = <NUM_LIT:0> , length = inherited . length ; i < length ; i ++ ) { MethodBinding inheritedMethod = inherited [ i ] ; if ( inheritedMethod == null ) continue ; if ( ! isOrEnclosedByPrivateType && current != null ) { inheritedMethod . original ( ) . modifiers |= ExtraCompilerModifiers . AccLocallyUsed ; } matchingInherited [ ++ index ] = inheritedMethod ; for ( int j = i + <NUM_LIT:1> ; j < length ; j ++ ) { MethodBinding otherInheritedMethod = inherited [ j ] ; if ( canSkipInheritedMethods ( inheritedMethod , otherInheritedMethod ) ) continue ; otherInheritedMethod = computeSubstituteMethod ( otherInheritedMethod , inheritedMethod ) ; if ( otherInheritedMethod != null ) { if ( isParameterSubsignature ( inheritedMethod , otherInheritedMethod ) ) { matchingInherited [ ++ index ] = otherInheritedMethod ; inherited [ j ] = null ; } } } if ( index == - <NUM_LIT:1> ) continue ; if ( index > <NUM_LIT:0> ) checkInheritedMethods ( matchingInherited , index + <NUM_LIT:1> ) ; else if ( mustImplementAbstractMethods && matchingInherited [ <NUM_LIT:0> ] . isAbstract ( ) ) checkAbstractMethod ( matchingInherited [ <NUM_LIT:0> ] ) ; while ( index >= <NUM_LIT:0> ) matchingInherited [ index -- ] = null ; } } } void checkPackagePrivateAbstractMethod ( MethodBinding abstractMethod ) { PackageBinding necessaryPackage = abstractMethod . declaringClass . fPackage ; if ( necessaryPackage == this . type . fPackage ) return ; ReferenceBinding superType = this . type . superclass ( ) ; char [ ] selector = abstractMethod . selector ; do { if ( ! superType . isValidBinding ( ) ) return ; if ( ! superType . isAbstract ( ) ) return ; if ( necessaryPackage == superType . fPackage ) { MethodBinding [ ] methods = superType . getMethods ( selector ) ; nextMethod : for ( int m = methods . length ; -- m >= <NUM_LIT:0> ; ) { MethodBinding method = methods [ m ] ; if ( method . isPrivate ( ) || method . isConstructor ( ) || method . isDefaultAbstract ( ) ) continue nextMethod ; if ( areMethodsCompatible ( method , abstractMethod ) ) return ; } } } while ( ( superType = superType . superclass ( ) ) != abstractMethod . declaringClass ) ; problemReporter ( ) . abstractMethodCannotBeOverridden ( this . type , abstractMethod ) ; } void computeInheritedMethods ( ) { ReferenceBinding superclass = this . type . isInterface ( ) ? this . type . scope . getJavaLangObject ( ) : this . type . superclass ( ) ; computeInheritedMethods ( superclass , this . type . superInterfaces ( ) ) ; checkForRedundantSuperinterfaces ( superclass , this . type . superInterfaces ( ) ) ; } void computeInheritedMethods ( ReferenceBinding superclass , ReferenceBinding [ ] superInterfaces ) { this . inheritedMethods = new HashtableOfObject ( <NUM_LIT> ) ; ReferenceBinding [ ] interfacesToVisit = null ; int nextPosition = <NUM_LIT:0> ; ReferenceBinding [ ] itsInterfaces = superInterfaces ; if ( itsInterfaces != Binding . NO_SUPERINTERFACES ) { nextPosition = itsInterfaces . length ; interfacesToVisit = itsInterfaces ; } ReferenceBinding superType = superclass ; HashtableOfObject nonVisibleDefaultMethods = new HashtableOfObject ( <NUM_LIT:3> ) ; while ( superType != null && superType . isValidBinding ( ) ) { if ( ( itsInterfaces = superType . superInterfaces ( ) ) != Binding . NO_SUPERINTERFACES ) { if ( interfacesToVisit == null ) { interfacesToVisit = itsInterfaces ; nextPosition = interfacesToVisit . length ; } else { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } MethodBinding [ ] methods = superType . unResolvedMethods ( ) ; nextMethod : for ( int m = methods . length ; -- m >= <NUM_LIT:0> ; ) { MethodBinding inheritedMethod = methods [ m ] ; if ( inheritedMethod . isPrivate ( ) || inheritedMethod . isConstructor ( ) || inheritedMethod . isDefaultAbstract ( ) ) continue nextMethod ; MethodBinding [ ] existingMethods = ( MethodBinding [ ] ) this . inheritedMethods . get ( inheritedMethod . selector ) ; if ( existingMethods != null ) { existing : for ( int i = <NUM_LIT:0> , length = existingMethods . length ; i < length ; i ++ ) { MethodBinding existingMethod = existingMethods [ i ] ; if ( existingMethod . declaringClass != inheritedMethod . declaringClass && areMethodsCompatible ( existingMethod , inheritedMethod ) && ! canOverridingMethodDifferInErasure ( existingMethod , inheritedMethod ) ) { if ( inheritedMethod . isDefault ( ) ) { if ( inheritedMethod . isAbstract ( ) ) { checkPackagePrivateAbstractMethod ( inheritedMethod ) ; } else if ( existingMethod . declaringClass . fPackage != inheritedMethod . declaringClass . fPackage ) { if ( this . type . fPackage == inheritedMethod . declaringClass . fPackage && ! areReturnTypesCompatible ( inheritedMethod , existingMethod ) ) continue existing ; } } continue nextMethod ; } } } if ( ! inheritedMethod . isDefault ( ) || inheritedMethod . declaringClass . fPackage == this . type . fPackage ) { if ( existingMethods == null ) { existingMethods = new MethodBinding [ ] { inheritedMethod } ; } else { int length = existingMethods . length ; System . arraycopy ( existingMethods , <NUM_LIT:0> , existingMethods = new MethodBinding [ length + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; existingMethods [ length ] = inheritedMethod ; } this . inheritedMethods . put ( inheritedMethod . selector , existingMethods ) ; } else { MethodBinding [ ] nonVisible = ( MethodBinding [ ] ) nonVisibleDefaultMethods . get ( inheritedMethod . selector ) ; if ( nonVisible != null ) for ( int i = <NUM_LIT:0> , l = nonVisible . length ; i < l ; i ++ ) if ( areMethodsCompatible ( nonVisible [ i ] , inheritedMethod ) ) continue nextMethod ; if ( nonVisible == null ) { nonVisible = new MethodBinding [ ] { inheritedMethod } ; } else { int length = nonVisible . length ; System . arraycopy ( nonVisible , <NUM_LIT:0> , nonVisible = new MethodBinding [ length + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; nonVisible [ length ] = inheritedMethod ; } nonVisibleDefaultMethods . put ( inheritedMethod . selector , nonVisible ) ; if ( inheritedMethod . isAbstract ( ) && ! this . type . isAbstract ( ) ) problemReporter ( ) . abstractMethodCannotBeOverridden ( this . type , inheritedMethod ) ; MethodBinding [ ] current = ( MethodBinding [ ] ) this . currentMethods . get ( inheritedMethod . selector ) ; if ( current != null && ! inheritedMethod . isStatic ( ) ) { foundMatch : for ( int i = <NUM_LIT:0> , length = current . length ; i < length ; i ++ ) { if ( ! current [ i ] . isStatic ( ) && areMethodsCompatible ( current [ i ] , inheritedMethod ) ) { problemReporter ( ) . overridesPackageDefaultMethod ( current [ i ] , inheritedMethod ) ; break foundMatch ; } } } } } superType = superType . superclass ( ) ; } if ( nextPosition == <NUM_LIT:0> ) return ; SimpleSet skip = findSuperinterfaceCollisions ( superclass , superInterfaces ) ; for ( int i = <NUM_LIT:0> ; i < nextPosition ; i ++ ) { superType = interfacesToVisit [ i ] ; if ( superType . isValidBinding ( ) ) { if ( skip != null && skip . includes ( superType ) ) continue ; if ( ( itsInterfaces = superType . superInterfaces ( ) ) != Binding . NO_SUPERINTERFACES ) { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } MethodBinding [ ] methods = superType . unResolvedMethods ( ) ; nextMethod : for ( int m = methods . length ; -- m >= <NUM_LIT:0> ; ) { MethodBinding inheritedMethod = methods [ m ] ; MethodBinding [ ] existingMethods = ( MethodBinding [ ] ) this . inheritedMethods . get ( inheritedMethod . selector ) ; if ( existingMethods == null ) { existingMethods = new MethodBinding [ ] { inheritedMethod } ; } else { int length = existingMethods . length ; for ( int e = <NUM_LIT:0> ; e < length ; e ++ ) if ( isInterfaceMethodImplemented ( inheritedMethod , existingMethods [ e ] , superType ) && ! canOverridingMethodDifferInErasure ( existingMethods [ e ] , inheritedMethod ) ) continue nextMethod ; System . arraycopy ( existingMethods , <NUM_LIT:0> , existingMethods = new MethodBinding [ length + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; existingMethods [ length ] = inheritedMethod ; } this . inheritedMethods . put ( inheritedMethod . selector , existingMethods ) ; } } } } protected boolean canOverridingMethodDifferInErasure ( MethodBinding overridingMethod , MethodBinding inheritedMethod ) { return false ; } void computeMethods ( ) { MethodBinding [ ] methods = this . type . methods ( ) ; int size = methods . length ; this . currentMethods = new HashtableOfObject ( size == <NUM_LIT:0> ? <NUM_LIT:1> : size ) ; for ( int m = size ; -- m >= <NUM_LIT:0> ; ) { MethodBinding method = methods [ m ] ; if ( ! ( method . isConstructor ( ) || method . isDefaultAbstract ( ) ) ) { MethodBinding [ ] existingMethods = ( MethodBinding [ ] ) this . currentMethods . get ( method . selector ) ; if ( existingMethods == null ) existingMethods = new MethodBinding [ <NUM_LIT:1> ] ; else System . arraycopy ( existingMethods , <NUM_LIT:0> , ( existingMethods = new MethodBinding [ existingMethods . length + <NUM_LIT:1> ] ) , <NUM_LIT:0> , existingMethods . length - <NUM_LIT:1> ) ; existingMethods [ existingMethods . length - <NUM_LIT:1> ] = method ; this . currentMethods . put ( method . selector , existingMethods ) ; } } } MethodBinding computeSubstituteMethod ( MethodBinding inheritedMethod , MethodBinding currentMethod ) { if ( inheritedMethod == null ) return null ; if ( currentMethod . parameters . length != inheritedMethod . parameters . length ) return null ; return inheritedMethod ; } boolean couldMethodOverride ( MethodBinding method , MethodBinding inheritedMethod ) { if ( ! org . eclipse . jdt . core . compiler . CharOperation . equals ( method . selector , inheritedMethod . selector ) ) return false ; if ( method == inheritedMethod || method . isStatic ( ) || inheritedMethod . isStatic ( ) ) return false ; if ( inheritedMethod . isPrivate ( ) ) return false ; if ( inheritedMethod . isDefault ( ) && method . declaringClass . getPackage ( ) != inheritedMethod . declaringClass . getPackage ( ) ) return false ; if ( ! method . isPublic ( ) ) { if ( inheritedMethod . isPublic ( ) ) return false ; if ( inheritedMethod . isProtected ( ) && ! method . isProtected ( ) ) return false ; } return true ; } public boolean doesMethodOverride ( MethodBinding method , MethodBinding inheritedMethod ) { if ( ! couldMethodOverride ( method , inheritedMethod ) ) return false ; inheritedMethod = inheritedMethod . original ( ) ; TypeBinding match = method . declaringClass . findSuperTypeOriginatingFrom ( inheritedMethod . declaringClass ) ; if ( ! ( match instanceof ReferenceBinding ) ) return false ; return isParameterSubsignature ( method , inheritedMethod ) ; } SimpleSet findSuperinterfaceCollisions ( ReferenceBinding superclass , ReferenceBinding [ ] superInterfaces ) { return null ; } MethodBinding findBestInheritedAbstractMethod ( MethodBinding [ ] methods , int length ) { findMethod : for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { MethodBinding method = methods [ i ] ; if ( ! method . isAbstract ( ) ) continue findMethod ; for ( int j = <NUM_LIT:0> ; j < length ; j ++ ) { if ( i == j ) continue ; if ( ! checkInheritedReturnTypes ( method , methods [ j ] ) ) { if ( this . type . isInterface ( ) && methods [ j ] . declaringClass . id == TypeIds . T_JavaLangObject ) return method ; continue findMethod ; } } return method ; } return null ; } int [ ] findOverriddenInheritedMethods ( MethodBinding [ ] methods , int length ) { int [ ] toSkip = null ; int i = <NUM_LIT:0> ; ReferenceBinding declaringClass = methods [ i ] . declaringClass ; if ( ! declaringClass . isInterface ( ) ) { ReferenceBinding declaringClass2 = methods [ ++ i ] . declaringClass ; while ( declaringClass == declaringClass2 ) { if ( ++ i == length ) return null ; declaringClass2 = methods [ i ] . declaringClass ; } if ( ! declaringClass2 . isInterface ( ) ) { if ( declaringClass . fPackage != declaringClass2 . fPackage && methods [ i ] . isDefault ( ) ) return null ; toSkip = new int [ length ] ; do { toSkip [ i ] = - <NUM_LIT:1> ; if ( ++ i == length ) return toSkip ; declaringClass2 = methods [ i ] . declaringClass ; } while ( ! declaringClass2 . isInterface ( ) ) ; } } nextMethod : for ( ; i < length ; i ++ ) { if ( toSkip != null && toSkip [ i ] == - <NUM_LIT:1> ) continue nextMethod ; declaringClass = methods [ i ] . declaringClass ; for ( int j = i + <NUM_LIT:1> ; j < length ; j ++ ) { if ( toSkip != null && toSkip [ j ] == - <NUM_LIT:1> ) continue ; ReferenceBinding declaringClass2 = methods [ j ] . declaringClass ; if ( declaringClass == declaringClass2 ) continue ; if ( declaringClass . implementsInterface ( declaringClass2 , true ) ) { if ( toSkip == null ) toSkip = new int [ length ] ; toSkip [ j ] = - <NUM_LIT:1> ; } else if ( declaringClass2 . implementsInterface ( declaringClass , true ) ) { if ( toSkip == null ) toSkip = new int [ length ] ; toSkip [ i ] = - <NUM_LIT:1> ; continue nextMethod ; } } } return toSkip ; } boolean isAsVisible ( MethodBinding newMethod , MethodBinding inheritedMethod ) { if ( inheritedMethod . modifiers == newMethod . modifiers ) return true ; if ( newMethod . isPublic ( ) ) return true ; if ( inheritedMethod . isPublic ( ) ) return false ; if ( newMethod . isProtected ( ) ) return true ; if ( inheritedMethod . isProtected ( ) ) return false ; return ! newMethod . isPrivate ( ) ; } boolean isInterfaceMethodImplemented ( MethodBinding inheritedMethod , MethodBinding existingMethod , ReferenceBinding superType ) { return areParametersEqual ( existingMethod , inheritedMethod ) && existingMethod . declaringClass . implementsInterface ( superType , true ) ; } public boolean isMethodSubsignature ( MethodBinding method , MethodBinding inheritedMethod ) { return org . eclipse . jdt . core . compiler . CharOperation . equals ( method . selector , inheritedMethod . selector ) && isParameterSubsignature ( method , inheritedMethod ) ; } boolean isParameterSubsignature ( MethodBinding method , MethodBinding inheritedMethod ) { return areParametersEqual ( method , inheritedMethod ) ; } boolean isSameClassOrSubclassOf ( ReferenceBinding testClass , ReferenceBinding superclass ) { do { if ( testClass == superclass ) return true ; } while ( ( testClass = testClass . superclass ( ) ) != null ) ; return false ; } boolean mustImplementAbstractMethod ( ReferenceBinding declaringClass ) { if ( ! mustImplementAbstractMethods ( ) ) return false ; ReferenceBinding superclass = this . type . superclass ( ) ; if ( declaringClass . isClass ( ) ) { while ( superclass . isAbstract ( ) && superclass != declaringClass ) superclass = superclass . superclass ( ) ; } else { if ( this . type . implementsInterface ( declaringClass , false ) ) if ( ! superclass . implementsInterface ( declaringClass , true ) ) return true ; while ( superclass . isAbstract ( ) && ! superclass . implementsInterface ( declaringClass , false ) ) superclass = superclass . superclass ( ) ; } return superclass . isAbstract ( ) ; } boolean mustImplementAbstractMethods ( ) { return ! this . type . isInterface ( ) && ! this . type . isAbstract ( ) ; } ProblemReporter problemReporter ( ) { return this . type . scope . problemReporter ( ) ; } ProblemReporter problemReporter ( MethodBinding currentMethod ) { ProblemReporter reporter = problemReporter ( ) ; if ( currentMethod . declaringClass == this . type && currentMethod . sourceMethod ( ) != null ) reporter . referenceContext = currentMethod . sourceMethod ( ) ; return reporter ; } boolean reportIncompatibleReturnTypeError ( MethodBinding currentMethod , MethodBinding inheritedMethod ) { problemReporter ( currentMethod ) . incompatibleReturnType ( currentMethod , inheritedMethod ) ; return true ; } ReferenceBinding [ ] resolvedExceptionTypesFor ( MethodBinding method ) { ReferenceBinding [ ] exceptions = method . thrownExceptions ; if ( ( method . modifiers & ExtraCompilerModifiers . AccUnresolved ) == <NUM_LIT:0> ) return exceptions ; if ( ! ( method . declaringClass instanceof BinaryTypeBinding ) ) return Binding . NO_EXCEPTIONS ; for ( int i = exceptions . length ; -- i >= <NUM_LIT:0> ; ) exceptions [ i ] = ( ReferenceBinding ) BinaryTypeBinding . resolveType ( exceptions [ i ] , this . environment , true ) ; return exceptions ; } void verify ( ) { computeMethods ( ) ; computeInheritedMethods ( ) ; checkMethods ( ) ; if ( this . type . isClass ( ) ) checkForMissingHashCodeMethod ( ) ; } void verify ( SourceTypeBinding someType ) { if ( this . type == null ) { try { this . type = someType ; verify ( ) ; } finally { this . type = null ; } } else { this . environment . newMethodVerifier ( ) . verify ( someType ) ; } } public String toString ( ) { StringBuffer buffer = new StringBuffer ( <NUM_LIT:10> ) ; buffer . append ( "<STR_LIT>" ) ; buffer . append ( this . type . readableName ( ) ) ; buffer . append ( '<STR_LIT:\n>' ) ; buffer . append ( "<STR_LIT>" ) ; buffer . append ( this . inheritedMethods ) ; return buffer . toString ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; public class InferenceContext { private TypeBinding [ ] [ ] [ ] collectedSubstitutes ; MethodBinding genericMethod ; int depth ; int status ; TypeBinding expectedType ; boolean hasExplicitExpectedType ; public boolean isUnchecked ; TypeBinding [ ] substitutes ; final static int FAILED = <NUM_LIT:1> ; public InferenceContext ( MethodBinding genericMethod ) { this . genericMethod = genericMethod ; TypeVariableBinding [ ] typeVariables = genericMethod . typeVariables ; int varLength = typeVariables . length ; this . collectedSubstitutes = new TypeBinding [ varLength ] [ <NUM_LIT:3> ] [ ] ; this . substitutes = new TypeBinding [ varLength ] ; } public TypeBinding [ ] getSubstitutes ( TypeVariableBinding typeVariable , int constraint ) { return this . collectedSubstitutes [ typeVariable . rank ] [ constraint ] ; } public boolean hasUnresolvedTypeArgument ( ) { for ( int i = <NUM_LIT:0> , varLength = this . substitutes . length ; i < varLength ; i ++ ) { if ( this . substitutes [ i ] == null ) { return true ; } } return false ; } public void recordSubstitute ( TypeVariableBinding typeVariable , TypeBinding actualType , int constraint ) { TypeBinding [ ] [ ] variableSubstitutes = this . collectedSubstitutes [ typeVariable . rank ] ; insertLoop : { TypeBinding [ ] constraintSubstitutes = variableSubstitutes [ constraint ] ; int length ; if ( constraintSubstitutes == null ) { length = <NUM_LIT:0> ; constraintSubstitutes = new TypeBinding [ <NUM_LIT:1> ] ; } else { length = constraintSubstitutes . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeBinding substitute = constraintSubstitutes [ i ] ; if ( substitute == actualType ) return ; if ( substitute == null ) { constraintSubstitutes [ i ] = actualType ; break insertLoop ; } } System . arraycopy ( constraintSubstitutes , <NUM_LIT:0> , constraintSubstitutes = new TypeBinding [ length + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; } constraintSubstitutes [ length ] = actualType ; variableSubstitutes [ constraint ] = constraintSubstitutes ; } } public String toString ( ) { StringBuffer buffer = new StringBuffer ( <NUM_LIT:20> ) ; buffer . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> , length = this . genericMethod . typeVariables . length ; i < length ; i ++ ) { buffer . append ( this . genericMethod . typeVariables [ i ] ) ; } buffer . append ( this . genericMethod ) ; buffer . append ( "<STR_LIT>" ) ; switch ( this . status ) { case <NUM_LIT:0> : buffer . append ( "<STR_LIT>" ) ; break ; case FAILED : buffer . append ( "<STR_LIT>" ) ; break ; } if ( this . expectedType == null ) { buffer . append ( "<STR_LIT>" ) ; } else { buffer . append ( "<STR_LIT>" ) . append ( this . expectedType . shortReadableName ( ) ) . append ( '<CHAR_LIT:]>' ) ; } buffer . append ( "<STR_LIT>" ) . append ( this . depth ) . append ( '<CHAR_LIT:]>' ) ; buffer . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> , length = this . collectedSubstitutes == null ? <NUM_LIT:0> : this . collectedSubstitutes . length ; i < length ; i ++ ) { TypeBinding [ ] [ ] collected = this . collectedSubstitutes [ i ] ; for ( int j = TypeConstants . CONSTRAINT_EQUAL ; j <= TypeConstants . CONSTRAINT_SUPER ; j ++ ) { TypeBinding [ ] constraintCollected = collected [ j ] ; if ( constraintCollected != null ) { for ( int k = <NUM_LIT:0> , clength = constraintCollected . length ; k < clength ; k ++ ) { buffer . append ( "<STR_LIT>" ) . append ( this . genericMethod . typeVariables [ i ] . sourceName ) ; switch ( j ) { case TypeConstants . CONSTRAINT_EQUAL : buffer . append ( "<STR_LIT:=>" ) ; break ; case TypeConstants . CONSTRAINT_EXTENDS : buffer . append ( "<STR_LIT>" ) ; break ; case TypeConstants . CONSTRAINT_SUPER : buffer . append ( "<STR_LIT>" ) ; break ; } if ( constraintCollected [ k ] != null ) { buffer . append ( constraintCollected [ k ] . shortReadableName ( ) ) ; } } } } } buffer . append ( "<STR_LIT>" ) ; buffer . append ( "<STR_LIT>" ) ; int count = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> , length = this . substitutes == null ? <NUM_LIT:0> : this . substitutes . length ; i < length ; i ++ ) { if ( this . substitutes [ i ] == null ) continue ; count ++ ; buffer . append ( '<CHAR_LIT>' ) . append ( this . genericMethod . typeVariables [ i ] . sourceName ) ; buffer . append ( "<STR_LIT:=>" ) . append ( this . substitutes [ i ] . shortReadableName ( ) ) . append ( '<CHAR_LIT:}>' ) ; } if ( count == <NUM_LIT:0> ) buffer . append ( "<STR_LIT:{}>" ) ; buffer . append ( '<CHAR_LIT:]>' ) ; return buffer . toString ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . FieldDeclaration ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . impl . Constant ; public class FieldBinding extends VariableBinding { public ReferenceBinding declaringClass ; public int compoundUseFlag = <NUM_LIT:0> ; protected FieldBinding ( ) { super ( null , null , <NUM_LIT:0> , null ) ; } public FieldBinding ( char [ ] name , TypeBinding type , int modifiers , ReferenceBinding declaringClass , Constant constant ) { super ( name , type , modifiers , constant ) ; this . declaringClass = declaringClass ; } public FieldBinding ( FieldBinding initialFieldBinding , ReferenceBinding declaringClass ) { super ( initialFieldBinding . name , initialFieldBinding . type , initialFieldBinding . modifiers , initialFieldBinding . constant ( ) ) ; this . declaringClass = declaringClass ; this . id = initialFieldBinding . id ; setAnnotations ( initialFieldBinding . getAnnotations ( ) ) ; } public FieldBinding ( FieldDeclaration field , TypeBinding type , int modifiers , ReferenceBinding declaringClass ) { this ( field . name , type , modifiers , declaringClass , null ) ; field . binding = this ; } public final boolean canBeSeenBy ( PackageBinding invocationPackage ) { if ( isPublic ( ) ) return true ; if ( isPrivate ( ) ) return false ; return invocationPackage == this . declaringClass . getPackage ( ) ; } public final boolean canBeSeenBy ( TypeBinding receiverType , InvocationSite invocationSite , Scope scope ) { if ( isPublic ( ) ) return true ; SourceTypeBinding invocationType = scope . enclosingSourceType ( ) ; if ( invocationType == this . declaringClass && invocationType == receiverType ) return true ; if ( invocationType == null ) return ! isPrivate ( ) && scope . getCurrentPackage ( ) == this . declaringClass . fPackage ; if ( isProtected ( ) ) { if ( invocationType == this . declaringClass ) return true ; if ( invocationType . fPackage == this . declaringClass . fPackage ) return true ; ReferenceBinding currentType = invocationType ; int depth = <NUM_LIT:0> ; ReferenceBinding receiverErasure = ( ReferenceBinding ) receiverType . erasure ( ) ; ReferenceBinding declaringErasure = ( ReferenceBinding ) this . declaringClass . erasure ( ) ; do { if ( currentType . findSuperTypeOriginatingFrom ( declaringErasure ) != null ) { if ( invocationSite . isSuperAccess ( ) ) return true ; if ( receiverType instanceof ArrayBinding ) return false ; if ( isStatic ( ) ) { if ( depth > <NUM_LIT:0> ) invocationSite . setDepth ( depth ) ; return true ; } if ( currentType == receiverErasure || receiverErasure . findSuperTypeOriginatingFrom ( currentType ) != null ) { if ( depth > <NUM_LIT:0> ) invocationSite . setDepth ( depth ) ; return true ; } } depth ++ ; currentType = currentType . enclosingType ( ) ; } while ( currentType != null ) ; return false ; } if ( isPrivate ( ) ) { receiverCheck : { if ( receiverType != this . declaringClass ) { if ( scope . compilerOptions ( ) . complianceLevel <= ClassFileConstants . JDK1_6 && receiverType . isTypeVariable ( ) && ( ( TypeVariableBinding ) receiverType ) . isErasureBoundTo ( this . declaringClass . erasure ( ) ) ) break receiverCheck ; return false ; } } if ( invocationType != this . declaringClass ) { ReferenceBinding outerInvocationType = invocationType ; ReferenceBinding temp = outerInvocationType . enclosingType ( ) ; while ( temp != null ) { outerInvocationType = temp ; temp = temp . enclosingType ( ) ; } ReferenceBinding outerDeclaringClass = ( ReferenceBinding ) this . declaringClass . erasure ( ) ; temp = outerDeclaringClass . enclosingType ( ) ; while ( temp != null ) { outerDeclaringClass = temp ; temp = temp . enclosingType ( ) ; } if ( outerInvocationType != outerDeclaringClass ) return false ; } return true ; } PackageBinding declaringPackage = this . declaringClass . fPackage ; if ( invocationType . fPackage != declaringPackage ) return false ; if ( receiverType instanceof ArrayBinding ) return false ; TypeBinding originalDeclaringClass = this . declaringClass . original ( ) ; ReferenceBinding currentType = ( ReferenceBinding ) receiverType ; do { if ( currentType . isCapture ( ) ) { if ( originalDeclaringClass == currentType . erasure ( ) . original ( ) ) return true ; } else { if ( originalDeclaringClass == currentType . original ( ) ) return true ; } PackageBinding currentPackage = currentType . fPackage ; if ( currentPackage != null && currentPackage != declaringPackage ) return false ; } while ( ( currentType = currentType . superclass ( ) ) != null ) ; return false ; } public char [ ] computeUniqueKey ( boolean isLeaf ) { char [ ] declaringKey = this . declaringClass == null ? CharOperation . NO_CHAR : this . declaringClass . computeUniqueKey ( false ) ; int declaringLength = declaringKey . length ; int nameLength = this . name . length ; char [ ] returnTypeKey = this . type == null ? new char [ ] { '<CHAR_LIT>' } : this . type . computeUniqueKey ( false ) ; int returnTypeLength = returnTypeKey . length ; char [ ] uniqueKey = new char [ declaringLength + <NUM_LIT:1> + nameLength + <NUM_LIT:1> + returnTypeLength ] ; int index = <NUM_LIT:0> ; System . arraycopy ( declaringKey , <NUM_LIT:0> , uniqueKey , index , declaringLength ) ; index += declaringLength ; uniqueKey [ index ++ ] = '<CHAR_LIT:.>' ; System . arraycopy ( this . name , <NUM_LIT:0> , uniqueKey , index , nameLength ) ; index += nameLength ; uniqueKey [ index ++ ] = '<CHAR_LIT:)>' ; System . arraycopy ( returnTypeKey , <NUM_LIT:0> , uniqueKey , index , returnTypeLength ) ; return uniqueKey ; } public Constant constant ( ) { Constant fieldConstant = this . constant ; if ( fieldConstant == null ) { if ( isFinal ( ) ) { FieldBinding originalField = original ( ) ; if ( originalField . declaringClass instanceof SourceTypeBinding ) { SourceTypeBinding sourceType = ( SourceTypeBinding ) originalField . declaringClass ; if ( sourceType . scope != null ) { TypeDeclaration typeDecl = sourceType . scope . referenceContext ; FieldDeclaration fieldDecl = typeDecl . declarationOf ( originalField ) ; MethodScope initScope = originalField . isStatic ( ) ? typeDecl . staticInitializerScope : typeDecl . initializerScope ; boolean old = initScope . insideTypeAnnotation ; try { initScope . insideTypeAnnotation = false ; fieldDecl . resolve ( initScope ) ; } finally { initScope . insideTypeAnnotation = old ; } fieldConstant = originalField . constant == null ? Constant . NotAConstant : originalField . constant ; } else { fieldConstant = Constant . NotAConstant ; } } else { fieldConstant = Constant . NotAConstant ; } } else { fieldConstant = Constant . NotAConstant ; } this . constant = fieldConstant ; } return fieldConstant ; } public char [ ] genericSignature ( ) { if ( ( this . modifiers & ExtraCompilerModifiers . AccGenericSignature ) == <NUM_LIT:0> ) return null ; return this . type . genericTypeSignature ( ) ; } public final int getAccessFlags ( ) { return this . modifiers & ExtraCompilerModifiers . AccJustFlag ; } public AnnotationBinding [ ] getAnnotations ( ) { FieldBinding originalField = original ( ) ; ReferenceBinding declaringClassBinding = originalField . declaringClass ; if ( declaringClassBinding == null ) { return Binding . NO_ANNOTATIONS ; } return declaringClassBinding . retrieveAnnotations ( originalField ) ; } public long getAnnotationTagBits ( ) { FieldBinding originalField = original ( ) ; if ( ( originalField . tagBits & TagBits . AnnotationResolved ) == <NUM_LIT:0> && originalField . declaringClass instanceof SourceTypeBinding ) { ClassScope scope = ( ( SourceTypeBinding ) originalField . declaringClass ) . scope ; if ( scope == null ) { this . tagBits |= ( TagBits . AnnotationResolved | TagBits . DeprecatedAnnotationResolved ) ; return <NUM_LIT:0> ; } TypeDeclaration typeDecl = scope . referenceContext ; FieldDeclaration fieldDecl = typeDecl . declarationOf ( originalField ) ; if ( fieldDecl != null ) { MethodScope initializationScope = isStatic ( ) ? typeDecl . staticInitializerScope : typeDecl . initializerScope ; FieldBinding previousField = initializationScope . initializedField ; int previousFieldID = initializationScope . lastVisibleFieldID ; try { initializationScope . initializedField = originalField ; initializationScope . lastVisibleFieldID = originalField . id ; ASTNode . resolveAnnotations ( initializationScope , fieldDecl . annotations , originalField ) ; } finally { initializationScope . initializedField = previousField ; initializationScope . lastVisibleFieldID = previousFieldID ; } } } return originalField . tagBits ; } public final boolean isDefault ( ) { return ! isPublic ( ) && ! isProtected ( ) && ! isPrivate ( ) ; } public final boolean isDeprecated ( ) { return ( this . modifiers & ClassFileConstants . AccDeprecated ) != <NUM_LIT:0> ; } public final boolean isPrivate ( ) { return ( this . modifiers & ClassFileConstants . AccPrivate ) != <NUM_LIT:0> ; } public final boolean isOrEnclosedByPrivateType ( ) { if ( ( this . modifiers & ClassFileConstants . AccPrivate ) != <NUM_LIT:0> ) return true ; return this . declaringClass != null && this . declaringClass . isOrEnclosedByPrivateType ( ) ; } public final boolean isProtected ( ) { return ( this . modifiers & ClassFileConstants . AccProtected ) != <NUM_LIT:0> ; } public final boolean isPublic ( ) { return ( this . modifiers & ClassFileConstants . AccPublic ) != <NUM_LIT:0> ; } public final boolean isStatic ( ) { return ( this . modifiers & ClassFileConstants . AccStatic ) != <NUM_LIT:0> ; } public final boolean isSynthetic ( ) { return ( this . modifiers & ClassFileConstants . AccSynthetic ) != <NUM_LIT:0> ; } public final boolean isTransient ( ) { return ( this . modifiers & ClassFileConstants . AccTransient ) != <NUM_LIT:0> ; } public final boolean isUsed ( ) { return ( this . modifiers & ExtraCompilerModifiers . AccLocallyUsed ) != <NUM_LIT:0> || this . compoundUseFlag > <NUM_LIT:0> ; } public final boolean isUsedOnlyInCompound ( ) { return ( this . modifiers & ExtraCompilerModifiers . AccLocallyUsed ) == <NUM_LIT:0> && this . compoundUseFlag > <NUM_LIT:0> ; } public final boolean isViewedAsDeprecated ( ) { return ( this . modifiers & ( ClassFileConstants . AccDeprecated | ExtraCompilerModifiers . AccDeprecatedImplicitly ) ) != <NUM_LIT:0> ; } public final boolean isVolatile ( ) { return ( this . modifiers & ClassFileConstants . AccVolatile ) != <NUM_LIT:0> ; } public final int kind ( ) { return FIELD ; } public FieldBinding original ( ) { return this ; } public void setAnnotations ( AnnotationBinding [ ] annotations ) { this . declaringClass . storeAnnotations ( this , annotations ) ; } public FieldDeclaration sourceField ( ) { SourceTypeBinding sourceType ; try { sourceType = ( SourceTypeBinding ) this . declaringClass ; } catch ( ClassCastException e ) { return null ; } FieldDeclaration [ ] fields = sourceType . scope . referenceContext . fields ; if ( fields != null ) { for ( int i = fields . length ; -- i >= <NUM_LIT:0> ; ) if ( this == fields [ i ] . binding ) return fields [ i ] ; } return null ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . ast . LocalDeclaration ; public class CatchParameterBinding extends LocalVariableBinding { TypeBinding [ ] preciseTypes = Binding . NO_EXCEPTIONS ; public CatchParameterBinding ( LocalDeclaration declaration , TypeBinding type , int modifiers , boolean isArgument ) { super ( declaration , type , modifiers , isArgument ) ; } public TypeBinding [ ] getPreciseTypes ( ) { return this . preciseTypes ; } public void setPreciseType ( TypeBinding raisedException ) { int length = this . preciseTypes . length ; for ( int i = <NUM_LIT:0> ; i < length ; ++ i ) { if ( this . preciseTypes [ i ] == raisedException ) return ; } System . arraycopy ( this . preciseTypes , <NUM_LIT:0> , this . preciseTypes = new TypeBinding [ length + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; this . preciseTypes [ length ] = raisedException ; return ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; public class UnresolvedAnnotationBinding extends AnnotationBinding { private LookupEnvironment env ; private boolean typeUnresolved = true ; UnresolvedAnnotationBinding ( ReferenceBinding type , ElementValuePair [ ] pairs , LookupEnvironment env ) { super ( type , pairs ) ; this . env = env ; } public ReferenceBinding getAnnotationType ( ) { if ( this . typeUnresolved ) { this . type = ( ReferenceBinding ) BinaryTypeBinding . resolveType ( this . type , this . env , false ) ; this . typeUnresolved = false ; } return this . type ; } public ElementValuePair [ ] getElementValuePairs ( ) { if ( this . env != null ) { if ( this . typeUnresolved ) { getAnnotationType ( ) ; } for ( int i = this . pairs . length ; -- i >= <NUM_LIT:0> ; ) { ElementValuePair pair = this . pairs [ i ] ; MethodBinding [ ] methods = this . type . getMethods ( pair . getName ( ) ) ; if ( methods != null && methods . length == <NUM_LIT:1> ) { pair . setMethodBinding ( methods [ <NUM_LIT:0> ] ) ; } Object value = pair . getValue ( ) ; if ( value instanceof UnresolvedReferenceBinding ) { pair . setValue ( ( ( UnresolvedReferenceBinding ) value ) . resolve ( this . env , false ) ) ; } } this . env = null ; } return this . pairs ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; import java . util . * ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . * ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . impl . ReferenceContext ; import org . eclipse . jdt . internal . compiler . problem . AbortCompilation ; import org . eclipse . jdt . internal . compiler . problem . ProblemReporter ; import org . eclipse . jdt . internal . compiler . util . HashtableOfObject ; import org . eclipse . jdt . internal . compiler . util . ObjectVector ; import org . eclipse . jdt . internal . compiler . util . SimpleLookupTable ; import org . eclipse . jdt . internal . compiler . util . SimpleSet ; public abstract class Scope { public final static int BLOCK_SCOPE = <NUM_LIT:1> ; public final static int CLASS_SCOPE = <NUM_LIT:3> ; public final static int COMPILATION_UNIT_SCOPE = <NUM_LIT:4> ; public final static int METHOD_SCOPE = <NUM_LIT:2> ; public final static int NOT_COMPATIBLE = - <NUM_LIT:1> ; public final static int COMPATIBLE = <NUM_LIT:0> ; public final static int AUTOBOX_COMPATIBLE = <NUM_LIT:1> ; public final static int VARARGS_COMPATIBLE = <NUM_LIT:2> ; public static final int EQUAL_OR_MORE_SPECIFIC = - <NUM_LIT:1> ; public static final int NOT_RELATED = <NUM_LIT:0> ; public static final int MORE_GENERIC = <NUM_LIT:1> ; public int kind ; public Scope parent ; protected Scope ( int kind , Scope parent ) { this . kind = kind ; this . parent = parent ; } public static int compareTypes ( TypeBinding left , TypeBinding right ) { if ( left . isCompatibleWith ( right ) ) return Scope . EQUAL_OR_MORE_SPECIFIC ; if ( right . isCompatibleWith ( left ) ) return Scope . MORE_GENERIC ; return Scope . NOT_RELATED ; } public static TypeBinding convertEliminatingTypeVariables ( TypeBinding originalType , ReferenceBinding genericType , int rank , Set eliminatedVariables ) { if ( ( originalType . tagBits & TagBits . HasTypeVariable ) != <NUM_LIT:0> ) { switch ( originalType . kind ( ) ) { case Binding . ARRAY_TYPE : ArrayBinding originalArrayType = ( ArrayBinding ) originalType ; TypeBinding originalLeafComponentType = originalArrayType . leafComponentType ; TypeBinding substitute = convertEliminatingTypeVariables ( originalLeafComponentType , genericType , rank , eliminatedVariables ) ; if ( substitute != originalLeafComponentType ) { return originalArrayType . environment . createArrayType ( substitute . leafComponentType ( ) , substitute . dimensions ( ) + originalArrayType . dimensions ( ) ) ; } break ; case Binding . PARAMETERIZED_TYPE : ParameterizedTypeBinding paramType = ( ParameterizedTypeBinding ) originalType ; ReferenceBinding originalEnclosing = paramType . enclosingType ( ) ; ReferenceBinding substitutedEnclosing = originalEnclosing ; if ( originalEnclosing != null ) { substitutedEnclosing = ( ReferenceBinding ) convertEliminatingTypeVariables ( originalEnclosing , genericType , rank , eliminatedVariables ) ; } TypeBinding [ ] originalArguments = paramType . arguments ; TypeBinding [ ] substitutedArguments = originalArguments ; for ( int i = <NUM_LIT:0> , length = originalArguments == null ? <NUM_LIT:0> : originalArguments . length ; i < length ; i ++ ) { TypeBinding originalArgument = originalArguments [ i ] ; TypeBinding substitutedArgument = convertEliminatingTypeVariables ( originalArgument , paramType . genericType ( ) , i , eliminatedVariables ) ; if ( substitutedArgument != originalArgument ) { if ( substitutedArguments == originalArguments ) { System . arraycopy ( originalArguments , <NUM_LIT:0> , substitutedArguments = new TypeBinding [ length ] , <NUM_LIT:0> , i ) ; } substitutedArguments [ i ] = substitutedArgument ; } else if ( substitutedArguments != originalArguments ) { substitutedArguments [ i ] = originalArgument ; } } if ( originalEnclosing != substitutedEnclosing || originalArguments != substitutedArguments ) { return paramType . environment . createParameterizedType ( paramType . genericType ( ) , substitutedArguments , substitutedEnclosing ) ; } break ; case Binding . TYPE_PARAMETER : if ( genericType == null ) { break ; } TypeVariableBinding originalVariable = ( TypeVariableBinding ) originalType ; if ( eliminatedVariables != null && eliminatedVariables . contains ( originalType ) ) { return originalVariable . environment . createWildcard ( genericType , rank , null , null , Wildcard . UNBOUND ) ; } TypeBinding originalUpperBound = originalVariable . upperBound ( ) ; if ( eliminatedVariables == null ) { eliminatedVariables = new HashSet ( <NUM_LIT:2> ) ; } eliminatedVariables . add ( originalVariable ) ; TypeBinding substitutedUpperBound = convertEliminatingTypeVariables ( originalUpperBound , genericType , rank , eliminatedVariables ) ; eliminatedVariables . remove ( originalVariable ) ; return originalVariable . environment . createWildcard ( genericType , rank , substitutedUpperBound , null , Wildcard . EXTENDS ) ; case Binding . RAW_TYPE : break ; case Binding . GENERIC_TYPE : ReferenceBinding currentType = ( ReferenceBinding ) originalType ; originalEnclosing = currentType . enclosingType ( ) ; substitutedEnclosing = originalEnclosing ; if ( originalEnclosing != null ) { substitutedEnclosing = ( ReferenceBinding ) convertEliminatingTypeVariables ( originalEnclosing , genericType , rank , eliminatedVariables ) ; } originalArguments = currentType . typeVariables ( ) ; substitutedArguments = originalArguments ; for ( int i = <NUM_LIT:0> , length = originalArguments == null ? <NUM_LIT:0> : originalArguments . length ; i < length ; i ++ ) { TypeBinding originalArgument = originalArguments [ i ] ; TypeBinding substitutedArgument = convertEliminatingTypeVariables ( originalArgument , currentType , i , eliminatedVariables ) ; if ( substitutedArgument != originalArgument ) { if ( substitutedArguments == originalArguments ) { System . arraycopy ( originalArguments , <NUM_LIT:0> , substitutedArguments = new TypeBinding [ length ] , <NUM_LIT:0> , i ) ; } substitutedArguments [ i ] = substitutedArgument ; } else if ( substitutedArguments != originalArguments ) { substitutedArguments [ i ] = originalArgument ; } } if ( originalEnclosing != substitutedEnclosing || originalArguments != substitutedArguments ) { return ( ( TypeVariableBinding ) originalArguments [ <NUM_LIT:0> ] ) . environment . createParameterizedType ( genericType , substitutedArguments , substitutedEnclosing ) ; } break ; case Binding . WILDCARD_TYPE : WildcardBinding wildcard = ( WildcardBinding ) originalType ; TypeBinding originalBound = wildcard . bound ; TypeBinding substitutedBound = originalBound ; if ( originalBound != null ) { substitutedBound = convertEliminatingTypeVariables ( originalBound , genericType , rank , eliminatedVariables ) ; if ( substitutedBound != originalBound ) { return wildcard . environment . createWildcard ( wildcard . genericType , wildcard . rank , substitutedBound , null , wildcard . boundKind ) ; } } break ; case Binding . INTERSECTION_TYPE : WildcardBinding intersection = ( WildcardBinding ) originalType ; originalBound = intersection . bound ; substitutedBound = originalBound ; if ( originalBound != null ) { substitutedBound = convertEliminatingTypeVariables ( originalBound , genericType , rank , eliminatedVariables ) ; } TypeBinding [ ] originalOtherBounds = intersection . otherBounds ; TypeBinding [ ] substitutedOtherBounds = originalOtherBounds ; for ( int i = <NUM_LIT:0> , length = originalOtherBounds == null ? <NUM_LIT:0> : originalOtherBounds . length ; i < length ; i ++ ) { TypeBinding originalOtherBound = originalOtherBounds [ i ] ; TypeBinding substitutedOtherBound = convertEliminatingTypeVariables ( originalOtherBound , genericType , rank , eliminatedVariables ) ; if ( substitutedOtherBound != originalOtherBound ) { if ( substitutedOtherBounds == originalOtherBounds ) { System . arraycopy ( originalOtherBounds , <NUM_LIT:0> , substitutedOtherBounds = new TypeBinding [ length ] , <NUM_LIT:0> , i ) ; } substitutedOtherBounds [ i ] = substitutedOtherBound ; } else if ( substitutedOtherBounds != originalOtherBounds ) { substitutedOtherBounds [ i ] = originalOtherBound ; } } if ( substitutedBound != originalBound || substitutedOtherBounds != originalOtherBounds ) { return intersection . environment . createWildcard ( intersection . genericType , intersection . rank , substitutedBound , substitutedOtherBounds , intersection . boundKind ) ; } break ; } } return originalType ; } public static TypeBinding getBaseType ( char [ ] name ) { int length = name . length ; if ( length > <NUM_LIT:2> && length < <NUM_LIT:8> ) { switch ( name [ <NUM_LIT:0> ] ) { case '<CHAR_LIT>' : if ( length == <NUM_LIT:3> && name [ <NUM_LIT:1> ] == '<CHAR_LIT>' && name [ <NUM_LIT:2> ] == '<CHAR_LIT>' ) return TypeBinding . INT ; break ; case '<CHAR_LIT>' : if ( length == <NUM_LIT:4> && name [ <NUM_LIT:1> ] == '<CHAR_LIT>' && name [ <NUM_LIT:2> ] == '<CHAR_LIT>' && name [ <NUM_LIT:3> ] == '<CHAR_LIT>' ) return TypeBinding . VOID ; break ; case '<CHAR_LIT:b>' : if ( length == <NUM_LIT:7> && name [ <NUM_LIT:1> ] == '<CHAR_LIT>' && name [ <NUM_LIT:2> ] == '<CHAR_LIT>' && name [ <NUM_LIT:3> ] == '<CHAR_LIT>' && name [ <NUM_LIT:4> ] == '<CHAR_LIT:e>' && name [ <NUM_LIT:5> ] == '<CHAR_LIT:a>' && name [ <NUM_LIT:6> ] == '<CHAR_LIT>' ) return TypeBinding . BOOLEAN ; if ( length == <NUM_LIT:4> && name [ <NUM_LIT:1> ] == '<CHAR_LIT>' && name [ <NUM_LIT:2> ] == '<CHAR_LIT>' && name [ <NUM_LIT:3> ] == '<CHAR_LIT:e>' ) return TypeBinding . BYTE ; break ; case '<CHAR_LIT:c>' : if ( length == <NUM_LIT:4> && name [ <NUM_LIT:1> ] == '<CHAR_LIT>' && name [ <NUM_LIT:2> ] == '<CHAR_LIT:a>' && name [ <NUM_LIT:3> ] == '<CHAR_LIT>' ) return TypeBinding . CHAR ; break ; case '<CHAR_LIT>' : if ( length == <NUM_LIT:6> && name [ <NUM_LIT:1> ] == '<CHAR_LIT>' && name [ <NUM_LIT:2> ] == '<CHAR_LIT>' && name [ <NUM_LIT:3> ] == '<CHAR_LIT:b>' && name [ <NUM_LIT:4> ] == '<CHAR_LIT>' && name [ <NUM_LIT:5> ] == '<CHAR_LIT:e>' ) return TypeBinding . DOUBLE ; break ; case '<CHAR_LIT>' : if ( length == <NUM_LIT:5> && name [ <NUM_LIT:1> ] == '<CHAR_LIT>' && name [ <NUM_LIT:2> ] == '<CHAR_LIT>' && name [ <NUM_LIT:3> ] == '<CHAR_LIT:a>' && name [ <NUM_LIT:4> ] == '<CHAR_LIT>' ) return TypeBinding . FLOAT ; break ; case '<CHAR_LIT>' : if ( length == <NUM_LIT:4> && name [ <NUM_LIT:1> ] == '<CHAR_LIT>' && name [ <NUM_LIT:2> ] == '<CHAR_LIT>' && name [ <NUM_LIT:3> ] == '<CHAR_LIT>' ) return TypeBinding . LONG ; break ; case '<CHAR_LIT>' : if ( length == <NUM_LIT:5> && name [ <NUM_LIT:1> ] == '<CHAR_LIT>' && name [ <NUM_LIT:2> ] == '<CHAR_LIT>' && name [ <NUM_LIT:3> ] == '<CHAR_LIT>' && name [ <NUM_LIT:4> ] == '<CHAR_LIT>' ) return TypeBinding . SHORT ; } } return null ; } public static ReferenceBinding [ ] greaterLowerBound ( ReferenceBinding [ ] types ) { if ( types == null ) return null ; int length = types . length ; if ( length == <NUM_LIT:0> ) return null ; ReferenceBinding [ ] result = types ; int removed = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { ReferenceBinding iType = result [ i ] ; if ( iType == null ) continue ; for ( int j = <NUM_LIT:0> ; j < length ; j ++ ) { if ( i == j ) continue ; ReferenceBinding jType = result [ j ] ; if ( jType == null ) continue ; if ( iType . isCompatibleWith ( jType ) ) { if ( result == types ) { System . arraycopy ( result , <NUM_LIT:0> , result = new ReferenceBinding [ length ] , <NUM_LIT:0> , length ) ; } result [ j ] = null ; removed ++ ; } } } if ( removed == <NUM_LIT:0> ) return result ; if ( length == removed ) return null ; ReferenceBinding [ ] trimmedResult = new ReferenceBinding [ length - removed ] ; for ( int i = <NUM_LIT:0> , index = <NUM_LIT:0> ; i < length ; i ++ ) { ReferenceBinding iType = result [ i ] ; if ( iType != null ) { trimmedResult [ index ++ ] = iType ; } } return trimmedResult ; } public static TypeBinding [ ] greaterLowerBound ( TypeBinding [ ] types ) { if ( types == null ) return null ; int length = types . length ; if ( length == <NUM_LIT:0> ) return null ; TypeBinding [ ] result = types ; int removed = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeBinding iType = result [ i ] ; if ( iType == null ) continue ; for ( int j = <NUM_LIT:0> ; j < length ; j ++ ) { if ( i == j ) continue ; TypeBinding jType = result [ j ] ; if ( jType == null ) continue ; if ( iType . isCompatibleWith ( jType ) ) { if ( result == types ) { System . arraycopy ( result , <NUM_LIT:0> , result = new TypeBinding [ length ] , <NUM_LIT:0> , length ) ; } result [ j ] = null ; removed ++ ; } } } if ( removed == <NUM_LIT:0> ) return result ; if ( length == removed ) return null ; TypeBinding [ ] trimmedResult = new TypeBinding [ length - removed ] ; for ( int i = <NUM_LIT:0> , index = <NUM_LIT:0> ; i < length ; i ++ ) { TypeBinding iType = result [ i ] ; if ( iType != null ) { trimmedResult [ index ++ ] = iType ; } } return trimmedResult ; } public static ReferenceBinding [ ] substitute ( Substitution substitution , ReferenceBinding [ ] originalTypes ) { if ( originalTypes == null ) return null ; ReferenceBinding [ ] substitutedTypes = originalTypes ; for ( int i = <NUM_LIT:0> , length = originalTypes . length ; i < length ; i ++ ) { ReferenceBinding originalType = originalTypes [ i ] ; TypeBinding substitutedType = substitute ( substitution , originalType ) ; if ( ! ( substitutedType instanceof ReferenceBinding ) ) { return null ; } if ( substitutedType != originalType ) { if ( substitutedTypes == originalTypes ) { System . arraycopy ( originalTypes , <NUM_LIT:0> , substitutedTypes = new ReferenceBinding [ length ] , <NUM_LIT:0> , i ) ; } substitutedTypes [ i ] = ( ReferenceBinding ) substitutedType ; } else if ( substitutedTypes != originalTypes ) { substitutedTypes [ i ] = originalType ; } } return substitutedTypes ; } public static TypeBinding substitute ( Substitution substitution , TypeBinding originalType ) { if ( originalType == null ) return null ; switch ( originalType . kind ( ) ) { case Binding . TYPE_PARAMETER : return substitution . substitute ( ( TypeVariableBinding ) originalType ) ; case Binding . PARAMETERIZED_TYPE : ParameterizedTypeBinding originalParameterizedType = ( ParameterizedTypeBinding ) originalType ; ReferenceBinding originalEnclosing = originalType . enclosingType ( ) ; ReferenceBinding substitutedEnclosing = originalEnclosing ; if ( originalEnclosing != null ) { substitutedEnclosing = ( ReferenceBinding ) substitute ( substitution , originalEnclosing ) ; } TypeBinding [ ] originalArguments = originalParameterizedType . arguments ; TypeBinding [ ] substitutedArguments = originalArguments ; if ( originalArguments != null ) { if ( substitution . isRawSubstitution ( ) ) { return originalParameterizedType . environment . createRawType ( originalParameterizedType . genericType ( ) , substitutedEnclosing ) ; } substitutedArguments = substitute ( substitution , originalArguments ) ; } if ( substitutedArguments != originalArguments || substitutedEnclosing != originalEnclosing ) { return originalParameterizedType . environment . createParameterizedType ( originalParameterizedType . genericType ( ) , substitutedArguments , substitutedEnclosing ) ; } break ; case Binding . ARRAY_TYPE : ArrayBinding originalArrayType = ( ArrayBinding ) originalType ; TypeBinding originalLeafComponentType = originalArrayType . leafComponentType ; TypeBinding substitute = substitute ( substitution , originalLeafComponentType ) ; if ( substitute != originalLeafComponentType ) { return originalArrayType . environment . createArrayType ( substitute . leafComponentType ( ) , substitute . dimensions ( ) + originalType . dimensions ( ) ) ; } break ; case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : WildcardBinding wildcard = ( WildcardBinding ) originalType ; if ( wildcard . boundKind != Wildcard . UNBOUND ) { TypeBinding originalBound = wildcard . bound ; TypeBinding substitutedBound = substitute ( substitution , originalBound ) ; TypeBinding [ ] originalOtherBounds = wildcard . otherBounds ; TypeBinding [ ] substitutedOtherBounds = substitute ( substitution , originalOtherBounds ) ; if ( substitutedBound != originalBound || originalOtherBounds != substitutedOtherBounds ) { if ( originalOtherBounds != null ) { TypeBinding [ ] bounds = new TypeBinding [ <NUM_LIT:1> + substitutedOtherBounds . length ] ; bounds [ <NUM_LIT:0> ] = substitutedBound ; System . arraycopy ( substitutedOtherBounds , <NUM_LIT:0> , bounds , <NUM_LIT:1> , substitutedOtherBounds . length ) ; TypeBinding [ ] glb = Scope . greaterLowerBound ( bounds ) ; if ( glb != null && glb != bounds ) { substitutedBound = glb [ <NUM_LIT:0> ] ; if ( glb . length == <NUM_LIT:1> ) { substitutedOtherBounds = null ; } else { System . arraycopy ( glb , <NUM_LIT:1> , substitutedOtherBounds = new TypeBinding [ glb . length - <NUM_LIT:1> ] , <NUM_LIT:0> , glb . length - <NUM_LIT:1> ) ; } } } return wildcard . environment . createWildcard ( wildcard . genericType , wildcard . rank , substitutedBound , substitutedOtherBounds , wildcard . boundKind ) ; } } break ; case Binding . TYPE : if ( ! originalType . isMemberType ( ) ) break ; ReferenceBinding originalReferenceType = ( ReferenceBinding ) originalType ; originalEnclosing = originalType . enclosingType ( ) ; substitutedEnclosing = originalEnclosing ; if ( originalEnclosing != null ) { substitutedEnclosing = ( ReferenceBinding ) substitute ( substitution , originalEnclosing ) ; } if ( substitutedEnclosing != originalEnclosing ) { return substitution . isRawSubstitution ( ) ? substitution . environment ( ) . createRawType ( originalReferenceType , substitutedEnclosing ) : substitution . environment ( ) . createParameterizedType ( originalReferenceType , null , substitutedEnclosing ) ; } break ; case Binding . GENERIC_TYPE : originalReferenceType = ( ReferenceBinding ) originalType ; originalEnclosing = originalType . enclosingType ( ) ; substitutedEnclosing = originalEnclosing ; if ( originalEnclosing != null ) { substitutedEnclosing = ( ReferenceBinding ) substitute ( substitution , originalEnclosing ) ; } if ( substitution . isRawSubstitution ( ) ) { return substitution . environment ( ) . createRawType ( originalReferenceType , substitutedEnclosing ) ; } originalArguments = originalReferenceType . typeVariables ( ) ; substitutedArguments = substitute ( substitution , originalArguments ) ; return substitution . environment ( ) . createParameterizedType ( originalReferenceType , substitutedArguments , substitutedEnclosing ) ; } return originalType ; } public static TypeBinding [ ] substitute ( Substitution substitution , TypeBinding [ ] originalTypes ) { if ( originalTypes == null ) return null ; TypeBinding [ ] substitutedTypes = originalTypes ; for ( int i = <NUM_LIT:0> , length = originalTypes . length ; i < length ; i ++ ) { TypeBinding originalType = originalTypes [ i ] ; TypeBinding substitutedParameter = substitute ( substitution , originalType ) ; if ( substitutedParameter != originalType ) { if ( substitutedTypes == originalTypes ) { System . arraycopy ( originalTypes , <NUM_LIT:0> , substitutedTypes = new TypeBinding [ length ] , <NUM_LIT:0> , i ) ; } substitutedTypes [ i ] = substitutedParameter ; } else if ( substitutedTypes != originalTypes ) { substitutedTypes [ i ] = originalType ; } } return substitutedTypes ; } public TypeBinding boxing ( TypeBinding type ) { if ( type . isBaseType ( ) ) return environment ( ) . computeBoxingType ( type ) ; return type ; } public final ClassScope classScope ( ) { Scope scope = this ; do { if ( scope instanceof ClassScope ) return ( ClassScope ) scope ; scope = scope . parent ; } while ( scope != null ) ; return null ; } public final CompilationUnitScope compilationUnitScope ( ) { Scope lastScope = null ; Scope scope = this ; do { lastScope = scope ; scope = scope . parent ; } while ( scope != null ) ; return ( CompilationUnitScope ) lastScope ; } public final CompilerOptions compilerOptions ( ) { return compilationUnitScope ( ) . environment . globalOptions ; } protected final MethodBinding computeCompatibleMethod ( MethodBinding method , TypeBinding [ ] arguments , InvocationSite invocationSite ) { TypeBinding [ ] genericTypeArguments = invocationSite . genericTypeArguments ( ) ; TypeBinding [ ] parameters = method . parameters ; TypeVariableBinding [ ] typeVariables = method . typeVariables ; if ( parameters == arguments && ( method . returnType . tagBits & TagBits . HasTypeVariable ) == <NUM_LIT:0> && genericTypeArguments == null && typeVariables == Binding . NO_TYPE_VARIABLES ) return method ; int argLength = arguments . length ; int paramLength = parameters . length ; boolean isVarArgs = method . isVarargs ( ) ; if ( argLength != paramLength ) if ( ! isVarArgs || argLength < paramLength - <NUM_LIT:1> ) return null ; if ( typeVariables != Binding . NO_TYPE_VARIABLES && compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ) { TypeBinding [ ] newArgs = null ; for ( int i = <NUM_LIT:0> ; i < argLength ; i ++ ) { TypeBinding param = i < paramLength ? parameters [ i ] : parameters [ paramLength - <NUM_LIT:1> ] ; if ( arguments [ i ] . isBaseType ( ) != param . isBaseType ( ) ) { if ( newArgs == null ) { newArgs = new TypeBinding [ argLength ] ; System . arraycopy ( arguments , <NUM_LIT:0> , newArgs , <NUM_LIT:0> , argLength ) ; } newArgs [ i ] = environment ( ) . computeBoxingType ( arguments [ i ] ) ; } } if ( newArgs != null ) arguments = newArgs ; method = ParameterizedGenericMethodBinding . computeCompatibleMethod ( method , arguments , this , invocationSite ) ; if ( method == null ) return null ; if ( ! method . isValidBinding ( ) ) return method ; } else if ( genericTypeArguments != null && compilerOptions ( ) . complianceLevel < ClassFileConstants . JDK1_7 ) { if ( method instanceof ParameterizedGenericMethodBinding ) { if ( ! ( ( ParameterizedGenericMethodBinding ) method ) . wasInferred ) return new ProblemMethodBinding ( method , method . selector , genericTypeArguments , ProblemReasons . TypeArgumentsForRawGenericMethod ) ; } else if ( ! method . isOverriding ( ) || ! isOverriddenMethodGeneric ( method ) ) { return new ProblemMethodBinding ( method , method . selector , genericTypeArguments , ProblemReasons . TypeParameterArityMismatch ) ; } } if ( parameterCompatibilityLevel ( method , arguments ) > NOT_COMPATIBLE ) { if ( ( method . tagBits & TagBits . AnnotationPolymorphicSignature ) != <NUM_LIT:0> ) { return this . environment ( ) . createPolymorphicMethod ( method , arguments ) ; } return method ; } if ( genericTypeArguments != null && typeVariables != Binding . NO_TYPE_VARIABLES ) return new ProblemMethodBinding ( method , method . selector , arguments , ProblemReasons . ParameterizedMethodTypeMismatch ) ; return null ; } protected boolean connectTypeVariables ( TypeParameter [ ] typeParameters , boolean checkForErasedCandidateCollisions ) { if ( typeParameters == null || typeParameters . length == <NUM_LIT:0> ) return true ; Map invocations = new HashMap ( <NUM_LIT:2> ) ; boolean noProblems = true ; for ( int i = <NUM_LIT:0> , paramLength = typeParameters . length ; i < paramLength ; i ++ ) { TypeParameter typeParameter = typeParameters [ i ] ; TypeVariableBinding typeVariable = typeParameter . binding ; if ( typeVariable == null ) return false ; typeVariable . superclass = getJavaLangObject ( ) ; typeVariable . superInterfaces = Binding . NO_SUPERINTERFACES ; typeVariable . firstBound = null ; } nextVariable : for ( int i = <NUM_LIT:0> , paramLength = typeParameters . length ; i < paramLength ; i ++ ) { TypeParameter typeParameter = typeParameters [ i ] ; TypeVariableBinding typeVariable = typeParameter . binding ; TypeReference typeRef = typeParameter . type ; if ( typeRef == null ) continue nextVariable ; boolean isFirstBoundTypeVariable = false ; TypeBinding superType = this . kind == METHOD_SCOPE ? typeRef . resolveType ( ( BlockScope ) this , false ) : typeRef . resolveType ( ( ClassScope ) this ) ; if ( superType == null ) { typeVariable . tagBits |= TagBits . HierarchyHasProblems ; } else { typeRef . resolvedType = superType ; firstBound : { switch ( superType . kind ( ) ) { case Binding . ARRAY_TYPE : problemReporter ( ) . boundCannotBeArray ( typeRef , superType ) ; typeVariable . tagBits |= TagBits . HierarchyHasProblems ; break firstBound ; case Binding . TYPE_PARAMETER : isFirstBoundTypeVariable = true ; TypeVariableBinding varSuperType = ( TypeVariableBinding ) superType ; if ( varSuperType . rank >= typeVariable . rank && varSuperType . declaringElement == typeVariable . declaringElement ) { if ( compilerOptions ( ) . complianceLevel <= ClassFileConstants . JDK1_6 ) { problemReporter ( ) . forwardTypeVariableReference ( typeParameter , varSuperType ) ; typeVariable . tagBits |= TagBits . HierarchyHasProblems ; break firstBound ; } } if ( compilerOptions ( ) . complianceLevel > ClassFileConstants . JDK1_6 ) { if ( typeVariable . rank >= varSuperType . rank && varSuperType . declaringElement == typeVariable . declaringElement ) { SimpleSet set = new SimpleSet ( typeParameters . length ) ; set . add ( typeVariable ) ; ReferenceBinding superBinding = varSuperType ; while ( superBinding instanceof TypeVariableBinding ) { if ( set . includes ( superBinding ) ) { problemReporter ( ) . hierarchyCircularity ( typeVariable , varSuperType , typeRef ) ; typeVariable . tagBits |= TagBits . HierarchyHasProblems ; break firstBound ; } else { set . add ( superBinding ) ; superBinding = ( ( TypeVariableBinding ) superBinding ) . superclass ; } } } } break ; default : if ( ( ( ReferenceBinding ) superType ) . isFinal ( ) ) { problemReporter ( ) . finalVariableBound ( typeVariable , typeRef ) ; } break ; } ReferenceBinding superRefType = ( ReferenceBinding ) superType ; if ( ! superType . isInterface ( ) ) { typeVariable . superclass = superRefType ; } else { typeVariable . superInterfaces = new ReferenceBinding [ ] { superRefType } ; } typeVariable . tagBits |= superType . tagBits & TagBits . ContainsNestedTypeReferences ; typeVariable . firstBound = superRefType ; } } TypeReference [ ] boundRefs = typeParameter . bounds ; if ( boundRefs != null ) { nextBound : for ( int j = <NUM_LIT:0> , boundLength = boundRefs . length ; j < boundLength ; j ++ ) { typeRef = boundRefs [ j ] ; superType = this . kind == METHOD_SCOPE ? typeRef . resolveType ( ( BlockScope ) this , false ) : typeRef . resolveType ( ( ClassScope ) this ) ; if ( superType == null ) { typeVariable . tagBits |= TagBits . HierarchyHasProblems ; continue nextBound ; } else { typeVariable . tagBits |= superType . tagBits & TagBits . ContainsNestedTypeReferences ; boolean didAlreadyComplain = ! typeRef . resolvedType . isValidBinding ( ) ; if ( isFirstBoundTypeVariable && j == <NUM_LIT:0> ) { problemReporter ( ) . noAdditionalBoundAfterTypeVariable ( typeRef ) ; typeVariable . tagBits |= TagBits . HierarchyHasProblems ; didAlreadyComplain = true ; } else if ( superType . isArrayType ( ) ) { if ( ! didAlreadyComplain ) { problemReporter ( ) . boundCannotBeArray ( typeRef , superType ) ; typeVariable . tagBits |= TagBits . HierarchyHasProblems ; } continue nextBound ; } else { if ( ! superType . isInterface ( ) ) { if ( ! didAlreadyComplain ) { problemReporter ( ) . boundMustBeAnInterface ( typeRef , superType ) ; typeVariable . tagBits |= TagBits . HierarchyHasProblems ; } continue nextBound ; } } if ( checkForErasedCandidateCollisions && typeVariable . firstBound == typeVariable . superclass ) { if ( hasErasedCandidatesCollisions ( superType , typeVariable . superclass , invocations , typeVariable , typeRef ) ) { continue nextBound ; } } ReferenceBinding superRefType = ( ReferenceBinding ) superType ; for ( int index = typeVariable . superInterfaces . length ; -- index >= <NUM_LIT:0> ; ) { ReferenceBinding previousInterface = typeVariable . superInterfaces [ index ] ; if ( previousInterface == superRefType ) { problemReporter ( ) . duplicateBounds ( typeRef , superType ) ; typeVariable . tagBits |= TagBits . HierarchyHasProblems ; continue nextBound ; } if ( checkForErasedCandidateCollisions ) { if ( hasErasedCandidatesCollisions ( superType , previousInterface , invocations , typeVariable , typeRef ) ) { continue nextBound ; } } } int size = typeVariable . superInterfaces . length ; System . arraycopy ( typeVariable . superInterfaces , <NUM_LIT:0> , typeVariable . superInterfaces = new ReferenceBinding [ size + <NUM_LIT:1> ] , <NUM_LIT:0> , size ) ; typeVariable . superInterfaces [ size ] = superRefType ; } } } noProblems &= ( typeVariable . tagBits & TagBits . HierarchyHasProblems ) == <NUM_LIT:0> ; } return noProblems ; } public ArrayBinding createArrayType ( TypeBinding type , int dimension ) { if ( type . isValidBinding ( ) ) return environment ( ) . createArrayType ( type , dimension ) ; return new ArrayBinding ( type , dimension , environment ( ) ) ; } public TypeVariableBinding [ ] createTypeVariables ( TypeParameter [ ] typeParameters , Binding declaringElement ) { if ( typeParameters == null || typeParameters . length == <NUM_LIT:0> ) return Binding . NO_TYPE_VARIABLES ; PackageBinding unitPackage = compilationUnitScope ( ) . fPackage ; int length = typeParameters . length ; TypeVariableBinding [ ] typeVariableBindings = new TypeVariableBinding [ length ] ; int count = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeParameter typeParameter = typeParameters [ i ] ; TypeVariableBinding parameterBinding = new TypeVariableBinding ( typeParameter . name , declaringElement , i , environment ( ) ) ; parameterBinding . fPackage = unitPackage ; typeParameter . binding = parameterBinding ; for ( int j = <NUM_LIT:0> ; j < count ; j ++ ) { TypeVariableBinding knownVar = typeVariableBindings [ j ] ; if ( CharOperation . equals ( knownVar . sourceName , typeParameter . name ) ) problemReporter ( ) . duplicateTypeParameterInType ( typeParameter ) ; } typeVariableBindings [ count ++ ] = parameterBinding ; } if ( count != length ) System . arraycopy ( typeVariableBindings , <NUM_LIT:0> , typeVariableBindings = new TypeVariableBinding [ count ] , <NUM_LIT:0> , count ) ; return typeVariableBindings ; } public final ClassScope enclosingClassScope ( ) { Scope scope = this ; while ( ( scope = scope . parent ) != null ) { if ( scope instanceof ClassScope ) return ( ClassScope ) scope ; } return null ; } public final MethodScope enclosingMethodScope ( ) { Scope scope = this ; while ( ( scope = scope . parent ) != null ) { if ( scope instanceof MethodScope ) return ( MethodScope ) scope ; } return null ; } public final ReferenceBinding enclosingReceiverType ( ) { Scope scope = this ; do { if ( scope instanceof ClassScope ) { return environment ( ) . convertToParameterizedType ( ( ( ClassScope ) scope ) . referenceContext . binding ) ; } scope = scope . parent ; } while ( scope != null ) ; return null ; } public ReferenceContext enclosingReferenceContext ( ) { Scope current = this ; while ( ( current = current . parent ) != null ) { switch ( current . kind ) { case METHOD_SCOPE : return ( ( MethodScope ) current ) . referenceContext ; case CLASS_SCOPE : return ( ( ClassScope ) current ) . referenceContext ; case COMPILATION_UNIT_SCOPE : return ( ( CompilationUnitScope ) current ) . referenceContext ; } } return null ; } public final SourceTypeBinding enclosingSourceType ( ) { Scope scope = this ; do { if ( scope instanceof ClassScope ) return ( ( ClassScope ) scope ) . referenceContext . binding ; scope = scope . parent ; } while ( scope != null ) ; return null ; } public final LookupEnvironment environment ( ) { Scope scope , unitScope = this ; while ( ( scope = unitScope . parent ) != null ) unitScope = scope ; return ( ( CompilationUnitScope ) unitScope ) . environment ; } protected MethodBinding findDefaultAbstractMethod ( ReferenceBinding receiverType , char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite , ReferenceBinding classHierarchyStart , ObjectVector found , MethodBinding concreteMatch ) { int startFoundSize = found . size ; ReferenceBinding currentType = classHierarchyStart ; while ( currentType != null ) { findMethodInSuperInterfaces ( currentType , selector , found , invocationSite ) ; currentType = currentType . superclass ( ) ; } MethodBinding [ ] candidates = null ; int candidatesCount = <NUM_LIT:0> ; MethodBinding problemMethod = null ; int foundSize = found . size ; if ( foundSize > startFoundSize ) { for ( int i = startFoundSize ; i < foundSize ; i ++ ) { MethodBinding methodBinding = ( MethodBinding ) found . elementAt ( i ) ; MethodBinding compatibleMethod = computeCompatibleMethod ( methodBinding , argumentTypes , invocationSite ) ; if ( compatibleMethod != null ) { if ( compatibleMethod . isValidBinding ( ) ) { if ( concreteMatch != null && environment ( ) . methodVerifier ( ) . areMethodsCompatible ( concreteMatch , compatibleMethod ) ) continue ; if ( candidatesCount == <NUM_LIT:0> ) { candidates = new MethodBinding [ foundSize - startFoundSize + <NUM_LIT:1> ] ; if ( concreteMatch != null ) candidates [ candidatesCount ++ ] = concreteMatch ; } candidates [ candidatesCount ++ ] = compatibleMethod ; } else if ( problemMethod == null ) { problemMethod = compatibleMethod ; } } } } if ( candidatesCount < <NUM_LIT:2> ) { if ( concreteMatch == null ) { if ( candidatesCount == <NUM_LIT:0> ) return problemMethod ; concreteMatch = candidates [ <NUM_LIT:0> ] ; } compilationUnitScope ( ) . recordTypeReferences ( concreteMatch . thrownExceptions ) ; return concreteMatch ; } if ( compilerOptions ( ) . complianceLevel >= ClassFileConstants . JDK1_4 ) return mostSpecificMethodBinding ( candidates , candidatesCount , argumentTypes , invocationSite , receiverType ) ; return mostSpecificInterfaceMethodBinding ( candidates , candidatesCount , invocationSite ) ; } public ReferenceBinding findDirectMemberType ( char [ ] typeName , ReferenceBinding enclosingType ) { if ( ( enclosingType . tagBits & TagBits . HasNoMemberTypes ) != <NUM_LIT:0> ) return null ; ReferenceBinding enclosingReceiverType = enclosingReceiverType ( ) ; CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordReference ( enclosingType , typeName ) ; ReferenceBinding memberType = enclosingType . getMemberType ( typeName ) ; if ( memberType != null ) { unitScope . recordTypeReference ( memberType ) ; if ( enclosingReceiverType == null ) { if ( memberType . canBeSeenBy ( getCurrentPackage ( ) ) ) { return memberType ; } if ( this instanceof CompilationUnitScope ) { TypeDeclaration [ ] types = ( ( CompilationUnitScope ) this ) . referenceContext . types ; if ( types != null ) { for ( int i = <NUM_LIT:0> , max = types . length ; i < max ; i ++ ) { if ( memberType . canBeSeenBy ( enclosingType , types [ i ] . binding ) ) { return memberType ; } } } } } else if ( memberType . canBeSeenBy ( enclosingType , enclosingReceiverType ) ) { return memberType ; } return new ProblemReferenceBinding ( new char [ ] [ ] { typeName } , memberType , ProblemReasons . NotVisible ) ; } return null ; } public MethodBinding findExactMethod ( ReferenceBinding receiverType , char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordTypeReferences ( argumentTypes ) ; MethodBinding exactMethod = receiverType . getExactMethod ( selector , argumentTypes , unitScope ) ; if ( exactMethod != null && exactMethod . typeVariables == Binding . NO_TYPE_VARIABLES && ! exactMethod . isBridge ( ) ) { if ( compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ) for ( int i = argumentTypes . length ; -- i >= <NUM_LIT:0> ; ) if ( isPossibleSubtypeOfRawType ( argumentTypes [ i ] ) ) return null ; unitScope . recordTypeReferences ( exactMethod . thrownExceptions ) ; if ( exactMethod . isAbstract ( ) && exactMethod . thrownExceptions != Binding . NO_EXCEPTIONS ) return null ; if ( receiverType . isInterface ( ) || exactMethod . canBeSeenBy ( receiverType , invocationSite , this ) ) { if ( argumentTypes == Binding . NO_PARAMETERS && CharOperation . equals ( selector , TypeConstants . GETCLASS ) && exactMethod . returnType . isParameterizedType ( ) ) { return environment ( ) . createGetClassMethod ( receiverType , exactMethod , this ) ; } if ( invocationSite . genericTypeArguments ( ) != null ) { exactMethod = computeCompatibleMethod ( exactMethod , argumentTypes , invocationSite ) ; } return exactMethod ; } } return null ; } public FieldBinding findField ( TypeBinding receiverType , char [ ] fieldName , InvocationSite invocationSite , boolean needResolve ) { return findField ( receiverType , fieldName , invocationSite , needResolve , false ) ; } public FieldBinding findField ( TypeBinding receiverType , char [ ] fieldName , InvocationSite invocationSite , boolean needResolve , boolean invisibleFieldsOk ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordTypeReference ( receiverType ) ; checkArrayField : { TypeBinding leafType ; switch ( receiverType . kind ( ) ) { case Binding . BASE_TYPE : return null ; case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : case Binding . TYPE_PARAMETER : TypeBinding receiverErasure = receiverType . erasure ( ) ; if ( ! receiverErasure . isArrayType ( ) ) break checkArrayField ; leafType = receiverErasure . leafComponentType ( ) ; break ; case Binding . ARRAY_TYPE : leafType = receiverType . leafComponentType ( ) ; break ; default : break checkArrayField ; } if ( leafType instanceof ReferenceBinding ) if ( ! ( ( ReferenceBinding ) leafType ) . canBeSeenBy ( this ) ) return new ProblemFieldBinding ( ( ReferenceBinding ) leafType , fieldName , ProblemReasons . ReceiverTypeNotVisible ) ; if ( CharOperation . equals ( fieldName , TypeConstants . LENGTH ) ) { if ( ( leafType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { return new ProblemFieldBinding ( ArrayBinding . ArrayLength , null , fieldName , ProblemReasons . NotFound ) ; } return ArrayBinding . ArrayLength ; } return null ; } ReferenceBinding currentType = ( ReferenceBinding ) receiverType ; if ( ! currentType . canBeSeenBy ( this ) ) return new ProblemFieldBinding ( currentType , fieldName , ProblemReasons . ReceiverTypeNotVisible ) ; currentType . initializeForStaticImports ( ) ; FieldBinding field = currentType . getField ( fieldName , needResolve ) ; boolean insideTypeAnnotations = this instanceof MethodScope && ( ( MethodScope ) this ) . insideTypeAnnotation ; if ( field != null ) { if ( invisibleFieldsOk ) { return field ; } if ( invocationSite == null || insideTypeAnnotations ? field . canBeSeenBy ( getCurrentPackage ( ) ) : field . canBeSeenBy ( currentType , invocationSite , this ) ) return field ; return new ProblemFieldBinding ( field , field . declaringClass , fieldName , ProblemReasons . NotVisible ) ; } ReferenceBinding [ ] interfacesToVisit = null ; int nextPosition = <NUM_LIT:0> ; FieldBinding visibleField = null ; boolean keepLooking = true ; FieldBinding notVisibleField = null ; while ( keepLooking ) { ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { if ( interfacesToVisit == null ) { interfacesToVisit = itsInterfaces ; nextPosition = interfacesToVisit . length ; } else { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } if ( ( currentType = currentType . superclass ( ) ) == null ) break ; unitScope . recordTypeReference ( currentType ) ; currentType . initializeForStaticImports ( ) ; currentType = ( ReferenceBinding ) currentType . capture ( this , invocationSite == null ? <NUM_LIT:0> : invocationSite . sourceEnd ( ) ) ; if ( ( field = currentType . getField ( fieldName , needResolve ) ) != null ) { if ( invisibleFieldsOk ) { return field ; } keepLooking = false ; if ( field . canBeSeenBy ( receiverType , invocationSite , this ) ) { if ( visibleField == null ) visibleField = field ; else return new ProblemFieldBinding ( visibleField , visibleField . declaringClass , fieldName , ProblemReasons . Ambiguous ) ; } else { if ( notVisibleField == null ) notVisibleField = field ; } } } if ( interfacesToVisit != null ) { ProblemFieldBinding ambiguous = null ; done : for ( int i = <NUM_LIT:0> ; i < nextPosition ; i ++ ) { ReferenceBinding anInterface = interfacesToVisit [ i ] ; unitScope . recordTypeReference ( anInterface ) ; if ( ( field = anInterface . getField ( fieldName , true ) ) != null ) { if ( invisibleFieldsOk ) { return field ; } if ( visibleField == null ) { visibleField = field ; } else { ambiguous = new ProblemFieldBinding ( visibleField , visibleField . declaringClass , fieldName , ProblemReasons . Ambiguous ) ; break done ; } } else { ReferenceBinding [ ] itsInterfaces = anInterface . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } } if ( ambiguous != null ) return ambiguous ; } if ( visibleField != null ) return visibleField ; if ( notVisibleField != null ) { return new ProblemFieldBinding ( notVisibleField , currentType , fieldName , ProblemReasons . NotVisible ) ; } return null ; } public ReferenceBinding findMemberType ( char [ ] typeName , ReferenceBinding enclosingType ) { if ( ( enclosingType . tagBits & TagBits . HasNoMemberTypes ) != <NUM_LIT:0> ) return null ; ReferenceBinding enclosingSourceType = enclosingSourceType ( ) ; PackageBinding currentPackage = getCurrentPackage ( ) ; CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordReference ( enclosingType , typeName ) ; ReferenceBinding memberType = enclosingType . getMemberType ( typeName ) ; if ( memberType != null ) { unitScope . recordTypeReference ( memberType ) ; if ( enclosingSourceType == null || ( this . parent == unitScope && ( enclosingSourceType . tagBits & TagBits . TypeVariablesAreConnected ) == <NUM_LIT:0> ) ? memberType . canBeSeenBy ( currentPackage ) : memberType . canBeSeenBy ( enclosingType , enclosingSourceType ) ) return memberType ; return new ProblemReferenceBinding ( new char [ ] [ ] { typeName } , memberType , ProblemReasons . NotVisible ) ; } ReferenceBinding currentType = enclosingType ; ReferenceBinding [ ] interfacesToVisit = null ; int nextPosition = <NUM_LIT:0> ; ReferenceBinding visibleMemberType = null ; boolean keepLooking = true ; ReferenceBinding notVisible = null ; while ( keepLooking ) { ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces == null ) { ReferenceBinding sourceType = currentType . isParameterizedType ( ) ? ( ( ParameterizedTypeBinding ) currentType ) . genericType ( ) : currentType ; if ( sourceType . isHierarchyBeingConnected ( ) ) return null ; ( ( SourceTypeBinding ) sourceType ) . scope . connectTypeHierarchy ( ) ; itsInterfaces = currentType . superInterfaces ( ) ; } if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { if ( interfacesToVisit == null ) { interfacesToVisit = itsInterfaces ; nextPosition = interfacesToVisit . length ; } else { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } if ( ( currentType = currentType . superclass ( ) ) == null ) break ; unitScope . recordReference ( currentType , typeName ) ; if ( ( memberType = currentType . getMemberType ( typeName ) ) != null ) { unitScope . recordTypeReference ( memberType ) ; keepLooking = false ; if ( enclosingSourceType == null ? memberType . canBeSeenBy ( currentPackage ) : memberType . canBeSeenBy ( enclosingType , enclosingSourceType ) ) { if ( visibleMemberType == null ) visibleMemberType = memberType ; else return new ProblemReferenceBinding ( new char [ ] [ ] { typeName } , visibleMemberType , ProblemReasons . Ambiguous ) ; } else { notVisible = memberType ; } } } if ( interfacesToVisit != null ) { ProblemReferenceBinding ambiguous = null ; done : for ( int i = <NUM_LIT:0> ; i < nextPosition ; i ++ ) { ReferenceBinding anInterface = interfacesToVisit [ i ] ; unitScope . recordReference ( anInterface , typeName ) ; if ( ( memberType = anInterface . getMemberType ( typeName ) ) != null ) { unitScope . recordTypeReference ( memberType ) ; if ( visibleMemberType == null ) { visibleMemberType = memberType ; } else { ambiguous = new ProblemReferenceBinding ( new char [ ] [ ] { typeName } , visibleMemberType , ProblemReasons . Ambiguous ) ; break done ; } } else { ReferenceBinding [ ] itsInterfaces = anInterface . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } } if ( ambiguous != null ) return ambiguous ; } if ( visibleMemberType != null ) return visibleMemberType ; if ( notVisible != null ) return new ProblemReferenceBinding ( new char [ ] [ ] { typeName } , notVisible , ProblemReasons . NotVisible ) ; return null ; } public MethodBinding findMethod ( ReferenceBinding receiverType , char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite ) { return findMethod ( receiverType , selector , argumentTypes , invocationSite , false ) ; } public MethodBinding oneLastLook ( ReferenceBinding receiverType , char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite ) { MethodBinding [ ] extraMethods = receiverType . getAnyExtraMethods ( selector ) ; if ( extraMethods != null ) { return extraMethods [ <NUM_LIT:0> ] ; } else { return null ; } } public MethodBinding findMethod ( ReferenceBinding receiverType , char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite , boolean inStaticContext ) { ReferenceBinding currentType = receiverType ; boolean receiverTypeIsInterface = receiverType . isInterface ( ) ; ObjectVector found = new ObjectVector ( <NUM_LIT:3> ) ; CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordTypeReferences ( argumentTypes ) ; if ( receiverTypeIsInterface ) { unitScope . recordTypeReference ( receiverType ) ; MethodBinding [ ] receiverMethods = receiverType . getMethods ( selector , argumentTypes . length ) ; if ( receiverMethods . length > <NUM_LIT:0> ) found . addAll ( receiverMethods ) ; findMethodInSuperInterfaces ( receiverType , selector , found , invocationSite ) ; currentType = getJavaLangObject ( ) ; } long complianceLevel = compilerOptions ( ) . complianceLevel ; boolean isCompliant14 = complianceLevel >= ClassFileConstants . JDK1_4 ; boolean isCompliant15 = complianceLevel >= ClassFileConstants . JDK1_5 ; ReferenceBinding classHierarchyStart = currentType ; MethodVerifier verifier = environment ( ) . methodVerifier ( ) ; while ( currentType != null ) { unitScope . recordTypeReference ( currentType ) ; currentType = ( ReferenceBinding ) currentType . capture ( this , invocationSite == null ? <NUM_LIT:0> : invocationSite . sourceEnd ( ) ) ; MethodBinding [ ] currentMethods = currentType . getMethods ( selector , argumentTypes . length ) ; int currentLength = currentMethods . length ; if ( currentLength > <NUM_LIT:0> ) { if ( isCompliant14 && ( receiverTypeIsInterface || found . size > <NUM_LIT:0> ) ) { nextMethod : for ( int i = <NUM_LIT:0> , l = currentLength ; i < l ; i ++ ) { MethodBinding currentMethod = currentMethods [ i ] ; if ( currentMethod == null ) continue nextMethod ; if ( receiverTypeIsInterface && ! currentMethod . isPublic ( ) ) { currentLength -- ; currentMethods [ i ] = null ; continue nextMethod ; } for ( int j = <NUM_LIT:0> , max = found . size ; j < max ; j ++ ) { MethodBinding matchingMethod = ( MethodBinding ) found . elementAt ( j ) ; MethodBinding matchingOriginal = matchingMethod . original ( ) ; MethodBinding currentOriginal = matchingOriginal . findOriginalInheritedMethod ( currentMethod ) ; if ( currentOriginal != null && verifier . isParameterSubsignature ( matchingOriginal , currentOriginal ) ) { if ( isCompliant15 ) { if ( matchingMethod . isBridge ( ) && ! currentMethod . isBridge ( ) ) continue nextMethod ; } currentLength -- ; currentMethods [ i ] = null ; continue nextMethod ; } } } } if ( currentLength > <NUM_LIT:0> ) { if ( currentMethods . length == currentLength ) { found . addAll ( currentMethods ) ; } else { for ( int i = <NUM_LIT:0> , max = currentMethods . length ; i < max ; i ++ ) { MethodBinding currentMethod = currentMethods [ i ] ; if ( currentMethod != null ) found . add ( currentMethod ) ; } } } } currentType = currentType . superclass ( ) ; } int foundSize = found . size ; MethodBinding [ ] candidates = null ; int candidatesCount = <NUM_LIT:0> ; MethodBinding problemMethod = null ; boolean searchForDefaultAbstractMethod = isCompliant14 && ! receiverTypeIsInterface && ( receiverType . isAbstract ( ) || receiverType . isTypeVariable ( ) ) ; if ( foundSize > <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> ; i < foundSize ; i ++ ) { MethodBinding methodBinding = ( MethodBinding ) found . elementAt ( i ) ; MethodBinding compatibleMethod = computeCompatibleMethod ( methodBinding , argumentTypes , invocationSite ) ; if ( compatibleMethod != null ) { if ( compatibleMethod . isValidBinding ( ) ) { if ( foundSize == <NUM_LIT:1> && compatibleMethod . canBeSeenBy ( receiverType , invocationSite , this ) ) { if ( searchForDefaultAbstractMethod ) return findDefaultAbstractMethod ( receiverType , selector , argumentTypes , invocationSite , classHierarchyStart , found , compatibleMethod ) ; unitScope . recordTypeReferences ( compatibleMethod . thrownExceptions ) ; return compatibleMethod ; } if ( candidatesCount == <NUM_LIT:0> ) candidates = new MethodBinding [ foundSize ] ; candidates [ candidatesCount ++ ] = compatibleMethod ; } else if ( problemMethod == null ) { problemMethod = compatibleMethod ; } } } } if ( candidatesCount == <NUM_LIT:0> ) { if ( problemMethod != null ) { switch ( problemMethod . problemId ( ) ) { case ProblemReasons . TypeArgumentsForRawGenericMethod : case ProblemReasons . TypeParameterArityMismatch : return problemMethod ; } } MethodBinding interfaceMethod = findDefaultAbstractMethod ( receiverType , selector , argumentTypes , invocationSite , classHierarchyStart , found , null ) ; if ( interfaceMethod != null ) return interfaceMethod ; if ( found . size == <NUM_LIT:0> ) return null ; if ( problemMethod != null ) return problemMethod ; int bestArgMatches = - <NUM_LIT:1> ; MethodBinding bestGuess = ( MethodBinding ) found . elementAt ( <NUM_LIT:0> ) ; int argLength = argumentTypes . length ; foundSize = found . size ; nextMethod : for ( int i = <NUM_LIT:0> ; i < foundSize ; i ++ ) { MethodBinding methodBinding = ( MethodBinding ) found . elementAt ( i ) ; TypeBinding [ ] params = methodBinding . parameters ; int paramLength = params . length ; int argMatches = <NUM_LIT:0> ; next : for ( int a = <NUM_LIT:0> ; a < argLength ; a ++ ) { TypeBinding arg = argumentTypes [ a ] ; for ( int p = a == <NUM_LIT:0> ? <NUM_LIT:0> : a - <NUM_LIT:1> ; p < paramLength && p < a + <NUM_LIT:1> ; p ++ ) { if ( params [ p ] == arg ) { argMatches ++ ; continue next ; } } } if ( argMatches < bestArgMatches ) continue nextMethod ; if ( argMatches == bestArgMatches ) { int diff1 = paramLength < argLength ? <NUM_LIT:2> * ( argLength - paramLength ) : paramLength - argLength ; int bestLength = bestGuess . parameters . length ; int diff2 = bestLength < argLength ? <NUM_LIT:2> * ( argLength - bestLength ) : bestLength - argLength ; if ( diff1 >= diff2 ) continue nextMethod ; } bestArgMatches = argMatches ; bestGuess = methodBinding ; } return new ProblemMethodBinding ( bestGuess , bestGuess . selector , argumentTypes , ProblemReasons . NotFound ) ; } int visiblesCount = <NUM_LIT:0> ; if ( receiverTypeIsInterface ) { if ( candidatesCount == <NUM_LIT:1> ) { unitScope . recordTypeReferences ( candidates [ <NUM_LIT:0> ] . thrownExceptions ) ; return candidates [ <NUM_LIT:0> ] ; } visiblesCount = candidatesCount ; } else { for ( int i = <NUM_LIT:0> ; i < candidatesCount ; i ++ ) { MethodBinding methodBinding = candidates [ i ] ; if ( methodBinding . canBeSeenBy ( receiverType , invocationSite , this ) ) { if ( visiblesCount != i ) { candidates [ i ] = null ; candidates [ visiblesCount ] = methodBinding ; } visiblesCount ++ ; } } switch ( visiblesCount ) { case <NUM_LIT:0> : MethodBinding interfaceMethod = findDefaultAbstractMethod ( receiverType , selector , argumentTypes , invocationSite , classHierarchyStart , found , null ) ; if ( interfaceMethod != null ) return interfaceMethod ; return new ProblemMethodBinding ( candidates [ <NUM_LIT:0> ] , candidates [ <NUM_LIT:0> ] . selector , candidates [ <NUM_LIT:0> ] . parameters , ProblemReasons . NotVisible ) ; case <NUM_LIT:1> : if ( searchForDefaultAbstractMethod ) return findDefaultAbstractMethod ( receiverType , selector , argumentTypes , invocationSite , classHierarchyStart , found , candidates [ <NUM_LIT:0> ] ) ; unitScope . recordTypeReferences ( candidates [ <NUM_LIT:0> ] . thrownExceptions ) ; return candidates [ <NUM_LIT:0> ] ; default : break ; } } if ( complianceLevel <= ClassFileConstants . JDK1_3 ) { ReferenceBinding declaringClass = candidates [ <NUM_LIT:0> ] . declaringClass ; return ! declaringClass . isInterface ( ) ? mostSpecificClassMethodBinding ( candidates , visiblesCount , invocationSite ) : mostSpecificInterfaceMethodBinding ( candidates , visiblesCount , invocationSite ) ; } if ( compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ) { for ( int i = <NUM_LIT:0> ; i < visiblesCount ; i ++ ) { MethodBinding candidate = candidates [ i ] ; if ( candidate instanceof ParameterizedGenericMethodBinding ) candidate = ( ( ParameterizedGenericMethodBinding ) candidate ) . originalMethod ; if ( candidate . hasSubstitutedParameters ( ) ) { for ( int j = i + <NUM_LIT:1> ; j < visiblesCount ; j ++ ) { MethodBinding otherCandidate = candidates [ j ] ; if ( otherCandidate . hasSubstitutedParameters ( ) ) { if ( otherCandidate == candidate || ( candidate . declaringClass == otherCandidate . declaringClass && candidate . areParametersEqual ( otherCandidate ) ) ) { return new ProblemMethodBinding ( candidates [ i ] , candidates [ i ] . selector , candidates [ i ] . parameters , ProblemReasons . Ambiguous ) ; } } } } } } if ( inStaticContext ) { MethodBinding [ ] staticCandidates = new MethodBinding [ visiblesCount ] ; int staticCount = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < visiblesCount ; i ++ ) if ( candidates [ i ] . isStatic ( ) ) staticCandidates [ staticCount ++ ] = candidates [ i ] ; if ( staticCount == <NUM_LIT:1> ) return staticCandidates [ <NUM_LIT:0> ] ; if ( staticCount > <NUM_LIT:1> ) return mostSpecificMethodBinding ( staticCandidates , staticCount , argumentTypes , invocationSite , receiverType ) ; } MethodBinding mostSpecificMethod = mostSpecificMethodBinding ( candidates , visiblesCount , argumentTypes , invocationSite , receiverType ) ; if ( searchForDefaultAbstractMethod ) { if ( mostSpecificMethod . isValidBinding ( ) ) return findDefaultAbstractMethod ( receiverType , selector , argumentTypes , invocationSite , classHierarchyStart , found , mostSpecificMethod ) ; MethodBinding interfaceMethod = findDefaultAbstractMethod ( receiverType , selector , argumentTypes , invocationSite , classHierarchyStart , found , null ) ; if ( interfaceMethod != null && interfaceMethod . isValidBinding ( ) ) return interfaceMethod ; } return mostSpecificMethod ; } public MethodBinding findMethodForArray ( ArrayBinding receiverType , char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite ) { TypeBinding leafType = receiverType . leafComponentType ( ) ; if ( leafType instanceof ReferenceBinding ) { if ( ! ( ( ReferenceBinding ) leafType ) . canBeSeenBy ( this ) ) return new ProblemMethodBinding ( selector , Binding . NO_PARAMETERS , ( ReferenceBinding ) leafType , ProblemReasons . ReceiverTypeNotVisible ) ; } ReferenceBinding object = getJavaLangObject ( ) ; MethodBinding methodBinding = object . getExactMethod ( selector , argumentTypes , null ) ; if ( methodBinding != null ) { if ( argumentTypes == Binding . NO_PARAMETERS ) { switch ( selector [ <NUM_LIT:0> ] ) { case '<CHAR_LIT:c>' : if ( CharOperation . equals ( selector , TypeConstants . CLONE ) ) { return environment ( ) . computeArrayClone ( methodBinding ) ; } break ; case '<CHAR_LIT>' : if ( CharOperation . equals ( selector , TypeConstants . GETCLASS ) && methodBinding . returnType . isParameterizedType ( ) ) { return environment ( ) . createGetClassMethod ( receiverType , methodBinding , this ) ; } break ; } } if ( methodBinding . canBeSeenBy ( receiverType , invocationSite , this ) ) return methodBinding ; } methodBinding = findMethod ( object , selector , argumentTypes , invocationSite ) ; if ( methodBinding == null ) return new ProblemMethodBinding ( selector , argumentTypes , ProblemReasons . NotFound ) ; return methodBinding ; } protected void findMethodInSuperInterfaces ( ReferenceBinding currentType , char [ ] selector , ObjectVector found , InvocationSite invocationSite ) { ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { ReferenceBinding [ ] interfacesToVisit = itsInterfaces ; int nextPosition = interfacesToVisit . length ; for ( int i = <NUM_LIT:0> ; i < nextPosition ; i ++ ) { currentType = interfacesToVisit [ i ] ; compilationUnitScope ( ) . recordTypeReference ( currentType ) ; currentType = ( ReferenceBinding ) currentType . capture ( this , invocationSite == null ? <NUM_LIT:0> : invocationSite . sourceEnd ( ) ) ; MethodBinding [ ] currentMethods = currentType . getMethods ( selector ) ; if ( currentMethods . length > <NUM_LIT:0> ) { int foundSize = found . size ; if ( foundSize > <NUM_LIT:0> ) { next : for ( int c = <NUM_LIT:0> , l = currentMethods . length ; c < l ; c ++ ) { MethodBinding current = currentMethods [ c ] ; for ( int f = <NUM_LIT:0> ; f < foundSize ; f ++ ) if ( current == found . elementAt ( f ) ) continue next ; found . add ( current ) ; } } else { found . addAll ( currentMethods ) ; } } if ( ( itsInterfaces = currentType . superInterfaces ( ) ) != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } } } public ReferenceBinding findType ( char [ ] typeName , PackageBinding declarationPackage , PackageBinding invocationPackage ) { compilationUnitScope ( ) . recordReference ( declarationPackage . compoundName , typeName ) ; ReferenceBinding typeBinding = declarationPackage . getType ( typeName ) ; if ( typeBinding == null ) return null ; if ( typeBinding . isValidBinding ( ) ) { if ( declarationPackage != invocationPackage && ! typeBinding . canBeSeenBy ( invocationPackage ) ) return new ProblemReferenceBinding ( new char [ ] [ ] { typeName } , typeBinding , ProblemReasons . NotVisible ) ; } return typeBinding ; } public LocalVariableBinding findVariable ( char [ ] variable ) { return null ; } public Binding getBinding ( char [ ] name , int mask , InvocationSite invocationSite , boolean needResolve ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; LookupEnvironment env = unitScope . environment ; try { env . missingClassFileLocation = invocationSite ; Binding binding = null ; FieldBinding problemField = null ; if ( ( mask & Binding . VARIABLE ) != <NUM_LIT:0> ) { boolean insideStaticContext = false ; boolean insideConstructorCall = false ; boolean insideTypeAnnotation = false ; FieldBinding foundField = null ; ProblemFieldBinding foundInsideProblem = null ; Scope scope = this ; int depth = <NUM_LIT:0> ; int foundDepth = <NUM_LIT:0> ; ReferenceBinding foundActualReceiverType = null ; done : while ( true ) { switch ( scope . kind ) { case METHOD_SCOPE : MethodScope methodScope = ( MethodScope ) scope ; insideStaticContext |= methodScope . isStatic ; insideConstructorCall |= methodScope . isConstructorCall ; insideTypeAnnotation = methodScope . insideTypeAnnotation ; case BLOCK_SCOPE : LocalVariableBinding variableBinding = scope . findVariable ( name ) ; if ( variableBinding != null ) { if ( foundField != null && foundField . isValidBinding ( ) ) return new ProblemFieldBinding ( foundField , foundField . declaringClass , name , ProblemReasons . InheritedNameHidesEnclosingName ) ; if ( depth > <NUM_LIT:0> ) invocationSite . setDepth ( depth ) ; return variableBinding ; } break ; case CLASS_SCOPE : ClassScope classScope = ( ClassScope ) scope ; ReferenceBinding receiverType = classScope . enclosingReceiverType ( ) ; if ( ! insideTypeAnnotation ) { FieldBinding fieldBinding = classScope . findField ( receiverType , name , invocationSite , needResolve ) ; if ( fieldBinding != null ) { if ( fieldBinding . problemId ( ) == ProblemReasons . Ambiguous ) { if ( foundField == null || foundField . problemId ( ) == ProblemReasons . NotVisible ) return fieldBinding ; return new ProblemFieldBinding ( foundField , foundField . declaringClass , name , ProblemReasons . InheritedNameHidesEnclosingName ) ; } ProblemFieldBinding insideProblem = null ; if ( fieldBinding . isValidBinding ( ) ) { if ( ! fieldBinding . isStatic ( ) ) { if ( insideConstructorCall ) { insideProblem = new ProblemFieldBinding ( fieldBinding , fieldBinding . declaringClass , name , ProblemReasons . NonStaticReferenceInConstructorInvocation ) ; } else if ( insideStaticContext ) { insideProblem = new ProblemFieldBinding ( fieldBinding , fieldBinding . declaringClass , name , ProblemReasons . NonStaticReferenceInStaticContext ) ; } } if ( receiverType == fieldBinding . declaringClass || compilerOptions ( ) . complianceLevel >= ClassFileConstants . JDK1_4 ) { if ( foundField == null ) { if ( depth > <NUM_LIT:0> ) { invocationSite . setDepth ( depth ) ; invocationSite . setActualReceiverType ( receiverType ) ; } return insideProblem == null ? fieldBinding : insideProblem ; } if ( foundField . isValidBinding ( ) ) if ( foundField . declaringClass != fieldBinding . declaringClass && foundField . declaringClass != foundActualReceiverType ) return new ProblemFieldBinding ( foundField , foundField . declaringClass , name , ProblemReasons . InheritedNameHidesEnclosingName ) ; } } if ( foundField == null || ( foundField . problemId ( ) == ProblemReasons . NotVisible && fieldBinding . problemId ( ) != ProblemReasons . NotVisible ) ) { foundDepth = depth ; foundActualReceiverType = receiverType ; foundInsideProblem = insideProblem ; foundField = fieldBinding ; } } } insideTypeAnnotation = false ; depth ++ ; insideStaticContext |= receiverType . isStatic ( ) ; MethodScope enclosingMethodScope = scope . methodScope ( ) ; insideConstructorCall = enclosingMethodScope == null ? false : enclosingMethodScope . isConstructorCall ; break ; case COMPILATION_UNIT_SCOPE : break done ; } scope = scope . parent ; } if ( foundInsideProblem != null ) return foundInsideProblem ; if ( foundField != null ) { if ( foundField . isValidBinding ( ) ) { if ( foundDepth > <NUM_LIT:0> ) { invocationSite . setDepth ( foundDepth ) ; invocationSite . setActualReceiverType ( foundActualReceiverType ) ; } return foundField ; } problemField = foundField ; foundField = null ; } if ( compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ) { unitScope . faultInImports ( ) ; ImportBinding [ ] imports = unitScope . imports ; if ( imports != null ) { for ( int i = <NUM_LIT:0> , length = imports . length ; i < length ; i ++ ) { ImportBinding importBinding = imports [ i ] ; if ( importBinding . isStatic ( ) && ! importBinding . onDemand ) { if ( CharOperation . equals ( importBinding . compoundName [ importBinding . compoundName . length - <NUM_LIT:1> ] , name ) ) { if ( unitScope . resolveSingleImport ( importBinding , Binding . TYPE | Binding . FIELD | Binding . METHOD ) != null && importBinding . resolvedImport instanceof FieldBinding ) { foundField = ( FieldBinding ) importBinding . resolvedImport ; ImportReference importReference = importBinding . reference ; if ( importReference != null && needResolve ) { importReference . bits |= ASTNode . Used ; } invocationSite . setActualReceiverType ( foundField . declaringClass ) ; if ( foundField . isValidBinding ( ) ) { return foundField ; } if ( problemField == null ) problemField = foundField ; } } } } boolean foundInImport = false ; for ( int i = <NUM_LIT:0> , length = imports . length ; i < length ; i ++ ) { ImportBinding importBinding = imports [ i ] ; if ( importBinding . isStatic ( ) && importBinding . onDemand ) { Binding resolvedImport = importBinding . resolvedImport ; if ( resolvedImport instanceof ReferenceBinding ) { FieldBinding temp = findField ( ( ReferenceBinding ) resolvedImport , name , invocationSite , needResolve ) ; if ( temp != null ) { if ( ! temp . isValidBinding ( ) ) { if ( problemField == null ) problemField = temp ; } else if ( temp . isStatic ( ) ) { if ( foundField == temp ) continue ; ImportReference importReference = importBinding . reference ; if ( importReference != null && needResolve ) { importReference . bits |= ASTNode . Used ; } if ( foundInImport ) return new ProblemFieldBinding ( foundField , foundField . declaringClass , name , ProblemReasons . Ambiguous ) ; foundField = temp ; foundInImport = true ; } } } } } if ( foundField != null ) { invocationSite . setActualReceiverType ( foundField . declaringClass ) ; return foundField ; } } } } if ( ( mask & Binding . TYPE ) != <NUM_LIT:0> ) { if ( ( binding = getBaseType ( name ) ) != null ) return binding ; binding = getTypeOrPackage ( name , ( mask & Binding . PACKAGE ) == <NUM_LIT:0> ? Binding . TYPE : Binding . TYPE | Binding . PACKAGE , needResolve ) ; if ( binding . isValidBinding ( ) || mask == Binding . TYPE ) return binding ; } else if ( ( mask & Binding . PACKAGE ) != <NUM_LIT:0> ) { unitScope . recordSimpleReference ( name ) ; if ( ( binding = env . getTopLevelPackage ( name ) ) != null ) return binding ; } if ( problemField != null ) return problemField ; if ( binding != null && binding . problemId ( ) != ProblemReasons . NotFound ) return binding ; return new ProblemBinding ( name , enclosingSourceType ( ) , ProblemReasons . NotFound ) ; } catch ( AbortCompilation e ) { e . updateContext ( invocationSite , referenceCompilationUnit ( ) . compilationResult ) ; throw e ; } finally { env . missingClassFileLocation = null ; } } public MethodBinding getConstructor ( ReferenceBinding receiverType , TypeBinding [ ] argumentTypes , InvocationSite invocationSite ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; LookupEnvironment env = unitScope . environment ; try { env . missingClassFileLocation = invocationSite ; unitScope . recordTypeReference ( receiverType ) ; unitScope . recordTypeReferences ( argumentTypes ) ; MethodBinding methodBinding = receiverType . getExactConstructor ( argumentTypes ) ; if ( methodBinding != null && methodBinding . canBeSeenBy ( invocationSite , this ) ) { if ( invocationSite . genericTypeArguments ( ) != null ) methodBinding = computeCompatibleMethod ( methodBinding , argumentTypes , invocationSite ) ; return methodBinding ; } MethodBinding [ ] methods = receiverType . getMethods ( TypeConstants . INIT , argumentTypes . length ) ; if ( methods == Binding . NO_METHODS ) return new ProblemMethodBinding ( TypeConstants . INIT , argumentTypes , ProblemReasons . NotFound ) ; MethodBinding [ ] compatible = new MethodBinding [ methods . length ] ; int compatibleIndex = <NUM_LIT:0> ; MethodBinding problemMethod = null ; for ( int i = <NUM_LIT:0> , length = methods . length ; i < length ; i ++ ) { MethodBinding compatibleMethod = computeCompatibleMethod ( methods [ i ] , argumentTypes , invocationSite ) ; if ( compatibleMethod != null ) { if ( compatibleMethod . isValidBinding ( ) ) compatible [ compatibleIndex ++ ] = compatibleMethod ; else if ( problemMethod == null ) problemMethod = compatibleMethod ; } } if ( compatibleIndex == <NUM_LIT:0> ) { if ( problemMethod == null ) return new ProblemMethodBinding ( methods [ <NUM_LIT:0> ] , TypeConstants . INIT , argumentTypes , ProblemReasons . NotFound ) ; return problemMethod ; } MethodBinding [ ] visible = new MethodBinding [ compatibleIndex ] ; int visibleIndex = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < compatibleIndex ; i ++ ) { MethodBinding method = compatible [ i ] ; if ( method . canBeSeenBy ( invocationSite , this ) ) visible [ visibleIndex ++ ] = method ; } if ( visibleIndex == <NUM_LIT:1> ) return visible [ <NUM_LIT:0> ] ; if ( visibleIndex == <NUM_LIT:0> ) return new ProblemMethodBinding ( compatible [ <NUM_LIT:0> ] , TypeConstants . INIT , compatible [ <NUM_LIT:0> ] . parameters , ProblemReasons . NotVisible ) ; return mostSpecificMethodBinding ( visible , visibleIndex , argumentTypes , invocationSite , receiverType ) ; } catch ( AbortCompilation e ) { e . updateContext ( invocationSite , referenceCompilationUnit ( ) . compilationResult ) ; throw e ; } finally { env . missingClassFileLocation = null ; } } public final PackageBinding getCurrentPackage ( ) { Scope scope , unitScope = this ; while ( ( scope = unitScope . parent ) != null ) unitScope = scope ; return ( ( CompilationUnitScope ) unitScope ) . fPackage ; } public int getDeclarationModifiers ( ) { switch ( this . kind ) { case Scope . BLOCK_SCOPE : case Scope . METHOD_SCOPE : MethodScope methodScope = methodScope ( ) ; if ( ! methodScope . isInsideInitializer ( ) ) { MethodBinding context = ( ( AbstractMethodDeclaration ) methodScope . referenceContext ) . binding ; if ( context != null ) return context . modifiers ; } else { SourceTypeBinding type = ( ( BlockScope ) this ) . referenceType ( ) . binding ; if ( methodScope . initializedField != null ) return methodScope . initializedField . modifiers ; if ( type != null ) return type . modifiers ; } break ; case Scope . CLASS_SCOPE : ReferenceBinding context = ( ( ClassScope ) this ) . referenceType ( ) . binding ; if ( context != null ) return context . modifiers ; break ; } return - <NUM_LIT:1> ; } public FieldBinding getField ( TypeBinding receiverType , char [ ] fieldName , InvocationSite invocationSite ) { LookupEnvironment env = environment ( ) ; try { env . missingClassFileLocation = invocationSite ; FieldBinding field = findField ( receiverType , fieldName , invocationSite , true ) ; if ( field != null ) return field ; return new ProblemFieldBinding ( receiverType instanceof ReferenceBinding ? ( ReferenceBinding ) receiverType : null , fieldName , ProblemReasons . NotFound ) ; } catch ( AbortCompilation e ) { e . updateContext ( invocationSite , referenceCompilationUnit ( ) . compilationResult ) ; throw e ; } finally { env . missingClassFileLocation = null ; } } public MethodBinding getImplicitMethod ( char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite ) { boolean insideStaticContext = false ; boolean insideConstructorCall = false ; boolean insideTypeAnnotation = false ; MethodBinding foundMethod = null ; MethodBinding foundProblem = null ; boolean foundProblemVisible = false ; Scope scope = this ; int depth = <NUM_LIT:0> ; CompilerOptions options ; boolean inheritedHasPrecedence = ( options = compilerOptions ( ) ) . complianceLevel >= ClassFileConstants . JDK1_4 ; done : while ( true ) { switch ( scope . kind ) { case METHOD_SCOPE : MethodScope methodScope = ( MethodScope ) scope ; insideStaticContext |= methodScope . isStatic ; insideConstructorCall |= methodScope . isConstructorCall ; insideTypeAnnotation = methodScope . insideTypeAnnotation ; break ; case CLASS_SCOPE : ClassScope classScope = ( ClassScope ) scope ; ReferenceBinding receiverType = classScope . enclosingReceiverType ( ) ; if ( ! insideTypeAnnotation ) { MethodBinding methodBinding = classScope . findExactMethod ( receiverType , selector , argumentTypes , invocationSite ) ; if ( methodBinding == null ) methodBinding = classScope . findMethod ( receiverType , selector , argumentTypes , invocationSite ) ; if ( methodBinding != null ) { if ( foundMethod == null ) { if ( methodBinding . isValidBinding ( ) ) { if ( ! methodBinding . isStatic ( ) && ( insideConstructorCall || insideStaticContext ) ) { if ( foundProblem != null && foundProblem . problemId ( ) != ProblemReasons . NotVisible ) return foundProblem ; return new ProblemMethodBinding ( methodBinding , methodBinding . selector , methodBinding . parameters , insideConstructorCall ? ProblemReasons . NonStaticReferenceInConstructorInvocation : ProblemReasons . NonStaticReferenceInStaticContext ) ; } if ( inheritedHasPrecedence || receiverType == methodBinding . declaringClass || ( receiverType . getMethods ( selector ) ) != Binding . NO_METHODS ) { if ( foundProblemVisible ) { return foundProblem ; } if ( depth > <NUM_LIT:0> ) { invocationSite . setDepth ( depth ) ; invocationSite . setActualReceiverType ( receiverType ) ; } if ( argumentTypes == Binding . NO_PARAMETERS && CharOperation . equals ( selector , TypeConstants . GETCLASS ) && methodBinding . returnType . isParameterizedType ( ) ) { return environment ( ) . createGetClassMethod ( receiverType , methodBinding , this ) ; } return methodBinding ; } if ( foundProblem == null || foundProblem . problemId ( ) == ProblemReasons . NotVisible ) { if ( foundProblem != null ) foundProblem = null ; if ( depth > <NUM_LIT:0> ) { invocationSite . setDepth ( depth ) ; invocationSite . setActualReceiverType ( receiverType ) ; } foundMethod = methodBinding ; } } else { if ( methodBinding . problemId ( ) != ProblemReasons . NotVisible && methodBinding . problemId ( ) != ProblemReasons . NotFound ) return methodBinding ; if ( foundProblem == null ) { foundProblem = methodBinding ; } if ( ! foundProblemVisible && methodBinding . problemId ( ) == ProblemReasons . NotFound ) { MethodBinding closestMatch = ( ( ProblemMethodBinding ) methodBinding ) . closestMatch ; if ( closestMatch != null && closestMatch . canBeSeenBy ( receiverType , invocationSite , this ) ) { foundProblem = methodBinding ; foundProblemVisible = true ; } } } } else { if ( methodBinding . problemId ( ) == ProblemReasons . Ambiguous || ( foundMethod . declaringClass != methodBinding . declaringClass && ( receiverType == methodBinding . declaringClass || receiverType . getMethods ( selector ) != Binding . NO_METHODS ) ) ) return new ProblemMethodBinding ( methodBinding , selector , argumentTypes , ProblemReasons . InheritedNameHidesEnclosingName ) ; } } } insideTypeAnnotation = false ; depth ++ ; insideStaticContext |= receiverType . isStatic ( ) ; MethodScope enclosingMethodScope = scope . methodScope ( ) ; insideConstructorCall = enclosingMethodScope == null ? false : enclosingMethodScope . isConstructorCall ; break ; case COMPILATION_UNIT_SCOPE : break done ; } scope = scope . parent ; } if ( insideStaticContext && options . sourceLevel >= ClassFileConstants . JDK1_5 ) { if ( foundProblem != null ) { if ( foundProblem . declaringClass != null && foundProblem . declaringClass . id == TypeIds . T_JavaLangObject ) return foundProblem ; if ( foundProblem . problemId ( ) == ProblemReasons . NotFound && foundProblemVisible ) { return foundProblem ; } } CompilationUnitScope unitScope = ( CompilationUnitScope ) scope ; unitScope . faultInImports ( ) ; ImportBinding [ ] imports = unitScope . imports ; if ( imports != null ) { ObjectVector visible = null ; boolean skipOnDemand = false ; for ( int i = <NUM_LIT:0> , length = imports . length ; i < length ; i ++ ) { ImportBinding importBinding = imports [ i ] ; if ( importBinding . isStatic ( ) ) { Binding resolvedImport = importBinding . resolvedImport ; MethodBinding possible = null ; if ( importBinding . onDemand ) { if ( ! skipOnDemand && resolvedImport instanceof ReferenceBinding ) possible = findMethod ( ( ReferenceBinding ) resolvedImport , selector , argumentTypes , invocationSite , true ) ; } else { if ( resolvedImport instanceof MethodBinding ) { MethodBinding staticMethod = ( MethodBinding ) resolvedImport ; if ( CharOperation . equals ( staticMethod . selector , selector ) ) possible = findMethod ( staticMethod . declaringClass , selector , argumentTypes , invocationSite , true ) ; } else if ( resolvedImport instanceof FieldBinding ) { FieldBinding staticField = ( FieldBinding ) resolvedImport ; if ( CharOperation . equals ( staticField . name , selector ) ) { char [ ] [ ] importName = importBinding . reference . tokens ; TypeBinding referencedType = getType ( importName , importName . length - <NUM_LIT:1> ) ; if ( referencedType != null ) possible = findMethod ( ( ReferenceBinding ) referencedType , selector , argumentTypes , invocationSite , true ) ; } } } if ( possible != null && possible != foundProblem ) { if ( ! possible . isValidBinding ( ) ) { if ( foundProblem == null ) foundProblem = possible ; } else if ( possible . isStatic ( ) ) { MethodBinding compatibleMethod = computeCompatibleMethod ( possible , argumentTypes , invocationSite ) ; if ( compatibleMethod != null ) { if ( compatibleMethod . isValidBinding ( ) ) { if ( compatibleMethod . canBeSeenBy ( unitScope . fPackage ) ) { if ( visible == null || ! visible . contains ( compatibleMethod ) ) { ImportReference importReference = importBinding . reference ; if ( importReference != null ) { importReference . bits |= ASTNode . Used ; } if ( ! skipOnDemand && ! importBinding . onDemand ) { visible = null ; skipOnDemand = true ; } if ( visible == null ) visible = new ObjectVector ( <NUM_LIT:3> ) ; visible . add ( compatibleMethod ) ; } } else if ( foundProblem == null ) { foundProblem = new ProblemMethodBinding ( compatibleMethod , selector , compatibleMethod . parameters , ProblemReasons . NotVisible ) ; } } else if ( foundProblem == null ) { foundProblem = compatibleMethod ; } } else if ( foundProblem == null ) { foundProblem = new ProblemMethodBinding ( possible , selector , argumentTypes , ProblemReasons . NotFound ) ; } } } } } if ( visible != null ) { MethodBinding [ ] temp = new MethodBinding [ visible . size ] ; visible . copyInto ( temp ) ; foundMethod = mostSpecificMethodBinding ( temp , temp . length , argumentTypes , invocationSite , null ) ; } } } if ( foundMethod != null ) { invocationSite . setActualReceiverType ( foundMethod . declaringClass ) ; return foundMethod ; } if ( foundProblem != null ) return foundProblem ; return new ProblemMethodBinding ( selector , argumentTypes , ProblemReasons . NotFound ) ; } public final ReferenceBinding getJavaIoSerializable ( ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( TypeConstants . JAVA_IO_SERIALIZABLE ) ; return unitScope . environment . getResolvedType ( TypeConstants . JAVA_IO_SERIALIZABLE , this ) ; } public final ReferenceBinding getJavaLangAnnotationAnnotation ( ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( TypeConstants . JAVA_LANG_ANNOTATION_ANNOTATION ) ; return unitScope . environment . getResolvedType ( TypeConstants . JAVA_LANG_ANNOTATION_ANNOTATION , this ) ; } public final ReferenceBinding getJavaLangAssertionError ( ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( TypeConstants . JAVA_LANG_ASSERTIONERROR ) ; return unitScope . environment . getResolvedType ( TypeConstants . JAVA_LANG_ASSERTIONERROR , this ) ; } public final ReferenceBinding getJavaLangClass ( ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( TypeConstants . JAVA_LANG_CLASS ) ; return unitScope . environment . getResolvedType ( TypeConstants . JAVA_LANG_CLASS , this ) ; } public final ReferenceBinding getJavaLangCloneable ( ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( TypeConstants . JAVA_LANG_CLONEABLE ) ; return unitScope . environment . getResolvedType ( TypeConstants . JAVA_LANG_CLONEABLE , this ) ; } public final ReferenceBinding getJavaLangEnum ( ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( TypeConstants . JAVA_LANG_ENUM ) ; return unitScope . environment . getResolvedType ( TypeConstants . JAVA_LANG_ENUM , this ) ; } public final ReferenceBinding getJavaLangIterable ( ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( TypeConstants . JAVA_LANG_ITERABLE ) ; return unitScope . environment . getResolvedType ( TypeConstants . JAVA_LANG_ITERABLE , this ) ; } public final ReferenceBinding getJavaLangObject ( ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( TypeConstants . JAVA_LANG_OBJECT ) ; return unitScope . environment . getResolvedType ( TypeConstants . JAVA_LANG_OBJECT , this ) ; } public final ReferenceBinding getJavaLangString ( ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( TypeConstants . JAVA_LANG_STRING ) ; return unitScope . environment . getResolvedType ( TypeConstants . JAVA_LANG_STRING , this ) ; } public final ReferenceBinding getJavaLangThrowable ( ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( TypeConstants . JAVA_LANG_THROWABLE ) ; return unitScope . environment . getResolvedType ( TypeConstants . JAVA_LANG_THROWABLE , this ) ; } public final ReferenceBinding getJavaUtilIterator ( ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( TypeConstants . JAVA_UTIL_ITERATOR ) ; return unitScope . environment . getResolvedType ( TypeConstants . JAVA_UTIL_ITERATOR , this ) ; } public final ReferenceBinding getMemberType ( char [ ] typeName , ReferenceBinding enclosingType ) { ReferenceBinding memberType = findMemberType ( typeName , enclosingType ) ; if ( memberType != null ) return memberType ; char [ ] [ ] compoundName = new char [ ] [ ] { typeName } ; return new ProblemReferenceBinding ( compoundName , null , ProblemReasons . NotFound ) ; } public MethodBinding getMethod ( TypeBinding receiverType , char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; LookupEnvironment env = unitScope . environment ; try { env . missingClassFileLocation = invocationSite ; switch ( receiverType . kind ( ) ) { case Binding . BASE_TYPE : return new ProblemMethodBinding ( selector , argumentTypes , ProblemReasons . NotFound ) ; case Binding . ARRAY_TYPE : unitScope . recordTypeReference ( receiverType ) ; return findMethodForArray ( ( ArrayBinding ) receiverType , selector , argumentTypes , invocationSite ) ; } unitScope . recordTypeReference ( receiverType ) ; ReferenceBinding currentType = ( ReferenceBinding ) receiverType ; if ( ! currentType . canBeSeenBy ( this ) ) return new ProblemMethodBinding ( selector , argumentTypes , ProblemReasons . ReceiverTypeNotVisible ) ; MethodBinding methodBinding = findExactMethod ( currentType , selector , argumentTypes , invocationSite ) ; if ( methodBinding != null ) return methodBinding ; methodBinding = findMethod ( currentType , selector , argumentTypes , invocationSite ) ; if ( methodBinding == null ) { methodBinding = oneLastLook ( currentType , selector , argumentTypes , invocationSite ) ; } if ( methodBinding == null ) return new ProblemMethodBinding ( selector , argumentTypes , ProblemReasons . NotFound ) ; if ( ! methodBinding . isValidBinding ( ) ) return methodBinding ; if ( argumentTypes == Binding . NO_PARAMETERS && CharOperation . equals ( selector , TypeConstants . GETCLASS ) && methodBinding . returnType . isParameterizedType ( ) ) { return environment ( ) . createGetClassMethod ( receiverType , methodBinding , this ) ; } return methodBinding ; } catch ( AbortCompilation e ) { e . updateContext ( invocationSite , referenceCompilationUnit ( ) . compilationResult ) ; throw e ; } finally { env . missingClassFileLocation = null ; } } public final Binding getPackage ( char [ ] [ ] compoundName ) { compilationUnitScope ( ) . recordQualifiedReference ( compoundName ) ; Binding binding = getTypeOrPackage ( compoundName [ <NUM_LIT:0> ] , Binding . TYPE | Binding . PACKAGE , true ) ; if ( binding == null ) { char [ ] [ ] qName = new char [ ] [ ] { compoundName [ <NUM_LIT:0> ] } ; return new ProblemReferenceBinding ( qName , environment ( ) . createMissingType ( null , compoundName ) , ProblemReasons . NotFound ) ; } if ( ! binding . isValidBinding ( ) ) { if ( binding instanceof PackageBinding ) { char [ ] [ ] qName = new char [ ] [ ] { compoundName [ <NUM_LIT:0> ] } ; return new ProblemReferenceBinding ( qName , null , ProblemReasons . NotFound ) ; } return binding ; } if ( ! ( binding instanceof PackageBinding ) ) return null ; int currentIndex = <NUM_LIT:1> , length = compoundName . length ; PackageBinding packageBinding = ( PackageBinding ) binding ; while ( currentIndex < length ) { binding = packageBinding . getTypeOrPackage ( compoundName [ currentIndex ++ ] ) ; if ( binding == null ) { return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , null , ProblemReasons . NotFound ) ; } if ( ! binding . isValidBinding ( ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , binding instanceof ReferenceBinding ? ( ReferenceBinding ) ( ( ReferenceBinding ) binding ) . closestMatch ( ) : null , binding . problemId ( ) ) ; if ( ! ( binding instanceof PackageBinding ) ) return packageBinding ; packageBinding = ( PackageBinding ) binding ; } return new ProblemReferenceBinding ( compoundName , null , ProblemReasons . NotFound ) ; } public final TypeBinding getType ( char [ ] name ) { TypeBinding binding = getBaseType ( name ) ; if ( binding != null ) return binding ; return ( ReferenceBinding ) getTypeOrPackage ( name , Binding . TYPE , true ) ; } public final TypeBinding getType ( char [ ] name , PackageBinding packageBinding ) { if ( packageBinding == null ) return getType ( name ) ; Binding binding = packageBinding . getTypeOrPackage ( name ) ; if ( binding == null ) { return new ProblemReferenceBinding ( CharOperation . arrayConcat ( packageBinding . compoundName , name ) , null , ProblemReasons . NotFound ) ; } if ( ! binding . isValidBinding ( ) ) { return new ProblemReferenceBinding ( binding instanceof ReferenceBinding ? ( ( ReferenceBinding ) binding ) . compoundName : CharOperation . arrayConcat ( packageBinding . compoundName , name ) , binding instanceof ReferenceBinding ? ( ReferenceBinding ) ( ( ReferenceBinding ) binding ) . closestMatch ( ) : null , binding . problemId ( ) ) ; } ReferenceBinding typeBinding = ( ReferenceBinding ) binding ; if ( ! typeBinding . canBeSeenBy ( this ) ) return new ProblemReferenceBinding ( typeBinding . compoundName , typeBinding , ProblemReasons . NotVisible ) ; return typeBinding ; } public final TypeBinding getType ( char [ ] [ ] compoundName , int typeNameLength ) { if ( typeNameLength == <NUM_LIT:1> ) { TypeBinding binding = getBaseType ( compoundName [ <NUM_LIT:0> ] ) ; if ( binding != null ) return binding ; } CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( compoundName ) ; Binding binding = getTypeOrPackage ( compoundName [ <NUM_LIT:0> ] , typeNameLength == <NUM_LIT:1> ? Binding . TYPE : Binding . TYPE | Binding . PACKAGE , true ) ; if ( binding == null ) { char [ ] [ ] qName = new char [ ] [ ] { compoundName [ <NUM_LIT:0> ] } ; return new ProblemReferenceBinding ( qName , environment ( ) . createMissingType ( compilationUnitScope ( ) . getCurrentPackage ( ) , qName ) , ProblemReasons . NotFound ) ; } if ( ! binding . isValidBinding ( ) ) { if ( binding instanceof PackageBinding ) { char [ ] [ ] qName = new char [ ] [ ] { compoundName [ <NUM_LIT:0> ] } ; return new ProblemReferenceBinding ( qName , environment ( ) . createMissingType ( null , qName ) , ProblemReasons . NotFound ) ; } return ( ReferenceBinding ) binding ; } int currentIndex = <NUM_LIT:1> ; boolean checkVisibility = false ; if ( binding instanceof PackageBinding ) { PackageBinding packageBinding = ( PackageBinding ) binding ; while ( currentIndex < typeNameLength ) { binding = packageBinding . getTypeOrPackage ( compoundName [ currentIndex ++ ] ) ; if ( binding == null ) { char [ ] [ ] qName = CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) ; return new ProblemReferenceBinding ( qName , environment ( ) . createMissingType ( packageBinding , qName ) , ProblemReasons . NotFound ) ; } if ( ! binding . isValidBinding ( ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , binding instanceof ReferenceBinding ? ( ReferenceBinding ) ( ( ReferenceBinding ) binding ) . closestMatch ( ) : null , binding . problemId ( ) ) ; if ( ! ( binding instanceof PackageBinding ) ) break ; packageBinding = ( PackageBinding ) binding ; } if ( binding instanceof PackageBinding ) { char [ ] [ ] qName = CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) ; return new ProblemReferenceBinding ( qName , environment ( ) . createMissingType ( null , qName ) , ProblemReasons . NotFound ) ; } checkVisibility = true ; } ReferenceBinding typeBinding = ( ReferenceBinding ) binding ; unitScope . recordTypeReference ( typeBinding ) ; if ( checkVisibility ) if ( ! typeBinding . canBeSeenBy ( this ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , typeBinding , ProblemReasons . NotVisible ) ; while ( currentIndex < typeNameLength ) { typeBinding = getMemberType ( compoundName [ currentIndex ++ ] , typeBinding ) ; if ( ! typeBinding . isValidBinding ( ) ) { if ( typeBinding instanceof ProblemReferenceBinding ) { ProblemReferenceBinding problemBinding = ( ProblemReferenceBinding ) typeBinding ; return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , problemBinding . closestReferenceMatch ( ) , typeBinding . problemId ( ) ) ; } return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , ( ReferenceBinding ) ( ( ReferenceBinding ) binding ) . closestMatch ( ) , typeBinding . problemId ( ) ) ; } } return typeBinding ; } final Binding getTypeOrPackage ( char [ ] name , int mask , boolean needResolve ) { Scope scope = this ; ReferenceBinding foundType = null ; boolean insideStaticContext = false ; boolean insideTypeAnnotation = false ; if ( ( mask & Binding . TYPE ) == <NUM_LIT:0> ) { Scope next = scope ; while ( ( next = scope . parent ) != null ) scope = next ; } else { boolean inheritedHasPrecedence = compilerOptions ( ) . complianceLevel >= ClassFileConstants . JDK1_4 ; done : while ( true ) { switch ( scope . kind ) { case METHOD_SCOPE : MethodScope methodScope = ( MethodScope ) scope ; AbstractMethodDeclaration methodDecl = methodScope . referenceMethod ( ) ; if ( methodDecl != null ) { if ( methodDecl . binding != null ) { TypeVariableBinding typeVariable = methodDecl . binding . getTypeVariable ( name ) ; if ( typeVariable != null ) return typeVariable ; } else { TypeParameter [ ] params = methodDecl . typeParameters ( ) ; for ( int i = params == null ? <NUM_LIT:0> : params . length ; -- i >= <NUM_LIT:0> ; ) if ( CharOperation . equals ( params [ i ] . name , name ) ) if ( params [ i ] . binding != null && params [ i ] . binding . isValidBinding ( ) ) return params [ i ] . binding ; } } insideStaticContext |= methodScope . isStatic ; insideTypeAnnotation = methodScope . insideTypeAnnotation ; case BLOCK_SCOPE : ReferenceBinding localType = ( ( BlockScope ) scope ) . findLocalType ( name ) ; if ( localType != null ) { if ( foundType != null && foundType != localType ) return new ProblemReferenceBinding ( new char [ ] [ ] { name } , foundType , ProblemReasons . InheritedNameHidesEnclosingName ) ; return localType ; } break ; case CLASS_SCOPE : SourceTypeBinding sourceType = ( ( ClassScope ) scope ) . referenceContext . binding ; if ( scope == this && ( sourceType . tagBits & TagBits . TypeVariablesAreConnected ) == <NUM_LIT:0> ) { TypeVariableBinding typeVariable = sourceType . getTypeVariable ( name ) ; if ( typeVariable != null ) return typeVariable ; if ( CharOperation . equals ( name , sourceType . sourceName ) ) return sourceType ; insideStaticContext |= sourceType . isStatic ( ) ; break ; } if ( ! insideTypeAnnotation ) { ReferenceBinding memberType = findMemberType ( name , sourceType ) ; if ( memberType != null ) { if ( memberType . problemId ( ) == ProblemReasons . Ambiguous ) { if ( foundType == null || foundType . problemId ( ) == ProblemReasons . NotVisible ) return memberType ; return new ProblemReferenceBinding ( new char [ ] [ ] { name } , foundType , ProblemReasons . InheritedNameHidesEnclosingName ) ; } if ( memberType . isValidBinding ( ) ) { if ( sourceType == memberType . enclosingType ( ) || inheritedHasPrecedence ) { if ( insideStaticContext && ! memberType . isStatic ( ) && sourceType . isGenericType ( ) ) return new ProblemReferenceBinding ( new char [ ] [ ] { name } , memberType , ProblemReasons . NonStaticReferenceInStaticContext ) ; if ( foundType == null || ( inheritedHasPrecedence && foundType . problemId ( ) == ProblemReasons . NotVisible ) ) return memberType ; if ( foundType . isValidBinding ( ) && foundType != memberType ) return new ProblemReferenceBinding ( new char [ ] [ ] { name } , foundType , ProblemReasons . InheritedNameHidesEnclosingName ) ; } } if ( foundType == null || ( foundType . problemId ( ) == ProblemReasons . NotVisible && memberType . problemId ( ) != ProblemReasons . NotVisible ) ) foundType = memberType ; } } TypeVariableBinding typeVariable = sourceType . getTypeVariable ( name ) ; if ( typeVariable != null ) { if ( insideStaticContext ) return new ProblemReferenceBinding ( new char [ ] [ ] { name } , typeVariable , ProblemReasons . NonStaticReferenceInStaticContext ) ; return typeVariable ; } insideStaticContext |= sourceType . isStatic ( ) ; insideTypeAnnotation = false ; if ( CharOperation . equals ( sourceType . sourceName , name ) ) { if ( foundType != null && foundType != sourceType && foundType . problemId ( ) != ProblemReasons . NotVisible ) return new ProblemReferenceBinding ( new char [ ] [ ] { name } , foundType , ProblemReasons . InheritedNameHidesEnclosingName ) ; return sourceType ; } break ; case COMPILATION_UNIT_SCOPE : break done ; } scope = scope . parent ; } if ( foundType != null && foundType . problemId ( ) != ProblemReasons . NotVisible ) return foundType ; } CompilationUnitScope unitScope = ( CompilationUnitScope ) scope ; HashtableOfObject typeOrPackageCache = unitScope . typeOrPackageCache ; if ( typeOrPackageCache != null ) { Binding cachedBinding = ( Binding ) typeOrPackageCache . get ( name ) ; if ( cachedBinding != null ) { if ( cachedBinding instanceof ImportBinding ) { ImportReference importReference = ( ( ImportBinding ) cachedBinding ) . reference ; if ( importReference != null ) { importReference . bits |= ASTNode . Used ; } if ( cachedBinding instanceof ImportConflictBinding ) typeOrPackageCache . put ( name , cachedBinding = ( ( ImportConflictBinding ) cachedBinding ) . conflictingTypeBinding ) ; else typeOrPackageCache . put ( name , cachedBinding = ( ( ImportBinding ) cachedBinding ) . resolvedImport ) ; } if ( ( mask & Binding . TYPE ) != <NUM_LIT:0> ) { if ( foundType != null && foundType . problemId ( ) != ProblemReasons . NotVisible && cachedBinding . problemId ( ) != ProblemReasons . Ambiguous ) return foundType ; if ( cachedBinding instanceof ReferenceBinding ) return cachedBinding ; } if ( ( mask & Binding . PACKAGE ) != <NUM_LIT:0> && cachedBinding instanceof PackageBinding ) return cachedBinding ; } } if ( ( mask & Binding . TYPE ) != <NUM_LIT:0> ) { ImportBinding [ ] imports = unitScope . imports ; if ( imports != null && typeOrPackageCache == null ) { nextImport : for ( int i = <NUM_LIT:0> , length = imports . length ; i < length ; i ++ ) { ImportBinding importBinding = imports [ i ] ; if ( ! importBinding . onDemand ) { if ( CharOperation . equals ( getSimpleName ( importBinding ) , name ) ) { Binding resolvedImport = unitScope . resolveSingleImport ( importBinding , Binding . TYPE ) ; if ( resolvedImport == null ) continue nextImport ; if ( resolvedImport instanceof TypeBinding ) { ImportReference importReference = importBinding . reference ; if ( importReference != null ) importReference . bits |= ASTNode . Used ; return resolvedImport ; } } } } } PackageBinding currentPackage = unitScope . fPackage ; unitScope . recordReference ( currentPackage . compoundName , name ) ; Binding binding = currentPackage . getTypeOrPackage ( name ) ; if ( binding instanceof ReferenceBinding ) { ReferenceBinding referenceType = ( ReferenceBinding ) binding ; if ( ( referenceType . tagBits & TagBits . HasMissingType ) == <NUM_LIT:0> ) { if ( typeOrPackageCache != null ) typeOrPackageCache . put ( name , referenceType ) ; return referenceType ; } } if ( imports != null ) { boolean foundInImport = false ; ReferenceBinding type = null ; for ( int i = <NUM_LIT:0> , length = imports . length ; i < length ; i ++ ) { ImportBinding someImport = imports [ i ] ; if ( someImport . onDemand ) { Binding resolvedImport = someImport . resolvedImport ; ReferenceBinding temp = null ; if ( resolvedImport instanceof PackageBinding ) { temp = findType ( name , ( PackageBinding ) resolvedImport , currentPackage ) ; } else if ( someImport . isStatic ( ) ) { temp = findMemberType ( name , ( ReferenceBinding ) resolvedImport ) ; if ( temp != null && ! temp . isStatic ( ) ) temp = null ; } else { temp = findDirectMemberType ( name , ( ReferenceBinding ) resolvedImport ) ; } if ( temp != type && temp != null ) { if ( temp . isValidBinding ( ) ) { boolean conflict = true ; if ( this . parent != null && foundInImport ) { CompilationUnitScope cuScope = compilationUnitScope ( ) ; if ( cuScope != null ) { ReferenceBinding chosenBinding = cuScope . selectBinding ( temp , type , someImport . reference != null ) ; if ( chosenBinding != null ) { conflict = false ; foundInImport = true ; type = chosenBinding ; } } } if ( conflict ) { ImportReference importReference = someImport . reference ; if ( importReference != null ) { importReference . bits |= ASTNode . Used ; } if ( foundInImport ) { temp = new ProblemReferenceBinding ( new char [ ] [ ] { name } , type , ProblemReasons . Ambiguous ) ; if ( typeOrPackageCache != null ) typeOrPackageCache . put ( name , temp ) ; return temp ; } type = temp ; foundInImport = true ; } } else if ( foundType == null ) { foundType = temp ; } } } } if ( type != null ) { if ( typeOrPackageCache != null ) typeOrPackageCache . put ( name , type ) ; return type ; } } } unitScope . recordSimpleReference ( name ) ; if ( ( mask & Binding . PACKAGE ) != <NUM_LIT:0> ) { PackageBinding packageBinding = unitScope . environment . getTopLevelPackage ( name ) ; if ( packageBinding != null ) { if ( typeOrPackageCache != null ) typeOrPackageCache . put ( name , packageBinding ) ; return packageBinding ; } } if ( foundType == null ) { char [ ] [ ] qName = new char [ ] [ ] { name } ; ReferenceBinding closestMatch = null ; if ( ( mask & Binding . PACKAGE ) != <NUM_LIT:0> ) { if ( needResolve ) { closestMatch = environment ( ) . createMissingType ( unitScope . fPackage , qName ) ; } } else { PackageBinding packageBinding = unitScope . environment . getTopLevelPackage ( name ) ; if ( packageBinding == null || ! packageBinding . isValidBinding ( ) ) { if ( needResolve ) { closestMatch = environment ( ) . createMissingType ( unitScope . fPackage , qName ) ; } } } foundType = new ProblemReferenceBinding ( qName , closestMatch , ProblemReasons . NotFound ) ; if ( typeOrPackageCache != null && ( mask & Binding . PACKAGE ) != <NUM_LIT:0> ) { typeOrPackageCache . put ( name , foundType ) ; } } else if ( ( foundType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { char [ ] [ ] qName = new char [ ] [ ] { name } ; foundType = new ProblemReferenceBinding ( qName , foundType , ProblemReasons . NotFound ) ; if ( typeOrPackageCache != null && ( mask & Binding . PACKAGE ) != <NUM_LIT:0> ) typeOrPackageCache . put ( name , foundType ) ; } return foundType ; } public final Binding getTypeOrPackage ( char [ ] [ ] compoundName ) { int nameLength = compoundName . length ; if ( nameLength == <NUM_LIT:1> ) { TypeBinding binding = getBaseType ( compoundName [ <NUM_LIT:0> ] ) ; if ( binding != null ) return binding ; } Binding binding = getTypeOrPackage ( compoundName [ <NUM_LIT:0> ] , Binding . TYPE | Binding . PACKAGE , true ) ; if ( ! binding . isValidBinding ( ) ) return binding ; int currentIndex = <NUM_LIT:1> ; boolean checkVisibility = false ; if ( binding instanceof PackageBinding ) { PackageBinding packageBinding = ( PackageBinding ) binding ; while ( currentIndex < nameLength ) { binding = packageBinding . getTypeOrPackage ( compoundName [ currentIndex ++ ] ) ; if ( binding == null ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , null , ProblemReasons . NotFound ) ; if ( ! binding . isValidBinding ( ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , binding instanceof ReferenceBinding ? ( ReferenceBinding ) ( ( ReferenceBinding ) binding ) . closestMatch ( ) : null , binding . problemId ( ) ) ; if ( ! ( binding instanceof PackageBinding ) ) break ; packageBinding = ( PackageBinding ) binding ; } if ( binding instanceof PackageBinding ) return binding ; checkVisibility = true ; } ReferenceBinding typeBinding = ( ReferenceBinding ) binding ; ReferenceBinding qualifiedType = ( ReferenceBinding ) environment ( ) . convertToRawType ( typeBinding , false ) ; if ( checkVisibility ) if ( ! typeBinding . canBeSeenBy ( this ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , typeBinding , ProblemReasons . NotVisible ) ; while ( currentIndex < nameLength ) { typeBinding = getMemberType ( compoundName [ currentIndex ++ ] , typeBinding ) ; if ( ! typeBinding . isValidBinding ( ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , ( ReferenceBinding ) typeBinding . closestMatch ( ) , typeBinding . problemId ( ) ) ; if ( typeBinding . isGenericType ( ) ) { qualifiedType = environment ( ) . createRawType ( typeBinding , qualifiedType ) ; } else { qualifiedType = ( qualifiedType != null && ( qualifiedType . isRawType ( ) || qualifiedType . isParameterizedType ( ) ) ) ? environment ( ) . createParameterizedType ( typeBinding , null , qualifiedType ) : typeBinding ; } } return qualifiedType ; } protected boolean hasErasedCandidatesCollisions ( TypeBinding one , TypeBinding two , Map invocations , ReferenceBinding type , ASTNode typeRef ) { invocations . clear ( ) ; TypeBinding [ ] mecs = minimalErasedCandidates ( new TypeBinding [ ] { one , two } , invocations ) ; if ( mecs != null ) { nextCandidate : for ( int k = <NUM_LIT:0> , max = mecs . length ; k < max ; k ++ ) { TypeBinding mec = mecs [ k ] ; if ( mec == null ) continue nextCandidate ; Object value = invocations . get ( mec ) ; if ( value instanceof TypeBinding [ ] ) { TypeBinding [ ] invalidInvocations = ( TypeBinding [ ] ) value ; problemReporter ( ) . superinterfacesCollide ( invalidInvocations [ <NUM_LIT:0> ] . erasure ( ) , typeRef , invalidInvocations [ <NUM_LIT:0> ] , invalidInvocations [ <NUM_LIT:1> ] ) ; type . tagBits |= TagBits . HierarchyHasProblems ; return true ; } } } return false ; } protected char [ ] getSimpleName ( ImportBinding importBinding ) { if ( importBinding . reference == null ) { return importBinding . compoundName [ importBinding . compoundName . length - <NUM_LIT:1> ] ; } else { return importBinding . reference . getSimpleName ( ) ; } } public CaseStatement innermostSwitchCase ( ) { Scope scope = this ; do { if ( scope instanceof BlockScope ) return ( ( BlockScope ) scope ) . enclosingCase ; scope = scope . parent ; } while ( scope != null ) ; return null ; } protected boolean isAcceptableMethod ( MethodBinding one , MethodBinding two ) { TypeBinding [ ] oneParams = one . parameters ; TypeBinding [ ] twoParams = two . parameters ; int oneParamsLength = oneParams . length ; int twoParamsLength = twoParams . length ; if ( oneParamsLength == twoParamsLength ) { boolean applyErasure = environment ( ) . globalOptions . sourceLevel < ClassFileConstants . JDK1_5 ; next : for ( int i = <NUM_LIT:0> ; i < oneParamsLength ; i ++ ) { TypeBinding oneParam = applyErasure ? oneParams [ i ] . erasure ( ) : oneParams [ i ] ; TypeBinding twoParam = applyErasure ? twoParams [ i ] . erasure ( ) : twoParams [ i ] ; if ( oneParam == twoParam || oneParam . isCompatibleWith ( twoParam ) ) { if ( two . declaringClass . isRawType ( ) ) continue next ; TypeBinding leafComponentType = two . original ( ) . parameters [ i ] . leafComponentType ( ) ; TypeBinding originalTwoParam = applyErasure ? leafComponentType . erasure ( ) : leafComponentType ; switch ( originalTwoParam . kind ( ) ) { case Binding . TYPE_PARAMETER : if ( ( ( TypeVariableBinding ) originalTwoParam ) . hasOnlyRawBounds ( ) ) continue next ; case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : case Binding . PARAMETERIZED_TYPE : TypeBinding originalOneParam = one . original ( ) . parameters [ i ] . leafComponentType ( ) ; switch ( originalOneParam . kind ( ) ) { case Binding . TYPE : case Binding . GENERIC_TYPE : TypeBinding inheritedTwoParam = oneParam . findSuperTypeOriginatingFrom ( twoParam ) ; if ( inheritedTwoParam == null || ! inheritedTwoParam . leafComponentType ( ) . isRawType ( ) ) break ; return false ; case Binding . TYPE_PARAMETER : if ( ! ( ( TypeVariableBinding ) originalOneParam ) . upperBound ( ) . isRawType ( ) ) break ; return false ; case Binding . RAW_TYPE : return false ; } } } else { if ( i == oneParamsLength - <NUM_LIT:1> && one . isVarargs ( ) && two . isVarargs ( ) ) { TypeBinding eType = ( ( ArrayBinding ) twoParam ) . elementsType ( ) ; if ( oneParam == eType || oneParam . isCompatibleWith ( eType ) ) return true ; } return false ; } } return true ; } if ( one . isVarargs ( ) && two . isVarargs ( ) ) { if ( oneParamsLength > twoParamsLength ) { if ( ( ( ArrayBinding ) twoParams [ twoParamsLength - <NUM_LIT:1> ] ) . elementsType ( ) . id != TypeIds . T_JavaLangObject ) return false ; } for ( int i = ( oneParamsLength > twoParamsLength ? twoParamsLength : oneParamsLength ) - <NUM_LIT:2> ; i >= <NUM_LIT:0> ; i -- ) if ( oneParams [ i ] != twoParams [ i ] && ! oneParams [ i ] . isCompatibleWith ( twoParams [ i ] ) ) return false ; if ( parameterCompatibilityLevel ( one , twoParams ) == NOT_COMPATIBLE && parameterCompatibilityLevel ( two , oneParams ) == VARARGS_COMPATIBLE ) return true ; } return false ; } public boolean isBoxingCompatibleWith ( TypeBinding expressionType , TypeBinding targetType ) { LookupEnvironment environment = environment ( ) ; if ( environment . globalOptions . sourceLevel < ClassFileConstants . JDK1_5 || expressionType . isBaseType ( ) == targetType . isBaseType ( ) ) return false ; TypeBinding convertedType = environment . computeBoxingType ( expressionType ) ; return convertedType == targetType || convertedType . isCompatibleWith ( targetType ) ; } public final boolean isDefinedInField ( FieldBinding field ) { Scope scope = this ; do { if ( scope instanceof MethodScope ) { MethodScope methodScope = ( MethodScope ) scope ; if ( methodScope . initializedField == field ) return true ; } scope = scope . parent ; } while ( scope != null ) ; return false ; } public final boolean isDefinedInMethod ( MethodBinding method ) { Scope scope = this ; do { if ( scope instanceof MethodScope ) { ReferenceContext refContext = ( ( MethodScope ) scope ) . referenceContext ; if ( refContext instanceof AbstractMethodDeclaration ) if ( ( ( AbstractMethodDeclaration ) refContext ) . binding == method ) return true ; } scope = scope . parent ; } while ( scope != null ) ; return false ; } public final boolean isDefinedInSameUnit ( ReferenceBinding type ) { ReferenceBinding enclosingType = type ; while ( ( type = enclosingType . enclosingType ( ) ) != null ) enclosingType = type ; Scope scope , unitScope = this ; while ( ( scope = unitScope . parent ) != null ) unitScope = scope ; SourceTypeBinding [ ] topLevelTypes = ( ( CompilationUnitScope ) unitScope ) . topLevelTypes ; for ( int i = topLevelTypes . length ; -- i >= <NUM_LIT:0> ; ) if ( topLevelTypes [ i ] == enclosingType ) return true ; return false ; } public final boolean isDefinedInType ( ReferenceBinding type ) { Scope scope = this ; do { if ( scope instanceof ClassScope ) if ( ( ( ClassScope ) scope ) . referenceContext . binding == type ) return true ; scope = scope . parent ; } while ( scope != null ) ; return false ; } public boolean isInsideCase ( CaseStatement caseStatement ) { Scope scope = this ; do { switch ( scope . kind ) { case Scope . BLOCK_SCOPE : if ( ( ( BlockScope ) scope ) . enclosingCase == caseStatement ) { return true ; } } scope = scope . parent ; } while ( scope != null ) ; return false ; } public boolean isInsideDeprecatedCode ( ) { switch ( this . kind ) { case Scope . BLOCK_SCOPE : case Scope . METHOD_SCOPE : MethodScope methodScope = methodScope ( ) ; if ( ! methodScope . isInsideInitializer ( ) ) { MethodBinding context = ( ( AbstractMethodDeclaration ) methodScope . referenceContext ) . binding ; if ( context != null && context . isViewedAsDeprecated ( ) ) return true ; } else if ( methodScope . initializedField != null && methodScope . initializedField . isViewedAsDeprecated ( ) ) { return true ; } SourceTypeBinding declaringType = ( ( BlockScope ) this ) . referenceType ( ) . binding ; if ( declaringType != null ) { declaringType . initializeDeprecatedAnnotationTagBits ( ) ; if ( declaringType . isViewedAsDeprecated ( ) ) return true ; } break ; case Scope . CLASS_SCOPE : ReferenceBinding context = ( ( ClassScope ) this ) . referenceType ( ) . binding ; if ( context != null ) { context . initializeDeprecatedAnnotationTagBits ( ) ; if ( context . isViewedAsDeprecated ( ) ) return true ; } break ; case Scope . COMPILATION_UNIT_SCOPE : CompilationUnitDeclaration unit = referenceCompilationUnit ( ) ; if ( unit . types != null && unit . types . length > <NUM_LIT:0> ) { SourceTypeBinding type = unit . types [ <NUM_LIT:0> ] . binding ; if ( type != null ) { type . initializeDeprecatedAnnotationTagBits ( ) ; if ( type . isViewedAsDeprecated ( ) ) return true ; } } } return false ; } private boolean isOverriddenMethodGeneric ( MethodBinding method ) { MethodVerifier verifier = environment ( ) . methodVerifier ( ) ; ReferenceBinding currentType = method . declaringClass . superclass ( ) ; while ( currentType != null ) { MethodBinding [ ] currentMethods = currentType . getMethods ( method . selector ) ; for ( int i = <NUM_LIT:0> , l = currentMethods . length ; i < l ; i ++ ) { MethodBinding currentMethod = currentMethods [ i ] ; if ( currentMethod != null && currentMethod . original ( ) . typeVariables != Binding . NO_TYPE_VARIABLES ) if ( verifier . doesMethodOverride ( method , currentMethod ) ) return true ; } currentType = currentType . superclass ( ) ; } return false ; } public boolean isPossibleSubtypeOfRawType ( TypeBinding paramType ) { TypeBinding t = paramType . leafComponentType ( ) ; if ( t . isBaseType ( ) ) return false ; ReferenceBinding currentType = ( ReferenceBinding ) t ; ReferenceBinding [ ] interfacesToVisit = null ; int nextPosition = <NUM_LIT:0> ; do { if ( currentType . isRawType ( ) ) return true ; if ( ! currentType . isHierarchyConnected ( ) ) return true ; ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { if ( interfacesToVisit == null ) { interfacesToVisit = itsInterfaces ; nextPosition = interfacesToVisit . length ; } else { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } } while ( ( currentType = currentType . superclass ( ) ) != null ) ; for ( int i = <NUM_LIT:0> ; i < nextPosition ; i ++ ) { currentType = interfacesToVisit [ i ] ; if ( currentType . isRawType ( ) ) return true ; ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } return false ; } private TypeBinding leastContainingInvocation ( TypeBinding mec , Object invocationData , List lubStack ) { if ( invocationData == null ) return mec ; if ( invocationData instanceof TypeBinding ) { return ( TypeBinding ) invocationData ; } TypeBinding [ ] invocations = ( TypeBinding [ ] ) invocationData ; int dim = mec . dimensions ( ) ; mec = mec . leafComponentType ( ) ; int argLength = mec . typeVariables ( ) . length ; if ( argLength == <NUM_LIT:0> ) return mec ; TypeBinding [ ] bestArguments = new TypeBinding [ argLength ] ; for ( int i = <NUM_LIT:0> , length = invocations . length ; i < length ; i ++ ) { TypeBinding invocation = invocations [ i ] . leafComponentType ( ) ; switch ( invocation . kind ( ) ) { case Binding . GENERIC_TYPE : TypeVariableBinding [ ] invocationVariables = invocation . typeVariables ( ) ; for ( int j = <NUM_LIT:0> ; j < argLength ; j ++ ) { TypeBinding bestArgument = leastContainingTypeArgument ( bestArguments [ j ] , invocationVariables [ j ] , ( ReferenceBinding ) mec , j , lubStack ) ; if ( bestArgument == null ) return null ; bestArguments [ j ] = bestArgument ; } break ; case Binding . PARAMETERIZED_TYPE : ParameterizedTypeBinding parameterizedType = ( ParameterizedTypeBinding ) invocation ; for ( int j = <NUM_LIT:0> ; j < argLength ; j ++ ) { TypeBinding bestArgument = leastContainingTypeArgument ( bestArguments [ j ] , parameterizedType . arguments [ j ] , ( ReferenceBinding ) mec , j , lubStack ) ; if ( bestArgument == null ) return null ; bestArguments [ j ] = bestArgument ; } break ; case Binding . RAW_TYPE : return dim == <NUM_LIT:0> ? invocation : environment ( ) . createArrayType ( invocation , dim ) ; } } TypeBinding least = environment ( ) . createParameterizedType ( ( ReferenceBinding ) mec . erasure ( ) , bestArguments , mec . enclosingType ( ) ) ; return dim == <NUM_LIT:0> ? least : environment ( ) . createArrayType ( least , dim ) ; } private TypeBinding leastContainingTypeArgument ( TypeBinding u , TypeBinding v , ReferenceBinding genericType , int rank , List lubStack ) { if ( u == null ) return v ; if ( u == v ) return u ; if ( v . isWildcard ( ) ) { WildcardBinding wildV = ( WildcardBinding ) v ; if ( u . isWildcard ( ) ) { WildcardBinding wildU = ( WildcardBinding ) u ; switch ( wildU . boundKind ) { case Wildcard . EXTENDS : switch ( wildV . boundKind ) { case Wildcard . EXTENDS : TypeBinding lub = lowerUpperBound ( new TypeBinding [ ] { wildU . bound , wildV . bound } , lubStack ) ; if ( lub == null ) return null ; if ( lub == TypeBinding . INT ) return environment ( ) . createWildcard ( genericType , rank , null , null , Wildcard . UNBOUND ) ; return environment ( ) . createWildcard ( genericType , rank , lub , null , Wildcard . EXTENDS ) ; case Wildcard . SUPER : if ( wildU . bound == wildV . bound ) return wildU . bound ; return environment ( ) . createWildcard ( genericType , rank , null , null , Wildcard . UNBOUND ) ; } break ; case Wildcard . SUPER : if ( wildU . boundKind == Wildcard . SUPER ) { TypeBinding [ ] glb = greaterLowerBound ( new TypeBinding [ ] { wildU . bound , wildV . bound } ) ; if ( glb == null ) return null ; return environment ( ) . createWildcard ( genericType , rank , glb [ <NUM_LIT:0> ] , null , Wildcard . SUPER ) ; } } } else { switch ( wildV . boundKind ) { case Wildcard . EXTENDS : TypeBinding lub = lowerUpperBound ( new TypeBinding [ ] { u , wildV . bound } , lubStack ) ; if ( lub == null ) return null ; if ( lub == TypeBinding . INT ) return environment ( ) . createWildcard ( genericType , rank , null , null , Wildcard . UNBOUND ) ; return environment ( ) . createWildcard ( genericType , rank , lub , null , Wildcard . EXTENDS ) ; case Wildcard . SUPER : TypeBinding [ ] glb = greaterLowerBound ( new TypeBinding [ ] { u , wildV . bound } ) ; if ( glb == null ) return null ; return environment ( ) . createWildcard ( genericType , rank , glb [ <NUM_LIT:0> ] , null , Wildcard . SUPER ) ; case Wildcard . UNBOUND : } } } else if ( u . isWildcard ( ) ) { WildcardBinding wildU = ( WildcardBinding ) u ; switch ( wildU . boundKind ) { case Wildcard . EXTENDS : TypeBinding lub = lowerUpperBound ( new TypeBinding [ ] { wildU . bound , v } , lubStack ) ; if ( lub == null ) return null ; if ( lub == TypeBinding . INT ) return environment ( ) . createWildcard ( genericType , rank , null , null , Wildcard . UNBOUND ) ; return environment ( ) . createWildcard ( genericType , rank , lub , null , Wildcard . EXTENDS ) ; case Wildcard . SUPER : TypeBinding [ ] glb = greaterLowerBound ( new TypeBinding [ ] { wildU . bound , v } ) ; if ( glb == null ) return null ; return environment ( ) . createWildcard ( genericType , rank , glb [ <NUM_LIT:0> ] , null , Wildcard . SUPER ) ; case Wildcard . UNBOUND : } } TypeBinding lub = lowerUpperBound ( new TypeBinding [ ] { u , v } , lubStack ) ; if ( lub == null ) return null ; if ( lub == TypeBinding . INT ) return environment ( ) . createWildcard ( genericType , rank , null , null , Wildcard . UNBOUND ) ; return environment ( ) . createWildcard ( genericType , rank , lub , null , Wildcard . EXTENDS ) ; } public TypeBinding lowerUpperBound ( TypeBinding [ ] types ) { int typeLength = types . length ; if ( typeLength == <NUM_LIT:1> ) { TypeBinding type = types [ <NUM_LIT:0> ] ; return type == null ? TypeBinding . VOID : type ; } return lowerUpperBound ( types , new ArrayList ( <NUM_LIT:1> ) ) ; } private TypeBinding lowerUpperBound ( TypeBinding [ ] types , List lubStack ) { int typeLength = types . length ; if ( typeLength == <NUM_LIT:1> ) { TypeBinding type = types [ <NUM_LIT:0> ] ; return type == null ? TypeBinding . VOID : type ; } int stackLength = lubStack . size ( ) ; nextLubCheck : for ( int i = <NUM_LIT:0> ; i < stackLength ; i ++ ) { TypeBinding [ ] lubTypes = ( TypeBinding [ ] ) lubStack . get ( i ) ; int lubTypeLength = lubTypes . length ; if ( lubTypeLength < typeLength ) continue nextLubCheck ; nextTypeCheck : for ( int j = <NUM_LIT:0> ; j < typeLength ; j ++ ) { TypeBinding type = types [ j ] ; if ( type == null ) continue nextTypeCheck ; for ( int k = <NUM_LIT:0> ; k < lubTypeLength ; k ++ ) { TypeBinding lubType = lubTypes [ k ] ; if ( lubType == null ) continue ; if ( lubType == type || lubType . isEquivalentTo ( type ) ) continue nextTypeCheck ; } continue nextLubCheck ; } return TypeBinding . INT ; } lubStack . add ( types ) ; Map invocations = new HashMap ( <NUM_LIT:1> ) ; TypeBinding [ ] mecs = minimalErasedCandidates ( types , invocations ) ; if ( mecs == null ) return null ; int length = mecs . length ; if ( length == <NUM_LIT:0> ) return TypeBinding . VOID ; int count = <NUM_LIT:0> ; TypeBinding firstBound = null ; int commonDim = - <NUM_LIT:1> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeBinding mec = mecs [ i ] ; if ( mec == null ) continue ; mec = leastContainingInvocation ( mec , invocations . get ( mec ) , lubStack ) ; if ( mec == null ) return null ; int dim = mec . dimensions ( ) ; if ( commonDim == - <NUM_LIT:1> ) { commonDim = dim ; } else if ( dim != commonDim ) { return null ; } if ( firstBound == null && ! mec . leafComponentType ( ) . isInterface ( ) ) firstBound = mec . leafComponentType ( ) ; mecs [ count ++ ] = mec ; } switch ( count ) { case <NUM_LIT:0> : return TypeBinding . VOID ; case <NUM_LIT:1> : return mecs [ <NUM_LIT:0> ] ; case <NUM_LIT:2> : if ( ( commonDim == <NUM_LIT:0> ? mecs [ <NUM_LIT:1> ] . id : mecs [ <NUM_LIT:1> ] . leafComponentType ( ) . id ) == TypeIds . T_JavaLangObject ) return mecs [ <NUM_LIT:0> ] ; if ( ( commonDim == <NUM_LIT:0> ? mecs [ <NUM_LIT:0> ] . id : mecs [ <NUM_LIT:0> ] . leafComponentType ( ) . id ) == TypeIds . T_JavaLangObject ) return mecs [ <NUM_LIT:1> ] ; } TypeBinding [ ] otherBounds = new TypeBinding [ count - <NUM_LIT:1> ] ; int rank = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < count ; i ++ ) { TypeBinding mec = commonDim == <NUM_LIT:0> ? mecs [ i ] : mecs [ i ] . leafComponentType ( ) ; if ( mec . isInterface ( ) ) { otherBounds [ rank ++ ] = mec ; } } TypeBinding intersectionType = environment ( ) . createWildcard ( null , <NUM_LIT:0> , firstBound , otherBounds , Wildcard . EXTENDS ) ; return commonDim == <NUM_LIT:0> ? intersectionType : environment ( ) . createArrayType ( intersectionType , commonDim ) ; } public final MethodScope methodScope ( ) { Scope scope = this ; do { if ( scope instanceof MethodScope ) return ( MethodScope ) scope ; scope = scope . parent ; } while ( scope != null ) ; return null ; } protected TypeBinding [ ] minimalErasedCandidates ( TypeBinding [ ] types , Map allInvocations ) { int length = types . length ; int indexOfFirst = - <NUM_LIT:1> , actualLength = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeBinding type = types [ i ] ; if ( type == null ) continue ; if ( type . isBaseType ( ) ) return null ; if ( indexOfFirst < <NUM_LIT:0> ) indexOfFirst = i ; actualLength ++ ; } switch ( actualLength ) { case <NUM_LIT:0> : return Binding . NO_TYPES ; case <NUM_LIT:1> : return types ; } TypeBinding firstType = types [ indexOfFirst ] ; if ( firstType . isBaseType ( ) ) return null ; ArrayList typesToVisit = new ArrayList ( <NUM_LIT:5> ) ; int dim = firstType . dimensions ( ) ; TypeBinding leafType = firstType . leafComponentType ( ) ; TypeBinding firstErasure ; switch ( leafType . kind ( ) ) { case Binding . PARAMETERIZED_TYPE : case Binding . RAW_TYPE : case Binding . ARRAY_TYPE : firstErasure = firstType . erasure ( ) ; break ; default : firstErasure = firstType ; break ; } if ( firstErasure != firstType ) { allInvocations . put ( firstErasure , firstType ) ; } typesToVisit . add ( firstType ) ; int max = <NUM_LIT:1> ; ReferenceBinding currentType ; for ( int i = <NUM_LIT:0> ; i < max ; i ++ ) { TypeBinding typeToVisit = ( TypeBinding ) typesToVisit . get ( i ) ; dim = typeToVisit . dimensions ( ) ; if ( dim > <NUM_LIT:0> ) { leafType = typeToVisit . leafComponentType ( ) ; switch ( leafType . id ) { case TypeIds . T_JavaLangObject : if ( dim > <NUM_LIT:1> ) { TypeBinding elementType = ( ( ArrayBinding ) typeToVisit ) . elementsType ( ) ; if ( ! typesToVisit . contains ( elementType ) ) { typesToVisit . add ( elementType ) ; max ++ ; } continue ; } case TypeIds . T_byte : case TypeIds . T_short : case TypeIds . T_char : case TypeIds . T_boolean : case TypeIds . T_int : case TypeIds . T_long : case TypeIds . T_float : case TypeIds . T_double : TypeBinding superType = getJavaIoSerializable ( ) ; if ( ! typesToVisit . contains ( superType ) ) { typesToVisit . add ( superType ) ; max ++ ; } superType = getJavaLangCloneable ( ) ; if ( ! typesToVisit . contains ( superType ) ) { typesToVisit . add ( superType ) ; max ++ ; } superType = getJavaLangObject ( ) ; if ( ! typesToVisit . contains ( superType ) ) { typesToVisit . add ( superType ) ; max ++ ; } continue ; default : } typeToVisit = leafType ; } currentType = ( ReferenceBinding ) typeToVisit ; if ( currentType . isCapture ( ) ) { TypeBinding firstBound = ( ( CaptureBinding ) currentType ) . firstBound ; if ( firstBound != null && firstBound . isArrayType ( ) ) { TypeBinding superType = dim == <NUM_LIT:0> ? firstBound : ( TypeBinding ) environment ( ) . createArrayType ( firstBound , dim ) ; if ( ! typesToVisit . contains ( superType ) ) { typesToVisit . add ( superType ) ; max ++ ; TypeBinding superTypeErasure = ( firstBound . isTypeVariable ( ) || firstBound . isWildcard ( ) ) ? superType : superType . erasure ( ) ; if ( superTypeErasure != superType ) { allInvocations . put ( superTypeErasure , superType ) ; } } continue ; } } ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces != null ) { for ( int j = <NUM_LIT:0> , count = itsInterfaces . length ; j < count ; j ++ ) { TypeBinding itsInterface = itsInterfaces [ j ] ; TypeBinding superType = dim == <NUM_LIT:0> ? itsInterface : ( TypeBinding ) environment ( ) . createArrayType ( itsInterface , dim ) ; if ( ! typesToVisit . contains ( superType ) ) { typesToVisit . add ( superType ) ; max ++ ; TypeBinding superTypeErasure = ( itsInterface . isTypeVariable ( ) || itsInterface . isWildcard ( ) ) ? superType : superType . erasure ( ) ; if ( superTypeErasure != superType ) { allInvocations . put ( superTypeErasure , superType ) ; } } } } TypeBinding itsSuperclass = currentType . superclass ( ) ; if ( itsSuperclass != null ) { TypeBinding superType = dim == <NUM_LIT:0> ? itsSuperclass : ( TypeBinding ) environment ( ) . createArrayType ( itsSuperclass , dim ) ; if ( ! typesToVisit . contains ( superType ) ) { typesToVisit . add ( superType ) ; max ++ ; TypeBinding superTypeErasure = ( itsSuperclass . isTypeVariable ( ) || itsSuperclass . isWildcard ( ) ) ? superType : superType . erasure ( ) ; if ( superTypeErasure != superType ) { allInvocations . put ( superTypeErasure , superType ) ; } } } } int superLength = typesToVisit . size ( ) ; TypeBinding [ ] erasedSuperTypes = new TypeBinding [ superLength ] ; int rank = <NUM_LIT:0> ; for ( Iterator iter = typesToVisit . iterator ( ) ; iter . hasNext ( ) ; ) { TypeBinding type = ( TypeBinding ) iter . next ( ) ; leafType = type . leafComponentType ( ) ; erasedSuperTypes [ rank ++ ] = ( leafType . isTypeVariable ( ) || leafType . isWildcard ( ) ) ? type : type . erasure ( ) ; } int remaining = superLength ; nextOtherType : for ( int i = indexOfFirst + <NUM_LIT:1> ; i < length ; i ++ ) { TypeBinding otherType = types [ i ] ; if ( otherType == null ) continue nextOtherType ; if ( otherType . isArrayType ( ) ) { nextSuperType : for ( int j = <NUM_LIT:0> ; j < superLength ; j ++ ) { TypeBinding erasedSuperType = erasedSuperTypes [ j ] ; if ( erasedSuperType == null || erasedSuperType == otherType ) continue nextSuperType ; TypeBinding match ; if ( ( match = otherType . findSuperTypeOriginatingFrom ( erasedSuperType ) ) == null ) { erasedSuperTypes [ j ] = null ; if ( -- remaining == <NUM_LIT:0> ) return null ; continue nextSuperType ; } Object invocationData = allInvocations . get ( erasedSuperType ) ; if ( invocationData == null ) { allInvocations . put ( erasedSuperType , match ) ; } else if ( invocationData instanceof TypeBinding ) { if ( match != invocationData ) { TypeBinding [ ] someInvocations = { ( TypeBinding ) invocationData , match , } ; allInvocations . put ( erasedSuperType , someInvocations ) ; } } else { TypeBinding [ ] someInvocations = ( TypeBinding [ ] ) invocationData ; checkExisting : { int invocLength = someInvocations . length ; for ( int k = <NUM_LIT:0> ; k < invocLength ; k ++ ) { if ( someInvocations [ k ] == match ) break checkExisting ; } System . arraycopy ( someInvocations , <NUM_LIT:0> , someInvocations = new TypeBinding [ invocLength + <NUM_LIT:1> ] , <NUM_LIT:0> , invocLength ) ; allInvocations . put ( erasedSuperType , someInvocations ) ; someInvocations [ invocLength ] = match ; } } } continue nextOtherType ; } nextSuperType : for ( int j = <NUM_LIT:0> ; j < superLength ; j ++ ) { TypeBinding erasedSuperType = erasedSuperTypes [ j ] ; if ( erasedSuperType == null ) continue nextSuperType ; TypeBinding match ; if ( erasedSuperType == otherType || erasedSuperType . id == TypeIds . T_JavaLangObject && otherType . isInterface ( ) ) { match = erasedSuperType ; } else { if ( erasedSuperType . isArrayType ( ) ) { match = null ; } else { match = otherType . findSuperTypeOriginatingFrom ( erasedSuperType ) ; } if ( match == null ) { erasedSuperTypes [ j ] = null ; if ( -- remaining == <NUM_LIT:0> ) return null ; continue nextSuperType ; } } Object invocationData = allInvocations . get ( erasedSuperType ) ; if ( invocationData == null ) { allInvocations . put ( erasedSuperType , match ) ; } else if ( invocationData instanceof TypeBinding ) { if ( match != invocationData ) { TypeBinding [ ] someInvocations = { ( TypeBinding ) invocationData , match , } ; allInvocations . put ( erasedSuperType , someInvocations ) ; } } else { TypeBinding [ ] someInvocations = ( TypeBinding [ ] ) invocationData ; checkExisting : { int invocLength = someInvocations . length ; for ( int k = <NUM_LIT:0> ; k < invocLength ; k ++ ) { if ( someInvocations [ k ] == match ) break checkExisting ; } System . arraycopy ( someInvocations , <NUM_LIT:0> , someInvocations = new TypeBinding [ invocLength + <NUM_LIT:1> ] , <NUM_LIT:0> , invocLength ) ; allInvocations . put ( erasedSuperType , someInvocations ) ; someInvocations [ invocLength ] = match ; } } } } if ( remaining > <NUM_LIT:1> ) { nextType : for ( int i = <NUM_LIT:0> ; i < superLength ; i ++ ) { TypeBinding erasedSuperType = erasedSuperTypes [ i ] ; if ( erasedSuperType == null ) continue nextType ; nextOtherType : for ( int j = <NUM_LIT:0> ; j < superLength ; j ++ ) { if ( i == j ) continue nextOtherType ; TypeBinding otherType = erasedSuperTypes [ j ] ; if ( otherType == null ) continue nextOtherType ; if ( erasedSuperType instanceof ReferenceBinding ) { if ( otherType . id == TypeIds . T_JavaLangObject && erasedSuperType . isInterface ( ) ) continue nextOtherType ; if ( erasedSuperType . findSuperTypeOriginatingFrom ( otherType ) != null ) { erasedSuperTypes [ j ] = null ; remaining -- ; } } else if ( erasedSuperType . isArrayType ( ) ) { if ( otherType . isArrayType ( ) && otherType . leafComponentType ( ) . id == TypeIds . T_JavaLangObject && otherType . dimensions ( ) == erasedSuperType . dimensions ( ) && erasedSuperType . leafComponentType ( ) . isInterface ( ) ) continue nextOtherType ; if ( erasedSuperType . findSuperTypeOriginatingFrom ( otherType ) != null ) { erasedSuperTypes [ j ] = null ; remaining -- ; } } } } } return erasedSuperTypes ; } protected final MethodBinding mostSpecificClassMethodBinding ( MethodBinding [ ] visible , int visibleSize , InvocationSite invocationSite ) { MethodBinding previous = null ; nextVisible : for ( int i = <NUM_LIT:0> ; i < visibleSize ; i ++ ) { MethodBinding method = visible [ i ] ; if ( previous != null && method . declaringClass != previous . declaringClass ) break ; if ( ! method . isStatic ( ) ) previous = method ; for ( int j = <NUM_LIT:0> ; j < visibleSize ; j ++ ) { if ( i == j ) continue ; if ( ! visible [ j ] . areParametersCompatibleWith ( method . parameters ) ) continue nextVisible ; } compilationUnitScope ( ) . recordTypeReferences ( method . thrownExceptions ) ; return method ; } return new ProblemMethodBinding ( visible [ <NUM_LIT:0> ] , visible [ <NUM_LIT:0> ] . selector , visible [ <NUM_LIT:0> ] . parameters , ProblemReasons . Ambiguous ) ; } protected final MethodBinding mostSpecificInterfaceMethodBinding ( MethodBinding [ ] visible , int visibleSize , InvocationSite invocationSite ) { nextVisible : for ( int i = <NUM_LIT:0> ; i < visibleSize ; i ++ ) { MethodBinding method = visible [ i ] ; for ( int j = <NUM_LIT:0> ; j < visibleSize ; j ++ ) { if ( i == j ) continue ; if ( ! visible [ j ] . areParametersCompatibleWith ( method . parameters ) ) continue nextVisible ; } compilationUnitScope ( ) . recordTypeReferences ( method . thrownExceptions ) ; return method ; } return new ProblemMethodBinding ( visible [ <NUM_LIT:0> ] , visible [ <NUM_LIT:0> ] . selector , visible [ <NUM_LIT:0> ] . parameters , ProblemReasons . Ambiguous ) ; } protected final MethodBinding mostSpecificMethodBinding ( MethodBinding [ ] visible , int visibleSize , TypeBinding [ ] argumentTypes , final InvocationSite invocationSite , ReferenceBinding receiverType ) { int [ ] compatibilityLevels = new int [ visibleSize ] ; for ( int i = <NUM_LIT:0> ; i < visibleSize ; i ++ ) compatibilityLevels [ i ] = parameterCompatibilityLevel ( visible [ i ] , argumentTypes ) ; InvocationSite tieBreakInvocationSite = new InvocationSite ( ) { public TypeBinding [ ] genericTypeArguments ( ) { return null ; } public boolean isSuperAccess ( ) { return invocationSite . isSuperAccess ( ) ; } public boolean isTypeAccess ( ) { return invocationSite . isTypeAccess ( ) ; } public void setActualReceiverType ( ReferenceBinding actualReceiverType ) { } public void setDepth ( int depth ) { } public void setFieldIndex ( int depth ) { } public int sourceStart ( ) { return invocationSite . sourceStart ( ) ; } public int sourceEnd ( ) { return invocationSite . sourceStart ( ) ; } public TypeBinding expectedType ( ) { return invocationSite . expectedType ( ) ; } } ; MethodBinding [ ] moreSpecific = new MethodBinding [ visibleSize ] ; int count = <NUM_LIT:0> ; for ( int level = <NUM_LIT:0> , max = VARARGS_COMPATIBLE ; level <= max ; level ++ ) { nextVisible : for ( int i = <NUM_LIT:0> ; i < visibleSize ; i ++ ) { if ( compatibilityLevels [ i ] != level ) continue nextVisible ; max = level ; MethodBinding current = visible [ i ] ; MethodBinding original = current . original ( ) ; MethodBinding tiebreakMethod = current . tiebreakMethod ( ) ; for ( int j = <NUM_LIT:0> ; j < visibleSize ; j ++ ) { if ( i == j || compatibilityLevels [ j ] != level ) continue ; MethodBinding next = visible [ j ] ; if ( original == next . original ( ) ) { compatibilityLevels [ j ] = - <NUM_LIT:1> ; continue ; } MethodBinding methodToTest = next ; if ( next instanceof ParameterizedGenericMethodBinding ) { ParameterizedGenericMethodBinding pNext = ( ParameterizedGenericMethodBinding ) next ; if ( pNext . isRaw && ! pNext . isStatic ( ) ) { } else { methodToTest = pNext . originalMethod ; } } MethodBinding acceptable = computeCompatibleMethod ( methodToTest , tiebreakMethod . parameters , tieBreakInvocationSite ) ; if ( acceptable == null || ! acceptable . isValidBinding ( ) ) continue nextVisible ; if ( ! isAcceptableMethod ( tiebreakMethod , acceptable ) ) continue nextVisible ; if ( current . isBridge ( ) && ! next . isBridge ( ) ) if ( tiebreakMethod . areParametersEqual ( acceptable ) ) continue nextVisible ; } moreSpecific [ i ] = current ; count ++ ; } } if ( count == <NUM_LIT:1> ) { for ( int i = <NUM_LIT:0> ; i < visibleSize ; i ++ ) { if ( moreSpecific [ i ] != null ) { compilationUnitScope ( ) . recordTypeReferences ( visible [ i ] . thrownExceptions ) ; return visible [ i ] ; } } } else if ( count == <NUM_LIT:0> ) { return new ProblemMethodBinding ( visible [ <NUM_LIT:0> ] , visible [ <NUM_LIT:0> ] . selector , visible [ <NUM_LIT:0> ] . parameters , ProblemReasons . Ambiguous ) ; } if ( receiverType != null ) receiverType = receiverType instanceof CaptureBinding ? receiverType : ( ReferenceBinding ) receiverType . erasure ( ) ; nextSpecific : for ( int i = <NUM_LIT:0> ; i < visibleSize ; i ++ ) { MethodBinding current = moreSpecific [ i ] ; if ( current != null ) { ReferenceBinding [ ] mostSpecificExceptions = null ; MethodBinding original = current . original ( ) ; boolean shouldIntersectExceptions = original . declaringClass . isAbstract ( ) && original . thrownExceptions != Binding . NO_EXCEPTIONS ; for ( int j = <NUM_LIT:0> ; j < visibleSize ; j ++ ) { MethodBinding next = moreSpecific [ j ] ; if ( next == null || i == j ) continue ; MethodBinding original2 = next . original ( ) ; if ( original . declaringClass == original2 . declaringClass ) break nextSpecific ; if ( ! original . isAbstract ( ) ) { if ( original2 . isAbstract ( ) ) continue ; original2 = original . findOriginalInheritedMethod ( original2 ) ; if ( original2 == null ) continue nextSpecific ; if ( current . hasSubstitutedParameters ( ) || original . typeVariables != Binding . NO_TYPE_VARIABLES ) { if ( ! environment ( ) . methodVerifier ( ) . isParameterSubsignature ( original , original2 ) ) continue nextSpecific ; } } else if ( receiverType != null ) { TypeBinding superType = receiverType . findSuperTypeOriginatingFrom ( original . declaringClass . erasure ( ) ) ; if ( original . declaringClass == superType || ! ( superType instanceof ReferenceBinding ) ) { } else { MethodBinding [ ] superMethods = ( ( ReferenceBinding ) superType ) . getMethods ( original . selector , argumentTypes . length ) ; for ( int m = <NUM_LIT:0> , l = superMethods . length ; m < l ; m ++ ) { if ( superMethods [ m ] . original ( ) == original ) { original = superMethods [ m ] ; break ; } } } superType = receiverType . findSuperTypeOriginatingFrom ( original2 . declaringClass . erasure ( ) ) ; if ( original2 . declaringClass == superType || ! ( superType instanceof ReferenceBinding ) ) { } else { MethodBinding [ ] superMethods = ( ( ReferenceBinding ) superType ) . getMethods ( original2 . selector , argumentTypes . length ) ; for ( int m = <NUM_LIT:0> , l = superMethods . length ; m < l ; m ++ ) { if ( superMethods [ m ] . original ( ) == original2 ) { original2 = superMethods [ m ] ; break ; } } } if ( original . typeVariables != Binding . NO_TYPE_VARIABLES ) original2 = original . computeSubstitutedMethod ( original2 , environment ( ) ) ; if ( original2 == null || ! original . areParameterErasuresEqual ( original2 ) ) continue nextSpecific ; if ( original . returnType != original2 . returnType ) { if ( next . original ( ) . typeVariables != Binding . NO_TYPE_VARIABLES ) { if ( original . returnType . erasure ( ) . findSuperTypeOriginatingFrom ( original2 . returnType . erasure ( ) ) == null ) continue nextSpecific ; } else if ( ! current . returnType . isCompatibleWith ( next . returnType ) ) { continue nextSpecific ; } } if ( shouldIntersectExceptions && original2 . declaringClass . isInterface ( ) ) { if ( current . thrownExceptions != next . thrownExceptions ) { if ( next . thrownExceptions == Binding . NO_EXCEPTIONS ) { mostSpecificExceptions = Binding . NO_EXCEPTIONS ; } else { if ( mostSpecificExceptions == null ) { mostSpecificExceptions = current . thrownExceptions ; } int mostSpecificLength = mostSpecificExceptions . length ; int nextLength = next . thrownExceptions . length ; SimpleSet temp = new SimpleSet ( mostSpecificLength ) ; boolean changed = false ; nextException : for ( int t = <NUM_LIT:0> ; t < mostSpecificLength ; t ++ ) { ReferenceBinding exception = mostSpecificExceptions [ t ] ; for ( int s = <NUM_LIT:0> ; s < nextLength ; s ++ ) { ReferenceBinding nextException = next . thrownExceptions [ s ] ; if ( exception . isCompatibleWith ( nextException ) ) { temp . add ( exception ) ; continue nextException ; } else if ( nextException . isCompatibleWith ( exception ) ) { temp . add ( nextException ) ; changed = true ; continue nextException ; } else { changed = true ; } } } if ( changed ) { mostSpecificExceptions = temp . elementSize == <NUM_LIT:0> ? Binding . NO_EXCEPTIONS : new ReferenceBinding [ temp . elementSize ] ; temp . asArray ( mostSpecificExceptions ) ; } } } } } } if ( mostSpecificExceptions != null && mostSpecificExceptions != current . thrownExceptions ) { return new MostSpecificExceptionMethodBinding ( current , mostSpecificExceptions ) ; } return current ; } } return new ProblemMethodBinding ( visible [ <NUM_LIT:0> ] , visible [ <NUM_LIT:0> ] . selector , visible [ <NUM_LIT:0> ] . parameters , ProblemReasons . Ambiguous ) ; } public final ClassScope outerMostClassScope ( ) { ClassScope lastClassScope = null ; Scope scope = this ; do { if ( scope instanceof ClassScope ) lastClassScope = ( ClassScope ) scope ; scope = scope . parent ; } while ( scope != null ) ; return lastClassScope ; } public final MethodScope outerMostMethodScope ( ) { MethodScope lastMethodScope = null ; Scope scope = this ; do { if ( scope instanceof MethodScope ) lastMethodScope = ( MethodScope ) scope ; scope = scope . parent ; } while ( scope != null ) ; return lastMethodScope ; } public int parameterCompatibilityLevel ( MethodBinding method , TypeBinding [ ] arguments ) { TypeBinding [ ] parameters = method . parameters ; int paramLength = parameters . length ; int argLength = arguments . length ; if ( compilerOptions ( ) . sourceLevel < ClassFileConstants . JDK1_5 ) { if ( paramLength != argLength ) return NOT_COMPATIBLE ; for ( int i = <NUM_LIT:0> ; i < argLength ; i ++ ) { TypeBinding param = parameters [ i ] ; TypeBinding arg = arguments [ i ] ; if ( arg != param && ! arg . isCompatibleWith ( param . erasure ( ) ) ) return NOT_COMPATIBLE ; } return COMPATIBLE ; } int level = COMPATIBLE ; int lastIndex = argLength ; LookupEnvironment env = environment ( ) ; if ( method . isVarargs ( ) ) { lastIndex = paramLength - <NUM_LIT:1> ; if ( paramLength == argLength ) { TypeBinding param = parameters [ lastIndex ] ; TypeBinding arg = arguments [ lastIndex ] ; if ( param != arg ) { level = parameterCompatibilityLevel ( arg , param , env ) ; if ( level == NOT_COMPATIBLE ) { param = ( ( ArrayBinding ) param ) . elementsType ( ) ; if ( parameterCompatibilityLevel ( arg , param , env ) == NOT_COMPATIBLE ) return NOT_COMPATIBLE ; level = VARARGS_COMPATIBLE ; } } } else { if ( paramLength < argLength ) { TypeBinding param = ( ( ArrayBinding ) parameters [ lastIndex ] ) . elementsType ( ) ; for ( int i = lastIndex ; i < argLength ; i ++ ) { TypeBinding arg = arguments [ i ] ; if ( param != arg && parameterCompatibilityLevel ( arg , param , env ) == NOT_COMPATIBLE ) return NOT_COMPATIBLE ; } } else if ( lastIndex != argLength ) { return NOT_COMPATIBLE ; } level = VARARGS_COMPATIBLE ; } } else if ( paramLength != argLength ) { return NOT_COMPATIBLE ; } for ( int i = <NUM_LIT:0> ; i < lastIndex ; i ++ ) { TypeBinding param = parameters [ i ] ; TypeBinding arg = arguments [ i ] ; if ( arg != param ) { int newLevel = parameterCompatibilityLevel ( arg , param , env ) ; if ( newLevel == NOT_COMPATIBLE ) return NOT_COMPATIBLE ; if ( newLevel > level ) level = newLevel ; } } return level ; } private int parameterCompatibilityLevel ( TypeBinding arg , TypeBinding param , LookupEnvironment env ) { if ( arg . isCompatibleWith ( param ) ) return COMPATIBLE ; if ( arg . isBaseType ( ) != param . isBaseType ( ) ) { TypeBinding convertedType = env . computeBoxingType ( arg ) ; if ( convertedType == param || convertedType . isCompatibleWith ( param ) ) return AUTOBOX_COMPATIBLE ; } return NOT_COMPATIBLE ; } public abstract ProblemReporter problemReporter ( ) ; public final CompilationUnitDeclaration referenceCompilationUnit ( ) { Scope scope , unitScope = this ; while ( ( scope = unitScope . parent ) != null ) unitScope = scope ; return ( ( CompilationUnitScope ) unitScope ) . referenceContext ; } public ReferenceContext referenceContext ( ) { Scope current = this ; do { switch ( current . kind ) { case METHOD_SCOPE : return ( ( MethodScope ) current ) . referenceContext ; case CLASS_SCOPE : return ( ( ClassScope ) current ) . referenceContext ; case COMPILATION_UNIT_SCOPE : return ( ( CompilationUnitScope ) current ) . referenceContext ; } } while ( ( current = current . parent ) != null ) ; return null ; } public void deferBoundCheck ( TypeReference typeRef ) { if ( this . kind == CLASS_SCOPE ) { ClassScope classScope = ( ClassScope ) this ; if ( classScope . deferredBoundChecks == null ) { classScope . deferredBoundChecks = new ArrayList ( <NUM_LIT:3> ) ; classScope . deferredBoundChecks . add ( typeRef ) ; } else if ( ! classScope . deferredBoundChecks . contains ( typeRef ) ) { classScope . deferredBoundChecks . add ( typeRef ) ; } } } int startIndex ( ) { return <NUM_LIT:0> ; } public MethodBinding getStaticFactory ( ReferenceBinding allocationType , ReferenceBinding originalEnclosingType , TypeBinding [ ] argumentTypes , final InvocationSite allocationSite ) { TypeVariableBinding [ ] classTypeVariables = allocationType . typeVariables ( ) ; int classTypeVariablesArity = classTypeVariables . length ; MethodBinding [ ] methods = allocationType . getMethods ( TypeConstants . INIT , argumentTypes . length ) ; MethodBinding [ ] staticFactories = new MethodBinding [ methods . length ] ; int sfi = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> , length = methods . length ; i < length ; i ++ ) { MethodBinding method = methods [ i ] ; int paramLength = method . parameters . length ; boolean isVarArgs = method . isVarargs ( ) ; if ( argumentTypes . length != paramLength ) if ( ! isVarArgs || argumentTypes . length < paramLength - <NUM_LIT:1> ) continue ; TypeVariableBinding [ ] methodTypeVariables = method . typeVariables ( ) ; int methodTypeVariablesArity = methodTypeVariables . length ; MethodBinding staticFactory = new MethodBinding ( method . modifiers | ClassFileConstants . AccStatic , TypeConstants . SYNTHETIC_STATIC_FACTORY , null , null , null , method . declaringClass ) ; staticFactory . typeVariables = new TypeVariableBinding [ classTypeVariablesArity + methodTypeVariablesArity ] ; final SimpleLookupTable map = new SimpleLookupTable ( classTypeVariablesArity + methodTypeVariablesArity ) ; final LookupEnvironment environment = environment ( ) ; for ( int j = <NUM_LIT:0> ; j < classTypeVariablesArity ; j ++ ) { map . put ( classTypeVariables [ j ] , staticFactory . typeVariables [ j ] = new TypeVariableBinding ( CharOperation . concat ( classTypeVariables [ j ] . sourceName , "<STR_LIT:'>" . toCharArray ( ) ) , staticFactory , j , environment ) ) ; } for ( int j = classTypeVariablesArity , max = classTypeVariablesArity + methodTypeVariablesArity ; j < max ; j ++ ) { map . put ( methodTypeVariables [ j - classTypeVariablesArity ] , ( staticFactory . typeVariables [ j ] = new TypeVariableBinding ( CharOperation . concat ( methodTypeVariables [ j - classTypeVariablesArity ] . sourceName , "<STR_LIT>" . toCharArray ( ) ) , staticFactory , j , environment ) ) ) ; } ReferenceBinding enclosingType = originalEnclosingType ; while ( enclosingType != null ) { if ( enclosingType . kind ( ) == Binding . PARAMETERIZED_TYPE ) { final ParameterizedTypeBinding parameterizedType = ( ParameterizedTypeBinding ) enclosingType ; final ReferenceBinding genericType = parameterizedType . genericType ( ) ; TypeVariableBinding [ ] enclosingClassTypeVariables = genericType . typeVariables ( ) ; int enclosingClassTypeVariablesArity = enclosingClassTypeVariables . length ; for ( int j = <NUM_LIT:0> ; j < enclosingClassTypeVariablesArity ; j ++ ) { map . put ( enclosingClassTypeVariables [ j ] , parameterizedType . arguments [ j ] ) ; } } enclosingType = enclosingType . enclosingType ( ) ; } final Scope scope = this ; Substitution substitution = new Substitution ( ) { public LookupEnvironment environment ( ) { return scope . environment ( ) ; } public boolean isRawSubstitution ( ) { return false ; } public TypeBinding substitute ( TypeVariableBinding typeVariable ) { TypeBinding retVal = ( TypeBinding ) map . get ( typeVariable ) ; return retVal != null ? retVal : typeVariable ; } } ; for ( int j = <NUM_LIT:0> , max = classTypeVariablesArity + methodTypeVariablesArity ; j < max ; j ++ ) { TypeVariableBinding originalVariable = j < classTypeVariablesArity ? classTypeVariables [ j ] : methodTypeVariables [ j - classTypeVariablesArity ] ; TypeBinding substitutedType = ( TypeBinding ) map . get ( originalVariable ) ; if ( substitutedType instanceof TypeVariableBinding ) { TypeVariableBinding substitutedVariable = ( TypeVariableBinding ) substitutedType ; TypeBinding substitutedSuperclass = Scope . substitute ( substitution , originalVariable . superclass ) ; ReferenceBinding [ ] substitutedInterfaces = Scope . substitute ( substitution , originalVariable . superInterfaces ) ; if ( originalVariable . firstBound != null ) { substitutedVariable . firstBound = originalVariable . firstBound == originalVariable . superclass ? substitutedSuperclass : substitutedInterfaces [ <NUM_LIT:0> ] ; } switch ( substitutedSuperclass . kind ( ) ) { case Binding . ARRAY_TYPE : substitutedVariable . superclass = environment . getResolvedType ( TypeConstants . JAVA_LANG_OBJECT , null ) ; substitutedVariable . superInterfaces = substitutedInterfaces ; break ; default : if ( substitutedSuperclass . isInterface ( ) ) { substitutedVariable . superclass = environment . getResolvedType ( TypeConstants . JAVA_LANG_OBJECT , null ) ; int interfaceCount = substitutedInterfaces . length ; System . arraycopy ( substitutedInterfaces , <NUM_LIT:0> , substitutedInterfaces = new ReferenceBinding [ interfaceCount + <NUM_LIT:1> ] , <NUM_LIT:1> , interfaceCount ) ; substitutedInterfaces [ <NUM_LIT:0> ] = ( ReferenceBinding ) substitutedSuperclass ; substitutedVariable . superInterfaces = substitutedInterfaces ; } else { substitutedVariable . superclass = ( ReferenceBinding ) substitutedSuperclass ; substitutedVariable . superInterfaces = substitutedInterfaces ; } } } } TypeVariableBinding [ ] returnTypeParameters = new TypeVariableBinding [ classTypeVariablesArity ] ; for ( int j = <NUM_LIT:0> ; j < classTypeVariablesArity ; j ++ ) { returnTypeParameters [ j ] = ( TypeVariableBinding ) map . get ( classTypeVariables [ j ] ) ; } staticFactory . returnType = environment . createParameterizedType ( allocationType , returnTypeParameters , allocationType . enclosingType ( ) ) ; staticFactory . parameters = Scope . substitute ( substitution , method . parameters ) ; staticFactory . thrownExceptions = Scope . substitute ( substitution , method . thrownExceptions ) ; if ( staticFactory . thrownExceptions == null ) { staticFactory . thrownExceptions = Binding . NO_EXCEPTIONS ; } staticFactories [ sfi ++ ] = new ParameterizedMethodBinding ( ( ParameterizedTypeBinding ) environment . convertToParameterizedType ( staticFactory . declaringClass ) , staticFactory ) ; } if ( sfi == <NUM_LIT:0> ) return null ; if ( sfi != methods . length ) { System . arraycopy ( staticFactories , <NUM_LIT:0> , staticFactories = new MethodBinding [ sfi ] , <NUM_LIT:0> , sfi ) ; } MethodBinding [ ] compatible = new MethodBinding [ sfi ] ; int compatibleIndex = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < sfi ; i ++ ) { MethodBinding compatibleMethod = computeCompatibleMethod ( staticFactories [ i ] , argumentTypes , allocationSite ) ; if ( compatibleMethod != null ) { if ( compatibleMethod . isValidBinding ( ) ) compatible [ compatibleIndex ++ ] = compatibleMethod ; } } if ( compatibleIndex == <NUM_LIT:0> ) { return null ; } MethodBinding [ ] visible = new MethodBinding [ compatibleIndex ] ; int visibleIndex = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < compatibleIndex ; i ++ ) { MethodBinding method = compatible [ i ] ; if ( method . canBeSeenBy ( allocationSite , this ) ) visible [ visibleIndex ++ ] = method ; } if ( visibleIndex == <NUM_LIT:0> ) { return null ; } return visibleIndex == <NUM_LIT:1> ? visible [ <NUM_LIT:0> ] : mostSpecificMethodBinding ( visible , visibleIndex , argumentTypes , allocationSite , allocationType ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . ast . * ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . impl . Constant ; public class ElementValuePair { char [ ] name ; public Object value ; public MethodBinding binding ; public static Object getValue ( Expression expression ) { if ( expression == null ) return null ; Constant constant = expression . constant ; if ( constant != null && constant != Constant . NotAConstant ) return constant ; if ( expression instanceof Annotation ) return ( ( Annotation ) expression ) . getCompilerAnnotation ( ) ; if ( expression instanceof ArrayInitializer ) { Expression [ ] exprs = ( ( ArrayInitializer ) expression ) . expressions ; int length = exprs == null ? <NUM_LIT:0> : exprs . length ; Object [ ] values = new Object [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) values [ i ] = getValue ( exprs [ i ] ) ; return values ; } if ( expression instanceof ClassLiteralAccess ) return ( ( ClassLiteralAccess ) expression ) . targetType ; if ( expression instanceof Reference ) { FieldBinding fieldBinding = null ; if ( expression instanceof FieldReference ) { fieldBinding = ( ( FieldReference ) expression ) . fieldBinding ( ) ; } else if ( expression instanceof NameReference ) { Binding binding = ( ( NameReference ) expression ) . binding ; if ( binding != null && binding . kind ( ) == Binding . FIELD ) fieldBinding = ( FieldBinding ) binding ; } if ( fieldBinding != null && ( fieldBinding . modifiers & ClassFileConstants . AccEnum ) > <NUM_LIT:0> ) return fieldBinding ; } return null ; } public ElementValuePair ( char [ ] name , Expression expression , MethodBinding binding ) { this ( name , ElementValuePair . getValue ( expression ) , binding ) ; } public ElementValuePair ( char [ ] name , Object value , MethodBinding binding ) { this . name = name ; this . value = value ; this . binding = binding ; } public char [ ] getName ( ) { return this . name ; } public MethodBinding getMethodBinding ( ) { return this . binding ; } public Object getValue ( ) { return this . value ; } void setMethodBinding ( MethodBinding binding ) { this . binding = binding ; } void setValue ( Object value ) { this . value = value ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( <NUM_LIT:5> ) ; buffer . append ( this . name ) . append ( "<STR_LIT:U+0020=U+0020>" ) ; buffer . append ( this . value ) ; return buffer . toString ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; public abstract class Binding { public static final int FIELD = ASTNode . Bit1 ; public static final int LOCAL = ASTNode . Bit2 ; public static final int VARIABLE = FIELD | LOCAL ; public static final int TYPE = ASTNode . Bit3 ; public static final int METHOD = ASTNode . Bit4 ; public static final int PACKAGE = ASTNode . Bit5 ; public static final int IMPORT = ASTNode . Bit6 ; public static final int ARRAY_TYPE = TYPE | ASTNode . Bit7 ; public static final int BASE_TYPE = TYPE | ASTNode . Bit8 ; public static final int PARAMETERIZED_TYPE = TYPE | ASTNode . Bit9 ; public static final int WILDCARD_TYPE = TYPE | ASTNode . Bit10 ; public static final int RAW_TYPE = TYPE | ASTNode . Bit11 ; public static final int GENERIC_TYPE = TYPE | ASTNode . Bit12 ; public static final int TYPE_PARAMETER = TYPE | ASTNode . Bit13 ; public static final int INTERSECTION_TYPE = TYPE | ASTNode . Bit14 ; public static final TypeBinding [ ] NO_TYPES = new TypeBinding [ <NUM_LIT:0> ] ; public static final TypeBinding [ ] NO_PARAMETERS = new TypeBinding [ <NUM_LIT:0> ] ; public static final ReferenceBinding [ ] NO_EXCEPTIONS = new ReferenceBinding [ <NUM_LIT:0> ] ; public static final ReferenceBinding [ ] ANY_EXCEPTION = new ReferenceBinding [ ] { null } ; public static final FieldBinding [ ] NO_FIELDS = new FieldBinding [ <NUM_LIT:0> ] ; public static final MethodBinding [ ] NO_METHODS = new MethodBinding [ <NUM_LIT:0> ] ; public static final ReferenceBinding [ ] NO_SUPERINTERFACES = new ReferenceBinding [ <NUM_LIT:0> ] ; public static final ReferenceBinding [ ] NO_MEMBER_TYPES = new ReferenceBinding [ <NUM_LIT:0> ] ; public static final TypeVariableBinding [ ] NO_TYPE_VARIABLES = new TypeVariableBinding [ <NUM_LIT:0> ] ; public static final AnnotationBinding [ ] NO_ANNOTATIONS = new AnnotationBinding [ <NUM_LIT:0> ] ; public static final ElementValuePair [ ] NO_ELEMENT_VALUE_PAIRS = new ElementValuePair [ <NUM_LIT:0> ] ; public static final FieldBinding [ ] UNINITIALIZED_FIELDS = new FieldBinding [ <NUM_LIT:0> ] ; public static final MethodBinding [ ] UNINITIALIZED_METHODS = new MethodBinding [ <NUM_LIT:0> ] ; public static final ReferenceBinding [ ] UNINITIALIZED_REFERENCE_TYPES = new ReferenceBinding [ <NUM_LIT:0> ] ; public abstract int kind ( ) ; public char [ ] computeUniqueKey ( ) { return computeUniqueKey ( true ) ; } public char [ ] computeUniqueKey ( boolean isLeaf ) { return null ; } public long getAnnotationTagBits ( ) { return <NUM_LIT:0> ; } public void initializeDeprecatedAnnotationTagBits ( ) { } public final boolean isValidBinding ( ) { return problemId ( ) == ProblemReasons . NoError ; } public boolean isVolatile ( ) { return false ; } public boolean isParameter ( ) { return false ; } public int problemId ( ) { return ProblemReasons . NoError ; } public abstract char [ ] readableName ( ) ; public char [ ] shortReadableName ( ) { return readableName ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; public class MostSpecificExceptionMethodBinding extends MethodBinding { private MethodBinding originalMethod ; public MostSpecificExceptionMethodBinding ( MethodBinding originalMethod , ReferenceBinding [ ] mostSpecificExceptions ) { super ( originalMethod . modifiers , originalMethod . selector , originalMethod . returnType , originalMethod . parameters , mostSpecificExceptions , originalMethod . declaringClass ) ; this . originalMethod = originalMethod ; } public MethodBinding original ( ) { return this . originalMethod . original ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . AbstractMethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . CaseStatement ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; import org . eclipse . jdt . internal . compiler . ast . TypeReference ; public final class LocalTypeBinding extends NestedTypeBinding { final static char [ ] LocalTypePrefix = { '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT:c>' , '<CHAR_LIT:a>' , '<CHAR_LIT>' , '<CHAR_LIT>' } ; private InnerEmulationDependency [ ] dependents ; public ArrayBinding [ ] localArrayBindings ; public CaseStatement enclosingCase ; public int sourceStart ; public MethodBinding enclosingMethod ; public LocalTypeBinding ( ClassScope scope , SourceTypeBinding enclosingType , CaseStatement switchCase ) { super ( new char [ ] [ ] { CharOperation . concat ( LocalTypeBinding . LocalTypePrefix , scope . referenceContext . name ) } , scope , enclosingType ) ; TypeDeclaration typeDeclaration = scope . referenceContext ; if ( ( typeDeclaration . bits & ASTNode . IsAnonymousType ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . AnonymousTypeMask ; } else { this . tagBits |= TagBits . LocalTypeMask ; } this . enclosingCase = switchCase ; this . sourceStart = typeDeclaration . sourceStart ; MethodScope methodScope = scope . enclosingMethodScope ( ) ; AbstractMethodDeclaration methodDeclaration = methodScope . referenceMethod ( ) ; if ( methodDeclaration != null ) { this . enclosingMethod = methodDeclaration . binding ; } } public void addInnerEmulationDependent ( BlockScope dependentScope , boolean wasEnclosingInstanceSupplied ) { int index ; if ( this . dependents == null ) { index = <NUM_LIT:0> ; this . dependents = new InnerEmulationDependency [ <NUM_LIT:1> ] ; } else { index = this . dependents . length ; for ( int i = <NUM_LIT:0> ; i < index ; i ++ ) if ( this . dependents [ i ] . scope == dependentScope ) return ; System . arraycopy ( this . dependents , <NUM_LIT:0> , ( this . dependents = new InnerEmulationDependency [ index + <NUM_LIT:1> ] ) , <NUM_LIT:0> , index ) ; } this . dependents [ index ] = new InnerEmulationDependency ( dependentScope , wasEnclosingInstanceSupplied ) ; } public ReferenceBinding anonymousOriginalSuperType ( ) { if ( this . superInterfaces != Binding . NO_SUPERINTERFACES ) { return this . superInterfaces [ <NUM_LIT:0> ] ; } if ( ( this . tagBits & TagBits . HierarchyHasProblems ) == <NUM_LIT:0> ) { return this . superclass ; } if ( this . scope != null ) { TypeReference typeReference = this . scope . referenceContext . allocation . type ; if ( typeReference != null ) { return ( ReferenceBinding ) typeReference . resolvedType ; } } return this . superclass ; } public char [ ] computeUniqueKey ( boolean isLeaf ) { char [ ] outerKey = outermostEnclosingType ( ) . computeUniqueKey ( isLeaf ) ; int semicolon = CharOperation . lastIndexOf ( '<CHAR_LIT:;>' , outerKey ) ; StringBuffer sig = new StringBuffer ( ) ; sig . append ( outerKey , <NUM_LIT:0> , semicolon ) ; sig . append ( '<CHAR_LIT>' ) ; sig . append ( String . valueOf ( this . sourceStart ) ) ; if ( ! isAnonymousType ( ) ) { sig . append ( '<CHAR_LIT>' ) ; sig . append ( this . sourceName ) ; } sig . append ( outerKey , semicolon , outerKey . length - semicolon ) ; int sigLength = sig . length ( ) ; char [ ] uniqueKey = new char [ sigLength ] ; sig . getChars ( <NUM_LIT:0> , sigLength , uniqueKey , <NUM_LIT:0> ) ; return uniqueKey ; } public char [ ] constantPoolName ( ) { if ( this . constantPoolName == null && this . scope != null ) { this . constantPoolName = this . scope . compilationUnitScope ( ) . computeConstantPoolName ( this ) ; } return this . constantPoolName ; } ArrayBinding createArrayType ( int dimensionCount , LookupEnvironment lookupEnvironment ) { if ( this . localArrayBindings == null ) { this . localArrayBindings = new ArrayBinding [ ] { new ArrayBinding ( this , dimensionCount , lookupEnvironment ) } ; return this . localArrayBindings [ <NUM_LIT:0> ] ; } int length = this . localArrayBindings . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) if ( this . localArrayBindings [ i ] . dimensions == dimensionCount ) return this . localArrayBindings [ i ] ; System . arraycopy ( this . localArrayBindings , <NUM_LIT:0> , this . localArrayBindings = new ArrayBinding [ length + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; return this . localArrayBindings [ length ] = new ArrayBinding ( this , dimensionCount , lookupEnvironment ) ; } public char [ ] genericTypeSignature ( ) { if ( this . genericReferenceTypeSignature == null && this . constantPoolName == null ) { if ( isAnonymousType ( ) ) setConstantPoolName ( superclass ( ) . sourceName ( ) ) ; else setConstantPoolName ( sourceName ( ) ) ; } return super . genericTypeSignature ( ) ; } public char [ ] readableName ( ) { char [ ] readableName ; if ( isAnonymousType ( ) ) { readableName = CharOperation . concat ( TypeConstants . ANONYM_PREFIX , anonymousOriginalSuperType ( ) . readableName ( ) , TypeConstants . ANONYM_SUFFIX ) ; } else if ( isMemberType ( ) ) { readableName = CharOperation . concat ( enclosingType ( ) . readableName ( ) , this . sourceName , '<CHAR_LIT:.>' ) ; } else { readableName = this . sourceName ; } TypeVariableBinding [ ] typeVars ; if ( ( typeVars = typeVariables ( ) ) != Binding . NO_TYPE_VARIABLES ) { StringBuffer nameBuffer = new StringBuffer ( <NUM_LIT:10> ) ; nameBuffer . append ( readableName ) . append ( '<CHAR_LIT>' ) ; for ( int i = <NUM_LIT:0> , length = typeVars . length ; i < length ; i ++ ) { if ( i > <NUM_LIT:0> ) nameBuffer . append ( '<CHAR_LIT:U+002C>' ) ; nameBuffer . append ( typeVars [ i ] . readableName ( ) ) ; } nameBuffer . append ( '<CHAR_LIT:>>' ) ; int nameLength = nameBuffer . length ( ) ; readableName = new char [ nameLength ] ; nameBuffer . getChars ( <NUM_LIT:0> , nameLength , readableName , <NUM_LIT:0> ) ; } return readableName ; } public char [ ] shortReadableName ( ) { char [ ] shortReadableName ; if ( isAnonymousType ( ) ) { shortReadableName = CharOperation . concat ( TypeConstants . ANONYM_PREFIX , anonymousOriginalSuperType ( ) . shortReadableName ( ) , TypeConstants . ANONYM_SUFFIX ) ; } else if ( isMemberType ( ) ) { shortReadableName = CharOperation . concat ( enclosingType ( ) . shortReadableName ( ) , this . sourceName , '<CHAR_LIT:.>' ) ; } else { shortReadableName = this . sourceName ; } TypeVariableBinding [ ] typeVars ; if ( ( typeVars = typeVariables ( ) ) != Binding . NO_TYPE_VARIABLES ) { StringBuffer nameBuffer = new StringBuffer ( <NUM_LIT:10> ) ; nameBuffer . append ( shortReadableName ) . append ( '<CHAR_LIT>' ) ; for ( int i = <NUM_LIT:0> , length = typeVars . length ; i < length ; i ++ ) { if ( i > <NUM_LIT:0> ) nameBuffer . append ( '<CHAR_LIT:U+002C>' ) ; nameBuffer . append ( typeVars [ i ] . shortReadableName ( ) ) ; } nameBuffer . append ( '<CHAR_LIT:>>' ) ; int nameLength = nameBuffer . length ( ) ; shortReadableName = new char [ nameLength ] ; nameBuffer . getChars ( <NUM_LIT:0> , nameLength , shortReadableName , <NUM_LIT:0> ) ; } return shortReadableName ; } public void setAsMemberType ( ) { this . tagBits |= TagBits . MemberTypeMask ; } public void setConstantPoolName ( char [ ] computedConstantPoolName ) { this . constantPoolName = computedConstantPoolName ; } public char [ ] signature ( ) { if ( this . signature == null && this . constantPoolName == null ) { if ( isAnonymousType ( ) ) setConstantPoolName ( superclass ( ) . sourceName ( ) ) ; else setConstantPoolName ( sourceName ( ) ) ; } return super . signature ( ) ; } public char [ ] sourceName ( ) { if ( isAnonymousType ( ) ) { return CharOperation . concat ( TypeConstants . ANONYM_PREFIX , anonymousOriginalSuperType ( ) . sourceName ( ) , TypeConstants . ANONYM_SUFFIX ) ; } else return this . sourceName ; } public String toString ( ) { if ( isAnonymousType ( ) ) return "<STR_LIT>" + super . toString ( ) ; if ( isMemberType ( ) ) return "<STR_LIT>" + new String ( sourceName ( ) ) + "<STR_LIT:U+0020>" + super . toString ( ) ; return "<STR_LIT>" + new String ( sourceName ( ) ) + "<STR_LIT:U+0020>" + super . toString ( ) ; } public void updateInnerEmulationDependents ( ) { if ( this . dependents != null ) { for ( int i = <NUM_LIT:0> ; i < this . dependents . length ; i ++ ) { InnerEmulationDependency dependency = this . dependents [ i ] ; dependency . scope . propagateInnerEmulation ( this , dependency . wasEnclosingInstanceSupplied ) ; } } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . ImportReference ; public class ImportBinding extends Binding { public char [ ] [ ] compoundName ; public boolean onDemand ; public ImportReference reference ; public Binding resolvedImport ; public ImportBinding ( char [ ] [ ] compoundName , boolean isOnDemand , Binding binding , ImportReference reference ) { this . compoundName = compoundName ; this . onDemand = isOnDemand ; this . resolvedImport = binding ; this . reference = reference ; } public final int kind ( ) { return IMPORT ; } public boolean isStatic ( ) { return this . reference != null && this . reference . isStatic ( ) ; } public char [ ] readableName ( ) { if ( this . onDemand ) return CharOperation . concat ( CharOperation . concatWith ( this . compoundName , '<CHAR_LIT:.>' ) , "<STR_LIT>" . toCharArray ( ) ) ; else return CharOperation . concatWith ( this . compoundName , '<CHAR_LIT:.>' ) ; } public String toString ( ) { return "<STR_LIT>" + new String ( readableName ( ) ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; public interface TypeConstants { char [ ] JAVA = "<STR_LIT>" . toCharArray ( ) ; char [ ] LANG = "<STR_LIT>" . toCharArray ( ) ; char [ ] IO = "<STR_LIT>" . toCharArray ( ) ; char [ ] UTIL = "<STR_LIT>" . toCharArray ( ) ; char [ ] ANNOTATION = "<STR_LIT>" . toCharArray ( ) ; char [ ] REFLECT = "<STR_LIT>" . toCharArray ( ) ; char [ ] LENGTH = "<STR_LIT>" . toCharArray ( ) ; char [ ] CLONE = "<STR_LIT>" . toCharArray ( ) ; char [ ] EQUALS = "<STR_LIT>" . toCharArray ( ) ; char [ ] GETCLASS = "<STR_LIT>" . toCharArray ( ) ; char [ ] HASHCODE = "<STR_LIT>" . toCharArray ( ) ; char [ ] OBJECT = "<STR_LIT>" . toCharArray ( ) ; char [ ] MAIN = "<STR_LIT>" . toCharArray ( ) ; char [ ] SERIALVERSIONUID = "<STR_LIT>" . toCharArray ( ) ; char [ ] SERIALPERSISTENTFIELDS = "<STR_LIT>" . toCharArray ( ) ; char [ ] READRESOLVE = "<STR_LIT>" . toCharArray ( ) ; char [ ] WRITEREPLACE = "<STR_LIT>" . toCharArray ( ) ; char [ ] READOBJECT = "<STR_LIT>" . toCharArray ( ) ; char [ ] WRITEOBJECT = "<STR_LIT>" . toCharArray ( ) ; char [ ] CharArray_JAVA_LANG_OBJECT = "<STR_LIT>" . toCharArray ( ) ; char [ ] CharArray_JAVA_LANG_ENUM = "<STR_LIT>" . toCharArray ( ) ; char [ ] CharArray_JAVA_LANG_ANNOTATION_ANNOTATION = "<STR_LIT>" . toCharArray ( ) ; char [ ] CharArray_JAVA_IO_OBJECTINPUTSTREAM = "<STR_LIT>" . toCharArray ( ) ; char [ ] CharArray_JAVA_IO_OBJECTOUTPUTSTREAM = "<STR_LIT>" . toCharArray ( ) ; char [ ] CharArray_JAVA_IO_OBJECTSTREAMFIELD = "<STR_LIT>" . toCharArray ( ) ; char [ ] ANONYM_PREFIX = "<STR_LIT>" . toCharArray ( ) ; char [ ] ANONYM_SUFFIX = "<STR_LIT>" . toCharArray ( ) ; char [ ] WILDCARD_NAME = { '<CHAR_LIT>' } ; char [ ] WILDCARD_SUPER = "<STR_LIT>" . toCharArray ( ) ; char [ ] WILDCARD_EXTENDS = "<STR_LIT>" . toCharArray ( ) ; char [ ] WILDCARD_MINUS = { '<CHAR_LIT:->' } ; char [ ] WILDCARD_STAR = { '<CHAR_LIT>' } ; char [ ] WILDCARD_PLUS = { '<CHAR_LIT>' } ; char [ ] WILDCARD_CAPTURE_NAME_PREFIX = "<STR_LIT>" . toCharArray ( ) ; char [ ] WILDCARD_CAPTURE_NAME_SUFFIX = "<STR_LIT>" . toCharArray ( ) ; char [ ] WILDCARD_CAPTURE = { '<CHAR_LIT>' } ; char [ ] BYTE = "<STR_LIT>" . toCharArray ( ) ; char [ ] SHORT = "<STR_LIT>" . toCharArray ( ) ; char [ ] INT = "<STR_LIT:int>" . toCharArray ( ) ; char [ ] LONG = "<STR_LIT:long>" . toCharArray ( ) ; char [ ] FLOAT = "<STR_LIT:float>" . toCharArray ( ) ; char [ ] DOUBLE = "<STR_LIT:double>" . toCharArray ( ) ; char [ ] CHAR = "<STR_LIT>" . toCharArray ( ) ; char [ ] BOOLEAN = "<STR_LIT:boolean>" . toCharArray ( ) ; char [ ] NULL = "<STR_LIT:null>" . toCharArray ( ) ; char [ ] VOID = "<STR_LIT>" . toCharArray ( ) ; char [ ] VALUE = "<STR_LIT:value>" . toCharArray ( ) ; char [ ] VALUES = "<STR_LIT>" . toCharArray ( ) ; char [ ] VALUEOF = "<STR_LIT>" . toCharArray ( ) ; char [ ] UPPER_SOURCE = "<STR_LIT>" . toCharArray ( ) ; char [ ] UPPER_CLASS = "<STR_LIT>" . toCharArray ( ) ; char [ ] UPPER_RUNTIME = "<STR_LIT>" . toCharArray ( ) ; char [ ] ANNOTATION_PREFIX = "<STR_LIT:@>" . toCharArray ( ) ; char [ ] ANNOTATION_SUFFIX = "<STR_LIT>" . toCharArray ( ) ; char [ ] TYPE = "<STR_LIT>" . toCharArray ( ) ; char [ ] UPPER_FIELD = "<STR_LIT>" . toCharArray ( ) ; char [ ] UPPER_METHOD = "<STR_LIT>" . toCharArray ( ) ; char [ ] UPPER_PARAMETER = "<STR_LIT>" . toCharArray ( ) ; char [ ] UPPER_CONSTRUCTOR = "<STR_LIT>" . toCharArray ( ) ; char [ ] UPPER_LOCAL_VARIABLE = "<STR_LIT>" . toCharArray ( ) ; char [ ] UPPER_ANNOTATION_TYPE = "<STR_LIT>" . toCharArray ( ) ; char [ ] UPPER_PACKAGE = "<STR_LIT>" . toCharArray ( ) ; char [ ] [ ] JAVA_LANG = { JAVA , LANG } ; char [ ] [ ] JAVA_IO = { JAVA , IO } ; char [ ] [ ] JAVA_LANG_ANNOTATION_ANNOTATION = { JAVA , LANG , ANNOTATION , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_ASSERTIONERROR = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_CLASS = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_CLASSNOTFOUNDEXCEPTION = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_CLONEABLE = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_ENUM = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_EXCEPTION = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_ERROR = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_ILLEGALARGUMENTEXCEPTION = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_ITERABLE = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_NOCLASSDEFERROR = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_OBJECT = { JAVA , LANG , OBJECT } ; char [ ] [ ] JAVA_LANG_STRING = { JAVA , LANG , "<STR_LIT:String>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_STRINGBUFFER = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_STRINGBUILDER = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_SYSTEM = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_RUNTIMEEXCEPTION = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_THROWABLE = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_REFLECT_CONSTRUCTOR = { JAVA , LANG , REFLECT , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_IO_PRINTSTREAM = { JAVA , IO , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_IO_SERIALIZABLE = { JAVA , IO , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_BYTE = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_SHORT = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_CHARACTER = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_INTEGER = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_LONG = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_FLOAT = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_DOUBLE = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_BOOLEAN = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_VOID = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_UTIL_COLLECTION = { JAVA , UTIL , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_UTIL_ITERATOR = { JAVA , UTIL , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_DEPRECATED = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_ANNOTATION_DOCUMENTED = { JAVA , LANG , ANNOTATION , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_ANNOTATION_INHERITED = { JAVA , LANG , ANNOTATION , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_OVERRIDE = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_ANNOTATION_RETENTION = { JAVA , LANG , ANNOTATION , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_SUPPRESSWARNINGS = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_ANNOTATION_TARGET = { JAVA , LANG , ANNOTATION , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_ANNOTATION_RETENTIONPOLICY = { JAVA , LANG , ANNOTATION , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_ANNOTATION_ELEMENTTYPE = { JAVA , LANG , ANNOTATION , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_REFLECT_FIELD = new char [ ] [ ] { JAVA , LANG , REFLECT , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_REFLECT_METHOD = new char [ ] [ ] { JAVA , LANG , REFLECT , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_IO_OBJECTSTREAMEXCEPTION = new char [ ] [ ] { JAVA , IO , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_IO_EXTERNALIZABLE = { JAVA , IO , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_IO_IOEXCEPTION = new char [ ] [ ] { JAVA , IO , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_IO_OBJECTOUTPUTSTREAM = new char [ ] [ ] { JAVA , IO , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_IO_OBJECTINPUTSTREAM = new char [ ] [ ] { JAVA , IO , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVAX_RMI_CORBA_STUB = new char [ ] [ ] { "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , } ; char [ ] [ ] JAVA_LANG_SAFEVARARGS = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] INVOKE = "<STR_LIT>" . toCharArray ( ) ; char [ ] [ ] JAVA_LANG_INVOKE_METHODHANDLE_POLYMORPHICSIGNATURE = { JAVA , LANG , INVOKE , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_INVOKE_METHODHANDLE_$_POLYMORPHICSIGNATURE = { JAVA , LANG , INVOKE , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_AUTOCLOSEABLE = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; int CONSTRAINT_EQUAL = <NUM_LIT:0> ; int CONSTRAINT_EXTENDS = <NUM_LIT:1> ; int CONSTRAINT_SUPER = <NUM_LIT:2> ; int OK = <NUM_LIT:0> ; int UNCHECKED = <NUM_LIT:1> ; int MISMATCH = <NUM_LIT:2> ; char [ ] INIT = "<STR_LIT>" . toCharArray ( ) ; char [ ] CLINIT = "<STR_LIT>" . toCharArray ( ) ; char [ ] SYNTHETIC_SWITCH_ENUM_TABLE = "<STR_LIT>" . toCharArray ( ) ; char [ ] SYNTHETIC_ENUM_VALUES = "<STR_LIT>" . toCharArray ( ) ; char [ ] SYNTHETIC_ASSERT_DISABLED = "<STR_LIT>" . toCharArray ( ) ; char [ ] SYNTHETIC_CLASS = "<STR_LIT>" . toCharArray ( ) ; char [ ] SYNTHETIC_OUTER_LOCAL_PREFIX = "<STR_LIT>" . toCharArray ( ) ; char [ ] SYNTHETIC_ENCLOSING_INSTANCE_PREFIX = "<STR_LIT>" . toCharArray ( ) ; char [ ] SYNTHETIC_ACCESS_METHOD_PREFIX = "<STR_LIT>" . toCharArray ( ) ; char [ ] SYNTHETIC_ENUM_CONSTANT_INITIALIZATION_METHOD_PREFIX = "<STR_LIT>" . toCharArray ( ) ; char [ ] SYNTHETIC_STATIC_FACTORY = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] PACKAGE_INFO_NAME = "<STR_LIT>" . toCharArray ( ) ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; public class LazilyResolvedMethodBinding extends MethodBinding { private boolean isGetter ; private String propertyName ; public LazilyResolvedMethodBinding ( boolean isGetter , String propertyName , int modifiers , char [ ] selector , ReferenceBinding [ ] thrownExceptions , ReferenceBinding declaringClass ) { super ( modifiers | ExtraCompilerModifiers . AccUnresolved , selector , null , null , thrownExceptions , declaringClass ) ; this . propertyName = propertyName ; this . isGetter = isGetter ; } private TypeBinding getTypeBinding ( ) { FieldBinding fBinding = this . declaringClass . getField ( this . propertyName . toCharArray ( ) , false ) ; if ( fBinding != null && ! ( fBinding . type instanceof MissingTypeBinding ) ) { return fBinding . type ; } return null ; } public TypeBinding getParameterTypeBinding ( ) { if ( this . isGetter ) { return null ; } else { return getTypeBinding ( ) ; } } public TypeBinding getReturnTypeBinding ( ) { if ( this . isGetter ) { return getTypeBinding ( ) ; } else { return TypeBinding . VOID ; } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; import java . util . HashMap ; import java . util . Iterator ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . AbstractMethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . AbstractVariableDeclaration ; import org . eclipse . jdt . internal . compiler . ast . Argument ; import org . eclipse . jdt . internal . compiler . ast . FieldDeclaration ; import org . eclipse . jdt . internal . compiler . ast . MethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; import org . eclipse . jdt . internal . compiler . ast . TypeParameter ; import org . eclipse . jdt . internal . compiler . ast . TypeReference ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . problem . ProblemSeverities ; import org . eclipse . jdt . internal . compiler . util . SimpleLookupTable ; import org . eclipse . jdt . internal . compiler . util . Util ; public class SourceTypeBinding extends ReferenceBinding { public ReferenceBinding superclass ; public ReferenceBinding [ ] superInterfaces ; private FieldBinding [ ] fields ; private MethodBinding [ ] methods ; public ReferenceBinding [ ] memberTypes ; public TypeVariableBinding [ ] typeVariables ; public ClassScope scope ; private final static int METHOD_EMUL = <NUM_LIT:0> ; private final static int FIELD_EMUL = <NUM_LIT:1> ; private final static int CLASS_LITERAL_EMUL = <NUM_LIT:2> ; private final static int MAX_SYNTHETICS = <NUM_LIT:3> ; HashMap [ ] synthetics ; char [ ] genericReferenceTypeSignature ; private SimpleLookupTable storedAnnotations = null ; public SourceTypeBinding ( char [ ] [ ] compoundName , PackageBinding fPackage , ClassScope scope ) { this . compoundName = compoundName ; this . fPackage = fPackage ; this . fileName = scope . referenceCompilationUnit ( ) . getFileName ( ) ; this . modifiers = scope . referenceContext . modifiers ; this . sourceName = scope . referenceContext . name ; this . scope = scope ; this . fields = Binding . UNINITIALIZED_FIELDS ; this . methods = Binding . UNINITIALIZED_METHODS ; computeId ( ) ; } private void addDefaultAbstractMethods ( ) { if ( ( this . tagBits & TagBits . KnowsDefaultAbstractMethods ) != <NUM_LIT:0> ) return ; this . tagBits |= TagBits . KnowsDefaultAbstractMethods ; if ( isClass ( ) && isAbstract ( ) ) { if ( this . scope . compilerOptions ( ) . targetJDK >= ClassFileConstants . JDK1_2 ) return ; ReferenceBinding [ ] itsInterfaces = superInterfaces ( ) ; if ( itsInterfaces != Binding . NO_SUPERINTERFACES ) { MethodBinding [ ] defaultAbstracts = null ; int defaultAbstractsCount = <NUM_LIT:0> ; ReferenceBinding [ ] interfacesToVisit = itsInterfaces ; int nextPosition = interfacesToVisit . length ; for ( int i = <NUM_LIT:0> ; i < nextPosition ; i ++ ) { ReferenceBinding superType = interfacesToVisit [ i ] ; if ( superType . isValidBinding ( ) ) { MethodBinding [ ] superMethods = superType . methods ( ) ; nextAbstractMethod : for ( int m = superMethods . length ; -- m >= <NUM_LIT:0> ; ) { MethodBinding method = superMethods [ m ] ; if ( implementsMethod ( method ) ) continue nextAbstractMethod ; if ( defaultAbstractsCount == <NUM_LIT:0> ) { defaultAbstracts = new MethodBinding [ <NUM_LIT:5> ] ; } else { for ( int k = <NUM_LIT:0> ; k < defaultAbstractsCount ; k ++ ) { MethodBinding alreadyAdded = defaultAbstracts [ k ] ; if ( CharOperation . equals ( alreadyAdded . selector , method . selector ) && alreadyAdded . areParametersEqual ( method ) ) continue nextAbstractMethod ; } } MethodBinding defaultAbstract = new MethodBinding ( method . modifiers | ExtraCompilerModifiers . AccDefaultAbstract | ClassFileConstants . AccSynthetic , method . selector , method . returnType , method . parameters , method . thrownExceptions , this ) ; if ( defaultAbstractsCount == defaultAbstracts . length ) System . arraycopy ( defaultAbstracts , <NUM_LIT:0> , defaultAbstracts = new MethodBinding [ <NUM_LIT:2> * defaultAbstractsCount ] , <NUM_LIT:0> , defaultAbstractsCount ) ; defaultAbstracts [ defaultAbstractsCount ++ ] = defaultAbstract ; } if ( ( itsInterfaces = superType . superInterfaces ( ) ) != Binding . NO_SUPERINTERFACES ) { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } } if ( defaultAbstractsCount > <NUM_LIT:0> ) { int length = this . methods . length ; System . arraycopy ( this . methods , <NUM_LIT:0> , this . methods = new MethodBinding [ length + defaultAbstractsCount ] , <NUM_LIT:0> , length ) ; System . arraycopy ( defaultAbstracts , <NUM_LIT:0> , this . methods , length , defaultAbstractsCount ) ; length = length + defaultAbstractsCount ; if ( length > <NUM_LIT:1> ) ReferenceBinding . sortMethods ( this . methods , <NUM_LIT:0> , length ) ; } } } } public FieldBinding addSyntheticFieldForInnerclass ( LocalVariableBinding actualOuterLocalVariable ) { if ( this . synthetics == null ) this . synthetics = new HashMap [ MAX_SYNTHETICS ] ; if ( this . synthetics [ SourceTypeBinding . FIELD_EMUL ] == null ) this . synthetics [ SourceTypeBinding . FIELD_EMUL ] = new HashMap ( <NUM_LIT:5> ) ; FieldBinding synthField = ( FieldBinding ) this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . get ( actualOuterLocalVariable ) ; if ( synthField == null ) { synthField = new SyntheticFieldBinding ( CharOperation . concat ( TypeConstants . SYNTHETIC_OUTER_LOCAL_PREFIX , actualOuterLocalVariable . name ) , actualOuterLocalVariable . type , ClassFileConstants . AccPrivate | ClassFileConstants . AccFinal | ClassFileConstants . AccSynthetic , this , Constant . NotAConstant , this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . size ( ) ) ; this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . put ( actualOuterLocalVariable , synthField ) ; } boolean needRecheck ; int index = <NUM_LIT:1> ; do { needRecheck = false ; FieldBinding existingField ; if ( ( existingField = getField ( synthField . name , true ) ) != null ) { TypeDeclaration typeDecl = this . scope . referenceContext ; FieldDeclaration [ ] fieldDeclarations = typeDecl . fields ; int max = fieldDeclarations == null ? <NUM_LIT:0> : fieldDeclarations . length ; for ( int i = <NUM_LIT:0> ; i < max ; i ++ ) { FieldDeclaration fieldDecl = fieldDeclarations [ i ] ; if ( fieldDecl . binding == existingField ) { synthField . name = CharOperation . concat ( TypeConstants . SYNTHETIC_OUTER_LOCAL_PREFIX , actualOuterLocalVariable . name , ( "<STR_LIT:$>" + String . valueOf ( index ++ ) ) . toCharArray ( ) ) ; needRecheck = true ; break ; } } } } while ( needRecheck ) ; return synthField ; } public FieldBinding addSyntheticFieldForInnerclass ( ReferenceBinding enclosingType ) { if ( this . synthetics == null ) this . synthetics = new HashMap [ MAX_SYNTHETICS ] ; if ( this . synthetics [ SourceTypeBinding . FIELD_EMUL ] == null ) this . synthetics [ SourceTypeBinding . FIELD_EMUL ] = new HashMap ( <NUM_LIT:5> ) ; FieldBinding synthField = ( FieldBinding ) this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . get ( enclosingType ) ; if ( synthField == null ) { synthField = new SyntheticFieldBinding ( CharOperation . concat ( TypeConstants . SYNTHETIC_ENCLOSING_INSTANCE_PREFIX , String . valueOf ( enclosingType . depth ( ) ) . toCharArray ( ) ) , enclosingType , ClassFileConstants . AccDefault | ClassFileConstants . AccFinal | ClassFileConstants . AccSynthetic , this , Constant . NotAConstant , this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . size ( ) ) ; this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . put ( enclosingType , synthField ) ; } boolean needRecheck ; do { needRecheck = false ; FieldBinding existingField ; if ( ( existingField = getField ( synthField . name , true ) ) != null ) { TypeDeclaration typeDecl = this . scope . referenceContext ; FieldDeclaration [ ] fieldDeclarations = typeDecl . fields ; int max = fieldDeclarations == null ? <NUM_LIT:0> : fieldDeclarations . length ; for ( int i = <NUM_LIT:0> ; i < max ; i ++ ) { FieldDeclaration fieldDecl = fieldDeclarations [ i ] ; if ( fieldDecl . binding == existingField ) { if ( this . scope . compilerOptions ( ) . complianceLevel >= ClassFileConstants . JDK1_5 ) { synthField . name = CharOperation . concat ( synthField . name , "<STR_LIT:$>" . toCharArray ( ) ) ; needRecheck = true ; } else { this . scope . problemReporter ( ) . duplicateFieldInType ( this , fieldDecl ) ; } break ; } } } } while ( needRecheck ) ; return synthField ; } public FieldBinding addSyntheticFieldForClassLiteral ( TypeBinding targetType , BlockScope blockScope ) { if ( this . synthetics == null ) this . synthetics = new HashMap [ MAX_SYNTHETICS ] ; if ( this . synthetics [ SourceTypeBinding . CLASS_LITERAL_EMUL ] == null ) this . synthetics [ SourceTypeBinding . CLASS_LITERAL_EMUL ] = new HashMap ( <NUM_LIT:5> ) ; FieldBinding synthField = ( FieldBinding ) this . synthetics [ SourceTypeBinding . CLASS_LITERAL_EMUL ] . get ( targetType ) ; if ( synthField == null ) { synthField = new SyntheticFieldBinding ( CharOperation . concat ( TypeConstants . SYNTHETIC_CLASS , String . valueOf ( this . synthetics [ SourceTypeBinding . CLASS_LITERAL_EMUL ] . size ( ) ) . toCharArray ( ) ) , blockScope . getJavaLangClass ( ) , ClassFileConstants . AccDefault | ClassFileConstants . AccStatic | ClassFileConstants . AccSynthetic , this , Constant . NotAConstant , this . synthetics [ SourceTypeBinding . CLASS_LITERAL_EMUL ] . size ( ) ) ; this . synthetics [ SourceTypeBinding . CLASS_LITERAL_EMUL ] . put ( targetType , synthField ) ; } FieldBinding existingField ; if ( ( existingField = getField ( synthField . name , true ) ) != null ) { TypeDeclaration typeDecl = blockScope . referenceType ( ) ; FieldDeclaration [ ] typeDeclarationFields = typeDecl . fields ; int max = typeDeclarationFields == null ? <NUM_LIT:0> : typeDeclarationFields . length ; for ( int i = <NUM_LIT:0> ; i < max ; i ++ ) { FieldDeclaration fieldDecl = typeDeclarationFields [ i ] ; if ( fieldDecl . binding == existingField ) { blockScope . problemReporter ( ) . duplicateFieldInType ( this , fieldDecl ) ; break ; } } } return synthField ; } public FieldBinding addSyntheticFieldForAssert ( BlockScope blockScope ) { if ( this . synthetics == null ) this . synthetics = new HashMap [ MAX_SYNTHETICS ] ; if ( this . synthetics [ SourceTypeBinding . FIELD_EMUL ] == null ) this . synthetics [ SourceTypeBinding . FIELD_EMUL ] = new HashMap ( <NUM_LIT:5> ) ; FieldBinding synthField = ( FieldBinding ) this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . get ( "<STR_LIT>" ) ; if ( synthField == null ) { synthField = new SyntheticFieldBinding ( TypeConstants . SYNTHETIC_ASSERT_DISABLED , TypeBinding . BOOLEAN , ClassFileConstants . AccDefault | ClassFileConstants . AccStatic | ClassFileConstants . AccSynthetic | ClassFileConstants . AccFinal , this , Constant . NotAConstant , this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . size ( ) ) ; this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . put ( "<STR_LIT>" , synthField ) ; } boolean needRecheck ; int index = <NUM_LIT:0> ; do { needRecheck = false ; FieldBinding existingField ; if ( ( existingField = getField ( synthField . name , true ) ) != null ) { TypeDeclaration typeDecl = this . scope . referenceContext ; int max = ( typeDecl . fields == null ) ? <NUM_LIT:0> : typeDecl . fields . length ; for ( int i = <NUM_LIT:0> ; i < max ; i ++ ) { FieldDeclaration fieldDecl = typeDecl . fields [ i ] ; if ( fieldDecl . binding == existingField ) { synthField . name = CharOperation . concat ( TypeConstants . SYNTHETIC_ASSERT_DISABLED , ( "<STR_LIT:_>" + String . valueOf ( index ++ ) ) . toCharArray ( ) ) ; needRecheck = true ; break ; } } } } while ( needRecheck ) ; return synthField ; } public FieldBinding addSyntheticFieldForEnumValues ( ) { if ( this . synthetics == null ) this . synthetics = new HashMap [ MAX_SYNTHETICS ] ; if ( this . synthetics [ SourceTypeBinding . FIELD_EMUL ] == null ) this . synthetics [ SourceTypeBinding . FIELD_EMUL ] = new HashMap ( <NUM_LIT:5> ) ; FieldBinding synthField = ( FieldBinding ) this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . get ( "<STR_LIT>" ) ; if ( synthField == null ) { synthField = new SyntheticFieldBinding ( TypeConstants . SYNTHETIC_ENUM_VALUES , this . scope . createArrayType ( this , <NUM_LIT:1> ) , ClassFileConstants . AccPrivate | ClassFileConstants . AccStatic | ClassFileConstants . AccSynthetic | ClassFileConstants . AccFinal , this , Constant . NotAConstant , this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . size ( ) ) ; this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . put ( "<STR_LIT>" , synthField ) ; } boolean needRecheck ; int index = <NUM_LIT:0> ; do { needRecheck = false ; FieldBinding existingField ; if ( ( existingField = getField ( synthField . name , true ) ) != null ) { TypeDeclaration typeDecl = this . scope . referenceContext ; FieldDeclaration [ ] fieldDeclarations = typeDecl . fields ; int max = fieldDeclarations == null ? <NUM_LIT:0> : fieldDeclarations . length ; for ( int i = <NUM_LIT:0> ; i < max ; i ++ ) { FieldDeclaration fieldDecl = fieldDeclarations [ i ] ; if ( fieldDecl . binding == existingField ) { synthField . name = CharOperation . concat ( TypeConstants . SYNTHETIC_ENUM_VALUES , ( "<STR_LIT:_>" + String . valueOf ( index ++ ) ) . toCharArray ( ) ) ; needRecheck = true ; break ; } } } } while ( needRecheck ) ; return synthField ; } public SyntheticMethodBinding addSyntheticMethod ( FieldBinding targetField , boolean isReadAccess , boolean isSuperAccess ) { if ( this . synthetics == null ) this . synthetics = new HashMap [ MAX_SYNTHETICS ] ; if ( this . synthetics [ SourceTypeBinding . METHOD_EMUL ] == null ) this . synthetics [ SourceTypeBinding . METHOD_EMUL ] = new HashMap ( <NUM_LIT:5> ) ; SyntheticMethodBinding accessMethod = null ; SyntheticMethodBinding [ ] accessors = ( SyntheticMethodBinding [ ] ) this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . get ( targetField ) ; if ( accessors == null ) { accessMethod = new SyntheticMethodBinding ( targetField , isReadAccess , isSuperAccess , this ) ; this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . put ( targetField , accessors = new SyntheticMethodBinding [ <NUM_LIT:2> ] ) ; accessors [ isReadAccess ? <NUM_LIT:0> : <NUM_LIT:1> ] = accessMethod ; } else { if ( ( accessMethod = accessors [ isReadAccess ? <NUM_LIT:0> : <NUM_LIT:1> ] ) == null ) { accessMethod = new SyntheticMethodBinding ( targetField , isReadAccess , isSuperAccess , this ) ; accessors [ isReadAccess ? <NUM_LIT:0> : <NUM_LIT:1> ] = accessMethod ; } } return accessMethod ; } public SyntheticMethodBinding addSyntheticEnumMethod ( char [ ] selector ) { if ( this . synthetics == null ) this . synthetics = new HashMap [ MAX_SYNTHETICS ] ; if ( this . synthetics [ SourceTypeBinding . METHOD_EMUL ] == null ) this . synthetics [ SourceTypeBinding . METHOD_EMUL ] = new HashMap ( <NUM_LIT:5> ) ; SyntheticMethodBinding accessMethod = null ; SyntheticMethodBinding [ ] accessors = ( SyntheticMethodBinding [ ] ) this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . get ( selector ) ; if ( accessors == null ) { accessMethod = new SyntheticMethodBinding ( this , selector ) ; this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . put ( selector , accessors = new SyntheticMethodBinding [ <NUM_LIT:2> ] ) ; accessors [ <NUM_LIT:0> ] = accessMethod ; } else { if ( ( accessMethod = accessors [ <NUM_LIT:0> ] ) == null ) { accessMethod = new SyntheticMethodBinding ( this , selector ) ; accessors [ <NUM_LIT:0> ] = accessMethod ; } } return accessMethod ; } public SyntheticFieldBinding addSyntheticFieldForSwitchEnum ( char [ ] fieldName , String key ) { if ( this . synthetics == null ) this . synthetics = new HashMap [ MAX_SYNTHETICS ] ; if ( this . synthetics [ SourceTypeBinding . FIELD_EMUL ] == null ) this . synthetics [ SourceTypeBinding . FIELD_EMUL ] = new HashMap ( <NUM_LIT:5> ) ; SyntheticFieldBinding synthField = ( SyntheticFieldBinding ) this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . get ( key ) ; if ( synthField == null ) { synthField = new SyntheticFieldBinding ( fieldName , this . scope . createArrayType ( TypeBinding . INT , <NUM_LIT:1> ) , ClassFileConstants . AccPrivate | ClassFileConstants . AccStatic | ClassFileConstants . AccSynthetic , this , Constant . NotAConstant , this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . size ( ) ) ; this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . put ( key , synthField ) ; } boolean needRecheck ; int index = <NUM_LIT:0> ; do { needRecheck = false ; FieldBinding existingField ; if ( ( existingField = getField ( synthField . name , true ) ) != null ) { TypeDeclaration typeDecl = this . scope . referenceContext ; FieldDeclaration [ ] fieldDeclarations = typeDecl . fields ; int max = fieldDeclarations == null ? <NUM_LIT:0> : fieldDeclarations . length ; for ( int i = <NUM_LIT:0> ; i < max ; i ++ ) { FieldDeclaration fieldDecl = fieldDeclarations [ i ] ; if ( fieldDecl . binding == existingField ) { synthField . name = CharOperation . concat ( fieldName , ( "<STR_LIT:_>" + String . valueOf ( index ++ ) ) . toCharArray ( ) ) ; needRecheck = true ; break ; } } } } while ( needRecheck ) ; return synthField ; } public SyntheticMethodBinding addSyntheticMethodForSwitchEnum ( TypeBinding enumBinding ) { if ( this . synthetics == null ) this . synthetics = new HashMap [ MAX_SYNTHETICS ] ; if ( this . synthetics [ SourceTypeBinding . METHOD_EMUL ] == null ) this . synthetics [ SourceTypeBinding . METHOD_EMUL ] = new HashMap ( <NUM_LIT:5> ) ; SyntheticMethodBinding accessMethod = null ; char [ ] selector = CharOperation . concat ( TypeConstants . SYNTHETIC_SWITCH_ENUM_TABLE , enumBinding . constantPoolName ( ) ) ; CharOperation . replace ( selector , '<CHAR_LIT:/>' , '<CHAR_LIT>' ) ; final String key = new String ( selector ) ; SyntheticMethodBinding [ ] accessors = ( SyntheticMethodBinding [ ] ) this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . get ( key ) ; if ( accessors == null ) { final SyntheticFieldBinding fieldBinding = addSyntheticFieldForSwitchEnum ( selector , key ) ; accessMethod = new SyntheticMethodBinding ( fieldBinding , this , enumBinding , selector ) ; this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . put ( key , accessors = new SyntheticMethodBinding [ <NUM_LIT:2> ] ) ; accessors [ <NUM_LIT:0> ] = accessMethod ; } else { if ( ( accessMethod = accessors [ <NUM_LIT:0> ] ) == null ) { final SyntheticFieldBinding fieldBinding = addSyntheticFieldForSwitchEnum ( selector , key ) ; accessMethod = new SyntheticMethodBinding ( fieldBinding , this , enumBinding , selector ) ; accessors [ <NUM_LIT:0> ] = accessMethod ; } } return accessMethod ; } public SyntheticMethodBinding addSyntheticMethodForEnumInitialization ( int begin , int end ) { if ( this . synthetics == null ) this . synthetics = new HashMap [ MAX_SYNTHETICS ] ; if ( this . synthetics [ SourceTypeBinding . METHOD_EMUL ] == null ) this . synthetics [ SourceTypeBinding . METHOD_EMUL ] = new HashMap ( <NUM_LIT:5> ) ; SyntheticMethodBinding accessMethod = new SyntheticMethodBinding ( this , begin , end ) ; SyntheticMethodBinding [ ] accessors = new SyntheticMethodBinding [ <NUM_LIT:2> ] ; this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . put ( accessMethod . selector , accessors ) ; accessors [ <NUM_LIT:0> ] = accessMethod ; return accessMethod ; } public SyntheticMethodBinding addSyntheticMethod ( MethodBinding targetMethod , boolean isSuperAccess ) { if ( this . synthetics == null ) this . synthetics = new HashMap [ MAX_SYNTHETICS ] ; if ( this . synthetics [ SourceTypeBinding . METHOD_EMUL ] == null ) this . synthetics [ SourceTypeBinding . METHOD_EMUL ] = new HashMap ( <NUM_LIT:5> ) ; SyntheticMethodBinding accessMethod = null ; SyntheticMethodBinding [ ] accessors = ( SyntheticMethodBinding [ ] ) this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . get ( targetMethod ) ; if ( accessors == null ) { accessMethod = new SyntheticMethodBinding ( targetMethod , isSuperAccess , this ) ; this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . put ( targetMethod , accessors = new SyntheticMethodBinding [ <NUM_LIT:2> ] ) ; accessors [ isSuperAccess ? <NUM_LIT:0> : <NUM_LIT:1> ] = accessMethod ; } else { if ( ( accessMethod = accessors [ isSuperAccess ? <NUM_LIT:0> : <NUM_LIT:1> ] ) == null ) { accessMethod = new SyntheticMethodBinding ( targetMethod , isSuperAccess , this ) ; accessors [ isSuperAccess ? <NUM_LIT:0> : <NUM_LIT:1> ] = accessMethod ; } } if ( targetMethod . declaringClass . isStatic ( ) ) { if ( ( targetMethod . isConstructor ( ) && targetMethod . parameters . length >= <NUM_LIT> ) || targetMethod . parameters . length >= <NUM_LIT> ) { this . scope . problemReporter ( ) . tooManyParametersForSyntheticMethod ( targetMethod . sourceMethod ( ) ) ; } } else if ( ( targetMethod . isConstructor ( ) && targetMethod . parameters . length >= <NUM_LIT> ) || targetMethod . parameters . length >= <NUM_LIT> ) { this . scope . problemReporter ( ) . tooManyParametersForSyntheticMethod ( targetMethod . sourceMethod ( ) ) ; } return accessMethod ; } public SyntheticMethodBinding addSyntheticBridgeMethod ( MethodBinding inheritedMethodToBridge , MethodBinding targetMethod ) { if ( isInterface ( ) ) return null ; if ( inheritedMethodToBridge . returnType . erasure ( ) == targetMethod . returnType . erasure ( ) && inheritedMethodToBridge . areParameterErasuresEqual ( targetMethod ) ) { return null ; } if ( this . synthetics == null ) this . synthetics = new HashMap [ MAX_SYNTHETICS ] ; if ( this . synthetics [ SourceTypeBinding . METHOD_EMUL ] == null ) { this . synthetics [ SourceTypeBinding . METHOD_EMUL ] = new HashMap ( <NUM_LIT:5> ) ; } else { Iterator synthMethods = this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . keySet ( ) . iterator ( ) ; while ( synthMethods . hasNext ( ) ) { Object synthetic = synthMethods . next ( ) ; if ( synthetic instanceof MethodBinding ) { MethodBinding method = ( MethodBinding ) synthetic ; if ( CharOperation . equals ( inheritedMethodToBridge . selector , method . selector ) && inheritedMethodToBridge . returnType . erasure ( ) == method . returnType . erasure ( ) && inheritedMethodToBridge . areParameterErasuresEqual ( method ) ) { return null ; } } } } SyntheticMethodBinding accessMethod = null ; SyntheticMethodBinding [ ] accessors = ( SyntheticMethodBinding [ ] ) this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . get ( inheritedMethodToBridge ) ; if ( accessors == null ) { accessMethod = new SyntheticMethodBinding ( inheritedMethodToBridge , targetMethod , this ) ; this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . put ( inheritedMethodToBridge , accessors = new SyntheticMethodBinding [ <NUM_LIT:2> ] ) ; accessors [ <NUM_LIT:1> ] = accessMethod ; } else { if ( ( accessMethod = accessors [ <NUM_LIT:1> ] ) == null ) { accessMethod = new SyntheticMethodBinding ( inheritedMethodToBridge , targetMethod , this ) ; accessors [ <NUM_LIT:1> ] = accessMethod ; } } return accessMethod ; } public SyntheticMethodBinding addSyntheticBridgeMethod ( MethodBinding inheritedMethodToBridge ) { if ( this . scope . compilerOptions ( ) . complianceLevel <= ClassFileConstants . JDK1_5 ) { return null ; } if ( isInterface ( ) ) return null ; if ( inheritedMethodToBridge . isAbstract ( ) || inheritedMethodToBridge . isFinal ( ) || inheritedMethodToBridge . isStatic ( ) ) { return null ; } if ( this . synthetics == null ) this . synthetics = new HashMap [ MAX_SYNTHETICS ] ; if ( this . synthetics [ SourceTypeBinding . METHOD_EMUL ] == null ) { this . synthetics [ SourceTypeBinding . METHOD_EMUL ] = new HashMap ( <NUM_LIT:5> ) ; } else { Iterator synthMethods = this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . keySet ( ) . iterator ( ) ; while ( synthMethods . hasNext ( ) ) { Object synthetic = synthMethods . next ( ) ; if ( synthetic instanceof MethodBinding ) { MethodBinding method = ( MethodBinding ) synthetic ; if ( CharOperation . equals ( inheritedMethodToBridge . selector , method . selector ) && inheritedMethodToBridge . returnType . erasure ( ) == method . returnType . erasure ( ) && inheritedMethodToBridge . areParameterErasuresEqual ( method ) ) { return null ; } } } } SyntheticMethodBinding accessMethod = null ; SyntheticMethodBinding [ ] accessors = ( SyntheticMethodBinding [ ] ) this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . get ( inheritedMethodToBridge ) ; if ( accessors == null ) { accessMethod = new SyntheticMethodBinding ( inheritedMethodToBridge , this ) ; this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . put ( inheritedMethodToBridge , accessors = new SyntheticMethodBinding [ <NUM_LIT:2> ] ) ; accessors [ <NUM_LIT:0> ] = accessMethod ; } else { if ( ( accessMethod = accessors [ <NUM_LIT:0> ] ) == null ) { accessMethod = new SyntheticMethodBinding ( inheritedMethodToBridge , this ) ; accessors [ <NUM_LIT:0> ] = accessMethod ; } } return accessMethod ; } boolean areFieldsInitialized ( ) { return this . fields != Binding . UNINITIALIZED_FIELDS ; } boolean areMethodsInitialized ( ) { return this . methods != Binding . UNINITIALIZED_METHODS ; } public int kind ( ) { if ( this . typeVariables != Binding . NO_TYPE_VARIABLES ) return Binding . GENERIC_TYPE ; return Binding . TYPE ; } public char [ ] computeUniqueKey ( boolean isLeaf ) { char [ ] uniqueKey = super . computeUniqueKey ( isLeaf ) ; if ( uniqueKey . length == <NUM_LIT:2> ) return uniqueKey ; if ( Util . isClassFileName ( this . fileName ) ) return uniqueKey ; int end = CharOperation . lastIndexOf ( '<CHAR_LIT:.>' , this . fileName ) ; if ( end != - <NUM_LIT:1> ) { int start = CharOperation . lastIndexOf ( '<CHAR_LIT:/>' , this . fileName ) + <NUM_LIT:1> ; char [ ] mainTypeName = CharOperation . subarray ( this . fileName , start , end ) ; start = CharOperation . lastIndexOf ( '<CHAR_LIT:/>' , uniqueKey ) + <NUM_LIT:1> ; if ( start == <NUM_LIT:0> ) start = <NUM_LIT:1> ; if ( this . isMemberType ( ) ) { end = CharOperation . indexOf ( '<CHAR_LIT>' , uniqueKey , start ) ; } else { end = - <NUM_LIT:1> ; } if ( end == - <NUM_LIT:1> ) end = CharOperation . indexOf ( '<CHAR_LIT>' , uniqueKey , start ) ; if ( end == - <NUM_LIT:1> ) end = CharOperation . indexOf ( '<CHAR_LIT:;>' , uniqueKey , start ) ; char [ ] topLevelType = CharOperation . subarray ( uniqueKey , start , end ) ; if ( ! CharOperation . equals ( topLevelType , mainTypeName ) ) { StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( uniqueKey , <NUM_LIT:0> , start ) ; buffer . append ( mainTypeName ) ; buffer . append ( '<CHAR_LIT>' ) ; buffer . append ( topLevelType ) ; buffer . append ( uniqueKey , end , uniqueKey . length - end ) ; int length = buffer . length ( ) ; uniqueKey = new char [ length ] ; buffer . getChars ( <NUM_LIT:0> , length , uniqueKey , <NUM_LIT:0> ) ; return uniqueKey ; } } return uniqueKey ; } void faultInTypesForFieldsAndMethods ( ) { getAnnotationTagBits ( ) ; ReferenceBinding enclosingType = enclosingType ( ) ; if ( enclosingType != null && enclosingType . isViewedAsDeprecated ( ) && ! isDeprecated ( ) ) this . modifiers |= ExtraCompilerModifiers . AccDeprecatedImplicitly ; fields ( ) ; methods ( ) ; for ( int i = <NUM_LIT:0> , length = this . memberTypes . length ; i < length ; i ++ ) ( ( SourceTypeBinding ) this . memberTypes [ i ] ) . faultInTypesForFieldsAndMethods ( ) ; } public FieldBinding [ ] fields ( ) { if ( ( this . tagBits & TagBits . AreFieldsComplete ) != <NUM_LIT:0> ) return this . fields ; int failed = <NUM_LIT:0> ; FieldBinding [ ] resolvedFields = this . fields ; try { if ( ( this . tagBits & TagBits . AreFieldsSorted ) == <NUM_LIT:0> ) { int length = this . fields . length ; if ( length > <NUM_LIT:1> ) ReferenceBinding . sortFields ( this . fields , <NUM_LIT:0> , length ) ; this . tagBits |= TagBits . AreFieldsSorted ; } for ( int i = <NUM_LIT:0> , length = this . fields . length ; i < length ; i ++ ) { if ( resolveTypeFor ( this . fields [ i ] ) == null ) { if ( resolvedFields == this . fields ) { System . arraycopy ( this . fields , <NUM_LIT:0> , resolvedFields = new FieldBinding [ length ] , <NUM_LIT:0> , length ) ; } resolvedFields [ i ] = null ; failed ++ ; } } } finally { if ( failed > <NUM_LIT:0> ) { int newSize = resolvedFields . length - failed ; if ( newSize == <NUM_LIT:0> ) return this . fields = Binding . NO_FIELDS ; FieldBinding [ ] newFields = new FieldBinding [ newSize ] ; for ( int i = <NUM_LIT:0> , j = <NUM_LIT:0> , length = resolvedFields . length ; i < length ; i ++ ) { if ( resolvedFields [ i ] != null ) newFields [ j ++ ] = resolvedFields [ i ] ; } this . fields = newFields ; } } this . tagBits |= TagBits . AreFieldsComplete ; return this . fields ; } public char [ ] genericTypeSignature ( ) { if ( this . genericReferenceTypeSignature == null ) this . genericReferenceTypeSignature = computeGenericTypeSignature ( this . typeVariables ) ; return this . genericReferenceTypeSignature ; } public char [ ] genericSignature ( ) { StringBuffer sig = null ; if ( this . typeVariables != Binding . NO_TYPE_VARIABLES ) { sig = new StringBuffer ( <NUM_LIT:10> ) ; sig . append ( '<CHAR_LIT>' ) ; for ( int i = <NUM_LIT:0> , length = this . typeVariables . length ; i < length ; i ++ ) sig . append ( this . typeVariables [ i ] . genericSignature ( ) ) ; sig . append ( '<CHAR_LIT:>>' ) ; } else { noSignature : if ( this . superclass == null || ! this . superclass . isParameterizedType ( ) ) { for ( int i = <NUM_LIT:0> , length = this . superInterfaces . length ; i < length ; i ++ ) if ( this . superInterfaces [ i ] . isParameterizedType ( ) ) break noSignature ; return null ; } sig = new StringBuffer ( <NUM_LIT:10> ) ; } if ( this . superclass != null ) sig . append ( this . superclass . genericTypeSignature ( ) ) ; else sig . append ( this . scope . getJavaLangObject ( ) . genericTypeSignature ( ) ) ; for ( int i = <NUM_LIT:0> , length = this . superInterfaces . length ; i < length ; i ++ ) sig . append ( this . superInterfaces [ i ] . genericTypeSignature ( ) ) ; return sig . toString ( ) . toCharArray ( ) ; } public long getAnnotationTagBits ( ) { if ( ( this . tagBits & TagBits . AnnotationResolved ) == <NUM_LIT:0> && this . scope != null ) { TypeDeclaration typeDecl = this . scope . referenceContext ; boolean old = typeDecl . staticInitializerScope . insideTypeAnnotation ; try { typeDecl . staticInitializerScope . insideTypeAnnotation = true ; ASTNode . resolveAnnotations ( typeDecl . staticInitializerScope , typeDecl . annotations , this ) ; } finally { typeDecl . staticInitializerScope . insideTypeAnnotation = old ; } if ( ( this . tagBits & TagBits . AnnotationDeprecated ) != <NUM_LIT:0> ) this . modifiers |= ClassFileConstants . AccDeprecated ; } return this . tagBits ; } public MethodBinding [ ] getDefaultAbstractMethods ( ) { int count = <NUM_LIT:0> ; for ( int i = this . methods . length ; -- i >= <NUM_LIT:0> ; ) if ( this . methods [ i ] . isDefaultAbstract ( ) ) count ++ ; if ( count == <NUM_LIT:0> ) return Binding . NO_METHODS ; MethodBinding [ ] result = new MethodBinding [ count ] ; count = <NUM_LIT:0> ; for ( int i = this . methods . length ; -- i >= <NUM_LIT:0> ; ) if ( this . methods [ i ] . isDefaultAbstract ( ) ) result [ count ++ ] = this . methods [ i ] ; return result ; } public MethodBinding getExactConstructor ( TypeBinding [ ] argumentTypes ) { int argCount = argumentTypes . length ; if ( ( this . tagBits & TagBits . AreMethodsComplete ) != <NUM_LIT:0> ) { long range ; if ( ( range = ReferenceBinding . binarySearch ( TypeConstants . INIT , this . methods ) ) >= <NUM_LIT:0> ) { nextMethod : for ( int imethod = ( int ) range , end = ( int ) ( range > > <NUM_LIT:32> ) ; imethod <= end ; imethod ++ ) { MethodBinding method = this . methods [ imethod ] ; if ( method . parameters . length == argCount ) { TypeBinding [ ] toMatch = method . parameters ; for ( int iarg = <NUM_LIT:0> ; iarg < argCount ; iarg ++ ) if ( toMatch [ iarg ] != argumentTypes [ iarg ] ) continue nextMethod ; return method ; } } } } else { if ( ( this . tagBits & TagBits . AreMethodsSorted ) == <NUM_LIT:0> ) { int length = this . methods . length ; if ( length > <NUM_LIT:1> ) ReferenceBinding . sortMethods ( this . methods , <NUM_LIT:0> , length ) ; this . tagBits |= TagBits . AreMethodsSorted ; } long range ; if ( ( range = ReferenceBinding . binarySearch ( TypeConstants . INIT , this . methods ) ) >= <NUM_LIT:0> ) { nextMethod : for ( int imethod = ( int ) range , end = ( int ) ( range > > <NUM_LIT:32> ) ; imethod <= end ; imethod ++ ) { MethodBinding method = this . methods [ imethod ] ; if ( resolveTypesFor ( method ) == null || method . returnType == null ) { methods ( ) ; return getExactConstructor ( argumentTypes ) ; } if ( method . parameters . length == argCount ) { TypeBinding [ ] toMatch = method . parameters ; for ( int iarg = <NUM_LIT:0> ; iarg < argCount ; iarg ++ ) if ( toMatch [ iarg ] != argumentTypes [ iarg ] ) continue nextMethod ; return method ; } } } } return null ; } public MethodBinding getExactMethod ( char [ ] selector , TypeBinding [ ] argumentTypes , CompilationUnitScope refScope ) { int argCount = argumentTypes . length ; boolean foundNothing = true ; if ( ( this . tagBits & TagBits . AreMethodsComplete ) != <NUM_LIT:0> ) { long range ; if ( ( range = ReferenceBinding . binarySearch ( selector , this . methods ) ) >= <NUM_LIT:0> ) { nextMethod : for ( int imethod = ( int ) range , end = ( int ) ( range > > <NUM_LIT:32> ) ; imethod <= end ; imethod ++ ) { MethodBinding method = this . methods [ imethod ] ; foundNothing = false ; if ( method . parameters . length == argCount ) { TypeBinding [ ] toMatch = method . parameters ; for ( int iarg = <NUM_LIT:0> ; iarg < argCount ; iarg ++ ) if ( toMatch [ iarg ] != argumentTypes [ iarg ] ) continue nextMethod ; return method ; } } } } else { if ( ( this . tagBits & TagBits . AreMethodsSorted ) == <NUM_LIT:0> ) { int length = this . methods . length ; if ( length > <NUM_LIT:1> ) ReferenceBinding . sortMethods ( this . methods , <NUM_LIT:0> , length ) ; this . tagBits |= TagBits . AreMethodsSorted ; } long range ; if ( ( range = ReferenceBinding . binarySearch ( selector , this . methods ) ) >= <NUM_LIT:0> ) { int start = ( int ) range , end = ( int ) ( range > > <NUM_LIT:32> ) ; for ( int imethod = start ; imethod <= end ; imethod ++ ) { MethodBinding method = this . methods [ imethod ] ; if ( resolveTypesFor ( method ) == null || method . returnType == null ) { methods ( ) ; return getExactMethod ( selector , argumentTypes , refScope ) ; } } boolean isSource15 = this . scope . compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ; for ( int i = start ; i <= end ; i ++ ) { MethodBinding method1 = this . methods [ i ] ; for ( int j = end ; j > i ; j -- ) { MethodBinding method2 = this . methods [ j ] ; boolean paramsMatch = isSource15 ? method1 . areParameterErasuresEqual ( method2 ) : method1 . areParametersEqual ( method2 ) ; if ( paramsMatch ) { methods ( ) ; return getExactMethod ( selector , argumentTypes , refScope ) ; } } } nextMethod : for ( int imethod = start ; imethod <= end ; imethod ++ ) { MethodBinding method = this . methods [ imethod ] ; TypeBinding [ ] toMatch = method . parameters ; if ( toMatch . length == argCount ) { for ( int iarg = <NUM_LIT:0> ; iarg < argCount ; iarg ++ ) if ( toMatch [ iarg ] != argumentTypes [ iarg ] ) continue nextMethod ; return method ; } } } } if ( foundNothing ) { if ( isInterface ( ) ) { if ( this . superInterfaces . length == <NUM_LIT:1> ) { if ( refScope != null ) refScope . recordTypeReference ( this . superInterfaces [ <NUM_LIT:0> ] ) ; return this . superInterfaces [ <NUM_LIT:0> ] . getExactMethod ( selector , argumentTypes , refScope ) ; } } else if ( this . superclass != null ) { if ( refScope != null ) refScope . recordTypeReference ( this . superclass ) ; return this . superclass . getExactMethod ( selector , argumentTypes , refScope ) ; } } return null ; } public FieldBinding getField ( char [ ] fieldName , boolean needResolve ) { if ( ( this . tagBits & TagBits . AreFieldsComplete ) != <NUM_LIT:0> ) return ReferenceBinding . binarySearch ( fieldName , this . fields ) ; if ( ( this . tagBits & TagBits . AreFieldsSorted ) == <NUM_LIT:0> ) { int length = this . fields . length ; if ( length > <NUM_LIT:1> ) ReferenceBinding . sortFields ( this . fields , <NUM_LIT:0> , length ) ; this . tagBits |= TagBits . AreFieldsSorted ; } FieldBinding field = ReferenceBinding . binarySearch ( fieldName , this . fields ) ; if ( field != null ) { FieldBinding result = null ; try { result = resolveTypeFor ( field ) ; return result ; } finally { if ( result == null ) { int newSize = this . fields . length - <NUM_LIT:1> ; if ( newSize == <NUM_LIT:0> ) { this . fields = Binding . NO_FIELDS ; } else { FieldBinding [ ] newFields = new FieldBinding [ newSize ] ; int index = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> , length = this . fields . length ; i < length ; i ++ ) { FieldBinding f = this . fields [ i ] ; if ( f == field ) continue ; newFields [ index ++ ] = f ; } this . fields = newFields ; } } } } return null ; } public MethodBinding [ ] getAnyExtraMethods ( char [ ] selector ) { return ( this . scope == null ? null : this . scope . getAnyExtraMethods ( selector ) ) ; } public MethodBinding [ ] getMethods ( char [ ] selector ) { if ( ( this . tagBits & TagBits . AreMethodsComplete ) != <NUM_LIT:0> ) { long range ; if ( ( range = ReferenceBinding . binarySearch ( selector , this . methods ) ) >= <NUM_LIT:0> ) { int start = ( int ) range , end = ( int ) ( range > > <NUM_LIT:32> ) ; int length = end - start + <NUM_LIT:1> ; MethodBinding [ ] result ; System . arraycopy ( this . methods , start , result = new MethodBinding [ length ] , <NUM_LIT:0> , length ) ; return result ; } else { return Binding . NO_METHODS ; } } if ( ( this . tagBits & TagBits . AreMethodsSorted ) == <NUM_LIT:0> ) { int length = this . methods . length ; if ( length > <NUM_LIT:1> ) ReferenceBinding . sortMethods ( this . methods , <NUM_LIT:0> , length ) ; this . tagBits |= TagBits . AreMethodsSorted ; } MethodBinding [ ] result ; long range ; if ( ( range = ReferenceBinding . binarySearch ( selector , this . methods ) ) >= <NUM_LIT:0> ) { int start = ( int ) range , end = ( int ) ( range > > <NUM_LIT:32> ) ; for ( int i = start ; i <= end ; i ++ ) { MethodBinding method = this . methods [ i ] ; if ( resolveTypesFor ( method ) == null || method . returnType == null ) { methods ( ) ; return getMethods ( selector ) ; } } int length = end - start + <NUM_LIT:1> ; System . arraycopy ( this . methods , start , result = new MethodBinding [ length ] , <NUM_LIT:0> , length ) ; } else { return Binding . NO_METHODS ; } boolean isSource15 = this . scope . compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ; for ( int i = <NUM_LIT:0> , length = result . length - <NUM_LIT:1> ; i < length ; i ++ ) { MethodBinding method = result [ i ] ; for ( int j = length ; j > i ; j -- ) { boolean paramsMatch = isSource15 ? method . areParameterErasuresEqual ( result [ j ] ) : method . areParametersEqual ( result [ j ] ) ; if ( paramsMatch ) { methods ( ) ; return getMethods ( selector ) ; } } } return result ; } public FieldBinding getSyntheticField ( LocalVariableBinding actualOuterLocalVariable ) { if ( this . synthetics == null || this . synthetics [ SourceTypeBinding . FIELD_EMUL ] == null ) return null ; return ( FieldBinding ) this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . get ( actualOuterLocalVariable ) ; } public FieldBinding getSyntheticField ( ReferenceBinding targetEnclosingType , boolean onlyExactMatch ) { if ( this . synthetics == null || this . synthetics [ SourceTypeBinding . FIELD_EMUL ] == null ) return null ; FieldBinding field = ( FieldBinding ) this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . get ( targetEnclosingType ) ; if ( field != null ) return field ; if ( ! onlyExactMatch ) { Iterator accessFields = this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . values ( ) . iterator ( ) ; while ( accessFields . hasNext ( ) ) { field = ( FieldBinding ) accessFields . next ( ) ; if ( CharOperation . prefixEquals ( TypeConstants . SYNTHETIC_ENCLOSING_INSTANCE_PREFIX , field . name ) && field . type . findSuperTypeOriginatingFrom ( targetEnclosingType ) != null ) return field ; } } return null ; } public SyntheticMethodBinding getSyntheticBridgeMethod ( MethodBinding inheritedMethodToBridge ) { if ( this . synthetics == null ) return null ; if ( this . synthetics [ SourceTypeBinding . METHOD_EMUL ] == null ) return null ; SyntheticMethodBinding [ ] accessors = ( SyntheticMethodBinding [ ] ) this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . get ( inheritedMethodToBridge ) ; if ( accessors == null ) return null ; return accessors [ <NUM_LIT:1> ] ; } public void initializeDeprecatedAnnotationTagBits ( ) { if ( ( this . tagBits & TagBits . DeprecatedAnnotationResolved ) == <NUM_LIT:0> ) { TypeDeclaration typeDecl = this . scope . referenceContext ; boolean old = typeDecl . staticInitializerScope . insideTypeAnnotation ; try { typeDecl . staticInitializerScope . insideTypeAnnotation = true ; ASTNode . resolveDeprecatedAnnotations ( typeDecl . staticInitializerScope , typeDecl . annotations , this ) ; this . tagBits |= TagBits . DeprecatedAnnotationResolved ; } finally { typeDecl . staticInitializerScope . insideTypeAnnotation = old ; } if ( ( this . tagBits & TagBits . AnnotationDeprecated ) != <NUM_LIT:0> ) { this . modifiers |= ClassFileConstants . AccDeprecated ; } } } void initializeForStaticImports ( ) { if ( this . scope == null ) return ; if ( this . superInterfaces == null ) this . scope . connectTypeHierarchy ( ) ; this . scope . buildFields ( ) ; this . scope . buildMethods ( ) ; } public boolean isEquivalentTo ( TypeBinding otherType ) { if ( this == otherType ) return true ; if ( otherType == null ) return false ; switch ( otherType . kind ( ) ) { case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : return ( ( WildcardBinding ) otherType ) . boundCheck ( this ) ; case Binding . PARAMETERIZED_TYPE : if ( ( otherType . tagBits & TagBits . HasDirectWildcard ) == <NUM_LIT:0> && ( ! isMemberType ( ) || ! otherType . isMemberType ( ) ) ) return false ; ParameterizedTypeBinding otherParamType = ( ParameterizedTypeBinding ) otherType ; if ( this != otherParamType . genericType ( ) ) return false ; if ( ! isStatic ( ) ) { ReferenceBinding enclosing = enclosingType ( ) ; if ( enclosing != null ) { ReferenceBinding otherEnclosing = otherParamType . enclosingType ( ) ; if ( otherEnclosing == null ) return false ; if ( ( otherEnclosing . tagBits & TagBits . HasDirectWildcard ) == <NUM_LIT:0> ) { if ( enclosing != otherEnclosing ) return false ; } else { if ( ! enclosing . isEquivalentTo ( otherParamType . enclosingType ( ) ) ) return false ; } } } int length = this . typeVariables == null ? <NUM_LIT:0> : this . typeVariables . length ; TypeBinding [ ] otherArguments = otherParamType . arguments ; int otherLength = otherArguments == null ? <NUM_LIT:0> : otherArguments . length ; if ( otherLength != length ) return false ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) if ( ! this . typeVariables [ i ] . isTypeArgumentContainedBy ( otherArguments [ i ] ) ) return false ; return true ; case Binding . RAW_TYPE : return otherType . erasure ( ) == this ; } return false ; } public boolean isGenericType ( ) { return this . typeVariables != Binding . NO_TYPE_VARIABLES ; } public boolean isHierarchyConnected ( ) { return ( this . tagBits & TagBits . EndHierarchyCheck ) != <NUM_LIT:0> ; } public ReferenceBinding [ ] memberTypes ( ) { return this . memberTypes ; } public boolean hasMemberTypes ( ) { return this . memberTypes . length > <NUM_LIT:0> ; } public MethodBinding [ ] methods ( ) { if ( ( this . tagBits & TagBits . AreMethodsComplete ) != <NUM_LIT:0> ) return this . methods ; if ( ( this . tagBits & TagBits . AreMethodsSorted ) == <NUM_LIT:0> ) { int length = this . methods . length ; if ( length > <NUM_LIT:1> ) ReferenceBinding . sortMethods ( this . methods , <NUM_LIT:0> , length ) ; this . tagBits |= TagBits . AreMethodsSorted ; } int failed = <NUM_LIT:0> ; MethodBinding [ ] resolvedMethods = this . methods ; try { for ( int i = <NUM_LIT:0> , length = this . methods . length ; i < length ; i ++ ) { if ( resolveTypesFor ( this . methods [ i ] ) == null ) { if ( resolvedMethods == this . methods ) { System . arraycopy ( this . methods , <NUM_LIT:0> , resolvedMethods = new MethodBinding [ length ] , <NUM_LIT:0> , length ) ; } resolvedMethods [ i ] = null ; failed ++ ; } } boolean complyTo15OrAbove = this . scope . compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ; boolean compliance16 = this . scope . compilerOptions ( ) . complianceLevel == ClassFileConstants . JDK1_6 ; for ( int i = <NUM_LIT:0> , length = this . methods . length ; i < length ; i ++ ) { int severity = ProblemSeverities . Error ; MethodBinding method = resolvedMethods [ i ] ; if ( method == null ) continue ; char [ ] selector = method . selector ; AbstractMethodDeclaration methodDecl = null ; nextSibling : for ( int j = i + <NUM_LIT:1> ; j < length ; j ++ ) { MethodBinding method2 = resolvedMethods [ j ] ; if ( method2 == null ) continue nextSibling ; if ( ! CharOperation . equals ( selector , method2 . selector ) ) break nextSibling ; if ( complyTo15OrAbove ) { if ( method . areParameterErasuresEqual ( method2 ) ) { if ( compliance16 && method . returnType != null && method2 . returnType != null ) { if ( method . returnType . erasure ( ) != method2 . returnType . erasure ( ) ) { TypeBinding [ ] params1 = method . parameters ; TypeBinding [ ] params2 = method2 . parameters ; int pLength = params1 . length ; TypeVariableBinding [ ] vars = method . typeVariables ; TypeVariableBinding [ ] vars2 = method2 . typeVariables ; boolean equalTypeVars = vars == vars2 ; MethodBinding subMethod = method2 ; if ( ! equalTypeVars ) { MethodBinding temp = method . computeSubstitutedMethod ( method2 , this . scope . environment ( ) ) ; if ( temp != null ) { equalTypeVars = true ; subMethod = temp ; } } boolean equalParams = method . areParametersEqual ( subMethod ) ; if ( equalParams && equalTypeVars ) { } else if ( vars != Binding . NO_TYPE_VARIABLES && vars2 != Binding . NO_TYPE_VARIABLES ) { severity = ProblemSeverities . Warning ; } else if ( pLength > <NUM_LIT:0> ) { int index = pLength ; for ( ; -- index >= <NUM_LIT:0> ; ) { if ( params1 [ index ] != params2 [ index ] . erasure ( ) ) break ; if ( params1 [ index ] == params2 [ index ] ) { TypeBinding type = params1 [ index ] . leafComponentType ( ) ; if ( type instanceof SourceTypeBinding && type . typeVariables ( ) != Binding . NO_TYPE_VARIABLES ) { index = pLength ; break ; } } } if ( index >= <NUM_LIT:0> && index < pLength ) { for ( index = pLength ; -- index >= <NUM_LIT:0> ; ) if ( params1 [ index ] . erasure ( ) != params2 [ index ] ) break ; } if ( index >= <NUM_LIT:0> ) { severity = ProblemSeverities . Warning ; } } else if ( pLength != <NUM_LIT:0> ) { severity = ProblemSeverities . Warning ; } } } } else { continue nextSibling ; } } else if ( ! method . areParametersEqual ( method2 ) ) { continue nextSibling ; } boolean isEnumSpecialMethod = isEnum ( ) && ( CharOperation . equals ( selector , TypeConstants . VALUEOF ) || CharOperation . equals ( selector , TypeConstants . VALUES ) ) ; boolean removeMethod2 = ( severity == ProblemSeverities . Error ) ? true : false ; if ( methodDecl == null ) { methodDecl = method . sourceMethod ( ) ; if ( methodDecl != null && methodDecl . binding != null ) { boolean removeMethod = method . returnType == null && method2 . returnType != null ; if ( isEnumSpecialMethod ) { this . scope . problemReporter ( ) . duplicateEnumSpecialMethod ( this , methodDecl ) ; removeMethod = true ; } else { this . scope . problemReporter ( ) . duplicateMethodInType ( this , methodDecl , method . areParametersEqual ( method2 ) , severity ) ; } if ( removeMethod ) { removeMethod2 = false ; methodDecl . binding = null ; if ( resolvedMethods == this . methods ) System . arraycopy ( this . methods , <NUM_LIT:0> , resolvedMethods = new MethodBinding [ length ] , <NUM_LIT:0> , length ) ; resolvedMethods [ i ] = null ; failed ++ ; } } } AbstractMethodDeclaration method2Decl = method2 . sourceMethod ( ) ; if ( method2Decl != null && method2Decl . binding != null ) { if ( isEnumSpecialMethod ) { this . scope . problemReporter ( ) . duplicateEnumSpecialMethod ( this , method2Decl ) ; removeMethod2 = true ; } else { this . scope . problemReporter ( ) . duplicateMethodInType ( this , method2Decl , method . areParametersEqual ( method2 ) , severity ) ; } if ( removeMethod2 ) { method2Decl . binding = null ; if ( resolvedMethods == this . methods ) System . arraycopy ( this . methods , <NUM_LIT:0> , resolvedMethods = new MethodBinding [ length ] , <NUM_LIT:0> , length ) ; resolvedMethods [ j ] = null ; failed ++ ; } } } if ( method . returnType == null && resolvedMethods [ i ] != null ) { methodDecl = method . sourceMethod ( ) ; if ( methodDecl != null ) methodDecl . binding = null ; if ( resolvedMethods == this . methods ) System . arraycopy ( this . methods , <NUM_LIT:0> , resolvedMethods = new MethodBinding [ length ] , <NUM_LIT:0> , length ) ; resolvedMethods [ i ] = null ; failed ++ ; } } } finally { if ( failed > <NUM_LIT:0> ) { int newSize = resolvedMethods . length - failed ; if ( newSize == <NUM_LIT:0> ) { this . methods = Binding . NO_METHODS ; } else { MethodBinding [ ] newMethods = new MethodBinding [ newSize ] ; for ( int i = <NUM_LIT:0> , j = <NUM_LIT:0> , length = resolvedMethods . length ; i < length ; i ++ ) if ( resolvedMethods [ i ] != null ) newMethods [ j ++ ] = resolvedMethods [ i ] ; this . methods = newMethods ; } } addDefaultAbstractMethods ( ) ; this . tagBits |= TagBits . AreMethodsComplete ; } return this . methods ; } public FieldBinding resolveTypeFor ( FieldBinding field ) { if ( ( field . modifiers & ExtraCompilerModifiers . AccUnresolved ) == <NUM_LIT:0> ) return field ; if ( this . scope . compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ) { if ( ( field . getAnnotationTagBits ( ) & TagBits . AnnotationDeprecated ) != <NUM_LIT:0> ) field . modifiers |= ClassFileConstants . AccDeprecated ; } if ( isViewedAsDeprecated ( ) && ! field . isDeprecated ( ) ) field . modifiers |= ExtraCompilerModifiers . AccDeprecatedImplicitly ; if ( hasRestrictedAccess ( ) ) field . modifiers |= ExtraCompilerModifiers . AccRestrictedAccess ; FieldDeclaration [ ] fieldDecls = this . scope . referenceContext . fields ; int length = fieldDecls == null ? <NUM_LIT:0> : fieldDecls . length ; for ( int f = <NUM_LIT:0> ; f < length ; f ++ ) { if ( fieldDecls [ f ] . binding != field ) continue ; MethodScope initializationScope = field . isStatic ( ) ? this . scope . referenceContext . staticInitializerScope : this . scope . referenceContext . initializerScope ; FieldBinding previousField = initializationScope . initializedField ; try { initializationScope . initializedField = field ; FieldDeclaration fieldDecl = fieldDecls [ f ] ; TypeBinding fieldType = fieldDecl . getKind ( ) == AbstractVariableDeclaration . ENUM_CONSTANT ? initializationScope . environment ( ) . convertToRawType ( this , false ) : fieldDecl . type . resolveType ( initializationScope , true ) ; field . type = fieldType ; field . modifiers &= ~ ExtraCompilerModifiers . AccUnresolved ; if ( fieldType == null ) { fieldDecl . binding = null ; return null ; } if ( fieldType == TypeBinding . VOID ) { this . scope . problemReporter ( ) . variableTypeCannotBeVoid ( fieldDecl ) ; fieldDecl . binding = null ; return null ; } if ( fieldType . isArrayType ( ) && ( ( ArrayBinding ) fieldType ) . leafComponentType == TypeBinding . VOID ) { this . scope . problemReporter ( ) . variableTypeCannotBeVoidArray ( fieldDecl ) ; fieldDecl . binding = null ; return null ; } if ( ( fieldType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { field . tagBits |= TagBits . HasMissingType ; } TypeBinding leafType = fieldType . leafComponentType ( ) ; if ( leafType instanceof ReferenceBinding && ( ( ( ReferenceBinding ) leafType ) . modifiers & ExtraCompilerModifiers . AccGenericSignature ) != <NUM_LIT:0> ) { field . modifiers |= ExtraCompilerModifiers . AccGenericSignature ; } } finally { initializationScope . initializedField = previousField ; } return field ; } return null ; } public MethodBinding resolveTypesFor ( MethodBinding method ) { if ( ( method . modifiers & ExtraCompilerModifiers . AccUnresolved ) == <NUM_LIT:0> ) return method ; if ( this . scope . compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ) { if ( ( method . getAnnotationTagBits ( ) & TagBits . AnnotationDeprecated ) != <NUM_LIT:0> ) method . modifiers |= ClassFileConstants . AccDeprecated ; } if ( isViewedAsDeprecated ( ) && ! method . isDeprecated ( ) ) method . modifiers |= ExtraCompilerModifiers . AccDeprecatedImplicitly ; if ( hasRestrictedAccess ( ) ) method . modifiers |= ExtraCompilerModifiers . AccRestrictedAccess ; AbstractMethodDeclaration methodDecl = method . sourceMethod ( ) ; if ( methodDecl == null ) { if ( method instanceof LazilyResolvedMethodBinding ) { LazilyResolvedMethodBinding lrMethod = ( LazilyResolvedMethodBinding ) method ; TypeBinding ptb = lrMethod . getParameterTypeBinding ( ) ; if ( ptb == null ) { method . parameters = Binding . NO_PARAMETERS ; } else { method . parameters = new TypeBinding [ ] { ptb } ; } method . returnType = lrMethod . getReturnTypeBinding ( ) ; method . modifiers &= ~ ExtraCompilerModifiers . AccUnresolved ; return method ; } return null ; } TypeParameter [ ] typeParameters = methodDecl . typeParameters ( ) ; if ( typeParameters != null ) { methodDecl . scope . connectTypeVariables ( typeParameters , true ) ; for ( int i = <NUM_LIT:0> , paramLength = typeParameters . length ; i < paramLength ; i ++ ) typeParameters [ i ] . checkBounds ( methodDecl . scope ) ; } TypeReference [ ] exceptionTypes = methodDecl . thrownExceptions ; if ( exceptionTypes != null ) { int size = exceptionTypes . length ; method . thrownExceptions = new ReferenceBinding [ size ] ; int count = <NUM_LIT:0> ; ReferenceBinding resolvedExceptionType ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) { resolvedExceptionType = ( ReferenceBinding ) exceptionTypes [ i ] . resolveType ( methodDecl . scope , true ) ; if ( resolvedExceptionType == null ) continue ; if ( resolvedExceptionType . isBoundParameterizedType ( ) ) { methodDecl . scope . problemReporter ( ) . invalidParameterizedExceptionType ( resolvedExceptionType , exceptionTypes [ i ] ) ; continue ; } if ( resolvedExceptionType . findSuperTypeOriginatingFrom ( TypeIds . T_JavaLangThrowable , true ) == null ) { if ( resolvedExceptionType . isValidBinding ( ) ) { methodDecl . scope . problemReporter ( ) . cannotThrowType ( exceptionTypes [ i ] , resolvedExceptionType ) ; continue ; } } if ( ( resolvedExceptionType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { method . tagBits |= TagBits . HasMissingType ; } method . modifiers |= ( resolvedExceptionType . modifiers & ExtraCompilerModifiers . AccGenericSignature ) ; method . thrownExceptions [ count ++ ] = resolvedExceptionType ; } if ( count < size ) System . arraycopy ( method . thrownExceptions , <NUM_LIT:0> , method . thrownExceptions = new ReferenceBinding [ count ] , <NUM_LIT:0> , count ) ; } final boolean reportUnavoidableGenericTypeProblems = this . scope . compilerOptions ( ) . reportUnavoidableGenericTypeProblems ; boolean foundArgProblem = false ; Argument [ ] arguments = methodDecl . arguments ; if ( arguments != null ) { int size = arguments . length ; method . parameters = Binding . NO_PARAMETERS ; TypeBinding [ ] newParameters = new TypeBinding [ size ] ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) { Argument arg = arguments [ i ] ; if ( arg . annotations != null ) { method . tagBits |= TagBits . HasParameterAnnotations ; } boolean deferRawTypeCheck = ! reportUnavoidableGenericTypeProblems && ! method . isConstructor ( ) && ( arg . type . bits & ASTNode . IgnoreRawTypeCheck ) == <NUM_LIT:0> ; TypeBinding parameterType ; if ( deferRawTypeCheck ) { arg . type . bits |= ASTNode . IgnoreRawTypeCheck ; } try { parameterType = arg . type . resolveType ( methodDecl . scope , true ) ; } finally { if ( deferRawTypeCheck ) { arg . type . bits &= ~ ASTNode . IgnoreRawTypeCheck ; } } if ( parameterType == null ) { foundArgProblem = true ; } else if ( parameterType == TypeBinding . VOID ) { methodDecl . scope . problemReporter ( ) . argumentTypeCannotBeVoid ( this , methodDecl , arg ) ; foundArgProblem = true ; } else { if ( ( parameterType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { method . tagBits |= TagBits . HasMissingType ; } TypeBinding leafType = parameterType . leafComponentType ( ) ; if ( leafType instanceof ReferenceBinding && ( ( ( ReferenceBinding ) leafType ) . modifiers & ExtraCompilerModifiers . AccGenericSignature ) != <NUM_LIT:0> ) method . modifiers |= ExtraCompilerModifiers . AccGenericSignature ; newParameters [ i ] = parameterType ; arg . binding = new LocalVariableBinding ( arg , parameterType , arg . modifiers , true ) ; } } if ( ! foundArgProblem ) { method . parameters = newParameters ; } } if ( this . scope . compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_7 ) { if ( ( method . tagBits & TagBits . AnnotationSafeVarargs ) != <NUM_LIT:0> ) { if ( ! method . isVarargs ( ) ) { methodDecl . scope . problemReporter ( ) . safeVarargsOnFixedArityMethod ( method ) ; } else if ( ! method . isStatic ( ) && ! method . isFinal ( ) && ! method . isConstructor ( ) ) { methodDecl . scope . problemReporter ( ) . safeVarargsOnNonFinalInstanceMethod ( method ) ; } } else if ( method . parameters != null && method . parameters . length > <NUM_LIT:0> && method . isVarargs ( ) ) { if ( ! method . parameters [ method . parameters . length - <NUM_LIT:1> ] . isReifiable ( ) ) { methodDecl . scope . problemReporter ( ) . possibleHeapPollutionFromVararg ( methodDecl . arguments [ methodDecl . arguments . length - <NUM_LIT:1> ] ) ; } } } boolean foundReturnTypeProblem = false ; if ( ! method . isConstructor ( ) ) { TypeReference returnType = methodDecl instanceof MethodDeclaration ? ( ( MethodDeclaration ) methodDecl ) . returnType : null ; if ( returnType == null ) { methodDecl . scope . problemReporter ( ) . missingReturnType ( methodDecl ) ; method . returnType = null ; foundReturnTypeProblem = true ; } else { boolean deferRawTypeCheck = ! reportUnavoidableGenericTypeProblems && ( returnType . bits & ASTNode . IgnoreRawTypeCheck ) == <NUM_LIT:0> ; TypeBinding methodType ; if ( deferRawTypeCheck ) { returnType . bits |= ASTNode . IgnoreRawTypeCheck ; } try { methodType = returnType . resolveType ( methodDecl . scope , true ) ; } finally { if ( deferRawTypeCheck ) { returnType . bits &= ~ ASTNode . IgnoreRawTypeCheck ; } } if ( methodType == null ) { foundReturnTypeProblem = true ; } else if ( methodType . isArrayType ( ) && ( ( ArrayBinding ) methodType ) . leafComponentType == TypeBinding . VOID ) { methodDecl . scope . problemReporter ( ) . returnTypeCannotBeVoidArray ( ( MethodDeclaration ) methodDecl ) ; foundReturnTypeProblem = true ; } else { if ( ( methodType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { method . tagBits |= TagBits . HasMissingType ; } method . returnType = methodType ; TypeBinding leafType = methodType . leafComponentType ( ) ; if ( leafType instanceof ReferenceBinding && ( ( ( ReferenceBinding ) leafType ) . modifiers & ExtraCompilerModifiers . AccGenericSignature ) != <NUM_LIT:0> ) method . modifiers |= ExtraCompilerModifiers . AccGenericSignature ; } } } if ( foundArgProblem ) { methodDecl . binding = null ; method . parameters = Binding . NO_PARAMETERS ; if ( typeParameters != null ) for ( int i = <NUM_LIT:0> , length = typeParameters . length ; i < length ; i ++ ) typeParameters [ i ] . binding = null ; return null ; } if ( foundReturnTypeProblem ) return method ; method . modifiers &= ~ ExtraCompilerModifiers . AccUnresolved ; return method ; } public AnnotationHolder retrieveAnnotationHolder ( Binding binding , boolean forceInitialization ) { if ( forceInitialization ) binding . getAnnotationTagBits ( ) ; return super . retrieveAnnotationHolder ( binding , false ) ; } public void setFields ( FieldBinding [ ] fields ) { this . fields = fields ; } public void setMethods ( MethodBinding [ ] methods ) { this . methods = methods ; } public final int sourceEnd ( ) { return this . scope . referenceContext . sourceEnd ; } public final int sourceStart ( ) { return this . scope . referenceContext . sourceStart ; } SimpleLookupTable storedAnnotations ( boolean forceInitialize ) { if ( forceInitialize && this . storedAnnotations == null && this . scope != null ) { this . scope . referenceCompilationUnit ( ) . compilationResult . hasAnnotations = true ; if ( ! this . scope . environment ( ) . globalOptions . storeAnnotations ) return null ; this . storedAnnotations = new SimpleLookupTable ( <NUM_LIT:3> ) ; } return this . storedAnnotations ; } public ReferenceBinding superclass ( ) { return this . superclass ; } public ReferenceBinding [ ] superInterfaces ( ) { return this . superInterfaces ; } public SyntheticMethodBinding [ ] syntheticMethods ( ) { if ( this . synthetics == null || this . synthetics [ SourceTypeBinding . METHOD_EMUL ] == null || this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . size ( ) == <NUM_LIT:0> ) { return null ; } int index = <NUM_LIT:0> ; SyntheticMethodBinding [ ] bindings = new SyntheticMethodBinding [ <NUM_LIT:1> ] ; Iterator methodArrayIterator = this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . values ( ) . iterator ( ) ; while ( methodArrayIterator . hasNext ( ) ) { SyntheticMethodBinding [ ] methodAccessors = ( SyntheticMethodBinding [ ] ) methodArrayIterator . next ( ) ; for ( int i = <NUM_LIT:0> , max = methodAccessors . length ; i < max ; i ++ ) { if ( methodAccessors [ i ] != null ) { if ( index + <NUM_LIT:1> > bindings . length ) { System . arraycopy ( bindings , <NUM_LIT:0> , ( bindings = new SyntheticMethodBinding [ index + <NUM_LIT:1> ] ) , <NUM_LIT:0> , index ) ; } bindings [ index ++ ] = methodAccessors [ i ] ; } } } int length ; SyntheticMethodBinding [ ] sortedBindings = new SyntheticMethodBinding [ length = bindings . length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { SyntheticMethodBinding binding = bindings [ i ] ; sortedBindings [ binding . index ] = binding ; } return sortedBindings ; } public FieldBinding [ ] syntheticFields ( ) { if ( this . synthetics == null ) return null ; int fieldSize = this . synthetics [ SourceTypeBinding . FIELD_EMUL ] == null ? <NUM_LIT:0> : this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . size ( ) ; int literalSize = this . synthetics [ SourceTypeBinding . CLASS_LITERAL_EMUL ] == null ? <NUM_LIT:0> : this . synthetics [ SourceTypeBinding . CLASS_LITERAL_EMUL ] . size ( ) ; int totalSize = fieldSize + literalSize ; if ( totalSize == <NUM_LIT:0> ) return null ; FieldBinding [ ] bindings = new FieldBinding [ totalSize ] ; if ( this . synthetics [ SourceTypeBinding . FIELD_EMUL ] != null ) { Iterator elements = this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . values ( ) . iterator ( ) ; for ( int i = <NUM_LIT:0> ; i < fieldSize ; i ++ ) { SyntheticFieldBinding synthBinding = ( SyntheticFieldBinding ) elements . next ( ) ; bindings [ synthBinding . index ] = synthBinding ; } } if ( this . synthetics [ SourceTypeBinding . CLASS_LITERAL_EMUL ] != null ) { Iterator elements = this . synthetics [ SourceTypeBinding . CLASS_LITERAL_EMUL ] . values ( ) . iterator ( ) ; for ( int i = <NUM_LIT:0> ; i < literalSize ; i ++ ) { SyntheticFieldBinding synthBinding = ( SyntheticFieldBinding ) elements . next ( ) ; bindings [ fieldSize + synthBinding . index ] = synthBinding ; } } return bindings ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( <NUM_LIT:30> ) ; buffer . append ( "<STR_LIT>" ) ; if ( this . id == TypeIds . NoId ) buffer . append ( "<STR_LIT>" ) ; else buffer . append ( this . id ) ; buffer . append ( "<STR_LIT>" ) ; if ( isDeprecated ( ) ) buffer . append ( "<STR_LIT>" ) ; if ( isPublic ( ) ) buffer . append ( "<STR_LIT>" ) ; if ( isProtected ( ) ) buffer . append ( "<STR_LIT>" ) ; if ( isPrivate ( ) ) buffer . append ( "<STR_LIT>" ) ; if ( isAbstract ( ) && isClass ( ) ) buffer . append ( "<STR_LIT>" ) ; if ( isStatic ( ) && isNestedType ( ) ) buffer . append ( "<STR_LIT>" ) ; if ( isFinal ( ) ) buffer . append ( "<STR_LIT>" ) ; if ( isEnum ( ) ) buffer . append ( "<STR_LIT>" ) ; else if ( isAnnotationType ( ) ) buffer . append ( "<STR_LIT>" ) ; else if ( isClass ( ) ) buffer . append ( "<STR_LIT>" ) ; else buffer . append ( "<STR_LIT>" ) ; buffer . append ( ( this . compoundName != null ) ? CharOperation . toString ( this . compoundName ) : "<STR_LIT>" ) ; if ( this . typeVariables == null ) { buffer . append ( "<STR_LIT>" ) ; } else if ( this . typeVariables != Binding . NO_TYPE_VARIABLES ) { buffer . append ( "<STR_LIT:<>" ) ; for ( int i = <NUM_LIT:0> , length = this . typeVariables . length ; i < length ; i ++ ) { if ( i > <NUM_LIT:0> ) buffer . append ( "<STR_LIT:U+002CU+0020>" ) ; if ( this . typeVariables [ i ] == null ) { buffer . append ( "<STR_LIT>" ) ; continue ; } char [ ] varChars = this . typeVariables [ i ] . toString ( ) . toCharArray ( ) ; buffer . append ( varChars , <NUM_LIT:1> , varChars . length - <NUM_LIT:2> ) ; } buffer . append ( "<STR_LIT:>>" ) ; } buffer . append ( "<STR_LIT>" ) ; buffer . append ( ( this . superclass != null ) ? this . superclass . debugName ( ) : "<STR_LIT>" ) ; if ( this . superInterfaces != null ) { if ( this . superInterfaces != Binding . NO_SUPERINTERFACES ) { buffer . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> , length = this . superInterfaces . length ; i < length ; i ++ ) { if ( i > <NUM_LIT:0> ) buffer . append ( "<STR_LIT:U+002CU+0020>" ) ; buffer . append ( ( this . superInterfaces [ i ] != null ) ? this . superInterfaces [ i ] . debugName ( ) : "<STR_LIT>" ) ; } } } else { buffer . append ( "<STR_LIT>" ) ; } if ( enclosingType ( ) != null ) { buffer . append ( "<STR_LIT>" ) ; buffer . append ( enclosingType ( ) . debugName ( ) ) ; } if ( this . fields != null ) { if ( this . fields != Binding . NO_FIELDS ) { buffer . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> , length = this . fields . length ; i < length ; i ++ ) buffer . append ( '<STR_LIT:\n>' ) . append ( ( this . fields [ i ] != null ) ? this . fields [ i ] . toString ( ) : "<STR_LIT>" ) ; } } else { buffer . append ( "<STR_LIT>" ) ; } if ( this . methods != null ) { if ( this . methods != Binding . NO_METHODS ) { buffer . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> , length = this . methods . length ; i < length ; i ++ ) buffer . append ( '<STR_LIT:\n>' ) . append ( ( this . methods [ i ] != null ) ? this . methods [ i ] . toString ( ) : "<STR_LIT>" ) ; } } else { buffer . append ( "<STR_LIT>" ) ; } if ( this . memberTypes != null ) { if ( this . memberTypes != Binding . NO_MEMBER_TYPES ) { buffer . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> , length = this . memberTypes . length ; i < length ; i ++ ) buffer . append ( '<STR_LIT:\n>' ) . append ( ( this . memberTypes [ i ] != null ) ? this . memberTypes [ i ] . toString ( ) : "<STR_LIT>" ) ; } } else { buffer . append ( "<STR_LIT>" ) ; } buffer . append ( "<STR_LIT>" ) ; return buffer . toString ( ) ; } public TypeVariableBinding [ ] typeVariables ( ) { return this . typeVariables != null ? this . typeVariables : Binding . NO_TYPE_VARIABLES ; } void verifyMethods ( MethodVerifier verifier ) { verifier . verify ( this ) ; for ( int i = this . memberTypes . length ; -- i >= <NUM_LIT:0> ; ) ( ( SourceTypeBinding ) this . memberTypes [ i ] ) . verifyMethods ( verifier ) ; } public FieldBinding [ ] unResolvedFields ( ) { return this . fields ; } public void tagIndirectlyAccessibleMembers ( ) { for ( int i = <NUM_LIT:0> ; i < this . fields . length ; i ++ ) { if ( ! this . fields [ i ] . isPrivate ( ) ) this . fields [ i ] . modifiers |= ExtraCompilerModifiers . AccLocallyUsed ; } for ( int i = <NUM_LIT:0> ; i < this . memberTypes . length ; i ++ ) { if ( ! this . memberTypes [ i ] . isPrivate ( ) ) this . memberTypes [ i ] . modifiers |= ExtraCompilerModifiers . AccLocallyUsed ; } if ( this . superclass . isPrivate ( ) ) if ( this . superclass instanceof SourceTypeBinding ) ( ( SourceTypeBinding ) this . superclass ) . tagIndirectlyAccessibleMembers ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; public class PolymorphicMethodBinding extends MethodBinding { protected MethodBinding polymorphicMethod ; public PolymorphicMethodBinding ( MethodBinding polymorphicMethod , TypeBinding [ ] parameterTypes ) { super ( polymorphicMethod . modifiers , polymorphicMethod . selector , polymorphicMethod . returnType , parameterTypes , polymorphicMethod . thrownExceptions , polymorphicMethod . declaringClass ) ; this . polymorphicMethod = polymorphicMethod ; this . tagBits = polymorphicMethod . tagBits ; } public PolymorphicMethodBinding ( MethodBinding polymorphicMethod , TypeBinding returnType , TypeBinding [ ] parameterTypes ) { super ( polymorphicMethod . modifiers , polymorphicMethod . selector , returnType , parameterTypes , polymorphicMethod . thrownExceptions , polymorphicMethod . declaringClass ) ; this . polymorphicMethod = polymorphicMethod ; this . tagBits = polymorphicMethod . tagBits ; } public MethodBinding original ( ) { return this . polymorphicMethod ; } public boolean isPolymorphic ( ) { return true ; } public boolean matches ( TypeBinding [ ] matchingParameters , TypeBinding matchingReturnType ) { int cachedParametersLength = this . parameters == null ? <NUM_LIT:0> : this . parameters . length ; int matchingParametersLength = matchingParameters == null ? <NUM_LIT:0> : matchingParameters . length ; if ( matchingParametersLength != cachedParametersLength ) { return false ; } for ( int j = <NUM_LIT:0> ; j < cachedParametersLength ; j ++ ) { if ( this . parameters [ j ] != matchingParameters [ j ] ) { return false ; } } TypeBinding cachedReturnType = this . returnType ; if ( matchingReturnType == null ) { if ( cachedReturnType != null ) { return false ; } } else if ( cachedReturnType == null ) { return false ; } else if ( matchingReturnType != cachedReturnType ) { return false ; } return true ; } public boolean isVarargs ( ) { return false ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . Wildcard ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; public class CaptureBinding extends TypeVariableBinding { public TypeBinding lowerBound ; public WildcardBinding wildcard ; public int captureID ; public ReferenceBinding sourceType ; public int position ; public CaptureBinding ( WildcardBinding wildcard , ReferenceBinding sourceType , int position , int captureID ) { super ( TypeConstants . WILDCARD_CAPTURE_NAME_PREFIX , null , <NUM_LIT:0> , wildcard . environment ) ; this . wildcard = wildcard ; this . modifiers = ClassFileConstants . AccPublic | ExtraCompilerModifiers . AccGenericSignature ; this . fPackage = wildcard . fPackage ; this . sourceType = sourceType ; this . position = position ; this . captureID = captureID ; } public char [ ] computeUniqueKey ( boolean isLeaf ) { StringBuffer buffer = new StringBuffer ( ) ; if ( isLeaf ) { buffer . append ( this . sourceType . computeUniqueKey ( false ) ) ; buffer . append ( '<CHAR_LIT>' ) ; } buffer . append ( TypeConstants . WILDCARD_CAPTURE ) ; buffer . append ( this . wildcard . computeUniqueKey ( false ) ) ; buffer . append ( this . position ) ; buffer . append ( '<CHAR_LIT:;>' ) ; int length = buffer . length ( ) ; char [ ] uniqueKey = new char [ length ] ; buffer . getChars ( <NUM_LIT:0> , length , uniqueKey , <NUM_LIT:0> ) ; return uniqueKey ; } public String debugName ( ) { if ( this . wildcard != null ) { StringBuffer buffer = new StringBuffer ( <NUM_LIT:10> ) ; buffer . append ( TypeConstants . WILDCARD_CAPTURE_NAME_PREFIX ) . append ( this . captureID ) . append ( TypeConstants . WILDCARD_CAPTURE_NAME_SUFFIX ) . append ( this . wildcard . debugName ( ) ) ; return buffer . toString ( ) ; } return super . debugName ( ) ; } public char [ ] genericTypeSignature ( ) { if ( this . genericTypeSignature == null ) { this . genericTypeSignature = CharOperation . concat ( TypeConstants . WILDCARD_CAPTURE , this . wildcard . genericTypeSignature ( ) ) ; } return this . genericTypeSignature ; } public void initializeBounds ( Scope scope , ParameterizedTypeBinding capturedParameterizedType ) { TypeVariableBinding wildcardVariable = this . wildcard . typeVariable ( ) ; if ( wildcardVariable == null ) { TypeBinding originalWildcardBound = this . wildcard . bound ; switch ( this . wildcard . boundKind ) { case Wildcard . EXTENDS : TypeBinding capturedWildcardBound = originalWildcardBound . capture ( scope , this . position ) ; if ( originalWildcardBound . isInterface ( ) ) { this . superclass = scope . getJavaLangObject ( ) ; this . superInterfaces = new ReferenceBinding [ ] { ( ReferenceBinding ) capturedWildcardBound } ; } else { if ( capturedWildcardBound . isArrayType ( ) || capturedWildcardBound == this ) { this . superclass = scope . getJavaLangObject ( ) ; } else { this . superclass = ( ReferenceBinding ) capturedWildcardBound ; } this . superInterfaces = Binding . NO_SUPERINTERFACES ; } this . firstBound = capturedWildcardBound ; if ( ( capturedWildcardBound . tagBits & TagBits . HasTypeVariable ) == <NUM_LIT:0> ) this . tagBits &= ~ TagBits . HasTypeVariable ; break ; case Wildcard . UNBOUND : this . superclass = scope . getJavaLangObject ( ) ; this . superInterfaces = Binding . NO_SUPERINTERFACES ; this . tagBits &= ~ TagBits . HasTypeVariable ; break ; case Wildcard . SUPER : this . superclass = scope . getJavaLangObject ( ) ; this . superInterfaces = Binding . NO_SUPERINTERFACES ; this . lowerBound = this . wildcard . bound ; if ( ( originalWildcardBound . tagBits & TagBits . HasTypeVariable ) == <NUM_LIT:0> ) this . tagBits &= ~ TagBits . HasTypeVariable ; break ; } return ; } ReferenceBinding originalVariableSuperclass = wildcardVariable . superclass ; ReferenceBinding substitutedVariableSuperclass = ( ReferenceBinding ) Scope . substitute ( capturedParameterizedType , originalVariableSuperclass ) ; if ( substitutedVariableSuperclass == this ) substitutedVariableSuperclass = originalVariableSuperclass ; ReferenceBinding [ ] originalVariableInterfaces = wildcardVariable . superInterfaces ( ) ; ReferenceBinding [ ] substitutedVariableInterfaces = Scope . substitute ( capturedParameterizedType , originalVariableInterfaces ) ; if ( substitutedVariableInterfaces != originalVariableInterfaces ) { for ( int i = <NUM_LIT:0> , length = substitutedVariableInterfaces . length ; i < length ; i ++ ) { if ( substitutedVariableInterfaces [ i ] == this ) substitutedVariableInterfaces [ i ] = originalVariableInterfaces [ i ] ; } } TypeBinding originalWildcardBound = this . wildcard . bound ; switch ( this . wildcard . boundKind ) { case Wildcard . EXTENDS : TypeBinding capturedWildcardBound = originalWildcardBound . capture ( scope , this . position ) ; if ( originalWildcardBound . isInterface ( ) ) { this . superclass = substitutedVariableSuperclass ; if ( substitutedVariableInterfaces == Binding . NO_SUPERINTERFACES ) { this . superInterfaces = new ReferenceBinding [ ] { ( ReferenceBinding ) capturedWildcardBound } ; } else { int length = substitutedVariableInterfaces . length ; System . arraycopy ( substitutedVariableInterfaces , <NUM_LIT:0> , substitutedVariableInterfaces = new ReferenceBinding [ length + <NUM_LIT:1> ] , <NUM_LIT:1> , length ) ; substitutedVariableInterfaces [ <NUM_LIT:0> ] = ( ReferenceBinding ) capturedWildcardBound ; this . superInterfaces = Scope . greaterLowerBound ( substitutedVariableInterfaces ) ; } } else { if ( capturedWildcardBound . isArrayType ( ) || capturedWildcardBound == this ) { this . superclass = substitutedVariableSuperclass ; } else { this . superclass = ( ReferenceBinding ) capturedWildcardBound ; if ( this . superclass . isSuperclassOf ( substitutedVariableSuperclass ) ) { this . superclass = substitutedVariableSuperclass ; } } this . superInterfaces = substitutedVariableInterfaces ; } this . firstBound = capturedWildcardBound ; if ( ( capturedWildcardBound . tagBits & TagBits . HasTypeVariable ) == <NUM_LIT:0> ) this . tagBits &= ~ TagBits . HasTypeVariable ; break ; case Wildcard . UNBOUND : this . superclass = substitutedVariableSuperclass ; this . superInterfaces = substitutedVariableInterfaces ; this . tagBits &= ~ TagBits . HasTypeVariable ; break ; case Wildcard . SUPER : this . superclass = substitutedVariableSuperclass ; if ( wildcardVariable . firstBound == substitutedVariableSuperclass || originalWildcardBound == substitutedVariableSuperclass ) { this . firstBound = substitutedVariableSuperclass ; } this . superInterfaces = substitutedVariableInterfaces ; this . lowerBound = originalWildcardBound ; if ( ( originalWildcardBound . tagBits & TagBits . HasTypeVariable ) == <NUM_LIT:0> ) this . tagBits &= ~ TagBits . HasTypeVariable ; break ; } } public boolean isCapture ( ) { return true ; } public boolean isEquivalentTo ( TypeBinding otherType ) { if ( this == otherType ) return true ; if ( otherType == null ) return false ; if ( this . firstBound != null && this . firstBound . isArrayType ( ) ) { if ( this . firstBound . isCompatibleWith ( otherType ) ) return true ; } switch ( otherType . kind ( ) ) { case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : return ( ( WildcardBinding ) otherType ) . boundCheck ( this ) ; } return false ; } public char [ ] readableName ( ) { if ( this . wildcard != null ) { StringBuffer buffer = new StringBuffer ( <NUM_LIT:10> ) ; buffer . append ( TypeConstants . WILDCARD_CAPTURE_NAME_PREFIX ) . append ( this . captureID ) . append ( TypeConstants . WILDCARD_CAPTURE_NAME_SUFFIX ) . append ( this . wildcard . readableName ( ) ) ; int length = buffer . length ( ) ; char [ ] name = new char [ length ] ; buffer . getChars ( <NUM_LIT:0> , length , name , <NUM_LIT:0> ) ; return name ; } return super . readableName ( ) ; } public char [ ] shortReadableName ( ) { if ( this . wildcard != null ) { StringBuffer buffer = new StringBuffer ( <NUM_LIT:10> ) ; buffer . append ( TypeConstants . WILDCARD_CAPTURE_NAME_PREFIX ) . append ( this . captureID ) . append ( TypeConstants . WILDCARD_CAPTURE_NAME_SUFFIX ) . append ( this . wildcard . shortReadableName ( ) ) ; int length = buffer . length ( ) ; char [ ] name = new char [ length ] ; buffer . getChars ( <NUM_LIT:0> , length , name , <NUM_LIT:0> ) ; return name ; } return super . shortReadableName ( ) ; } public String toString ( ) { if ( this . wildcard != null ) { StringBuffer buffer = new StringBuffer ( <NUM_LIT:10> ) ; buffer . append ( TypeConstants . WILDCARD_CAPTURE_NAME_PREFIX ) . append ( this . captureID ) . append ( TypeConstants . WILDCARD_CAPTURE_NAME_SUFFIX ) . append ( this . wildcard ) ; return buffer . toString ( ) ; } return super . toString ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; import java . util . List ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . TypeReference ; import org . eclipse . jdt . internal . compiler . ast . Wildcard ; public class ParameterizedTypeBinding extends ReferenceBinding implements Substitution { private ReferenceBinding type ; public TypeBinding [ ] arguments ; public LookupEnvironment environment ; public char [ ] genericTypeSignature ; public ReferenceBinding superclass ; public ReferenceBinding [ ] superInterfaces ; public FieldBinding [ ] fields ; public ReferenceBinding [ ] memberTypes ; public MethodBinding [ ] methods ; private ReferenceBinding enclosingType ; public ParameterizedTypeBinding ( ReferenceBinding type , TypeBinding [ ] arguments , ReferenceBinding enclosingType , LookupEnvironment environment ) { this . environment = environment ; this . enclosingType = enclosingType ; initialize ( type , arguments ) ; if ( type instanceof UnresolvedReferenceBinding ) ( ( UnresolvedReferenceBinding ) type ) . addWrapper ( this , environment ) ; if ( arguments != null ) { for ( int i = <NUM_LIT:0> , l = arguments . length ; i < l ; i ++ ) if ( arguments [ i ] instanceof UnresolvedReferenceBinding ) ( ( UnresolvedReferenceBinding ) arguments [ i ] ) . addWrapper ( this , environment ) ; } this . tagBits |= TagBits . HasUnresolvedTypeVariables ; } protected ReferenceBinding actualType ( ) { return this . type ; } public void boundCheck ( Scope scope , TypeReference [ ] argumentReferences ) { if ( ( this . tagBits & TagBits . PassedBoundCheck ) == <NUM_LIT:0> ) { boolean hasErrors = false ; TypeVariableBinding [ ] typeVariables = this . type . typeVariables ( ) ; if ( this . arguments != null && typeVariables != null ) { for ( int i = <NUM_LIT:0> , length = typeVariables . length ; i < length ; i ++ ) { if ( typeVariables [ i ] . boundCheck ( this , this . arguments [ i ] ) != TypeConstants . OK ) { hasErrors = true ; if ( ( this . arguments [ i ] . tagBits & TagBits . HasMissingType ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . typeMismatchError ( this . arguments [ i ] , typeVariables [ i ] , this . type , argumentReferences [ i ] ) ; } } } } if ( ! hasErrors ) this . tagBits |= TagBits . PassedBoundCheck ; } } public boolean canBeInstantiated ( ) { return ( ( this . tagBits & TagBits . HasDirectWildcard ) == <NUM_LIT:0> ) && super . canBeInstantiated ( ) ; } public TypeBinding capture ( Scope scope , int position ) { if ( ( this . tagBits & TagBits . HasDirectWildcard ) == <NUM_LIT:0> ) return this ; TypeBinding [ ] originalArguments = this . arguments ; int length = originalArguments . length ; TypeBinding [ ] capturedArguments = new TypeBinding [ length ] ; ReferenceBinding contextType = scope . enclosingSourceType ( ) ; if ( contextType != null ) contextType = contextType . outermostEnclosingType ( ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeBinding argument = originalArguments [ i ] ; if ( argument . kind ( ) == Binding . WILDCARD_TYPE ) { capturedArguments [ i ] = new CaptureBinding ( ( WildcardBinding ) argument , contextType , position , scope . compilationUnitScope ( ) . nextCaptureID ( ) ) ; } else { capturedArguments [ i ] = argument ; } } ParameterizedTypeBinding capturedParameterizedType = this . environment . createParameterizedType ( this . type , capturedArguments , enclosingType ( ) ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeBinding argument = capturedArguments [ i ] ; if ( argument . isCapture ( ) ) { ( ( CaptureBinding ) argument ) . initializeBounds ( scope , capturedParameterizedType ) ; } } return capturedParameterizedType ; } public List collectMissingTypes ( List missingTypes ) { if ( ( this . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { if ( this . enclosingType != null ) { missingTypes = this . enclosingType . collectMissingTypes ( missingTypes ) ; } missingTypes = genericType ( ) . collectMissingTypes ( missingTypes ) ; if ( this . arguments != null ) { for ( int i = <NUM_LIT:0> , max = this . arguments . length ; i < max ; i ++ ) { missingTypes = this . arguments [ i ] . collectMissingTypes ( missingTypes ) ; } } } return missingTypes ; } public void collectSubstitutes ( Scope scope , TypeBinding actualType , InferenceContext inferenceContext , int constraint ) { if ( ( this . tagBits & TagBits . HasTypeVariable ) == <NUM_LIT:0> ) { TypeBinding actualEquivalent = actualType . findSuperTypeOriginatingFrom ( this . type ) ; if ( actualEquivalent != null && actualEquivalent . isRawType ( ) ) { inferenceContext . isUnchecked = true ; } return ; } if ( actualType == TypeBinding . NULL ) return ; if ( ! ( actualType instanceof ReferenceBinding ) ) return ; TypeBinding formalEquivalent , actualEquivalent ; switch ( constraint ) { case TypeConstants . CONSTRAINT_EQUAL : case TypeConstants . CONSTRAINT_EXTENDS : formalEquivalent = this ; actualEquivalent = actualType . findSuperTypeOriginatingFrom ( this . type ) ; if ( actualEquivalent == null ) return ; break ; case TypeConstants . CONSTRAINT_SUPER : default : formalEquivalent = this . findSuperTypeOriginatingFrom ( actualType ) ; if ( formalEquivalent == null ) return ; actualEquivalent = actualType ; break ; } ReferenceBinding formalEnclosingType = formalEquivalent . enclosingType ( ) ; if ( formalEnclosingType != null ) { formalEnclosingType . collectSubstitutes ( scope , actualEquivalent . enclosingType ( ) , inferenceContext , constraint ) ; } if ( this . arguments == null ) return ; TypeBinding [ ] formalArguments ; switch ( formalEquivalent . kind ( ) ) { case Binding . GENERIC_TYPE : formalArguments = formalEquivalent . typeVariables ( ) ; break ; case Binding . PARAMETERIZED_TYPE : formalArguments = ( ( ParameterizedTypeBinding ) formalEquivalent ) . arguments ; break ; case Binding . RAW_TYPE : if ( inferenceContext . depth > <NUM_LIT:0> ) { inferenceContext . status = InferenceContext . FAILED ; } return ; default : return ; } TypeBinding [ ] actualArguments ; switch ( actualEquivalent . kind ( ) ) { case Binding . GENERIC_TYPE : actualArguments = actualEquivalent . typeVariables ( ) ; break ; case Binding . PARAMETERIZED_TYPE : actualArguments = ( ( ParameterizedTypeBinding ) actualEquivalent ) . arguments ; break ; case Binding . RAW_TYPE : if ( inferenceContext . depth > <NUM_LIT:0> ) { inferenceContext . status = InferenceContext . FAILED ; } else { inferenceContext . isUnchecked = true ; } return ; default : return ; } inferenceContext . depth ++ ; for ( int i = <NUM_LIT:0> , length = formalArguments . length ; i < length ; i ++ ) { TypeBinding formalArgument = formalArguments [ i ] ; TypeBinding actualArgument = actualArguments [ i ] ; if ( formalArgument . isWildcard ( ) ) { formalArgument . collectSubstitutes ( scope , actualArgument , inferenceContext , constraint ) ; continue ; } else if ( actualArgument . isWildcard ( ) ) { WildcardBinding actualWildcardArgument = ( WildcardBinding ) actualArgument ; if ( actualWildcardArgument . otherBounds == null ) { if ( constraint == TypeConstants . CONSTRAINT_SUPER ) { switch ( actualWildcardArgument . boundKind ) { case Wildcard . EXTENDS : formalArgument . collectSubstitutes ( scope , actualWildcardArgument . bound , inferenceContext , TypeConstants . CONSTRAINT_SUPER ) ; continue ; case Wildcard . SUPER : formalArgument . collectSubstitutes ( scope , actualWildcardArgument . bound , inferenceContext , TypeConstants . CONSTRAINT_EXTENDS ) ; continue ; default : continue ; } } else { continue ; } } } formalArgument . collectSubstitutes ( scope , actualArgument , inferenceContext , TypeConstants . CONSTRAINT_EQUAL ) ; } inferenceContext . depth -- ; } public void computeId ( ) { this . id = TypeIds . NoId ; } public char [ ] computeUniqueKey ( boolean isLeaf ) { StringBuffer sig = new StringBuffer ( <NUM_LIT:10> ) ; ReferenceBinding enclosing ; if ( isMemberType ( ) && ( ( enclosing = enclosingType ( ) ) . isParameterizedType ( ) || enclosing . isRawType ( ) ) ) { char [ ] typeSig = enclosing . computeUniqueKey ( false ) ; sig . append ( typeSig , <NUM_LIT:0> , typeSig . length - <NUM_LIT:1> ) ; sig . append ( '<CHAR_LIT:.>' ) . append ( sourceName ( ) ) ; } else if ( this . type . isLocalType ( ) ) { LocalTypeBinding localTypeBinding = ( LocalTypeBinding ) this . type ; enclosing = localTypeBinding . enclosingType ( ) ; ReferenceBinding temp ; while ( ( temp = enclosing . enclosingType ( ) ) != null ) enclosing = temp ; char [ ] typeSig = enclosing . computeUniqueKey ( false ) ; sig . append ( typeSig , <NUM_LIT:0> , typeSig . length - <NUM_LIT:1> ) ; sig . append ( '<CHAR_LIT>' ) ; sig . append ( localTypeBinding . sourceStart ) ; } else { char [ ] typeSig = this . type . computeUniqueKey ( false ) ; sig . append ( typeSig , <NUM_LIT:0> , typeSig . length - <NUM_LIT:1> ) ; } ReferenceBinding captureSourceType = null ; if ( this . arguments != null ) { sig . append ( '<CHAR_LIT>' ) ; for ( int i = <NUM_LIT:0> , length = this . arguments . length ; i < length ; i ++ ) { TypeBinding typeBinding = this . arguments [ i ] ; sig . append ( typeBinding . computeUniqueKey ( false ) ) ; if ( typeBinding instanceof CaptureBinding ) captureSourceType = ( ( CaptureBinding ) typeBinding ) . sourceType ; } sig . append ( '<CHAR_LIT:>>' ) ; } sig . append ( '<CHAR_LIT:;>' ) ; if ( captureSourceType != null && captureSourceType != this . type ) { sig . insert ( <NUM_LIT:0> , "<STR_LIT:&>" ) ; sig . insert ( <NUM_LIT:0> , captureSourceType . computeUniqueKey ( false ) ) ; } int sigLength = sig . length ( ) ; char [ ] uniqueKey = new char [ sigLength ] ; sig . getChars ( <NUM_LIT:0> , sigLength , uniqueKey , <NUM_LIT:0> ) ; return uniqueKey ; } public char [ ] constantPoolName ( ) { return this . type . constantPoolName ( ) ; } public ParameterizedMethodBinding createParameterizedMethod ( MethodBinding originalMethod ) { return new ParameterizedMethodBinding ( this , originalMethod ) ; } public String debugName ( ) { StringBuffer nameBuffer = new StringBuffer ( <NUM_LIT:10> ) ; if ( this . type instanceof UnresolvedReferenceBinding ) { nameBuffer . append ( this . type ) ; } else { nameBuffer . append ( this . type . sourceName ( ) ) ; } if ( this . arguments != null ) { nameBuffer . append ( '<CHAR_LIT>' ) ; for ( int i = <NUM_LIT:0> , length = this . arguments . length ; i < length ; i ++ ) { if ( i > <NUM_LIT:0> ) nameBuffer . append ( '<CHAR_LIT:U+002C>' ) ; nameBuffer . append ( this . arguments [ i ] . debugName ( ) ) ; } nameBuffer . append ( '<CHAR_LIT:>>' ) ; } return nameBuffer . toString ( ) ; } public ReferenceBinding enclosingType ( ) { return this . enclosingType ; } public LookupEnvironment environment ( ) { return this . environment ; } public TypeBinding erasure ( ) { return this . type . erasure ( ) ; } public int fieldCount ( ) { return this . type . fieldCount ( ) ; } public FieldBinding [ ] fields ( ) { if ( ( this . tagBits & TagBits . AreFieldsComplete ) != <NUM_LIT:0> ) return this . fields ; try { FieldBinding [ ] originalFields = this . type . fields ( ) ; int length = originalFields . length ; FieldBinding [ ] parameterizedFields = new FieldBinding [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) parameterizedFields [ i ] = new ParameterizedFieldBinding ( this , originalFields [ i ] ) ; this . fields = parameterizedFields ; } finally { if ( this . fields == null ) this . fields = Binding . NO_FIELDS ; this . tagBits |= TagBits . AreFieldsComplete ; } return this . fields ; } public ReferenceBinding genericType ( ) { if ( this . type instanceof UnresolvedReferenceBinding ) ( ( UnresolvedReferenceBinding ) this . type ) . resolve ( this . environment , false ) ; return this . type ; } public char [ ] genericTypeSignature ( ) { if ( this . genericTypeSignature == null ) { if ( ( this . modifiers & ExtraCompilerModifiers . AccGenericSignature ) == <NUM_LIT:0> ) { this . genericTypeSignature = this . type . signature ( ) ; } else { StringBuffer sig = new StringBuffer ( <NUM_LIT:10> ) ; if ( isMemberType ( ) ) { ReferenceBinding enclosing = enclosingType ( ) ; char [ ] typeSig = enclosing . genericTypeSignature ( ) ; sig . append ( typeSig , <NUM_LIT:0> , typeSig . length - <NUM_LIT:1> ) ; if ( ( enclosing . modifiers & ExtraCompilerModifiers . AccGenericSignature ) != <NUM_LIT:0> ) { sig . append ( '<CHAR_LIT:.>' ) ; } else { sig . append ( '<CHAR_LIT>' ) ; } sig . append ( sourceName ( ) ) ; } else { char [ ] typeSig = this . type . signature ( ) ; sig . append ( typeSig , <NUM_LIT:0> , typeSig . length - <NUM_LIT:1> ) ; } if ( this . arguments != null ) { sig . append ( '<CHAR_LIT>' ) ; for ( int i = <NUM_LIT:0> , length = this . arguments . length ; i < length ; i ++ ) { sig . append ( this . arguments [ i ] . genericTypeSignature ( ) ) ; } sig . append ( '<CHAR_LIT:>>' ) ; } sig . append ( '<CHAR_LIT:;>' ) ; int sigLength = sig . length ( ) ; this . genericTypeSignature = new char [ sigLength ] ; sig . getChars ( <NUM_LIT:0> , sigLength , this . genericTypeSignature , <NUM_LIT:0> ) ; } } return this . genericTypeSignature ; } public long getAnnotationTagBits ( ) { return this . type . getAnnotationTagBits ( ) ; } public int getEnclosingInstancesSlotSize ( ) { return genericType ( ) . getEnclosingInstancesSlotSize ( ) ; } public MethodBinding getExactConstructor ( TypeBinding [ ] argumentTypes ) { int argCount = argumentTypes . length ; MethodBinding match = null ; if ( ( this . tagBits & TagBits . AreMethodsComplete ) != <NUM_LIT:0> ) { long range ; if ( ( range = ReferenceBinding . binarySearch ( TypeConstants . INIT , this . methods ) ) >= <NUM_LIT:0> ) { nextMethod : for ( int imethod = ( int ) range , end = ( int ) ( range > > <NUM_LIT:32> ) ; imethod <= end ; imethod ++ ) { MethodBinding method = this . methods [ imethod ] ; if ( method . parameters . length == argCount ) { TypeBinding [ ] toMatch = method . parameters ; for ( int iarg = <NUM_LIT:0> ; iarg < argCount ; iarg ++ ) if ( toMatch [ iarg ] != argumentTypes [ iarg ] ) continue nextMethod ; if ( match != null ) return null ; match = method ; } } } } else { MethodBinding [ ] matchingMethods = getMethods ( TypeConstants . INIT ) ; nextMethod : for ( int m = matchingMethods . length ; -- m >= <NUM_LIT:0> ; ) { MethodBinding method = matchingMethods [ m ] ; TypeBinding [ ] toMatch = method . parameters ; if ( toMatch . length == argCount ) { for ( int p = <NUM_LIT:0> ; p < argCount ; p ++ ) if ( toMatch [ p ] != argumentTypes [ p ] ) continue nextMethod ; if ( match != null ) return null ; match = method ; } } } return match ; } public MethodBinding getExactMethod ( char [ ] selector , TypeBinding [ ] argumentTypes , CompilationUnitScope refScope ) { int argCount = argumentTypes . length ; boolean foundNothing = true ; MethodBinding match = null ; if ( ( this . tagBits & TagBits . AreMethodsComplete ) != <NUM_LIT:0> ) { long range ; if ( ( range = ReferenceBinding . binarySearch ( selector , this . methods ) ) >= <NUM_LIT:0> ) { nextMethod : for ( int imethod = ( int ) range , end = ( int ) ( range > > <NUM_LIT:32> ) ; imethod <= end ; imethod ++ ) { MethodBinding method = this . methods [ imethod ] ; foundNothing = false ; if ( method . parameters . length == argCount ) { TypeBinding [ ] toMatch = method . parameters ; for ( int iarg = <NUM_LIT:0> ; iarg < argCount ; iarg ++ ) if ( toMatch [ iarg ] != argumentTypes [ iarg ] ) continue nextMethod ; if ( match != null ) return null ; match = method ; } } } } else { MethodBinding [ ] matchingMethods = getMethods ( selector ) ; foundNothing = matchingMethods == Binding . NO_METHODS ; nextMethod : for ( int m = matchingMethods . length ; -- m >= <NUM_LIT:0> ; ) { MethodBinding method = matchingMethods [ m ] ; TypeBinding [ ] toMatch = method . parameters ; if ( toMatch . length == argCount ) { for ( int p = <NUM_LIT:0> ; p < argCount ; p ++ ) if ( toMatch [ p ] != argumentTypes [ p ] ) continue nextMethod ; if ( match != null ) return null ; match = method ; } } } if ( match != null ) { if ( match . hasSubstitutedParameters ( ) ) return null ; return match ; } if ( foundNothing && ( this . arguments == null || this . arguments . length <= <NUM_LIT:1> ) ) { if ( isInterface ( ) ) { if ( superInterfaces ( ) . length == <NUM_LIT:1> ) { if ( refScope != null ) refScope . recordTypeReference ( this . superInterfaces [ <NUM_LIT:0> ] ) ; return this . superInterfaces [ <NUM_LIT:0> ] . getExactMethod ( selector , argumentTypes , refScope ) ; } } else if ( superclass ( ) != null ) { if ( refScope != null ) refScope . recordTypeReference ( this . superclass ) ; return this . superclass . getExactMethod ( selector , argumentTypes , refScope ) ; } } return null ; } public FieldBinding getField ( char [ ] fieldName , boolean needResolve ) { fields ( ) ; return ReferenceBinding . binarySearch ( fieldName , this . fields ) ; } public ReferenceBinding getMemberType ( char [ ] typeName ) { memberTypes ( ) ; int typeLength = typeName . length ; for ( int i = this . memberTypes . length ; -- i >= <NUM_LIT:0> ; ) { ReferenceBinding memberType = this . memberTypes [ i ] ; if ( memberType . sourceName . length == typeLength && CharOperation . equals ( memberType . sourceName , typeName ) ) return memberType ; } return null ; } public MethodBinding [ ] getMethods ( char [ ] selector ) { if ( this . methods != null ) { long range ; if ( ( range = ReferenceBinding . binarySearch ( selector , this . methods ) ) >= <NUM_LIT:0> ) { int start = ( int ) range ; int length = ( int ) ( range > > <NUM_LIT:32> ) - start + <NUM_LIT:1> ; MethodBinding [ ] result ; System . arraycopy ( this . methods , start , result = new MethodBinding [ length ] , <NUM_LIT:0> , length ) ; return result ; } } if ( ( this . tagBits & TagBits . AreMethodsComplete ) != <NUM_LIT:0> ) return Binding . NO_METHODS ; MethodBinding [ ] parameterizedMethods = null ; try { MethodBinding [ ] originalMethods = this . type . getMethods ( selector ) ; int length = originalMethods . length ; if ( length == <NUM_LIT:0> ) return Binding . NO_METHODS ; parameterizedMethods = new MethodBinding [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) parameterizedMethods [ i ] = createParameterizedMethod ( originalMethods [ i ] ) ; if ( this . methods == null ) { MethodBinding [ ] temp = new MethodBinding [ length ] ; System . arraycopy ( parameterizedMethods , <NUM_LIT:0> , temp , <NUM_LIT:0> , length ) ; this . methods = temp ; } else { int total = length + this . methods . length ; MethodBinding [ ] temp = new MethodBinding [ total ] ; System . arraycopy ( parameterizedMethods , <NUM_LIT:0> , temp , <NUM_LIT:0> , length ) ; System . arraycopy ( this . methods , <NUM_LIT:0> , temp , length , this . methods . length ) ; if ( total > <NUM_LIT:1> ) ReferenceBinding . sortMethods ( temp , <NUM_LIT:0> , total ) ; this . methods = temp ; } return parameterizedMethods ; } finally { if ( parameterizedMethods == null ) this . methods = parameterizedMethods = Binding . NO_METHODS ; } } public int getOuterLocalVariablesSlotSize ( ) { return genericType ( ) . getOuterLocalVariablesSlotSize ( ) ; } public boolean hasMemberTypes ( ) { return this . type . hasMemberTypes ( ) ; } public boolean implementsMethod ( MethodBinding method ) { return this . type . implementsMethod ( method ) ; } void initialize ( ReferenceBinding someType , TypeBinding [ ] someArguments ) { this . type = someType ; this . sourceName = someType . sourceName ; this . compoundName = someType . compoundName ; this . fPackage = someType . fPackage ; this . fileName = someType . fileName ; this . modifiers = someType . modifiers & ~ ExtraCompilerModifiers . AccGenericSignature ; if ( someArguments != null ) { this . modifiers |= ExtraCompilerModifiers . AccGenericSignature ; } else if ( this . enclosingType != null ) { this . modifiers |= ( this . enclosingType . modifiers & ExtraCompilerModifiers . AccGenericSignature ) ; this . tagBits |= this . enclosingType . tagBits & ( TagBits . HasTypeVariable | TagBits . HasMissingType ) ; } if ( someArguments != null ) { this . arguments = someArguments ; for ( int i = <NUM_LIT:0> , length = someArguments . length ; i < length ; i ++ ) { TypeBinding someArgument = someArguments [ i ] ; switch ( someArgument . kind ( ) ) { case Binding . WILDCARD_TYPE : this . tagBits |= TagBits . HasDirectWildcard ; if ( ( ( WildcardBinding ) someArgument ) . boundKind != Wildcard . UNBOUND ) { this . tagBits |= TagBits . IsBoundParameterizedType ; } break ; case Binding . INTERSECTION_TYPE : this . tagBits |= TagBits . HasDirectWildcard | TagBits . IsBoundParameterizedType ; break ; default : this . tagBits |= TagBits . IsBoundParameterizedType ; break ; } this . tagBits |= someArgument . tagBits & ( TagBits . HasTypeVariable | TagBits . HasMissingType | TagBits . ContainsNestedTypeReferences ) ; } } this . tagBits |= someType . tagBits & ( TagBits . IsLocalType | TagBits . IsMemberType | TagBits . IsNestedType | TagBits . HasMissingType | TagBits . ContainsNestedTypeReferences ) ; this . tagBits &= ~ ( TagBits . AreFieldsComplete | TagBits . AreMethodsComplete ) ; } protected void initializeArguments ( ) { } void initializeForStaticImports ( ) { this . type . initializeForStaticImports ( ) ; } public boolean isEquivalentTo ( TypeBinding otherType ) { if ( this == otherType ) return true ; if ( otherType == null ) return false ; switch ( otherType . kind ( ) ) { case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : return ( ( WildcardBinding ) otherType ) . boundCheck ( this ) ; case Binding . PARAMETERIZED_TYPE : ParameterizedTypeBinding otherParamType = ( ParameterizedTypeBinding ) otherType ; if ( this . type != otherParamType . type ) return false ; if ( ! isStatic ( ) ) { ReferenceBinding enclosing = enclosingType ( ) ; if ( enclosing != null ) { ReferenceBinding otherEnclosing = otherParamType . enclosingType ( ) ; if ( otherEnclosing == null ) return false ; if ( ( otherEnclosing . tagBits & TagBits . HasDirectWildcard ) == <NUM_LIT:0> ) { if ( enclosing != otherEnclosing ) return false ; } else { if ( ! enclosing . isEquivalentTo ( otherParamType . enclosingType ( ) ) ) return false ; } } } if ( this . arguments == null ) { return otherParamType . arguments == null ; } int length = this . arguments . length ; TypeBinding [ ] otherArguments = otherParamType . arguments ; if ( otherArguments == null || otherArguments . length != length ) return false ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( ! this . arguments [ i ] . isTypeArgumentContainedBy ( otherArguments [ i ] ) ) return false ; } return true ; case Binding . RAW_TYPE : return erasure ( ) == otherType . erasure ( ) ; } if ( erasure ( ) == otherType ) { return true ; } return false ; } public boolean isHierarchyConnected ( ) { return this . superclass != null && this . superInterfaces != null ; } public boolean isRawSubstitution ( ) { return isRawType ( ) ; } public int kind ( ) { return PARAMETERIZED_TYPE ; } public ReferenceBinding [ ] memberTypes ( ) { if ( this . memberTypes == null ) { try { ReferenceBinding [ ] originalMemberTypes = this . type . memberTypes ( ) ; int length = originalMemberTypes . length ; ReferenceBinding [ ] parameterizedMemberTypes = new ReferenceBinding [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) parameterizedMemberTypes [ i ] = this . environment . createParameterizedType ( originalMemberTypes [ i ] , null , this ) ; this . memberTypes = parameterizedMemberTypes ; } finally { if ( this . memberTypes == null ) this . memberTypes = Binding . NO_MEMBER_TYPES ; } } return this . memberTypes ; } public MethodBinding [ ] methods ( ) { if ( ( this . tagBits & TagBits . AreMethodsComplete ) != <NUM_LIT:0> ) return this . methods ; try { MethodBinding [ ] originalMethods = this . type . methods ( ) ; int length = originalMethods . length ; MethodBinding [ ] parameterizedMethods = new MethodBinding [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) parameterizedMethods [ i ] = createParameterizedMethod ( originalMethods [ i ] ) ; this . methods = parameterizedMethods ; } finally { if ( this . methods == null ) this . methods = Binding . NO_METHODS ; this . tagBits |= TagBits . AreMethodsComplete ; } return this . methods ; } public int problemId ( ) { return this . type . problemId ( ) ; } public char [ ] qualifiedPackageName ( ) { return this . type . qualifiedPackageName ( ) ; } public char [ ] qualifiedSourceName ( ) { return this . type . qualifiedSourceName ( ) ; } public char [ ] readableName ( ) { StringBuffer nameBuffer = new StringBuffer ( <NUM_LIT:10> ) ; if ( isMemberType ( ) ) { nameBuffer . append ( CharOperation . concat ( enclosingType ( ) . readableName ( ) , this . sourceName , '<CHAR_LIT:.>' ) ) ; } else { nameBuffer . append ( CharOperation . concatWith ( this . type . compoundName , '<CHAR_LIT:.>' ) ) ; } if ( this . arguments != null ) { nameBuffer . append ( '<CHAR_LIT>' ) ; for ( int i = <NUM_LIT:0> , length = this . arguments . length ; i < length ; i ++ ) { if ( i > <NUM_LIT:0> ) nameBuffer . append ( '<CHAR_LIT:U+002C>' ) ; nameBuffer . append ( this . arguments [ i ] . readableName ( ) ) ; } nameBuffer . append ( '<CHAR_LIT:>>' ) ; } int nameLength = nameBuffer . length ( ) ; char [ ] readableName = new char [ nameLength ] ; nameBuffer . getChars ( <NUM_LIT:0> , nameLength , readableName , <NUM_LIT:0> ) ; return readableName ; } ReferenceBinding resolve ( ) { if ( ( this . tagBits & TagBits . HasUnresolvedTypeVariables ) == <NUM_LIT:0> ) return this ; this . tagBits &= ~ TagBits . HasUnresolvedTypeVariables ; ReferenceBinding resolvedType = ( ReferenceBinding ) BinaryTypeBinding . resolveType ( this . type , this . environment , false ) ; this . tagBits |= resolvedType . tagBits & TagBits . ContainsNestedTypeReferences ; if ( this . arguments != null ) { int argLength = this . arguments . length ; for ( int i = <NUM_LIT:0> ; i < argLength ; i ++ ) { TypeBinding resolveType = BinaryTypeBinding . resolveType ( this . arguments [ i ] , this . environment , true ) ; this . arguments [ i ] = resolveType ; this . tagBits |= resolvedType . tagBits & TagBits . ContainsNestedTypeReferences ; } } return this ; } public char [ ] shortReadableName ( ) { StringBuffer nameBuffer = new StringBuffer ( <NUM_LIT:10> ) ; if ( isMemberType ( ) ) { nameBuffer . append ( CharOperation . concat ( enclosingType ( ) . shortReadableName ( ) , this . sourceName , '<CHAR_LIT:.>' ) ) ; } else { nameBuffer . append ( this . type . sourceName ) ; } if ( this . arguments != null ) { nameBuffer . append ( '<CHAR_LIT>' ) ; for ( int i = <NUM_LIT:0> , length = this . arguments . length ; i < length ; i ++ ) { if ( i > <NUM_LIT:0> ) nameBuffer . append ( '<CHAR_LIT:U+002C>' ) ; nameBuffer . append ( this . arguments [ i ] . shortReadableName ( ) ) ; } nameBuffer . append ( '<CHAR_LIT:>>' ) ; } int nameLength = nameBuffer . length ( ) ; char [ ] shortReadableName = new char [ nameLength ] ; nameBuffer . getChars ( <NUM_LIT:0> , nameLength , shortReadableName , <NUM_LIT:0> ) ; return shortReadableName ; } public char [ ] signature ( ) { if ( this . signature == null ) { this . signature = this . type . signature ( ) ; } return this . signature ; } public char [ ] sourceName ( ) { return this . type . sourceName ( ) ; } public TypeBinding substitute ( TypeVariableBinding originalVariable ) { ParameterizedTypeBinding currentType = this ; while ( true ) { TypeVariableBinding [ ] typeVariables = currentType . type . typeVariables ( ) ; int length = typeVariables . length ; if ( originalVariable . rank < length && typeVariables [ originalVariable . rank ] == originalVariable ) { if ( currentType . arguments == null ) currentType . initializeArguments ( ) ; if ( currentType . arguments != null ) { if ( currentType . arguments . length == <NUM_LIT:0> ) { return originalVariable ; } return currentType . arguments [ originalVariable . rank ] ; } } if ( currentType . isStatic ( ) ) break ; ReferenceBinding enclosing = currentType . enclosingType ( ) ; if ( ! ( enclosing instanceof ParameterizedTypeBinding ) ) break ; currentType = ( ParameterizedTypeBinding ) enclosing ; } return originalVariable ; } public ReferenceBinding superclass ( ) { if ( this . superclass == null ) { ReferenceBinding genericSuperclass = this . type . superclass ( ) ; if ( genericSuperclass == null ) return null ; this . superclass = ( ReferenceBinding ) Scope . substitute ( this , genericSuperclass ) ; } return this . superclass ; } public ReferenceBinding [ ] superInterfaces ( ) { if ( this . superInterfaces == null ) { if ( this . type . isHierarchyBeingConnected ( ) ) return Binding . NO_SUPERINTERFACES ; this . superInterfaces = Scope . substitute ( this , this . type . superInterfaces ( ) ) ; } return this . superInterfaces ; } public void swapUnresolved ( UnresolvedReferenceBinding unresolvedType , ReferenceBinding resolvedType , LookupEnvironment env ) { boolean update = false ; if ( this . type == unresolvedType ) { this . type = resolvedType ; update = true ; ReferenceBinding enclosing = resolvedType . enclosingType ( ) ; if ( enclosing != null ) { this . enclosingType = ( ReferenceBinding ) env . convertUnresolvedBinaryToRawType ( enclosing ) ; } } if ( this . arguments != null ) { for ( int i = <NUM_LIT:0> , l = this . arguments . length ; i < l ; i ++ ) { if ( this . arguments [ i ] == unresolvedType ) { this . arguments [ i ] = env . convertUnresolvedBinaryToRawType ( resolvedType ) ; update = true ; } } } if ( update ) initialize ( this . type , this . arguments ) ; } public ReferenceBinding [ ] syntheticEnclosingInstanceTypes ( ) { return genericType ( ) . syntheticEnclosingInstanceTypes ( ) ; } public SyntheticArgumentBinding [ ] syntheticOuterLocalVariables ( ) { return genericType ( ) . syntheticOuterLocalVariables ( ) ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( <NUM_LIT:30> ) ; if ( this . type instanceof UnresolvedReferenceBinding ) { buffer . append ( debugName ( ) ) ; } else { if ( isDeprecated ( ) ) buffer . append ( "<STR_LIT>" ) ; if ( isPublic ( ) ) buffer . append ( "<STR_LIT>" ) ; if ( isProtected ( ) ) buffer . append ( "<STR_LIT>" ) ; if ( isPrivate ( ) ) buffer . append ( "<STR_LIT>" ) ; if ( isAbstract ( ) && isClass ( ) ) buffer . append ( "<STR_LIT>" ) ; if ( isStatic ( ) && isNestedType ( ) ) buffer . append ( "<STR_LIT>" ) ; if ( isFinal ( ) ) buffer . append ( "<STR_LIT>" ) ; if ( isEnum ( ) ) buffer . append ( "<STR_LIT>" ) ; else if ( isAnnotationType ( ) ) buffer . append ( "<STR_LIT>" ) ; else if ( isClass ( ) ) buffer . append ( "<STR_LIT>" ) ; else buffer . append ( "<STR_LIT>" ) ; buffer . append ( debugName ( ) ) ; buffer . append ( "<STR_LIT>" ) ; buffer . append ( ( this . superclass != null ) ? this . superclass . debugName ( ) : "<STR_LIT>" ) ; if ( this . superInterfaces != null ) { if ( this . superInterfaces != Binding . NO_SUPERINTERFACES ) { buffer . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> , length = this . superInterfaces . length ; i < length ; i ++ ) { if ( i > <NUM_LIT:0> ) buffer . append ( "<STR_LIT:U+002CU+0020>" ) ; buffer . append ( ( this . superInterfaces [ i ] != null ) ? this . superInterfaces [ i ] . debugName ( ) : "<STR_LIT>" ) ; } } } else { buffer . append ( "<STR_LIT>" ) ; } if ( enclosingType ( ) != null ) { buffer . append ( "<STR_LIT>" ) ; buffer . append ( enclosingType ( ) . debugName ( ) ) ; } if ( this . fields != null ) { if ( this . fields != Binding . NO_FIELDS ) { buffer . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> , length = this . fields . length ; i < length ; i ++ ) buffer . append ( '<STR_LIT:\n>' ) . append ( ( this . fields [ i ] != null ) ? this . fields [ i ] . toString ( ) : "<STR_LIT>" ) ; } } else { buffer . append ( "<STR_LIT>" ) ; } if ( this . methods != null ) { if ( this . methods != Binding . NO_METHODS ) { buffer . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> , length = this . methods . length ; i < length ; i ++ ) buffer . append ( '<STR_LIT:\n>' ) . append ( ( this . methods [ i ] != null ) ? this . methods [ i ] . toString ( ) : "<STR_LIT>" ) ; } } else { buffer . append ( "<STR_LIT>" ) ; } buffer . append ( "<STR_LIT>" ) ; } return buffer . toString ( ) ; } public TypeVariableBinding [ ] typeVariables ( ) { if ( this . arguments == null ) { return this . type . typeVariables ( ) ; } return Binding . NO_TYPE_VARIABLES ; } public FieldBinding [ ] unResolvedFields ( ) { return this . fields ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; import java . util . ArrayList ; import java . util . HashMap ; import java . util . HashSet ; import java . util . Map ; import java . util . Set ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ClassFilePool ; import org . eclipse . jdt . internal . compiler . ast . CompilationUnitDeclaration ; import org . eclipse . jdt . internal . compiler . ast . Wildcard ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . env . * ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . impl . ITypeRequestor ; import org . eclipse . jdt . internal . compiler . problem . AbortCompilation ; import org . eclipse . jdt . internal . compiler . problem . ProblemReporter ; import org . eclipse . jdt . internal . compiler . util . HashtableOfPackage ; import org . eclipse . jdt . internal . compiler . util . SimpleLookupTable ; public class LookupEnvironment implements ProblemReasons , TypeConstants { private Map accessRestrictions ; ImportBinding [ ] defaultImports ; public PackageBinding defaultPackage ; HashtableOfPackage knownPackages ; private int lastCompletedUnitIndex = - <NUM_LIT:1> ; private int lastUnitIndex = - <NUM_LIT:1> ; public INameEnvironment nameEnvironment ; public CompilerOptions globalOptions ; public ProblemReporter problemReporter ; public ClassFilePool classFilePool ; private int stepCompleted ; public ITypeRequestor typeRequestor ; private ArrayBinding [ ] [ ] uniqueArrayBindings ; private SimpleLookupTable uniqueParameterizedTypeBindings ; private SimpleLookupTable uniqueRawTypeBindings ; private SimpleLookupTable uniqueWildcardBindings ; private SimpleLookupTable uniqueParameterizedGenericMethodBindings ; private SimpleLookupTable uniquePolymorphicMethodBindings ; private SimpleLookupTable uniqueGetClassMethodBinding ; public CompilationUnitDeclaration unitBeingCompleted = null ; public Object missingClassFileLocation = null ; private CompilationUnitDeclaration [ ] units = new CompilationUnitDeclaration [ <NUM_LIT:4> ] ; private MethodVerifier verifier ; public MethodBinding arrayClone ; private ArrayList missingTypes ; Set typesBeingConnected ; public boolean isProcessingAnnotations = false ; final static int BUILD_FIELDS_AND_METHODS = <NUM_LIT:4> ; final static int BUILD_TYPE_HIERARCHY = <NUM_LIT:1> ; final static int CHECK_AND_SET_IMPORTS = <NUM_LIT:2> ; final static int CONNECT_TYPE_HIERARCHY = <NUM_LIT:3> ; static final ProblemPackageBinding TheNotFoundPackage = new ProblemPackageBinding ( CharOperation . NO_CHAR , NotFound ) ; static final ProblemReferenceBinding TheNotFoundType = new ProblemReferenceBinding ( CharOperation . NO_CHAR_CHAR , null , NotFound ) ; public LookupEnvironment ( ITypeRequestor typeRequestor , CompilerOptions globalOptions , ProblemReporter problemReporter , INameEnvironment nameEnvironment ) { this . typeRequestor = typeRequestor ; this . globalOptions = globalOptions ; this . problemReporter = problemReporter ; this . defaultPackage = new PackageBinding ( this ) ; this . defaultImports = null ; this . nameEnvironment = nameEnvironment ; this . knownPackages = new HashtableOfPackage ( ) ; this . uniqueArrayBindings = new ArrayBinding [ <NUM_LIT:5> ] [ ] ; this . uniqueArrayBindings [ <NUM_LIT:0> ] = new ArrayBinding [ <NUM_LIT> ] ; this . uniqueParameterizedTypeBindings = new SimpleLookupTable ( <NUM_LIT:3> ) ; this . uniqueRawTypeBindings = new SimpleLookupTable ( <NUM_LIT:3> ) ; this . uniqueWildcardBindings = new SimpleLookupTable ( <NUM_LIT:3> ) ; this . uniqueParameterizedGenericMethodBindings = new SimpleLookupTable ( <NUM_LIT:3> ) ; this . uniquePolymorphicMethodBindings = new SimpleLookupTable ( <NUM_LIT:3> ) ; this . missingTypes = null ; this . accessRestrictions = new HashMap ( <NUM_LIT:3> ) ; this . classFilePool = ClassFilePool . newInstance ( ) ; this . typesBeingConnected = new HashSet ( ) ; } public ReferenceBinding askForType ( char [ ] [ ] compoundName ) { NameEnvironmentAnswer answer = this . nameEnvironment . findType ( compoundName ) ; if ( answer == null ) return null ; if ( answer . isBinaryType ( ) ) { this . typeRequestor . accept ( answer . getBinaryType ( ) , computePackageFrom ( compoundName , false ) , answer . getAccessRestriction ( ) ) ; } else if ( answer . isCompilationUnit ( ) ) { this . typeRequestor . accept ( answer . getCompilationUnit ( ) , answer . getAccessRestriction ( ) ) ; } else if ( answer . isSourceType ( ) ) { this . typeRequestor . accept ( answer . getSourceTypes ( ) , computePackageFrom ( compoundName , false ) , answer . getAccessRestriction ( ) ) ; } return getCachedType ( compoundName ) ; } ReferenceBinding askForType ( PackageBinding packageBinding , char [ ] name ) { if ( packageBinding == null ) { packageBinding = this . defaultPackage ; } NameEnvironmentAnswer answer = this . nameEnvironment . findType ( name , packageBinding . compoundName ) ; if ( answer == null ) return null ; if ( answer . isBinaryType ( ) ) { this . typeRequestor . accept ( answer . getBinaryType ( ) , packageBinding , answer . getAccessRestriction ( ) ) ; } else if ( answer . isCompilationUnit ( ) ) { try { this . typeRequestor . accept ( answer . getCompilationUnit ( ) , answer . getAccessRestriction ( ) ) ; } catch ( AbortCompilation abort ) { if ( CharOperation . equals ( name , TypeConstants . PACKAGE_INFO_NAME ) ) return null ; throw abort ; } } else if ( answer . isSourceType ( ) ) { this . typeRequestor . accept ( answer . getSourceTypes ( ) , packageBinding , answer . getAccessRestriction ( ) ) ; } return packageBinding . getType0 ( name ) ; } public void buildTypeBindings ( CompilationUnitDeclaration unit , AccessRestriction accessRestriction ) { CompilationUnitScope scope = unit . buildCompilationUnitScope ( this ) ; scope . buildTypeBindings ( accessRestriction ) ; int unitsLength = this . units . length ; if ( ++ this . lastUnitIndex >= unitsLength ) System . arraycopy ( this . units , <NUM_LIT:0> , this . units = new CompilationUnitDeclaration [ <NUM_LIT:2> * unitsLength ] , <NUM_LIT:0> , unitsLength ) ; this . units [ this . lastUnitIndex ] = unit ; } public BinaryTypeBinding cacheBinaryType ( IBinaryType binaryType , AccessRestriction accessRestriction ) { return cacheBinaryType ( binaryType , true , accessRestriction ) ; } public BinaryTypeBinding cacheBinaryType ( IBinaryType binaryType , boolean needFieldsAndMethods , AccessRestriction accessRestriction ) { char [ ] [ ] compoundName = CharOperation . splitOn ( '<CHAR_LIT:/>' , binaryType . getName ( ) ) ; ReferenceBinding existingType = getCachedType ( compoundName ) ; if ( existingType == null || existingType instanceof UnresolvedReferenceBinding ) return createBinaryTypeFrom ( binaryType , computePackageFrom ( compoundName , false ) , needFieldsAndMethods , accessRestriction ) ; return null ; } public void completeTypeBindings ( ) { this . stepCompleted = BUILD_TYPE_HIERARCHY ; for ( int i = this . lastCompletedUnitIndex + <NUM_LIT:1> ; i <= this . lastUnitIndex ; i ++ ) { ( this . unitBeingCompleted = this . units [ i ] ) . scope . checkAndSetImports ( ) ; } this . stepCompleted = CHECK_AND_SET_IMPORTS ; for ( int i = this . lastCompletedUnitIndex + <NUM_LIT:1> ; i <= this . lastUnitIndex ; i ++ ) { ( this . unitBeingCompleted = this . units [ i ] ) . scope . connectTypeHierarchy ( ) ; ( this . unitBeingCompleted = this . units [ i ] ) . scope . augmentTypeHierarchy ( ) ; } this . stepCompleted = CONNECT_TYPE_HIERARCHY ; for ( int i = this . lastCompletedUnitIndex + <NUM_LIT:1> ; i <= this . lastUnitIndex ; i ++ ) { CompilationUnitScope unitScope = ( this . unitBeingCompleted = this . units [ i ] ) . scope ; unitScope . checkParameterizedTypes ( ) ; unitScope . buildFieldsAndMethods ( ) ; this . units [ i ] = null ; } this . stepCompleted = BUILD_FIELDS_AND_METHODS ; this . lastCompletedUnitIndex = this . lastUnitIndex ; this . unitBeingCompleted = null ; } public void completeTypeBindings ( CompilationUnitDeclaration parsedUnit ) { if ( this . stepCompleted == BUILD_FIELDS_AND_METHODS ) { completeTypeBindings ( ) ; } else { if ( parsedUnit . scope == null ) return ; if ( this . stepCompleted >= CHECK_AND_SET_IMPORTS ) ( this . unitBeingCompleted = parsedUnit ) . scope . checkAndSetImports ( ) ; if ( this . stepCompleted >= CONNECT_TYPE_HIERARCHY ) ( this . unitBeingCompleted = parsedUnit ) . scope . connectTypeHierarchy ( ) ; this . unitBeingCompleted = null ; } } public void completeTypeBindings ( CompilationUnitDeclaration parsedUnit , boolean buildFieldsAndMethods ) { if ( parsedUnit . scope == null ) return ; ( this . unitBeingCompleted = parsedUnit ) . scope . checkAndSetImports ( ) ; parsedUnit . scope . connectTypeHierarchy ( ) ; parsedUnit . scope . checkParameterizedTypes ( ) ; if ( buildFieldsAndMethods ) parsedUnit . scope . buildFieldsAndMethods ( ) ; this . unitBeingCompleted = null ; } public void completeTypeBindings ( CompilationUnitDeclaration [ ] parsedUnits , boolean [ ] buildFieldsAndMethods , int unitCount ) { for ( int i = <NUM_LIT:0> ; i < unitCount ; i ++ ) { CompilationUnitDeclaration parsedUnit = parsedUnits [ i ] ; if ( parsedUnit . scope != null ) ( this . unitBeingCompleted = parsedUnit ) . scope . checkAndSetImports ( ) ; } for ( int i = <NUM_LIT:0> ; i < unitCount ; i ++ ) { CompilationUnitDeclaration parsedUnit = parsedUnits [ i ] ; if ( parsedUnit . scope != null ) ( this . unitBeingCompleted = parsedUnit ) . scope . connectTypeHierarchy ( ) ; } for ( int i = <NUM_LIT:0> ; i < unitCount ; i ++ ) { CompilationUnitDeclaration parsedUnit = parsedUnits [ i ] ; if ( parsedUnit . scope != null ) { ( this . unitBeingCompleted = parsedUnit ) . scope . checkParameterizedTypes ( ) ; if ( buildFieldsAndMethods [ i ] ) parsedUnit . scope . buildFieldsAndMethods ( ) ; } } this . unitBeingCompleted = null ; } public MethodBinding computeArrayClone ( MethodBinding objectClone ) { if ( this . arrayClone == null ) { this . arrayClone = new MethodBinding ( ( objectClone . modifiers & ~ ClassFileConstants . AccProtected ) | ClassFileConstants . AccPublic , TypeConstants . CLONE , objectClone . returnType , Binding . NO_PARAMETERS , Binding . NO_EXCEPTIONS , ( ReferenceBinding ) objectClone . returnType ) ; } return this . arrayClone ; } public TypeBinding computeBoxingType ( TypeBinding type ) { TypeBinding boxedType ; switch ( type . id ) { case TypeIds . T_JavaLangBoolean : return TypeBinding . BOOLEAN ; case TypeIds . T_JavaLangByte : return TypeBinding . BYTE ; case TypeIds . T_JavaLangCharacter : return TypeBinding . CHAR ; case TypeIds . T_JavaLangShort : return TypeBinding . SHORT ; case TypeIds . T_JavaLangDouble : return TypeBinding . DOUBLE ; case TypeIds . T_JavaLangFloat : return TypeBinding . FLOAT ; case TypeIds . T_JavaLangInteger : return TypeBinding . INT ; case TypeIds . T_JavaLangLong : return TypeBinding . LONG ; case TypeIds . T_int : boxedType = getType ( JAVA_LANG_INTEGER ) ; if ( boxedType != null ) return boxedType ; return new ProblemReferenceBinding ( JAVA_LANG_INTEGER , null , NotFound ) ; case TypeIds . T_byte : boxedType = getType ( JAVA_LANG_BYTE ) ; if ( boxedType != null ) return boxedType ; return new ProblemReferenceBinding ( JAVA_LANG_BYTE , null , NotFound ) ; case TypeIds . T_short : boxedType = getType ( JAVA_LANG_SHORT ) ; if ( boxedType != null ) return boxedType ; return new ProblemReferenceBinding ( JAVA_LANG_SHORT , null , NotFound ) ; case TypeIds . T_char : boxedType = getType ( JAVA_LANG_CHARACTER ) ; if ( boxedType != null ) return boxedType ; return new ProblemReferenceBinding ( JAVA_LANG_CHARACTER , null , NotFound ) ; case TypeIds . T_long : boxedType = getType ( JAVA_LANG_LONG ) ; if ( boxedType != null ) return boxedType ; return new ProblemReferenceBinding ( JAVA_LANG_LONG , null , NotFound ) ; case TypeIds . T_float : boxedType = getType ( JAVA_LANG_FLOAT ) ; if ( boxedType != null ) return boxedType ; return new ProblemReferenceBinding ( JAVA_LANG_FLOAT , null , NotFound ) ; case TypeIds . T_double : boxedType = getType ( JAVA_LANG_DOUBLE ) ; if ( boxedType != null ) return boxedType ; return new ProblemReferenceBinding ( JAVA_LANG_DOUBLE , null , NotFound ) ; case TypeIds . T_boolean : boxedType = getType ( JAVA_LANG_BOOLEAN ) ; if ( boxedType != null ) return boxedType ; return new ProblemReferenceBinding ( JAVA_LANG_BOOLEAN , null , NotFound ) ; } switch ( type . kind ( ) ) { case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : case Binding . TYPE_PARAMETER : switch ( type . erasure ( ) . id ) { case TypeIds . T_JavaLangBoolean : return TypeBinding . BOOLEAN ; case TypeIds . T_JavaLangByte : return TypeBinding . BYTE ; case TypeIds . T_JavaLangCharacter : return TypeBinding . CHAR ; case TypeIds . T_JavaLangShort : return TypeBinding . SHORT ; case TypeIds . T_JavaLangDouble : return TypeBinding . DOUBLE ; case TypeIds . T_JavaLangFloat : return TypeBinding . FLOAT ; case TypeIds . T_JavaLangInteger : return TypeBinding . INT ; case TypeIds . T_JavaLangLong : return TypeBinding . LONG ; } } return type ; } private PackageBinding computePackageFrom ( char [ ] [ ] constantPoolName , boolean isMissing ) { if ( constantPoolName . length == <NUM_LIT:1> ) return this . defaultPackage ; PackageBinding packageBinding = getPackage0 ( constantPoolName [ <NUM_LIT:0> ] ) ; if ( packageBinding == null || packageBinding == TheNotFoundPackage ) { packageBinding = new PackageBinding ( constantPoolName [ <NUM_LIT:0> ] , this ) ; if ( isMissing ) packageBinding . tagBits |= TagBits . HasMissingType ; this . knownPackages . put ( constantPoolName [ <NUM_LIT:0> ] , packageBinding ) ; } for ( int i = <NUM_LIT:1> , length = constantPoolName . length - <NUM_LIT:1> ; i < length ; i ++ ) { PackageBinding parent = packageBinding ; if ( ( packageBinding = parent . getPackage0 ( constantPoolName [ i ] ) ) == null || packageBinding == TheNotFoundPackage ) { packageBinding = new PackageBinding ( CharOperation . subarray ( constantPoolName , <NUM_LIT:0> , i + <NUM_LIT:1> ) , parent , this ) ; if ( isMissing ) { packageBinding . tagBits |= TagBits . HasMissingType ; } parent . addPackage ( packageBinding ) ; } } return packageBinding ; } public ReferenceBinding convertToParameterizedType ( ReferenceBinding originalType ) { if ( originalType != null ) { boolean isGeneric = originalType . isGenericType ( ) ; ReferenceBinding originalEnclosingType = originalType . enclosingType ( ) ; ReferenceBinding convertedEnclosingType = originalEnclosingType ; boolean needToConvert = isGeneric ; if ( originalEnclosingType != null ) { convertedEnclosingType = originalType . isStatic ( ) ? ( ReferenceBinding ) convertToRawType ( originalEnclosingType , false ) : convertToParameterizedType ( originalEnclosingType ) ; needToConvert |= originalEnclosingType != convertedEnclosingType ; } if ( needToConvert ) { return createParameterizedType ( originalType , isGeneric ? originalType . typeVariables ( ) : null , convertedEnclosingType ) ; } } return originalType ; } public TypeBinding convertToRawType ( TypeBinding type , boolean forceRawEnclosingType ) { int dimension ; TypeBinding originalType ; switch ( type . kind ( ) ) { case Binding . BASE_TYPE : case Binding . TYPE_PARAMETER : case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : case Binding . RAW_TYPE : return type ; case Binding . ARRAY_TYPE : dimension = type . dimensions ( ) ; originalType = type . leafComponentType ( ) ; break ; default : if ( type . id == TypeIds . T_JavaLangObject ) return type ; dimension = <NUM_LIT:0> ; originalType = type ; } boolean needToConvert ; switch ( originalType . kind ( ) ) { case Binding . BASE_TYPE : return type ; case Binding . GENERIC_TYPE : needToConvert = true ; break ; case Binding . PARAMETERIZED_TYPE : ParameterizedTypeBinding paramType = ( ParameterizedTypeBinding ) originalType ; needToConvert = paramType . genericType ( ) . isGenericType ( ) ; break ; default : needToConvert = false ; break ; } ReferenceBinding originalEnclosing = originalType . enclosingType ( ) ; TypeBinding convertedType ; if ( originalEnclosing == null ) { convertedType = needToConvert ? createRawType ( ( ReferenceBinding ) originalType . erasure ( ) , null ) : originalType ; } else { ReferenceBinding convertedEnclosing ; if ( originalEnclosing . kind ( ) == Binding . RAW_TYPE ) { needToConvert |= ! ( ( ReferenceBinding ) originalType ) . isStatic ( ) ; convertedEnclosing = originalEnclosing ; } else if ( forceRawEnclosingType && ! needToConvert ) { convertedEnclosing = ( ReferenceBinding ) convertToRawType ( originalEnclosing , forceRawEnclosingType ) ; needToConvert = originalEnclosing != convertedEnclosing ; } else if ( needToConvert || ( ( ReferenceBinding ) originalType ) . isStatic ( ) ) { convertedEnclosing = ( ReferenceBinding ) convertToRawType ( originalEnclosing , false ) ; } else { convertedEnclosing = convertToParameterizedType ( originalEnclosing ) ; } if ( needToConvert ) { convertedType = createRawType ( ( ReferenceBinding ) originalType . erasure ( ) , convertedEnclosing ) ; } else if ( originalEnclosing != convertedEnclosing ) { convertedType = createParameterizedType ( ( ReferenceBinding ) originalType . erasure ( ) , null , convertedEnclosing ) ; } else { convertedType = originalType ; } } if ( originalType != convertedType ) { return dimension > <NUM_LIT:0> ? ( TypeBinding ) createArrayType ( convertedType , dimension ) : convertedType ; } return type ; } public ReferenceBinding [ ] convertToRawTypes ( ReferenceBinding [ ] originalTypes , boolean forceErasure , boolean forceRawEnclosingType ) { if ( originalTypes == null ) return null ; ReferenceBinding [ ] convertedTypes = originalTypes ; for ( int i = <NUM_LIT:0> , length = originalTypes . length ; i < length ; i ++ ) { ReferenceBinding originalType = originalTypes [ i ] ; ReferenceBinding convertedType = ( ReferenceBinding ) convertToRawType ( forceErasure ? originalType . erasure ( ) : originalType , forceRawEnclosingType ) ; if ( convertedType != originalType ) { if ( convertedTypes == originalTypes ) { System . arraycopy ( originalTypes , <NUM_LIT:0> , convertedTypes = new ReferenceBinding [ length ] , <NUM_LIT:0> , i ) ; } convertedTypes [ i ] = convertedType ; } else if ( convertedTypes != originalTypes ) { convertedTypes [ i ] = originalType ; } } return convertedTypes ; } public TypeBinding convertUnresolvedBinaryToRawType ( TypeBinding type ) { int dimension ; TypeBinding originalType ; switch ( type . kind ( ) ) { case Binding . BASE_TYPE : case Binding . TYPE_PARAMETER : case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : case Binding . RAW_TYPE : return type ; case Binding . ARRAY_TYPE : dimension = type . dimensions ( ) ; originalType = type . leafComponentType ( ) ; break ; default : if ( type . id == TypeIds . T_JavaLangObject ) return type ; dimension = <NUM_LIT:0> ; originalType = type ; } boolean needToConvert ; switch ( originalType . kind ( ) ) { case Binding . BASE_TYPE : return type ; case Binding . GENERIC_TYPE : needToConvert = true ; break ; case Binding . PARAMETERIZED_TYPE : ParameterizedTypeBinding paramType = ( ParameterizedTypeBinding ) originalType ; needToConvert = paramType . genericType ( ) . isGenericType ( ) ; break ; default : needToConvert = false ; break ; } ReferenceBinding originalEnclosing = originalType . enclosingType ( ) ; TypeBinding convertedType ; if ( originalEnclosing == null ) { convertedType = needToConvert ? createRawType ( ( ReferenceBinding ) originalType . erasure ( ) , null ) : originalType ; } else { ReferenceBinding convertedEnclosing = ( ReferenceBinding ) convertUnresolvedBinaryToRawType ( originalEnclosing ) ; if ( convertedEnclosing != originalEnclosing ) { needToConvert |= ! ( ( ReferenceBinding ) originalType ) . isStatic ( ) ; } if ( needToConvert ) { convertedType = createRawType ( ( ReferenceBinding ) originalType . erasure ( ) , convertedEnclosing ) ; } else if ( originalEnclosing != convertedEnclosing ) { convertedType = createParameterizedType ( ( ReferenceBinding ) originalType . erasure ( ) , null , convertedEnclosing ) ; } else { convertedType = originalType ; } } if ( originalType != convertedType ) { return dimension > <NUM_LIT:0> ? ( TypeBinding ) createArrayType ( convertedType , dimension ) : convertedType ; } return type ; } public AnnotationBinding createAnnotation ( ReferenceBinding annotationType , ElementValuePair [ ] pairs ) { if ( pairs . length != <NUM_LIT:0> ) { AnnotationBinding . setMethodBindings ( annotationType , pairs ) ; } return new AnnotationBinding ( annotationType , pairs ) ; } public ArrayBinding createArrayType ( TypeBinding leafComponentType , int dimensionCount ) { if ( leafComponentType instanceof LocalTypeBinding ) return ( ( LocalTypeBinding ) leafComponentType ) . createArrayType ( dimensionCount , this ) ; int dimIndex = dimensionCount - <NUM_LIT:1> ; int length = this . uniqueArrayBindings . length ; ArrayBinding [ ] arrayBindings ; if ( dimIndex < length ) { if ( ( arrayBindings = this . uniqueArrayBindings [ dimIndex ] ) == null ) this . uniqueArrayBindings [ dimIndex ] = arrayBindings = new ArrayBinding [ <NUM_LIT:10> ] ; } else { System . arraycopy ( this . uniqueArrayBindings , <NUM_LIT:0> , this . uniqueArrayBindings = new ArrayBinding [ dimensionCount ] [ ] , <NUM_LIT:0> , length ) ; this . uniqueArrayBindings [ dimIndex ] = arrayBindings = new ArrayBinding [ <NUM_LIT:10> ] ; } int index = - <NUM_LIT:1> ; length = arrayBindings . length ; while ( ++ index < length ) { ArrayBinding currentBinding = arrayBindings [ index ] ; if ( currentBinding == null ) return arrayBindings [ index ] = new ArrayBinding ( leafComponentType , dimensionCount , this ) ; if ( currentBinding . leafComponentType == leafComponentType ) return currentBinding ; } System . arraycopy ( arrayBindings , <NUM_LIT:0> , ( arrayBindings = new ArrayBinding [ length * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; this . uniqueArrayBindings [ dimIndex ] = arrayBindings ; return arrayBindings [ length ] = new ArrayBinding ( leafComponentType , dimensionCount , this ) ; } public BinaryTypeBinding createBinaryTypeFrom ( IBinaryType binaryType , PackageBinding packageBinding , AccessRestriction accessRestriction ) { return createBinaryTypeFrom ( binaryType , packageBinding , true , accessRestriction ) ; } public BinaryTypeBinding createBinaryTypeFrom ( IBinaryType binaryType , PackageBinding packageBinding , boolean needFieldsAndMethods , AccessRestriction accessRestriction ) { BinaryTypeBinding binaryBinding = new BinaryTypeBinding ( packageBinding , binaryType , this ) ; ReferenceBinding cachedType = packageBinding . getType0 ( binaryBinding . compoundName [ binaryBinding . compoundName . length - <NUM_LIT:1> ] ) ; if ( cachedType != null ) { if ( cachedType instanceof UnresolvedReferenceBinding ) { ( ( UnresolvedReferenceBinding ) cachedType ) . setResolvedType ( binaryBinding , this ) ; } else { if ( cachedType . isBinaryBinding ( ) ) return ( BinaryTypeBinding ) cachedType ; return null ; } } packageBinding . addType ( binaryBinding ) ; setAccessRestriction ( binaryBinding , accessRestriction ) ; binaryBinding . cachePartsFrom ( binaryType , needFieldsAndMethods ) ; return binaryBinding ; } public MissingTypeBinding createMissingType ( PackageBinding packageBinding , char [ ] [ ] compoundName ) { if ( packageBinding == null ) { packageBinding = computePackageFrom ( compoundName , true ) ; if ( packageBinding == TheNotFoundPackage ) packageBinding = this . defaultPackage ; } MissingTypeBinding missingType = new MissingTypeBinding ( packageBinding , compoundName , this ) ; if ( missingType . id != TypeIds . T_JavaLangObject ) { ReferenceBinding objectType = getType ( TypeConstants . JAVA_LANG_OBJECT ) ; if ( objectType == null ) { objectType = createMissingType ( null , TypeConstants . JAVA_LANG_OBJECT ) ; } missingType . setMissingSuperclass ( objectType ) ; } packageBinding . addType ( missingType ) ; if ( this . missingTypes == null ) this . missingTypes = new ArrayList ( <NUM_LIT:3> ) ; this . missingTypes . add ( missingType ) ; return missingType ; } public PackageBinding createPackage ( char [ ] [ ] compoundName ) { PackageBinding packageBinding = getPackage0 ( compoundName [ <NUM_LIT:0> ] ) ; if ( packageBinding == null || packageBinding == TheNotFoundPackage ) { packageBinding = new PackageBinding ( compoundName [ <NUM_LIT:0> ] , this ) ; this . knownPackages . put ( compoundName [ <NUM_LIT:0> ] , packageBinding ) ; } for ( int i = <NUM_LIT:1> , length = compoundName . length ; i < length ; i ++ ) { ReferenceBinding type = packageBinding . getType0 ( compoundName [ i ] ) ; if ( type != null && type != TheNotFoundType && ! ( type instanceof UnresolvedReferenceBinding ) ) return null ; PackageBinding parent = packageBinding ; if ( ( packageBinding = parent . getPackage0 ( compoundName [ i ] ) ) == null || packageBinding == TheNotFoundPackage ) { if ( this . nameEnvironment . findType ( compoundName [ i ] , parent . compoundName ) != null ) return null ; packageBinding = new PackageBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , i + <NUM_LIT:1> ) , parent , this ) ; parent . addPackage ( packageBinding ) ; } } return packageBinding ; } public ParameterizedGenericMethodBinding createParameterizedGenericMethod ( MethodBinding genericMethod , RawTypeBinding rawType ) { ParameterizedGenericMethodBinding [ ] cachedInfo = ( ParameterizedGenericMethodBinding [ ] ) this . uniqueParameterizedGenericMethodBindings . get ( genericMethod ) ; boolean needToGrow = false ; int index = <NUM_LIT:0> ; if ( cachedInfo != null ) { nextCachedMethod : for ( int max = cachedInfo . length ; index < max ; index ++ ) { ParameterizedGenericMethodBinding cachedMethod = cachedInfo [ index ] ; if ( cachedMethod == null ) break nextCachedMethod ; if ( ! cachedMethod . isRaw ) continue nextCachedMethod ; if ( cachedMethod . declaringClass != ( rawType == null ? genericMethod . declaringClass : rawType ) ) continue nextCachedMethod ; return cachedMethod ; } needToGrow = true ; } else { cachedInfo = new ParameterizedGenericMethodBinding [ <NUM_LIT:5> ] ; this . uniqueParameterizedGenericMethodBindings . put ( genericMethod , cachedInfo ) ; } int length = cachedInfo . length ; if ( needToGrow && index == length ) { System . arraycopy ( cachedInfo , <NUM_LIT:0> , cachedInfo = new ParameterizedGenericMethodBinding [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; this . uniqueParameterizedGenericMethodBindings . put ( genericMethod , cachedInfo ) ; } ParameterizedGenericMethodBinding parameterizedGenericMethod = new ParameterizedGenericMethodBinding ( genericMethod , rawType , this ) ; cachedInfo [ index ] = parameterizedGenericMethod ; return parameterizedGenericMethod ; } public ParameterizedGenericMethodBinding createParameterizedGenericMethod ( MethodBinding genericMethod , TypeBinding [ ] typeArguments ) { ParameterizedGenericMethodBinding [ ] cachedInfo = ( ParameterizedGenericMethodBinding [ ] ) this . uniqueParameterizedGenericMethodBindings . get ( genericMethod ) ; int argLength = typeArguments == null ? <NUM_LIT:0> : typeArguments . length ; boolean needToGrow = false ; int index = <NUM_LIT:0> ; if ( cachedInfo != null ) { nextCachedMethod : for ( int max = cachedInfo . length ; index < max ; index ++ ) { ParameterizedGenericMethodBinding cachedMethod = cachedInfo [ index ] ; if ( cachedMethod == null ) break nextCachedMethod ; if ( cachedMethod . isRaw ) continue nextCachedMethod ; TypeBinding [ ] cachedArguments = cachedMethod . typeArguments ; int cachedArgLength = cachedArguments == null ? <NUM_LIT:0> : cachedArguments . length ; if ( argLength != cachedArgLength ) continue nextCachedMethod ; for ( int j = <NUM_LIT:0> ; j < cachedArgLength ; j ++ ) { if ( typeArguments [ j ] != cachedArguments [ j ] ) continue nextCachedMethod ; } return cachedMethod ; } needToGrow = true ; } else { cachedInfo = new ParameterizedGenericMethodBinding [ <NUM_LIT:5> ] ; this . uniqueParameterizedGenericMethodBindings . put ( genericMethod , cachedInfo ) ; } int length = cachedInfo . length ; if ( needToGrow && index == length ) { System . arraycopy ( cachedInfo , <NUM_LIT:0> , cachedInfo = new ParameterizedGenericMethodBinding [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; this . uniqueParameterizedGenericMethodBindings . put ( genericMethod , cachedInfo ) ; } ParameterizedGenericMethodBinding parameterizedGenericMethod = new ParameterizedGenericMethodBinding ( genericMethod , typeArguments , this ) ; cachedInfo [ index ] = parameterizedGenericMethod ; return parameterizedGenericMethod ; } public PolymorphicMethodBinding createPolymorphicMethod ( MethodBinding originalPolymorphicMethod , TypeBinding [ ] parameters ) { String key = new String ( originalPolymorphicMethod . selector ) ; PolymorphicMethodBinding [ ] cachedInfo = ( PolymorphicMethodBinding [ ] ) this . uniquePolymorphicMethodBindings . get ( key ) ; int parametersLength = parameters == null ? <NUM_LIT:0> : parameters . length ; TypeBinding [ ] parametersTypeBinding = new TypeBinding [ parametersLength ] ; for ( int i = <NUM_LIT:0> ; i < parametersLength ; i ++ ) { TypeBinding parameterTypeBinding = parameters [ i ] ; if ( parameterTypeBinding . id == TypeIds . T_null ) { parametersTypeBinding [ i ] = getType ( JAVA_LANG_VOID ) ; } else { parametersTypeBinding [ i ] = parameterTypeBinding . erasure ( ) ; } } boolean needToGrow = false ; int index = <NUM_LIT:0> ; if ( cachedInfo != null ) { nextCachedMethod : for ( int max = cachedInfo . length ; index < max ; index ++ ) { PolymorphicMethodBinding cachedMethod = cachedInfo [ index ] ; if ( cachedMethod == null ) { break nextCachedMethod ; } if ( cachedMethod . matches ( parametersTypeBinding , originalPolymorphicMethod . returnType ) ) { return cachedMethod ; } } needToGrow = true ; } else { cachedInfo = new PolymorphicMethodBinding [ <NUM_LIT:5> ] ; this . uniquePolymorphicMethodBindings . put ( key , cachedInfo ) ; } int length = cachedInfo . length ; if ( needToGrow && index == length ) { System . arraycopy ( cachedInfo , <NUM_LIT:0> , cachedInfo = new PolymorphicMethodBinding [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; this . uniquePolymorphicMethodBindings . put ( key , cachedInfo ) ; } PolymorphicMethodBinding polymorphicMethod = new PolymorphicMethodBinding ( originalPolymorphicMethod , parametersTypeBinding ) ; cachedInfo [ index ] = polymorphicMethod ; return polymorphicMethod ; } public MethodBinding updatePolymorphicMethodReturnType ( PolymorphicMethodBinding binding , TypeBinding typeBinding ) { String key = new String ( binding . selector ) ; PolymorphicMethodBinding [ ] cachedInfo = ( PolymorphicMethodBinding [ ] ) this . uniquePolymorphicMethodBindings . get ( key ) ; boolean needToGrow = false ; int index = <NUM_LIT:0> ; TypeBinding [ ] parameters = binding . parameters ; if ( cachedInfo != null ) { nextCachedMethod : for ( int max = cachedInfo . length ; index < max ; index ++ ) { PolymorphicMethodBinding cachedMethod = cachedInfo [ index ] ; if ( cachedMethod == null ) { break nextCachedMethod ; } if ( cachedMethod . matches ( parameters , typeBinding ) ) { return cachedMethod ; } } needToGrow = true ; } else { cachedInfo = new PolymorphicMethodBinding [ <NUM_LIT:5> ] ; this . uniquePolymorphicMethodBindings . put ( key , cachedInfo ) ; } int length = cachedInfo . length ; if ( needToGrow && index == length ) { System . arraycopy ( cachedInfo , <NUM_LIT:0> , cachedInfo = new PolymorphicMethodBinding [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; this . uniquePolymorphicMethodBindings . put ( key , cachedInfo ) ; } PolymorphicMethodBinding polymorphicMethod = new PolymorphicMethodBinding ( binding . original ( ) , typeBinding , parameters ) ; cachedInfo [ index ] = polymorphicMethod ; return polymorphicMethod ; } public ParameterizedMethodBinding createGetClassMethod ( TypeBinding receiverType , MethodBinding originalMethod , Scope scope ) { ParameterizedMethodBinding retVal = null ; if ( this . uniqueGetClassMethodBinding == null ) { this . uniqueGetClassMethodBinding = new SimpleLookupTable ( <NUM_LIT:3> ) ; } else { retVal = ( ParameterizedMethodBinding ) this . uniqueGetClassMethodBinding . get ( receiverType ) ; } if ( retVal == null ) { retVal = ParameterizedMethodBinding . instantiateGetClass ( receiverType , originalMethod , scope ) ; this . uniqueGetClassMethodBinding . put ( receiverType , retVal ) ; } return retVal ; } public ParameterizedTypeBinding createParameterizedType ( ReferenceBinding genericType , TypeBinding [ ] typeArguments , ReferenceBinding enclosingType ) { ParameterizedTypeBinding [ ] cachedInfo = ( ParameterizedTypeBinding [ ] ) this . uniqueParameterizedTypeBindings . get ( genericType ) ; int argLength = typeArguments == null ? <NUM_LIT:0> : typeArguments . length ; boolean needToGrow = false ; int index = <NUM_LIT:0> ; if ( cachedInfo != null ) { nextCachedType : for ( int max = cachedInfo . length ; index < max ; index ++ ) { ParameterizedTypeBinding cachedType = cachedInfo [ index ] ; if ( cachedType == null ) break nextCachedType ; if ( cachedType . actualType ( ) != genericType ) continue nextCachedType ; if ( cachedType . enclosingType ( ) != enclosingType ) continue nextCachedType ; TypeBinding [ ] cachedArguments = cachedType . arguments ; int cachedArgLength = cachedArguments == null ? <NUM_LIT:0> : cachedArguments . length ; if ( argLength != cachedArgLength ) continue nextCachedType ; for ( int j = <NUM_LIT:0> ; j < cachedArgLength ; j ++ ) { if ( typeArguments [ j ] != cachedArguments [ j ] ) continue nextCachedType ; } return cachedType ; } needToGrow = true ; } else { cachedInfo = new ParameterizedTypeBinding [ <NUM_LIT:5> ] ; this . uniqueParameterizedTypeBindings . put ( genericType , cachedInfo ) ; } int length = cachedInfo . length ; if ( needToGrow && index == length ) { System . arraycopy ( cachedInfo , <NUM_LIT:0> , cachedInfo = new ParameterizedTypeBinding [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; this . uniqueParameterizedTypeBindings . put ( genericType , cachedInfo ) ; } ParameterizedTypeBinding parameterizedType = new ParameterizedTypeBinding ( genericType , typeArguments , enclosingType , this ) ; cachedInfo [ index ] = parameterizedType ; return parameterizedType ; } public RawTypeBinding createRawType ( ReferenceBinding genericType , ReferenceBinding enclosingType ) { RawTypeBinding [ ] cachedInfo = ( RawTypeBinding [ ] ) this . uniqueRawTypeBindings . get ( genericType ) ; boolean needToGrow = false ; int index = <NUM_LIT:0> ; if ( cachedInfo != null ) { nextCachedType : for ( int max = cachedInfo . length ; index < max ; index ++ ) { RawTypeBinding cachedType = cachedInfo [ index ] ; if ( cachedType == null ) break nextCachedType ; if ( cachedType . actualType ( ) != genericType ) continue nextCachedType ; if ( cachedType . enclosingType ( ) != enclosingType ) continue nextCachedType ; return cachedType ; } needToGrow = true ; } else { cachedInfo = new RawTypeBinding [ <NUM_LIT:1> ] ; this . uniqueRawTypeBindings . put ( genericType , cachedInfo ) ; } int length = cachedInfo . length ; if ( needToGrow && index == length ) { System . arraycopy ( cachedInfo , <NUM_LIT:0> , cachedInfo = new RawTypeBinding [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; this . uniqueRawTypeBindings . put ( genericType , cachedInfo ) ; } RawTypeBinding rawType = new RawTypeBinding ( genericType , enclosingType , this ) ; cachedInfo [ index ] = rawType ; return rawType ; } public WildcardBinding createWildcard ( ReferenceBinding genericType , int rank , TypeBinding bound , TypeBinding [ ] otherBounds , int boundKind ) { if ( genericType == null ) genericType = ReferenceBinding . LUB_GENERIC ; WildcardBinding [ ] cachedInfo = ( WildcardBinding [ ] ) this . uniqueWildcardBindings . get ( genericType ) ; boolean needToGrow = false ; int index = <NUM_LIT:0> ; if ( cachedInfo != null ) { nextCachedType : for ( int max = cachedInfo . length ; index < max ; index ++ ) { WildcardBinding cachedType = cachedInfo [ index ] ; if ( cachedType == null ) break nextCachedType ; if ( cachedType . genericType != genericType ) continue nextCachedType ; if ( cachedType . rank != rank ) continue nextCachedType ; if ( cachedType . boundKind != boundKind ) continue nextCachedType ; if ( cachedType . bound != bound ) continue nextCachedType ; if ( cachedType . otherBounds != otherBounds ) { int cachedLength = cachedType . otherBounds == null ? <NUM_LIT:0> : cachedType . otherBounds . length ; int length = otherBounds == null ? <NUM_LIT:0> : otherBounds . length ; if ( cachedLength != length ) continue nextCachedType ; for ( int j = <NUM_LIT:0> ; j < length ; j ++ ) { if ( cachedType . otherBounds [ j ] != otherBounds [ j ] ) continue nextCachedType ; } } return cachedType ; } needToGrow = true ; } else { cachedInfo = new WildcardBinding [ <NUM_LIT:10> ] ; this . uniqueWildcardBindings . put ( genericType , cachedInfo ) ; } int length = cachedInfo . length ; if ( needToGrow && index == length ) { System . arraycopy ( cachedInfo , <NUM_LIT:0> , cachedInfo = new WildcardBinding [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; this . uniqueWildcardBindings . put ( genericType , cachedInfo ) ; } WildcardBinding wildcard = new WildcardBinding ( genericType , rank , bound , otherBounds , boundKind , this ) ; cachedInfo [ index ] = wildcard ; return wildcard ; } public AccessRestriction getAccessRestriction ( TypeBinding type ) { return ( AccessRestriction ) this . accessRestrictions . get ( type ) ; } public ReferenceBinding getCachedType ( char [ ] [ ] compoundName ) { if ( compoundName . length == <NUM_LIT:1> ) { return this . defaultPackage . getType0 ( compoundName [ <NUM_LIT:0> ] ) ; } PackageBinding packageBinding = getPackage0 ( compoundName [ <NUM_LIT:0> ] ) ; if ( packageBinding == null || packageBinding == TheNotFoundPackage ) return null ; for ( int i = <NUM_LIT:1> , packageLength = compoundName . length - <NUM_LIT:1> ; i < packageLength ; i ++ ) if ( ( packageBinding = packageBinding . getPackage0 ( compoundName [ i ] ) ) == null || packageBinding == TheNotFoundPackage ) return null ; return packageBinding . getType0 ( compoundName [ compoundName . length - <NUM_LIT:1> ] ) ; } PackageBinding getPackage0 ( char [ ] name ) { return this . knownPackages . get ( name ) ; } public ReferenceBinding getResolvedType ( char [ ] [ ] compoundName , Scope scope ) { ReferenceBinding type = getType ( compoundName ) ; if ( type != null ) return type ; this . problemReporter . isClassPathCorrect ( compoundName , scope == null ? this . unitBeingCompleted : scope . referenceCompilationUnit ( ) , this . missingClassFileLocation ) ; return createMissingType ( null , compoundName ) ; } PackageBinding getTopLevelPackage ( char [ ] name ) { PackageBinding packageBinding = getPackage0 ( name ) ; if ( packageBinding != null ) { if ( packageBinding == TheNotFoundPackage ) return null ; return packageBinding ; } if ( this . nameEnvironment . isPackage ( null , name ) ) { this . knownPackages . put ( name , packageBinding = new PackageBinding ( name , this ) ) ; return packageBinding ; } this . knownPackages . put ( name , TheNotFoundPackage ) ; return null ; } public ReferenceBinding getType ( char [ ] [ ] compoundName ) { ReferenceBinding referenceBinding ; if ( compoundName . length == <NUM_LIT:1> ) { if ( ( referenceBinding = this . defaultPackage . getType0 ( compoundName [ <NUM_LIT:0> ] ) ) == null ) { PackageBinding packageBinding = getPackage0 ( compoundName [ <NUM_LIT:0> ] ) ; if ( packageBinding != null && packageBinding != TheNotFoundPackage ) return null ; referenceBinding = askForType ( this . defaultPackage , compoundName [ <NUM_LIT:0> ] ) ; } } else { PackageBinding packageBinding = getPackage0 ( compoundName [ <NUM_LIT:0> ] ) ; if ( packageBinding == TheNotFoundPackage ) return null ; if ( packageBinding != null ) { for ( int i = <NUM_LIT:1> , packageLength = compoundName . length - <NUM_LIT:1> ; i < packageLength ; i ++ ) { if ( ( packageBinding = packageBinding . getPackage0 ( compoundName [ i ] ) ) == null ) break ; if ( packageBinding == TheNotFoundPackage ) return null ; } } if ( packageBinding == null ) referenceBinding = askForType ( compoundName ) ; else if ( ( referenceBinding = packageBinding . getType0 ( compoundName [ compoundName . length - <NUM_LIT:1> ] ) ) == null ) referenceBinding = askForType ( packageBinding , compoundName [ compoundName . length - <NUM_LIT:1> ] ) ; } if ( referenceBinding == null || referenceBinding == TheNotFoundType ) return null ; referenceBinding = ( ReferenceBinding ) BinaryTypeBinding . resolveType ( referenceBinding , this , false ) ; if ( referenceBinding . isNestedType ( ) ) return new ProblemReferenceBinding ( compoundName , referenceBinding , InternalNameProvided ) ; return referenceBinding ; } private TypeBinding [ ] getTypeArgumentsFromSignature ( SignatureWrapper wrapper , TypeVariableBinding [ ] staticVariables , ReferenceBinding enclosingType , ReferenceBinding genericType , char [ ] [ ] [ ] missingTypeNames ) { java . util . ArrayList args = new java . util . ArrayList ( <NUM_LIT:2> ) ; int rank = <NUM_LIT:0> ; do { args . add ( getTypeFromVariantTypeSignature ( wrapper , staticVariables , enclosingType , genericType , rank ++ , missingTypeNames ) ) ; } while ( wrapper . signature [ wrapper . start ] != '<CHAR_LIT:>>' ) ; wrapper . start ++ ; TypeBinding [ ] typeArguments = new TypeBinding [ args . size ( ) ] ; args . toArray ( typeArguments ) ; return typeArguments ; } private ReferenceBinding getTypeFromCompoundName ( char [ ] [ ] compoundName , boolean isParameterized , boolean wasMissingType ) { ReferenceBinding binding = getCachedType ( compoundName ) ; if ( binding == null ) { PackageBinding packageBinding = computePackageFrom ( compoundName , false ) ; binding = new UnresolvedReferenceBinding ( compoundName , packageBinding ) ; if ( wasMissingType ) { binding . tagBits |= TagBits . HasMissingType ; } packageBinding . addType ( binding ) ; } else if ( binding == TheNotFoundType ) { if ( ! wasMissingType ) { this . problemReporter . isClassPathCorrect ( compoundName , this . unitBeingCompleted , this . missingClassFileLocation ) ; } binding = createMissingType ( null , compoundName ) ; } else if ( ! isParameterized ) { binding = ( ReferenceBinding ) convertUnresolvedBinaryToRawType ( binding ) ; } return binding ; } ReferenceBinding getTypeFromConstantPoolName ( char [ ] signature , int start , int end , boolean isParameterized , char [ ] [ ] [ ] missingTypeNames ) { if ( end == - <NUM_LIT:1> ) end = signature . length ; char [ ] [ ] compoundName = CharOperation . splitOn ( '<CHAR_LIT:/>' , signature , start , end ) ; boolean wasMissingType = false ; if ( missingTypeNames != null ) { for ( int i = <NUM_LIT:0> , max = missingTypeNames . length ; i < max ; i ++ ) { if ( CharOperation . equals ( compoundName , missingTypeNames [ i ] ) ) { wasMissingType = true ; break ; } } } return getTypeFromCompoundName ( compoundName , isParameterized , wasMissingType ) ; } TypeBinding getTypeFromSignature ( char [ ] signature , int start , int end , boolean isParameterized , TypeBinding enclosingType , char [ ] [ ] [ ] missingTypeNames ) { int dimension = <NUM_LIT:0> ; while ( signature [ start ] == '<CHAR_LIT:[>' ) { start ++ ; dimension ++ ; } if ( end == - <NUM_LIT:1> ) end = signature . length - <NUM_LIT:1> ; TypeBinding binding = null ; if ( start == end ) { switch ( signature [ start ] ) { 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 ; default : this . problemReporter . corruptedSignature ( enclosingType , signature , start ) ; } } else { binding = getTypeFromConstantPoolName ( signature , start + <NUM_LIT:1> , end , isParameterized , missingTypeNames ) ; } if ( dimension == <NUM_LIT:0> ) return binding ; return createArrayType ( binding , dimension ) ; } public TypeBinding getTypeFromTypeSignature ( SignatureWrapper wrapper , TypeVariableBinding [ ] staticVariables , ReferenceBinding enclosingType , char [ ] [ ] [ ] missingTypeNames ) { int dimension = <NUM_LIT:0> ; while ( wrapper . signature [ wrapper . start ] == '<CHAR_LIT:[>' ) { wrapper . start ++ ; dimension ++ ; } if ( wrapper . signature [ wrapper . start ] == '<CHAR_LIT>' ) { int varStart = wrapper . start + <NUM_LIT:1> ; int varEnd = wrapper . computeEnd ( ) ; for ( int i = staticVariables . length ; -- i >= <NUM_LIT:0> ; ) if ( CharOperation . equals ( staticVariables [ i ] . sourceName , wrapper . signature , varStart , varEnd ) ) return dimension == <NUM_LIT:0> ? ( TypeBinding ) staticVariables [ i ] : createArrayType ( staticVariables [ i ] , dimension ) ; ReferenceBinding initialType = enclosingType ; do { TypeVariableBinding [ ] enclosingTypeVariables ; if ( enclosingType instanceof BinaryTypeBinding ) { enclosingTypeVariables = ( ( BinaryTypeBinding ) enclosingType ) . typeVariables ; } else { enclosingTypeVariables = enclosingType . typeVariables ( ) ; } for ( int i = enclosingTypeVariables . length ; -- i >= <NUM_LIT:0> ; ) if ( CharOperation . equals ( enclosingTypeVariables [ i ] . sourceName , wrapper . signature , varStart , varEnd ) ) return dimension == <NUM_LIT:0> ? ( TypeBinding ) enclosingTypeVariables [ i ] : createArrayType ( enclosingTypeVariables [ i ] , dimension ) ; } while ( ( enclosingType = enclosingType . enclosingType ( ) ) != null ) ; this . problemReporter . undefinedTypeVariableSignature ( CharOperation . subarray ( wrapper . signature , varStart , varEnd ) , initialType ) ; return null ; } boolean isParameterized ; TypeBinding type = getTypeFromSignature ( wrapper . signature , wrapper . start , wrapper . computeEnd ( ) , isParameterized = ( wrapper . end == wrapper . bracket ) , enclosingType , missingTypeNames ) ; if ( ! isParameterized ) return dimension == <NUM_LIT:0> ? type : createArrayType ( type , dimension ) ; ReferenceBinding actualType = ( ReferenceBinding ) type ; if ( actualType instanceof UnresolvedReferenceBinding ) if ( CharOperation . indexOf ( '<CHAR_LIT>' , actualType . compoundName [ actualType . compoundName . length - <NUM_LIT:1> ] ) > <NUM_LIT:0> ) actualType = ( ReferenceBinding ) BinaryTypeBinding . resolveType ( actualType , this , false ) ; ReferenceBinding actualEnclosing = actualType . enclosingType ( ) ; if ( actualEnclosing != null ) { actualEnclosing = ( ReferenceBinding ) convertToRawType ( actualEnclosing , false ) ; } TypeBinding [ ] typeArguments = getTypeArgumentsFromSignature ( wrapper , staticVariables , enclosingType , actualType , missingTypeNames ) ; ParameterizedTypeBinding parameterizedType = createParameterizedType ( actualType , typeArguments , actualEnclosing ) ; while ( wrapper . signature [ wrapper . start ] == '<CHAR_LIT:.>' ) { wrapper . start ++ ; int memberStart = wrapper . start ; char [ ] memberName = wrapper . nextWord ( ) ; BinaryTypeBinding . resolveType ( parameterizedType , this , false ) ; ReferenceBinding memberType = parameterizedType . genericType ( ) . getMemberType ( memberName ) ; if ( memberType == null ) this . problemReporter . corruptedSignature ( parameterizedType , wrapper . signature , memberStart ) ; if ( wrapper . signature [ wrapper . start ] == '<CHAR_LIT>' ) { wrapper . start ++ ; typeArguments = getTypeArgumentsFromSignature ( wrapper , staticVariables , enclosingType , memberType , missingTypeNames ) ; } else { typeArguments = null ; } parameterizedType = createParameterizedType ( memberType , typeArguments , parameterizedType ) ; } wrapper . start ++ ; return dimension == <NUM_LIT:0> ? ( TypeBinding ) parameterizedType : createArrayType ( parameterizedType , dimension ) ; } TypeBinding getTypeFromVariantTypeSignature ( SignatureWrapper wrapper , TypeVariableBinding [ ] staticVariables , ReferenceBinding enclosingType , ReferenceBinding genericType , int rank , char [ ] [ ] [ ] missingTypeNames ) { switch ( wrapper . signature [ wrapper . start ] ) { case '<CHAR_LIT:->' : wrapper . start ++ ; TypeBinding bound = getTypeFromTypeSignature ( wrapper , staticVariables , enclosingType , missingTypeNames ) ; return createWildcard ( genericType , rank , bound , null , Wildcard . SUPER ) ; case '<CHAR_LIT>' : wrapper . start ++ ; bound = getTypeFromTypeSignature ( wrapper , staticVariables , enclosingType , missingTypeNames ) ; return createWildcard ( genericType , rank , bound , null , Wildcard . EXTENDS ) ; case '<CHAR_LIT>' : wrapper . start ++ ; return createWildcard ( genericType , rank , null , null , Wildcard . UNBOUND ) ; default : return getTypeFromTypeSignature ( wrapper , staticVariables , enclosingType , missingTypeNames ) ; } } boolean isMissingType ( char [ ] typeName ) { for ( int i = this . missingTypes == null ? <NUM_LIT:0> : this . missingTypes . size ( ) ; -- i >= <NUM_LIT:0> ; ) { MissingTypeBinding missingType = ( MissingTypeBinding ) this . missingTypes . get ( i ) ; if ( CharOperation . equals ( missingType . sourceName , typeName ) ) return true ; } return false ; } boolean isPackage ( char [ ] [ ] compoundName , char [ ] name ) { if ( compoundName == null || compoundName . length == <NUM_LIT:0> ) return this . nameEnvironment . isPackage ( null , name ) ; return this . nameEnvironment . isPackage ( compoundName , name ) ; } public MethodVerifier methodVerifier ( ) { if ( this . verifier == null ) this . verifier = newMethodVerifier ( ) ; return this . verifier ; } public MethodVerifier newMethodVerifier ( ) { return new MethodVerifier15 ( this ) ; } public void releaseClassFiles ( org . eclipse . jdt . internal . compiler . ClassFile [ ] classFiles ) { for ( int i = <NUM_LIT:0> , fileCount = classFiles . length ; i < fileCount ; i ++ ) this . classFilePool . release ( classFiles [ i ] ) ; } public void reset ( ) { this . defaultPackage = new PackageBinding ( this ) ; this . defaultImports = null ; this . knownPackages = new HashtableOfPackage ( ) ; this . accessRestrictions = new HashMap ( <NUM_LIT:3> ) ; this . verifier = null ; for ( int i = this . uniqueArrayBindings . length ; -- i >= <NUM_LIT:0> ; ) { ArrayBinding [ ] arrayBindings = this . uniqueArrayBindings [ i ] ; if ( arrayBindings != null ) for ( int j = arrayBindings . length ; -- j >= <NUM_LIT:0> ; ) arrayBindings [ j ] = null ; } this . uniqueParameterizedTypeBindings = new SimpleLookupTable ( <NUM_LIT:3> ) ; this . uniqueRawTypeBindings = new SimpleLookupTable ( <NUM_LIT:3> ) ; this . uniqueWildcardBindings = new SimpleLookupTable ( <NUM_LIT:3> ) ; this . uniqueParameterizedGenericMethodBindings = new SimpleLookupTable ( <NUM_LIT:3> ) ; this . uniquePolymorphicMethodBindings = new SimpleLookupTable ( <NUM_LIT:3> ) ; this . uniqueGetClassMethodBinding = null ; this . missingTypes = null ; this . typesBeingConnected = new HashSet ( ) ; for ( int i = this . units . length ; -- i >= <NUM_LIT:0> ; ) this . units [ i ] = null ; this . lastUnitIndex = - <NUM_LIT:1> ; this . lastCompletedUnitIndex = - <NUM_LIT:1> ; this . unitBeingCompleted = null ; this . classFilePool . reset ( ) ; } public void setAccessRestriction ( ReferenceBinding type , AccessRestriction accessRestriction ) { if ( accessRestriction == null ) return ; type . modifiers |= ExtraCompilerModifiers . AccRestrictedAccess ; this . accessRestrictions . put ( type , accessRestriction ) ; } void updateCaches ( UnresolvedReferenceBinding unresolvedType , ReferenceBinding resolvedType ) { if ( this . uniqueParameterizedTypeBindings . get ( unresolvedType ) != null ) { Object [ ] keys = this . uniqueParameterizedTypeBindings . keyTable ; for ( int i = <NUM_LIT:0> , l = keys . length ; i < l ; i ++ ) { if ( keys [ i ] == unresolvedType ) { keys [ i ] = resolvedType ; break ; } } } if ( this . uniqueRawTypeBindings . get ( unresolvedType ) != null ) { Object [ ] keys = this . uniqueRawTypeBindings . keyTable ; for ( int i = <NUM_LIT:0> , l = keys . length ; i < l ; i ++ ) { if ( keys [ i ] == unresolvedType ) { keys [ i ] = resolvedType ; break ; } } } if ( this . uniqueWildcardBindings . get ( unresolvedType ) != null ) { Object [ ] keys = this . uniqueWildcardBindings . keyTable ; for ( int i = <NUM_LIT:0> , l = keys . length ; i < l ; i ++ ) { if ( keys [ i ] == unresolvedType ) { keys [ i ] = resolvedType ; break ; } } } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; public class ProblemPackageBinding extends PackageBinding { private int problemId ; ProblemPackageBinding ( char [ ] [ ] compoundName , int problemId ) { this . compoundName = compoundName ; this . problemId = problemId ; } ProblemPackageBinding ( char [ ] name , int problemId ) { this ( new char [ ] [ ] { name } , problemId ) ; } public final int problemId ( ) { return this . problemId ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; public interface InvocationSite { TypeBinding [ ] genericTypeArguments ( ) ; boolean isSuperAccess ( ) ; boolean isTypeAccess ( ) ; void setActualReceiverType ( ReferenceBinding receiverType ) ; void setDepth ( int depth ) ; void setFieldIndex ( int depth ) ; int sourceEnd ( ) ; int sourceStart ( ) ; TypeBinding expectedType ( ) ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; import java . util . List ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . Wildcard ; abstract public class TypeBinding extends Binding { public int id = TypeIds . NoId ; public long tagBits = <NUM_LIT:0> ; public final static BaseTypeBinding INT = new BaseTypeBinding ( TypeIds . T_int , TypeConstants . INT , new char [ ] { '<CHAR_LIT>' } ) ; public final static BaseTypeBinding BYTE = new BaseTypeBinding ( TypeIds . T_byte , TypeConstants . BYTE , new char [ ] { '<CHAR_LIT>' } ) ; public final static BaseTypeBinding SHORT = new BaseTypeBinding ( TypeIds . T_short , TypeConstants . SHORT , new char [ ] { '<CHAR_LIT>' } ) ; public final static BaseTypeBinding CHAR = new BaseTypeBinding ( TypeIds . T_char , TypeConstants . CHAR , new char [ ] { '<CHAR_LIT>' } ) ; public final static BaseTypeBinding LONG = new BaseTypeBinding ( TypeIds . T_long , TypeConstants . LONG , new char [ ] { '<CHAR_LIT>' } ) ; public final static BaseTypeBinding FLOAT = new BaseTypeBinding ( TypeIds . T_float , TypeConstants . FLOAT , new char [ ] { '<CHAR_LIT>' } ) ; public final static BaseTypeBinding DOUBLE = new BaseTypeBinding ( TypeIds . T_double , TypeConstants . DOUBLE , new char [ ] { '<CHAR_LIT>' } ) ; public final static BaseTypeBinding BOOLEAN = new BaseTypeBinding ( TypeIds . T_boolean , TypeConstants . BOOLEAN , new char [ ] { '<CHAR_LIT:Z>' } ) ; public final static BaseTypeBinding NULL = new BaseTypeBinding ( TypeIds . T_null , TypeConstants . NULL , new char [ ] { '<CHAR_LIT>' } ) ; public final static BaseTypeBinding VOID = new BaseTypeBinding ( TypeIds . T_void , TypeConstants . VOID , new char [ ] { '<CHAR_LIT>' } ) ; public static final TypeBinding wellKnownType ( Scope scope , int id ) { switch ( id ) { case TypeIds . T_boolean : return TypeBinding . BOOLEAN ; case TypeIds . T_byte : return TypeBinding . BYTE ; case TypeIds . T_char : return TypeBinding . CHAR ; case TypeIds . T_short : return TypeBinding . SHORT ; case TypeIds . T_double : return TypeBinding . DOUBLE ; case TypeIds . T_float : return TypeBinding . FLOAT ; case TypeIds . T_int : return TypeBinding . INT ; case TypeIds . T_long : return TypeBinding . LONG ; case TypeIds . T_JavaLangObject : return scope . getJavaLangObject ( ) ; case TypeIds . T_JavaLangString : return scope . getJavaLangString ( ) ; default : return null ; } } public boolean canBeInstantiated ( ) { return ! isBaseType ( ) ; } public TypeBinding capture ( Scope scope , int position ) { return this ; } public TypeBinding closestMatch ( ) { return this ; } public List collectMissingTypes ( List missingTypes ) { return missingTypes ; } public void collectSubstitutes ( Scope scope , TypeBinding actualType , InferenceContext inferenceContext , int constraint ) { } public abstract char [ ] constantPoolName ( ) ; public String debugName ( ) { return new String ( readableName ( ) ) ; } public int dimensions ( ) { return <NUM_LIT:0> ; } public ReferenceBinding enclosingType ( ) { return null ; } public TypeBinding erasure ( ) { return this ; } public ReferenceBinding findSuperTypeOriginatingFrom ( int wellKnownOriginalID , boolean originalIsClass ) { if ( ! ( this instanceof ReferenceBinding ) ) return null ; ReferenceBinding reference = ( ReferenceBinding ) this ; if ( reference . id == wellKnownOriginalID || ( original ( ) . id == wellKnownOriginalID ) ) return reference ; ReferenceBinding currentType = reference ; if ( originalIsClass ) { while ( ( currentType = currentType . superclass ( ) ) != null ) { if ( currentType . id == wellKnownOriginalID ) return currentType ; if ( currentType . original ( ) . id == wellKnownOriginalID ) return currentType ; } return null ; } ReferenceBinding [ ] interfacesToVisit = null ; int nextPosition = <NUM_LIT:0> ; do { ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { if ( interfacesToVisit == null ) { interfacesToVisit = itsInterfaces ; nextPosition = interfacesToVisit . length ; } else { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } } while ( ( currentType = currentType . superclass ( ) ) != null ) ; for ( int i = <NUM_LIT:0> ; i < nextPosition ; i ++ ) { currentType = interfacesToVisit [ i ] ; if ( currentType . id == wellKnownOriginalID ) return currentType ; if ( currentType . original ( ) . id == wellKnownOriginalID ) return currentType ; ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } return null ; } public TypeBinding findSuperTypeOriginatingFrom ( TypeBinding otherType ) { if ( this == otherType ) return this ; if ( otherType == null ) return null ; switch ( kind ( ) ) { case Binding . ARRAY_TYPE : ArrayBinding arrayType = ( ArrayBinding ) this ; int otherDim = otherType . dimensions ( ) ; if ( arrayType . dimensions != otherDim ) { switch ( otherType . id ) { case TypeIds . T_JavaLangObject : case TypeIds . T_JavaIoSerializable : case TypeIds . T_JavaLangCloneable : return otherType ; } if ( otherDim < arrayType . dimensions && otherType . leafComponentType ( ) . id == TypeIds . T_JavaLangObject ) { return otherType ; } return null ; } if ( ! ( arrayType . leafComponentType instanceof ReferenceBinding ) ) return null ; TypeBinding leafSuperType = arrayType . leafComponentType . findSuperTypeOriginatingFrom ( otherType . leafComponentType ( ) ) ; if ( leafSuperType == null ) return null ; return arrayType . environment ( ) . createArrayType ( leafSuperType , arrayType . dimensions ) ; case Binding . TYPE_PARAMETER : if ( isCapture ( ) ) { CaptureBinding capture = ( CaptureBinding ) this ; TypeBinding captureBound = capture . firstBound ; if ( captureBound instanceof ArrayBinding ) { TypeBinding match = captureBound . findSuperTypeOriginatingFrom ( otherType ) ; if ( match != null ) return match ; } } case Binding . TYPE : case Binding . PARAMETERIZED_TYPE : case Binding . GENERIC_TYPE : case Binding . RAW_TYPE : case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : otherType = otherType . original ( ) ; if ( this == otherType ) return this ; if ( original ( ) == otherType ) return this ; ReferenceBinding currentType = ( ReferenceBinding ) this ; if ( ! otherType . isInterface ( ) ) { while ( ( currentType = currentType . superclass ( ) ) != null ) { if ( currentType == otherType ) return currentType ; if ( currentType . original ( ) == otherType ) return currentType ; } return null ; } ReferenceBinding [ ] interfacesToVisit = null ; int nextPosition = <NUM_LIT:0> ; do { ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { if ( interfacesToVisit == null ) { interfacesToVisit = itsInterfaces ; nextPosition = interfacesToVisit . length ; } else { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } } while ( ( currentType = currentType . superclass ( ) ) != null ) ; for ( int i = <NUM_LIT:0> ; i < nextPosition ; i ++ ) { currentType = interfacesToVisit [ i ] ; if ( currentType == otherType ) return currentType ; if ( currentType . original ( ) == otherType ) return currentType ; ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } } return null ; } public TypeBinding genericCast ( TypeBinding targetType ) { if ( this == targetType ) return null ; TypeBinding targetErasure = targetType . erasure ( ) ; if ( erasure ( ) . findSuperTypeOriginatingFrom ( targetErasure ) != null ) return null ; return targetErasure ; } public char [ ] genericTypeSignature ( ) { return signature ( ) ; } public TypeBinding getErasureCompatibleType ( TypeBinding declaringClass ) { switch ( kind ( ) ) { case Binding . TYPE_PARAMETER : TypeVariableBinding variable = ( TypeVariableBinding ) this ; if ( variable . erasure ( ) . findSuperTypeOriginatingFrom ( declaringClass ) != null ) { return this ; } if ( variable . superclass != null && variable . superclass . findSuperTypeOriginatingFrom ( declaringClass ) != null ) { return variable . superclass . getErasureCompatibleType ( declaringClass ) ; } for ( int i = <NUM_LIT:0> , otherLength = variable . superInterfaces . length ; i < otherLength ; i ++ ) { ReferenceBinding superInterface = variable . superInterfaces [ i ] ; if ( superInterface . findSuperTypeOriginatingFrom ( declaringClass ) != null ) { return superInterface . getErasureCompatibleType ( declaringClass ) ; } } return this ; case Binding . INTERSECTION_TYPE : WildcardBinding intersection = ( WildcardBinding ) this ; if ( intersection . erasure ( ) . findSuperTypeOriginatingFrom ( declaringClass ) != null ) { return this ; } if ( intersection . superclass != null && intersection . superclass . findSuperTypeOriginatingFrom ( declaringClass ) != null ) { return intersection . superclass . getErasureCompatibleType ( declaringClass ) ; } for ( int i = <NUM_LIT:0> , otherLength = intersection . superInterfaces . length ; i < otherLength ; i ++ ) { ReferenceBinding superInterface = intersection . superInterfaces [ i ] ; if ( superInterface . findSuperTypeOriginatingFrom ( declaringClass ) != null ) { return superInterface . getErasureCompatibleType ( declaringClass ) ; } } return this ; default : return this ; } } public abstract PackageBinding getPackage ( ) ; void initializeForStaticImports ( ) { } public boolean isAnnotationType ( ) { return false ; } public final boolean isAnonymousType ( ) { return ( this . tagBits & TagBits . IsAnonymousType ) != <NUM_LIT:0> ; } public final boolean isArrayType ( ) { return ( this . tagBits & TagBits . IsArrayType ) != <NUM_LIT:0> ; } public final boolean isBaseType ( ) { return ( this . tagBits & TagBits . IsBaseType ) != <NUM_LIT:0> ; } public boolean isBoundParameterizedType ( ) { return ( this . tagBits & TagBits . IsBoundParameterizedType ) != <NUM_LIT:0> ; } public boolean isCapture ( ) { return false ; } public boolean isClass ( ) { return false ; } public abstract boolean isCompatibleWith ( TypeBinding right ) ; public boolean isEnum ( ) { return false ; } public boolean isEquivalentTo ( TypeBinding otherType ) { if ( this == otherType ) return true ; if ( otherType == null ) return false ; switch ( otherType . kind ( ) ) { case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : return ( ( WildcardBinding ) otherType ) . boundCheck ( this ) ; } return false ; } public boolean isGenericType ( ) { return false ; } public final boolean isHierarchyInconsistent ( ) { return ( this . tagBits & TagBits . HierarchyHasProblems ) != <NUM_LIT:0> ; } public boolean isInterface ( ) { return false ; } public boolean isIntersectionType ( ) { return false ; } public final boolean isLocalType ( ) { return ( this . tagBits & TagBits . IsLocalType ) != <NUM_LIT:0> ; } public final boolean isMemberType ( ) { return ( this . tagBits & TagBits . IsMemberType ) != <NUM_LIT:0> ; } public final boolean isNestedType ( ) { return ( this . tagBits & TagBits . IsNestedType ) != <NUM_LIT:0> ; } public final boolean isNumericType ( ) { switch ( this . id ) { case TypeIds . T_int : case TypeIds . T_float : case TypeIds . T_double : case TypeIds . T_short : case TypeIds . T_byte : case TypeIds . T_long : case TypeIds . T_char : return true ; default : return false ; } } public final boolean isParameterizedType ( ) { return kind ( ) == Binding . PARAMETERIZED_TYPE ; } public final boolean isParameterizedTypeWithActualArguments ( ) { return ( kind ( ) == Binding . PARAMETERIZED_TYPE ) && ( ( ParameterizedTypeBinding ) this ) . arguments != null ; } public boolean isParameterizedWithOwnVariables ( ) { if ( kind ( ) != Binding . PARAMETERIZED_TYPE ) return false ; ParameterizedTypeBinding paramType = ( ParameterizedTypeBinding ) this ; if ( paramType . arguments == null ) return false ; TypeVariableBinding [ ] variables = erasure ( ) . typeVariables ( ) ; for ( int i = <NUM_LIT:0> , length = variables . length ; i < length ; i ++ ) { if ( variables [ i ] != paramType . arguments [ i ] ) return false ; } ReferenceBinding enclosing = paramType . enclosingType ( ) ; if ( enclosing != null && enclosing . erasure ( ) . isGenericType ( ) && ! enclosing . isParameterizedWithOwnVariables ( ) ) { return false ; } return true ; } private boolean isProvableDistinctSubType ( TypeBinding otherType ) { if ( otherType . isInterface ( ) ) { if ( isInterface ( ) ) return false ; if ( isArrayType ( ) || ( ( this instanceof ReferenceBinding ) && ( ( ReferenceBinding ) this ) . isFinal ( ) ) || ( isTypeVariable ( ) && ( ( TypeVariableBinding ) this ) . superclass ( ) . isFinal ( ) ) ) { return ! isCompatibleWith ( otherType ) ; } return false ; } else { if ( isInterface ( ) ) { if ( otherType . isArrayType ( ) || ( ( otherType instanceof ReferenceBinding ) && ( ( ReferenceBinding ) otherType ) . isFinal ( ) ) || ( otherType . isTypeVariable ( ) && ( ( TypeVariableBinding ) otherType ) . superclass ( ) . isFinal ( ) ) ) { return ! isCompatibleWith ( otherType ) ; } } else { if ( ! isTypeVariable ( ) && ! otherType . isTypeVariable ( ) ) { return ! isCompatibleWith ( otherType ) ; } } } return false ; } public boolean isProvablyDistinct ( TypeBinding otherType ) { if ( this == otherType ) return false ; if ( otherType == null ) return true ; switch ( kind ( ) ) { case Binding . PARAMETERIZED_TYPE : ParameterizedTypeBinding paramType = ( ParameterizedTypeBinding ) this ; switch ( otherType . kind ( ) ) { case Binding . PARAMETERIZED_TYPE : ParameterizedTypeBinding otherParamType = ( ParameterizedTypeBinding ) otherType ; if ( paramType . genericType ( ) != otherParamType . genericType ( ) ) return true ; if ( ! paramType . isStatic ( ) ) { ReferenceBinding enclosing = enclosingType ( ) ; if ( enclosing != null ) { ReferenceBinding otherEnclosing = otherParamType . enclosingType ( ) ; if ( otherEnclosing == null ) return true ; if ( ( otherEnclosing . tagBits & TagBits . HasDirectWildcard ) == <NUM_LIT:0> ) { if ( enclosing . isProvablyDistinct ( otherEnclosing ) ) return true ; } else { if ( ! enclosing . isEquivalentTo ( otherParamType . enclosingType ( ) ) ) return true ; } } } int length = paramType . arguments == null ? <NUM_LIT:0> : paramType . arguments . length ; TypeBinding [ ] otherArguments = otherParamType . arguments ; int otherLength = otherArguments == null ? <NUM_LIT:0> : otherArguments . length ; if ( otherLength != length ) return true ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( paramType . arguments [ i ] . isProvablyDistinctTypeArgument ( otherArguments [ i ] , paramType , i ) ) return true ; } return false ; case Binding . GENERIC_TYPE : if ( paramType . genericType ( ) != otherType ) return true ; if ( ! paramType . isStatic ( ) ) { ReferenceBinding enclosing = enclosingType ( ) ; if ( enclosing != null ) { ReferenceBinding otherEnclosing = otherType . enclosingType ( ) ; if ( otherEnclosing == null ) return true ; if ( ( otherEnclosing . tagBits & TagBits . HasDirectWildcard ) == <NUM_LIT:0> ) { if ( enclosing != otherEnclosing ) return true ; } else { if ( ! enclosing . isEquivalentTo ( otherType . enclosingType ( ) ) ) return true ; } } } length = paramType . arguments == null ? <NUM_LIT:0> : paramType . arguments . length ; otherArguments = otherType . typeVariables ( ) ; otherLength = otherArguments == null ? <NUM_LIT:0> : otherArguments . length ; if ( otherLength != length ) return true ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( paramType . arguments [ i ] . isProvablyDistinctTypeArgument ( otherArguments [ i ] , paramType , i ) ) return true ; } return false ; case Binding . RAW_TYPE : return erasure ( ) != otherType . erasure ( ) ; case Binding . TYPE : return erasure ( ) != otherType ; } return true ; case Binding . RAW_TYPE : switch ( otherType . kind ( ) ) { case Binding . GENERIC_TYPE : case Binding . PARAMETERIZED_TYPE : case Binding . RAW_TYPE : case Binding . TYPE : return erasure ( ) != otherType . erasure ( ) ; } return true ; case Binding . TYPE : switch ( otherType . kind ( ) ) { case Binding . PARAMETERIZED_TYPE : case Binding . RAW_TYPE : return this != otherType . erasure ( ) ; } break ; default : break ; } return true ; } private boolean isProvablyDistinctTypeArgument ( TypeBinding otherArgument , final ParameterizedTypeBinding paramType , final int rank ) { if ( this == otherArgument ) return false ; TypeBinding upperBound1 = null ; TypeBinding lowerBound1 = null ; ReferenceBinding genericType = paramType . genericType ( ) ; switch ( kind ( ) ) { case Binding . WILDCARD_TYPE : WildcardBinding wildcard = ( WildcardBinding ) this ; switch ( wildcard . boundKind ) { case Wildcard . EXTENDS : upperBound1 = wildcard . bound ; break ; case Wildcard . SUPER : lowerBound1 = wildcard . bound ; break ; case Wildcard . UNBOUND : return false ; } break ; case Binding . INTERSECTION_TYPE : break ; case Binding . TYPE_PARAMETER : final TypeVariableBinding variable = ( TypeVariableBinding ) this ; if ( variable . isCapture ( ) ) { CaptureBinding capture = ( CaptureBinding ) variable ; switch ( capture . wildcard . boundKind ) { case Wildcard . EXTENDS : upperBound1 = capture . wildcard . bound ; break ; case Wildcard . SUPER : lowerBound1 = capture . wildcard . bound ; break ; case Wildcard . UNBOUND : return false ; } break ; } if ( variable . firstBound == null ) return false ; TypeBinding eliminatedType = Scope . convertEliminatingTypeVariables ( variable , genericType , rank , null ) ; switch ( eliminatedType . kind ( ) ) { case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : wildcard = ( WildcardBinding ) eliminatedType ; switch ( wildcard . boundKind ) { case Wildcard . EXTENDS : upperBound1 = wildcard . bound ; break ; case Wildcard . SUPER : lowerBound1 = wildcard . bound ; break ; case Wildcard . UNBOUND : return false ; } break ; } break ; } TypeBinding upperBound2 = null ; TypeBinding lowerBound2 = null ; switch ( otherArgument . kind ( ) ) { case Binding . WILDCARD_TYPE : WildcardBinding otherWildcard = ( WildcardBinding ) otherArgument ; switch ( otherWildcard . boundKind ) { case Wildcard . EXTENDS : upperBound2 = otherWildcard . bound ; break ; case Wildcard . SUPER : lowerBound2 = otherWildcard . bound ; break ; case Wildcard . UNBOUND : return false ; } break ; case Binding . INTERSECTION_TYPE : break ; case Binding . TYPE_PARAMETER : TypeVariableBinding otherVariable = ( TypeVariableBinding ) otherArgument ; if ( otherVariable . isCapture ( ) ) { CaptureBinding otherCapture = ( CaptureBinding ) otherVariable ; switch ( otherCapture . wildcard . boundKind ) { case Wildcard . EXTENDS : upperBound2 = otherCapture . wildcard . bound ; break ; case Wildcard . SUPER : lowerBound2 = otherCapture . wildcard . bound ; break ; case Wildcard . UNBOUND : return false ; } break ; } if ( otherVariable . firstBound == null ) return false ; TypeBinding otherEliminatedType = Scope . convertEliminatingTypeVariables ( otherVariable , genericType , rank , null ) ; switch ( otherEliminatedType . kind ( ) ) { case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : otherWildcard = ( WildcardBinding ) otherEliminatedType ; switch ( otherWildcard . boundKind ) { case Wildcard . EXTENDS : upperBound2 = otherWildcard . bound ; break ; case Wildcard . SUPER : lowerBound2 = otherWildcard . bound ; break ; case Wildcard . UNBOUND : return false ; } break ; } break ; } if ( lowerBound1 != null ) { if ( lowerBound2 != null ) { return false ; } else if ( upperBound2 != null ) { if ( lowerBound1 . isTypeVariable ( ) || upperBound2 . isTypeVariable ( ) ) { return false ; } return ! lowerBound1 . isCompatibleWith ( upperBound2 ) ; } else { if ( lowerBound1 . isTypeVariable ( ) || otherArgument . isTypeVariable ( ) ) { return false ; } return ! lowerBound1 . isCompatibleWith ( otherArgument ) ; } } else if ( upperBound1 != null ) { if ( lowerBound2 != null ) { return ! lowerBound2 . isCompatibleWith ( upperBound1 ) ; } else if ( upperBound2 != null ) { return upperBound1 . isProvableDistinctSubType ( upperBound2 ) && upperBound2 . isProvableDistinctSubType ( upperBound1 ) ; } else { return otherArgument . isProvableDistinctSubType ( upperBound1 ) ; } } else { if ( lowerBound2 != null ) { if ( lowerBound2 . isTypeVariable ( ) || isTypeVariable ( ) ) { return false ; } return ! lowerBound2 . isCompatibleWith ( this ) ; } else if ( upperBound2 != null ) { return isProvableDistinctSubType ( upperBound2 ) ; } else { return true ; } } } public final boolean isRawType ( ) { return kind ( ) == Binding . RAW_TYPE ; } public boolean isReifiable ( ) { TypeBinding leafType = leafComponentType ( ) ; if ( ! ( leafType instanceof ReferenceBinding ) ) return true ; ReferenceBinding current = ( ReferenceBinding ) leafType ; do { switch ( current . kind ( ) ) { case Binding . TYPE_PARAMETER : case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : case Binding . GENERIC_TYPE : return false ; case Binding . PARAMETERIZED_TYPE : if ( current . isBoundParameterizedType ( ) ) return false ; break ; case Binding . RAW_TYPE : return true ; } if ( current . isStatic ( ) ) { return true ; } if ( current . isLocalType ( ) ) { LocalTypeBinding localTypeBinding = ( LocalTypeBinding ) current . erasure ( ) ; MethodBinding enclosingMethod = localTypeBinding . enclosingMethod ; if ( enclosingMethod != null && enclosingMethod . isStatic ( ) ) { return true ; } } } while ( ( current = current . enclosingType ( ) ) != null ) ; return true ; } public boolean isThrowable ( ) { return false ; } public boolean isTypeArgumentContainedBy ( TypeBinding otherType ) { if ( this == otherType ) return true ; switch ( otherType . kind ( ) ) { case Binding . TYPE_PARAMETER : { if ( ! isParameterizedType ( ) || ! otherType . isCapture ( ) ) { return false ; } CaptureBinding capture = ( CaptureBinding ) otherType ; WildcardBinding wildcard = capture . wildcard ; TypeBinding upperBound = null ; TypeBinding [ ] otherBounds = null ; switch ( wildcard . boundKind ) { case Wildcard . SUPER : return false ; case Wildcard . UNBOUND : TypeVariableBinding variable = wildcard . genericType . typeVariables ( ) [ wildcard . rank ] ; upperBound = variable . upperBound ( ) ; otherBounds = variable . boundsCount ( ) > <NUM_LIT:1> ? variable . otherUpperBounds ( ) : null ; break ; case Wildcard . EXTENDS : upperBound = wildcard . bound ; otherBounds = wildcard . otherBounds ; break ; } if ( upperBound . id == TypeIds . T_JavaLangObject && otherBounds == null ) { return false ; } otherType = capture . environment . createWildcard ( null , <NUM_LIT:0> , upperBound , otherBounds , Wildcard . EXTENDS ) ; return isTypeArgumentContainedBy ( otherType ) ; } case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : TypeBinding lowerBound = this ; TypeBinding upperBound = this ; switch ( kind ( ) ) { case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : WildcardBinding wildcard = ( WildcardBinding ) this ; switch ( wildcard . boundKind ) { case Wildcard . EXTENDS : if ( wildcard . otherBounds != null ) break ; upperBound = wildcard . bound ; lowerBound = null ; break ; case Wildcard . SUPER : upperBound = wildcard ; lowerBound = wildcard . bound ; break ; case Wildcard . UNBOUND : upperBound = wildcard ; lowerBound = null ; } break ; case Binding . TYPE_PARAMETER : if ( isCapture ( ) ) { CaptureBinding capture = ( CaptureBinding ) this ; if ( capture . lowerBound != null ) lowerBound = capture . lowerBound ; } } WildcardBinding otherWildcard = ( WildcardBinding ) otherType ; if ( otherWildcard . otherBounds != null ) return false ; TypeBinding otherBound = otherWildcard . bound ; switch ( otherWildcard . boundKind ) { case Wildcard . EXTENDS : if ( otherBound == this ) return true ; if ( upperBound == null ) return false ; TypeBinding match = upperBound . findSuperTypeOriginatingFrom ( otherBound ) ; if ( match != null && ( match = match . leafComponentType ( ) ) . isRawType ( ) ) { return match == otherBound . leafComponentType ( ) ; } return upperBound . isCompatibleWith ( otherBound ) ; case Wildcard . SUPER : if ( otherBound == this ) return true ; if ( lowerBound == null ) return false ; match = otherBound . findSuperTypeOriginatingFrom ( lowerBound ) ; if ( match != null && ( match = match . leafComponentType ( ) ) . isRawType ( ) ) { return match == lowerBound . leafComponentType ( ) ; } return otherBound . isCompatibleWith ( lowerBound ) ; case Wildcard . UNBOUND : default : return true ; } case Binding . PARAMETERIZED_TYPE : if ( ! isParameterizedType ( ) ) return false ; ParameterizedTypeBinding paramType = ( ParameterizedTypeBinding ) this ; ParameterizedTypeBinding otherParamType = ( ParameterizedTypeBinding ) otherType ; if ( paramType . actualType ( ) != otherParamType . actualType ( ) ) return false ; if ( ! paramType . isStatic ( ) ) { ReferenceBinding enclosing = enclosingType ( ) ; if ( enclosing != null ) { ReferenceBinding otherEnclosing = otherParamType . enclosingType ( ) ; if ( otherEnclosing == null ) return false ; if ( ( otherEnclosing . tagBits & TagBits . HasDirectWildcard ) == <NUM_LIT:0> ) { if ( enclosing != otherEnclosing ) return false ; } else { if ( ! enclosing . isEquivalentTo ( otherParamType . enclosingType ( ) ) ) return false ; } } } int length = paramType . arguments == null ? <NUM_LIT:0> : paramType . arguments . length ; TypeBinding [ ] otherArguments = otherParamType . arguments ; int otherLength = otherArguments == null ? <NUM_LIT:0> : otherArguments . length ; if ( otherLength != length ) return false ; nextArgument : for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeBinding argument = paramType . arguments [ i ] ; TypeBinding otherArgument = otherArguments [ i ] ; if ( argument == otherArgument ) continue nextArgument ; int kind = argument . kind ( ) ; if ( otherArgument . kind ( ) != kind ) return false ; switch ( kind ) { case Binding . PARAMETERIZED_TYPE : if ( argument . isTypeArgumentContainedBy ( otherArgument ) ) continue nextArgument ; break ; case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : WildcardBinding wildcard = ( WildcardBinding ) argument ; otherWildcard = ( WildcardBinding ) otherArgument ; switch ( wildcard . boundKind ) { case Wildcard . EXTENDS : if ( otherWildcard . boundKind == Wildcard . UNBOUND && wildcard . bound == wildcard . typeVariable ( ) . upperBound ( ) ) continue nextArgument ; break ; case Wildcard . SUPER : break ; case Wildcard . UNBOUND : if ( otherWildcard . boundKind == Wildcard . EXTENDS && otherWildcard . bound == otherWildcard . typeVariable ( ) . upperBound ( ) ) continue nextArgument ; break ; } break ; } return false ; } return true ; } if ( otherType . id == TypeIds . T_JavaLangObject ) { switch ( kind ( ) ) { case Binding . WILDCARD_TYPE : WildcardBinding wildcard = ( WildcardBinding ) this ; if ( wildcard . boundKind == Wildcard . SUPER && wildcard . bound . id == TypeIds . T_JavaLangObject ) { return true ; } break ; } } return false ; } public boolean isTypeVariable ( ) { return false ; } public boolean isUnboundWildcard ( ) { return false ; } public boolean isUncheckedException ( boolean includeSupertype ) { return false ; } public boolean isWildcard ( ) { return false ; } public int kind ( ) { return Binding . TYPE ; } public TypeBinding leafComponentType ( ) { return this ; } public boolean needsUncheckedConversion ( TypeBinding targetType ) { if ( this == targetType ) return false ; targetType = targetType . leafComponentType ( ) ; if ( ! ( targetType instanceof ReferenceBinding ) ) return false ; TypeBinding currentType = leafComponentType ( ) ; TypeBinding match = currentType . findSuperTypeOriginatingFrom ( targetType ) ; if ( ! ( match instanceof ReferenceBinding ) ) return false ; ReferenceBinding compatible = ( ReferenceBinding ) match ; while ( compatible . isRawType ( ) ) { if ( targetType . isBoundParameterizedType ( ) ) return true ; if ( compatible . isStatic ( ) ) break ; if ( ( compatible = compatible . enclosingType ( ) ) == null ) break ; if ( ( targetType = targetType . enclosingType ( ) ) == null ) break ; } return false ; } public TypeBinding original ( ) { switch ( kind ( ) ) { case Binding . PARAMETERIZED_TYPE : case Binding . RAW_TYPE : case Binding . ARRAY_TYPE : return erasure ( ) ; default : return this ; } } public char [ ] qualifiedPackageName ( ) { PackageBinding packageBinding = getPackage ( ) ; return packageBinding == null || packageBinding . compoundName == CharOperation . NO_CHAR_CHAR ? CharOperation . NO_CHAR : packageBinding . readableName ( ) ; } public abstract char [ ] qualifiedSourceName ( ) ; public char [ ] signature ( ) { return constantPoolName ( ) ; } public abstract char [ ] sourceName ( ) ; public void swapUnresolved ( UnresolvedReferenceBinding unresolvedType , ReferenceBinding resolvedType , LookupEnvironment environment ) { } public TypeVariableBinding [ ] typeVariables ( ) { return Binding . NO_TYPE_VARIABLES ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; public interface TypeIds { final int T_undefined = <NUM_LIT:0> ; final int T_JavaLangObject = <NUM_LIT:1> ; final int T_char = <NUM_LIT:2> ; final int T_byte = <NUM_LIT:3> ; final int T_short = <NUM_LIT:4> ; final int T_boolean = <NUM_LIT:5> ; final int T_void = <NUM_LIT:6> ; final int T_long = <NUM_LIT:7> ; final int T_double = <NUM_LIT:8> ; final int T_float = <NUM_LIT:9> ; final int T_int = <NUM_LIT:10> ; final int T_JavaLangString = <NUM_LIT:11> ; final int T_null = <NUM_LIT:12> ; final int T_JavaLangClass = <NUM_LIT:16> ; final int T_JavaLangStringBuffer = <NUM_LIT> ; final int T_JavaLangSystem = <NUM_LIT> ; final int T_JavaLangError = <NUM_LIT> ; final int T_JavaLangReflectConstructor = <NUM_LIT:20> ; final int T_JavaLangThrowable = <NUM_LIT> ; final int T_JavaLangNoClassDefError = <NUM_LIT> ; final int T_JavaLangClassNotFoundException = <NUM_LIT> ; final int T_JavaLangRuntimeException = <NUM_LIT:24> ; final int T_JavaLangException = <NUM_LIT> ; final int T_JavaLangByte = <NUM_LIT> ; final int T_JavaLangShort = <NUM_LIT> ; final int T_JavaLangCharacter = <NUM_LIT> ; final int T_JavaLangInteger = <NUM_LIT> ; final int T_JavaLangLong = <NUM_LIT:30> ; final int T_JavaLangFloat = <NUM_LIT:31> ; final int T_JavaLangDouble = <NUM_LIT:32> ; final int T_JavaLangBoolean = <NUM_LIT> ; final int T_JavaLangVoid = <NUM_LIT> ; final int T_JavaLangAssertionError = <NUM_LIT> ; final int T_JavaLangCloneable = <NUM_LIT> ; final int T_JavaIoSerializable = <NUM_LIT> ; final int T_JavaLangIterable = <NUM_LIT> ; final int T_JavaUtilIterator = <NUM_LIT> ; final int T_JavaLangStringBuilder = <NUM_LIT> ; final int T_JavaLangEnum = <NUM_LIT> ; final int T_JavaLangIllegalArgumentException = <NUM_LIT> ; final int T_JavaLangAnnotationAnnotation = <NUM_LIT> ; final int T_JavaLangDeprecated = <NUM_LIT> ; final int T_JavaLangAnnotationDocumented = <NUM_LIT> ; final int T_JavaLangAnnotationInherited = <NUM_LIT> ; final int T_JavaLangOverride = <NUM_LIT> ; final int T_JavaLangAnnotationRetention = <NUM_LIT> ; final int T_JavaLangSuppressWarnings = <NUM_LIT> ; final int T_JavaLangAnnotationTarget = <NUM_LIT> ; final int T_JavaLangAnnotationRetentionPolicy = <NUM_LIT> ; final int T_JavaLangAnnotationElementType = <NUM_LIT> ; final int T_JavaIoPrintStream = <NUM_LIT> ; final int T_JavaLangReflectField = <NUM_LIT> ; final int T_JavaLangReflectMethod = <NUM_LIT> ; final int T_JavaIoExternalizable = <NUM_LIT> ; final int T_JavaIoObjectStreamException = <NUM_LIT> ; final int T_JavaIoException = <NUM_LIT> ; final int T_JavaUtilCollection = <NUM_LIT> ; final int T_JavaLangSafeVarargs = <NUM_LIT> ; final int T_JavaLangInvokeMethodHandlePolymorphicSignature = <NUM_LIT> ; final int T_JavaLangAutoCloseable = <NUM_LIT> ; final int NoId = Integer . MAX_VALUE ; public static final int IMPLICIT_CONVERSION_MASK = <NUM_LIT> ; public static final int COMPILE_TYPE_MASK = <NUM_LIT> ; final int Boolean2Int = T_boolean + ( T_int << <NUM_LIT:4> ) ; final int Boolean2String = T_boolean + ( T_JavaLangString << <NUM_LIT:4> ) ; final int Boolean2Boolean = T_boolean + ( T_boolean << <NUM_LIT:4> ) ; final int Byte2Byte = T_byte + ( T_byte << <NUM_LIT:4> ) ; final int Byte2Short = T_byte + ( T_short << <NUM_LIT:4> ) ; final int Byte2Char = T_byte + ( T_char << <NUM_LIT:4> ) ; final int Byte2Int = T_byte + ( T_int << <NUM_LIT:4> ) ; final int Byte2Long = T_byte + ( T_long << <NUM_LIT:4> ) ; final int Byte2Float = T_byte + ( T_float << <NUM_LIT:4> ) ; final int Byte2Double = T_byte + ( T_double << <NUM_LIT:4> ) ; final int Byte2String = T_byte + ( T_JavaLangString << <NUM_LIT:4> ) ; final int Short2Byte = T_short + ( T_byte << <NUM_LIT:4> ) ; final int Short2Short = T_short + ( T_short << <NUM_LIT:4> ) ; final int Short2Char = T_short + ( T_char << <NUM_LIT:4> ) ; final int Short2Int = T_short + ( T_int << <NUM_LIT:4> ) ; final int Short2Long = T_short + ( T_long << <NUM_LIT:4> ) ; final int Short2Float = T_short + ( T_float << <NUM_LIT:4> ) ; final int Short2Double = T_short + ( T_double << <NUM_LIT:4> ) ; final int Short2String = T_short + ( T_JavaLangString << <NUM_LIT:4> ) ; final int Char2Byte = T_char + ( T_byte << <NUM_LIT:4> ) ; final int Char2Short = T_char + ( T_short << <NUM_LIT:4> ) ; final int Char2Char = T_char + ( T_char << <NUM_LIT:4> ) ; final int Char2Int = T_char + ( T_int << <NUM_LIT:4> ) ; final int Char2Long = T_char + ( T_long << <NUM_LIT:4> ) ; final int Char2Float = T_char + ( T_float << <NUM_LIT:4> ) ; final int Char2Double = T_char + ( T_double << <NUM_LIT:4> ) ; final int Char2String = T_char + ( T_JavaLangString << <NUM_LIT:4> ) ; final int Int2Byte = T_int + ( T_byte << <NUM_LIT:4> ) ; final int Int2Short = T_int + ( T_short << <NUM_LIT:4> ) ; final int Int2Char = T_int + ( T_char << <NUM_LIT:4> ) ; final int Int2Int = T_int + ( T_int << <NUM_LIT:4> ) ; final int Int2Long = T_int + ( T_long << <NUM_LIT:4> ) ; final int Int2Float = T_int + ( T_float << <NUM_LIT:4> ) ; final int Int2Double = T_int + ( T_double << <NUM_LIT:4> ) ; final int Int2String = T_int + ( T_JavaLangString << <NUM_LIT:4> ) ; final int Long2Byte = T_long + ( T_byte << <NUM_LIT:4> ) ; final int Long2Short = T_long + ( T_short << <NUM_LIT:4> ) ; final int Long2Char = T_long + ( T_char << <NUM_LIT:4> ) ; final int Long2Int = T_long + ( T_int << <NUM_LIT:4> ) ; final int Long2Long = T_long + ( T_long << <NUM_LIT:4> ) ; final int Long2Float = T_long + ( T_float << <NUM_LIT:4> ) ; final int Long2Double = T_long + ( T_double << <NUM_LIT:4> ) ; final int Long2String = T_long + ( T_JavaLangString << <NUM_LIT:4> ) ; final int Float2Byte = T_float + ( T_byte << <NUM_LIT:4> ) ; final int Float2Short = T_float + ( T_short << <NUM_LIT:4> ) ; final int Float2Char = T_float + ( T_char << <NUM_LIT:4> ) ; final int Float2Int = T_float + ( T_int << <NUM_LIT:4> ) ; final int Float2Long = T_float + ( T_long << <NUM_LIT:4> ) ; final int Float2Float = T_float + ( T_float << <NUM_LIT:4> ) ; final int Float2Double = T_float + ( T_double << <NUM_LIT:4> ) ; final int Float2String = T_float + ( T_JavaLangString << <NUM_LIT:4> ) ; final int Double2Byte = T_double + ( T_byte << <NUM_LIT:4> ) ; final int Double2Short = T_double + ( T_short << <NUM_LIT:4> ) ; final int Double2Char = T_double + ( T_char << <NUM_LIT:4> ) ; final int Double2Int = T_double + ( T_int << <NUM_LIT:4> ) ; final int Double2Long = T_double + ( T_long << <NUM_LIT:4> ) ; final int Double2Float = T_double + ( T_float << <NUM_LIT:4> ) ; final int Double2Double = T_double + ( T_double << <NUM_LIT:4> ) ; final int Double2String = T_double + ( T_JavaLangString << <NUM_LIT:4> ) ; final int String2String = T_JavaLangString + ( T_JavaLangString << <NUM_LIT:4> ) ; final int Object2String = T_JavaLangObject + ( T_JavaLangString << <NUM_LIT:4> ) ; final int Null2Null = T_null + ( T_null << <NUM_LIT:4> ) ; final int Null2String = T_null + ( T_JavaLangString << <NUM_LIT:4> ) ; final int Object2Object = T_JavaLangObject + ( T_JavaLangObject << <NUM_LIT:4> ) ; final int Object2byte = T_JavaLangObject + ( T_byte << <NUM_LIT:4> ) ; final int Object2short = T_JavaLangObject + ( T_short << <NUM_LIT:4> ) ; final int Object2char = T_JavaLangObject + ( T_char << <NUM_LIT:4> ) ; final int Object2int = T_JavaLangObject + ( T_int << <NUM_LIT:4> ) ; final int Object2long = T_JavaLangObject + ( T_long << <NUM_LIT:4> ) ; final int Object2float = T_JavaLangObject + ( T_float << <NUM_LIT:4> ) ; final int Object2double = T_JavaLangObject + ( T_double << <NUM_LIT:4> ) ; final int Object2boolean = T_JavaLangObject + ( T_boolean << <NUM_LIT:4> ) ; final int BOXING = <NUM_LIT> ; final int UNBOXING = <NUM_LIT> ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . ast . Wildcard ; public class ParameterizedMethodBinding extends MethodBinding { protected MethodBinding originalMethod ; public ParameterizedMethodBinding ( final ParameterizedTypeBinding parameterizedDeclaringClass , MethodBinding originalMethod ) { super ( originalMethod . modifiers , originalMethod . selector , originalMethod . returnType , originalMethod . parameters , originalMethod . thrownExceptions , parameterizedDeclaringClass ) ; this . originalMethod = originalMethod ; this . tagBits = originalMethod . tagBits & ~ TagBits . HasMissingType ; final TypeVariableBinding [ ] originalVariables = originalMethod . typeVariables ; Substitution substitution = null ; final int length = originalVariables . length ; final boolean isStatic = originalMethod . isStatic ( ) ; if ( length == <NUM_LIT:0> ) { this . typeVariables = Binding . NO_TYPE_VARIABLES ; if ( ! isStatic ) substitution = parameterizedDeclaringClass ; } else { final TypeVariableBinding [ ] substitutedVariables = new TypeVariableBinding [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeVariableBinding originalVariable = originalVariables [ i ] ; substitutedVariables [ i ] = new TypeVariableBinding ( originalVariable . sourceName , this , originalVariable . rank , parameterizedDeclaringClass . environment ) ; } this . typeVariables = substitutedVariables ; substitution = new Substitution ( ) { public LookupEnvironment environment ( ) { return parameterizedDeclaringClass . environment ; } public boolean isRawSubstitution ( ) { return ! isStatic && parameterizedDeclaringClass . isRawSubstitution ( ) ; } public TypeBinding substitute ( TypeVariableBinding typeVariable ) { if ( typeVariable . rank < length && originalVariables [ typeVariable . rank ] == typeVariable ) { return substitutedVariables [ typeVariable . rank ] ; } if ( ! isStatic ) return parameterizedDeclaringClass . substitute ( typeVariable ) ; return typeVariable ; } } ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeVariableBinding originalVariable = originalVariables [ i ] ; TypeVariableBinding substitutedVariable = substitutedVariables [ i ] ; TypeBinding substitutedSuperclass = Scope . substitute ( substitution , originalVariable . superclass ) ; ReferenceBinding [ ] substitutedInterfaces = Scope . substitute ( substitution , originalVariable . superInterfaces ) ; if ( originalVariable . firstBound != null ) { substitutedVariable . firstBound = originalVariable . firstBound == originalVariable . superclass ? substitutedSuperclass : substitutedInterfaces [ <NUM_LIT:0> ] ; } switch ( substitutedSuperclass . kind ( ) ) { case Binding . ARRAY_TYPE : substitutedVariable . superclass = parameterizedDeclaringClass . environment . getResolvedType ( TypeConstants . JAVA_LANG_OBJECT , null ) ; substitutedVariable . superInterfaces = substitutedInterfaces ; break ; default : if ( substitutedSuperclass . isInterface ( ) ) { substitutedVariable . superclass = parameterizedDeclaringClass . environment . getResolvedType ( TypeConstants . JAVA_LANG_OBJECT , null ) ; int interfaceCount = substitutedInterfaces . length ; System . arraycopy ( substitutedInterfaces , <NUM_LIT:0> , substitutedInterfaces = new ReferenceBinding [ interfaceCount + <NUM_LIT:1> ] , <NUM_LIT:1> , interfaceCount ) ; substitutedInterfaces [ <NUM_LIT:0> ] = ( ReferenceBinding ) substitutedSuperclass ; substitutedVariable . superInterfaces = substitutedInterfaces ; } else { substitutedVariable . superclass = ( ReferenceBinding ) substitutedSuperclass ; substitutedVariable . superInterfaces = substitutedInterfaces ; } } } } if ( substitution != null ) { this . returnType = Scope . substitute ( substitution , this . returnType ) ; this . parameters = Scope . substitute ( substitution , this . parameters ) ; this . thrownExceptions = Scope . substitute ( substitution , this . thrownExceptions ) ; if ( this . thrownExceptions == null ) this . thrownExceptions = Binding . NO_EXCEPTIONS ; } checkMissingType : { if ( ( this . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) break checkMissingType ; if ( ( this . returnType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . HasMissingType ; break checkMissingType ; } for ( int i = <NUM_LIT:0> , max = this . parameters . length ; i < max ; i ++ ) { if ( ( this . parameters [ i ] . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . HasMissingType ; break checkMissingType ; } } for ( int i = <NUM_LIT:0> , max = this . thrownExceptions . length ; i < max ; i ++ ) { if ( ( this . thrownExceptions [ i ] . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . HasMissingType ; break checkMissingType ; } } } } public ParameterizedMethodBinding ( final ReferenceBinding declaringClass , MethodBinding originalMethod , char [ ] [ ] alternateParamaterNames , final LookupEnvironment environment ) { super ( originalMethod . modifiers , originalMethod . selector , originalMethod . returnType , originalMethod . parameters , originalMethod . thrownExceptions , declaringClass ) ; this . originalMethod = originalMethod ; this . tagBits = originalMethod . tagBits & ~ TagBits . HasMissingType ; final TypeVariableBinding [ ] originalVariables = originalMethod . typeVariables ; Substitution substitution = null ; final int length = originalVariables . length ; if ( length == <NUM_LIT:0> ) { this . typeVariables = Binding . NO_TYPE_VARIABLES ; } else { final TypeVariableBinding [ ] substitutedVariables = new TypeVariableBinding [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeVariableBinding originalVariable = originalVariables [ i ] ; substitutedVariables [ i ] = new TypeVariableBinding ( alternateParamaterNames == null ? originalVariable . sourceName : alternateParamaterNames [ i ] , this , originalVariable . rank , environment ) ; } this . typeVariables = substitutedVariables ; substitution = new Substitution ( ) { public LookupEnvironment environment ( ) { return environment ; } public boolean isRawSubstitution ( ) { return false ; } public TypeBinding substitute ( TypeVariableBinding typeVariable ) { if ( typeVariable . rank < length && originalVariables [ typeVariable . rank ] == typeVariable ) { return substitutedVariables [ typeVariable . rank ] ; } return typeVariable ; } } ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeVariableBinding originalVariable = originalVariables [ i ] ; TypeVariableBinding substitutedVariable = substitutedVariables [ i ] ; TypeBinding substitutedSuperclass = Scope . substitute ( substitution , originalVariable . superclass ) ; ReferenceBinding [ ] substitutedInterfaces = Scope . substitute ( substitution , originalVariable . superInterfaces ) ; if ( originalVariable . firstBound != null ) { substitutedVariable . firstBound = originalVariable . firstBound == originalVariable . superclass ? substitutedSuperclass : substitutedInterfaces [ <NUM_LIT:0> ] ; } switch ( substitutedSuperclass . kind ( ) ) { case Binding . ARRAY_TYPE : substitutedVariable . superclass = environment . getResolvedType ( TypeConstants . JAVA_LANG_OBJECT , null ) ; substitutedVariable . superInterfaces = substitutedInterfaces ; break ; default : if ( substitutedSuperclass . isInterface ( ) ) { substitutedVariable . superclass = environment . getResolvedType ( TypeConstants . JAVA_LANG_OBJECT , null ) ; int interfaceCount = substitutedInterfaces . length ; System . arraycopy ( substitutedInterfaces , <NUM_LIT:0> , substitutedInterfaces = new ReferenceBinding [ interfaceCount + <NUM_LIT:1> ] , <NUM_LIT:1> , interfaceCount ) ; substitutedInterfaces [ <NUM_LIT:0> ] = ( ReferenceBinding ) substitutedSuperclass ; substitutedVariable . superInterfaces = substitutedInterfaces ; } else { substitutedVariable . superclass = ( ReferenceBinding ) substitutedSuperclass ; substitutedVariable . superInterfaces = substitutedInterfaces ; } } } } if ( substitution != null ) { this . returnType = Scope . substitute ( substitution , this . returnType ) ; this . parameters = Scope . substitute ( substitution , this . parameters ) ; this . thrownExceptions = Scope . substitute ( substitution , this . thrownExceptions ) ; if ( this . thrownExceptions == null ) this . thrownExceptions = Binding . NO_EXCEPTIONS ; } checkMissingType : { if ( ( this . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) break checkMissingType ; if ( ( this . returnType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . HasMissingType ; break checkMissingType ; } for ( int i = <NUM_LIT:0> , max = this . parameters . length ; i < max ; i ++ ) { if ( ( this . parameters [ i ] . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . HasMissingType ; break checkMissingType ; } } for ( int i = <NUM_LIT:0> , max = this . thrownExceptions . length ; i < max ; i ++ ) { if ( ( this . thrownExceptions [ i ] . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . HasMissingType ; break checkMissingType ; } } } } public ParameterizedMethodBinding ( ) { } public static ParameterizedMethodBinding instantiateGetClass ( TypeBinding receiverType , MethodBinding originalMethod , Scope scope ) { ParameterizedMethodBinding method = new ParameterizedMethodBinding ( ) ; method . modifiers = originalMethod . modifiers ; method . selector = originalMethod . selector ; method . declaringClass = originalMethod . declaringClass ; method . typeVariables = Binding . NO_TYPE_VARIABLES ; method . originalMethod = originalMethod ; method . parameters = originalMethod . parameters ; method . thrownExceptions = originalMethod . thrownExceptions ; method . tagBits = originalMethod . tagBits ; ReferenceBinding genericClassType = scope . getJavaLangClass ( ) ; LookupEnvironment environment = scope . environment ( ) ; TypeBinding rawType = environment . convertToRawType ( receiverType . erasure ( ) , false ) ; method . returnType = environment . createParameterizedType ( genericClassType , new TypeBinding [ ] { environment . createWildcard ( genericClassType , <NUM_LIT:0> , rawType , null , Wildcard . EXTENDS ) } , null ) ; if ( ( method . returnType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { method . tagBits |= TagBits . HasMissingType ; } return method ; } public boolean hasSubstitutedParameters ( ) { return this . parameters != this . originalMethod . parameters ; } public boolean hasSubstitutedReturnType ( ) { return this . returnType != this . originalMethod . returnType ; } public MethodBinding original ( ) { return this . originalMethod . original ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; public final class BaseTypeBinding extends TypeBinding { public static final int [ ] CONVERSIONS ; public static final int IDENTITY = <NUM_LIT:1> ; public static final int WIDENING = <NUM_LIT:2> ; public static final int NARROWING = <NUM_LIT:4> ; public static final int MAX_CONVERSIONS = <NUM_LIT:16> * <NUM_LIT:16> ; static { CONVERSIONS = initializeConversions ( ) ; } public static final int [ ] initializeConversions ( ) { int [ ] table = new int [ MAX_CONVERSIONS ] ; table [ TypeIds . Boolean2Boolean ] = IDENTITY ; table [ TypeIds . Byte2Byte ] = IDENTITY ; table [ TypeIds . Byte2Short ] = WIDENING ; table [ TypeIds . Byte2Char ] = NARROWING ; table [ TypeIds . Byte2Int ] = WIDENING ; table [ TypeIds . Byte2Long ] = WIDENING ; table [ TypeIds . Byte2Float ] = WIDENING ; table [ TypeIds . Byte2Double ] = WIDENING ; table [ TypeIds . Short2Byte ] = NARROWING ; table [ TypeIds . Short2Short ] = IDENTITY ; table [ TypeIds . Short2Char ] = NARROWING ; table [ TypeIds . Short2Int ] = WIDENING ; table [ TypeIds . Short2Long ] = WIDENING ; table [ TypeIds . Short2Float ] = WIDENING ; table [ TypeIds . Short2Double ] = WIDENING ; table [ TypeIds . Char2Byte ] = NARROWING ; table [ TypeIds . Char2Short ] = NARROWING ; table [ TypeIds . Char2Char ] = IDENTITY ; table [ TypeIds . Char2Int ] = WIDENING ; table [ TypeIds . Char2Long ] = WIDENING ; table [ TypeIds . Char2Float ] = WIDENING ; table [ TypeIds . Char2Double ] = WIDENING ; table [ TypeIds . Int2Byte ] = NARROWING ; table [ TypeIds . Int2Short ] = NARROWING ; table [ TypeIds . Int2Char ] = NARROWING ; table [ TypeIds . Int2Int ] = IDENTITY ; table [ TypeIds . Int2Long ] = WIDENING ; table [ TypeIds . Int2Float ] = WIDENING ; table [ TypeIds . Int2Double ] = WIDENING ; table [ TypeIds . Long2Byte ] = NARROWING ; table [ TypeIds . Long2Short ] = NARROWING ; table [ TypeIds . Long2Char ] = NARROWING ; table [ TypeIds . Long2Int ] = NARROWING ; table [ TypeIds . Long2Long ] = IDENTITY ; table [ TypeIds . Long2Float ] = WIDENING ; table [ TypeIds . Long2Double ] = WIDENING ; table [ TypeIds . Float2Byte ] = NARROWING ; table [ TypeIds . Float2Short ] = NARROWING ; table [ TypeIds . Float2Char ] = NARROWING ; table [ TypeIds . Float2Int ] = NARROWING ; table [ TypeIds . Float2Long ] = NARROWING ; table [ TypeIds . Float2Float ] = IDENTITY ; table [ TypeIds . Float2Double ] = WIDENING ; table [ TypeIds . Double2Byte ] = NARROWING ; table [ TypeIds . Double2Short ] = NARROWING ; table [ TypeIds . Double2Char ] = NARROWING ; table [ TypeIds . Double2Int ] = NARROWING ; table [ TypeIds . Double2Long ] = NARROWING ; table [ TypeIds . Double2Float ] = NARROWING ; table [ TypeIds . Double2Double ] = IDENTITY ; return table ; } public static final boolean isNarrowing ( int left , int right ) { int right2left = right + ( left << <NUM_LIT:4> ) ; return right2left >= <NUM_LIT:0> && right2left < MAX_CONVERSIONS && ( CONVERSIONS [ right2left ] & ( IDENTITY | NARROWING ) ) != <NUM_LIT:0> ; } public static final boolean isWidening ( int left , int right ) { int right2left = right + ( left << <NUM_LIT:4> ) ; return right2left >= <NUM_LIT:0> && right2left < MAX_CONVERSIONS && ( CONVERSIONS [ right2left ] & ( IDENTITY | WIDENING ) ) != <NUM_LIT:0> ; } public char [ ] simpleName ; private char [ ] constantPoolName ; BaseTypeBinding ( int id , char [ ] name , char [ ] constantPoolName ) { this . tagBits |= TagBits . IsBaseType ; this . id = id ; this . simpleName = name ; this . constantPoolName = constantPoolName ; } public char [ ] computeUniqueKey ( boolean isLeaf ) { return constantPoolName ( ) ; } public char [ ] constantPoolName ( ) { return this . constantPoolName ; } public PackageBinding getPackage ( ) { return null ; } public final boolean isCompatibleWith ( TypeBinding left ) { if ( this == left ) return true ; int right2left = this . id + ( left . id << <NUM_LIT:4> ) ; if ( right2left >= <NUM_LIT:0> && right2left < MAX_CONVERSIONS && ( CONVERSIONS [ right2left ] & ( IDENTITY | WIDENING ) ) != <NUM_LIT:0> ) return true ; return this == TypeBinding . NULL && ! left . isBaseType ( ) ; } public boolean isUncheckedException ( boolean includeSupertype ) { return this == TypeBinding . NULL ; } public int kind ( ) { return Binding . BASE_TYPE ; } public char [ ] qualifiedSourceName ( ) { return this . simpleName ; } public char [ ] readableName ( ) { return this . simpleName ; } public char [ ] shortReadableName ( ) { return this . simpleName ; } public char [ ] sourceName ( ) { return this . simpleName ; } public String toString ( ) { return new String ( this . constantPoolName ) + "<STR_LIT>" + this . id + "<STR_LIT:)>" ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . env . ICompilationUnit ; public class SourceTypeCollisionException extends RuntimeException { private static final long serialVersionUID = <NUM_LIT> ; public ICompilationUnit [ ] newAnnotationProcessorUnits ; } </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.